Remove user_hash_algo
Use always hash algo from signature like kernel does. Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
This commit is contained in:
parent
86d8772653
commit
e92cbe4756
@ -1590,7 +1590,6 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
case 'a':
|
||||
params.hash_algo = optarg;
|
||||
params.user_hash_algo = 1;
|
||||
break;
|
||||
case 'p':
|
||||
keypass = optarg;
|
||||
|
15
src/libevm.c
15
src/libevm.c
@ -491,16 +491,13 @@ int ima_verify_signature(const char *file, unsigned char *sig, int siglen)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* If user specified an hash algo on command line, let it override */
|
||||
if (!params.user_hash_algo) {
|
||||
sig_hash_algo = get_hash_algo_from_sig(sig + 1);
|
||||
if (sig_hash_algo < 0) {
|
||||
log_err("Invalid signature\n");
|
||||
return -1;
|
||||
}
|
||||
/* Use hash algorithm as retrieved from signature */
|
||||
params.hash_algo = pkey_hash_algo[sig_hash_algo];
|
||||
sig_hash_algo = get_hash_algo_from_sig(sig + 1);
|
||||
if (sig_hash_algo < 0) {
|
||||
log_err("Invalid signature\n");
|
||||
return -1;
|
||||
}
|
||||
/* Use hash algorithm as retrieved from signature */
|
||||
params.hash_algo = pkey_hash_algo[sig_hash_algo];
|
||||
|
||||
hashlen = ima_calc_hash(file, hash);
|
||||
if (hashlen <= 1)
|
||||
|
@ -128,7 +128,6 @@ typedef int (*verify_hash_fn_t)(const unsigned char *hash, int size, unsigned ch
|
||||
struct libevm_params {
|
||||
int verbose;
|
||||
const char *hash_algo;
|
||||
int user_hash_algo;
|
||||
int x509;
|
||||
char *keyfile;
|
||||
verify_hash_fn_t verify_hash;
|
||||
|
Loading…
x
Reference in New Issue
Block a user