Auto-format touch-up

This commit is contained in:
Valerie Snyder 2025-07-01 23:39:58 -04:00 committed by Val S.
parent 13c4788f36
commit 4660141186
No known key found for this signature in database
GPG key ID: 3A7D293D8274CA1B
6 changed files with 19 additions and 15 deletions

View file

@ -66,7 +66,9 @@ static cl_error_t prompt_user_for_what_to_do(cl_scan_layer_t *layer, bool is_ale
if (scanf("%d", &choice) != 1) {
// clear stdin
int c;
while ((c = getchar()) != '\n' && c != EOF);
while ((c = getchar()) != '\n' && c != EOF) {
continue;
}
printf("Invalid input. Please enter a number between 1 and 5.\n");
return prompt_user_for_what_to_do(layer, is_alert_callback);
}
@ -584,6 +586,7 @@ static cl_error_t print_layer_info(cl_scan_layer_t *layer)
layer = parent;
printf("\n"); // print empty line between layers
} // while layer != NULL
status = CL_SUCCESS;

View file

@ -2087,10 +2087,10 @@ extern const char *cl_strerror(cl_error_t clerror);
* If this flag is set, the function will allocate a buffer for the hash and return it. \
* The caller is responsible for freeing the buffer using free(). \
* If this flag is not set, the caller must provide a buffer to store the hash. */
#define CL_HASH_FLAG_FIPS_BYPASS 0x02 /* Use CL_HASH_FLAG_FIPS_BYPASS to bypass FIPS restrictions on which algorithms can be \
* used. This is useful if you want to use algorithms that are not FIPS-approved. \
* For example, you might want to use this flag if you want to use "md5" or "sha1". \
* You should only do this when the hash is used for non-cryptographic purposes. \
#define CL_HASH_FLAG_FIPS_BYPASS 0x02 /* Use CL_HASH_FLAG_FIPS_BYPASS to bypass FIPS restrictions on which algorithms can be \
* used. This is useful if you want to use algorithms that are not FIPS-approved. \
* For example, you might want to use this flag if you want to use "md5" or "sha1". \
* You should only do this when the hash is used for non-cryptographic purposes. \
* Note: If OpenSSL's FIPS provider is not available, this flag has no effect. */
/**

View file

@ -395,7 +395,9 @@ struct cl_cvd *cl_cvdhead(const char *file)
if ((pt = strpbrk(head, "\n\r")))
*pt = 0;
for (i = bread - 1; i > 0 && (head[i] == ' ' || head[i] == '\n' || head[i] == '\r'); head[i] = 0, i--);
for (i = bread - 1; i > 0 && (head[i] == ' ' || head[i] == '\n' || head[i] == '\r'); head[i] = 0, i--) {
continue;
}
return cl_cvdparse(head);
}

View file

@ -56,7 +56,7 @@ size_t cli_hash_len(cli_hash_type_t type);
* @param name The name of the hash type.
* @return cli_hash_type_t The hash type.
*/
cl_error_t cli_hash_type_from_name(const char* name, cli_hash_type_t *type_out);
cl_error_t cli_hash_type_from_name(const char* name, cli_hash_type_t* type_out);
#define CLI_HASHLEN_MAX SHA256_HASH_SIZE

View file

@ -35,7 +35,7 @@ typedef struct cli_scan_layer {
cli_file_t type;
size_t size;
cl_fmap_t *fmap; /* The fmap for this layer. This used to be in an array in the ctx. */
uint32_t recursion_level; /* The recursion level of this layer in the scan stack. */
uint32_t recursion_level; /* The recursion level of this layer in the scan stack. */
uint32_t recursion_level_buffer; /* Which buffer layer in scan recursion. */
uint32_t recursion_level_buffer_fmap; /* Which fmap layer in this buffer. */
uint32_t attributes; /* layer attributes. */

View file

@ -368,14 +368,10 @@ pub unsafe extern "C" fn _evidence_remove_indicator(
rrf_call!(
err = err,
evidence.remove_indicator(
name_str,
indicator_type
)
evidence.remove_indicator(name_str, indicator_type)
)
}
impl Evidence {
/// Check if we have any indicators that should alert the user.
pub fn render_verdict(&self) -> bool {
@ -440,7 +436,11 @@ impl Evidence {
}
/// Add evidence from a child layer to this evidence instance.
pub fn add_child_evidence(&mut self, child: &Evidence, from_normalized: bool) -> Result<(), Error> {
pub fn add_child_evidence(
&mut self,
child: &Evidence,
from_normalized: bool,
) -> Result<(), Error> {
if child.strong.is_empty() && child.pua.is_empty() && child.weak.is_empty() {
return Err(Error::InvalidParameter(
"Child evidence must contain at least one indicator".to_string(),
@ -529,5 +529,4 @@ impl Evidence {
Ok(())
}
}