mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-27 22:32:31 +02:00
ima-evm-utils: Fix mismatched type checking
Even if imaevm_get_hash_algo() returns an error value of -1, it is forced to be converted to uint8_t type here, resulting in this error not being checked by the if condition. This patch fixes this error. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
c9e99f0a21
commit
fb19ae86db
@ -924,7 +924,7 @@ static int sign_hash_v2(const char *algo, const unsigned char *hash,
|
||||
hdr->version = (uint8_t) DIGSIG_VERSION_2;
|
||||
|
||||
hdr->hash_algo = imaevm_get_hash_algo(algo);
|
||||
if (hdr->hash_algo == -1) {
|
||||
if (hdr->hash_algo == (uint8_t)-1) {
|
||||
log_err("sign_hash_v2: hash algo is unknown: %s\n", algo);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user