mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-28 22:53:37 +02:00
Remove user_sig_type flag
Always use signature type from signature header - like kernel does. Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
This commit is contained in:
parent
ff5f07e171
commit
4578679081
@ -1613,7 +1613,6 @@ int main(int argc, char *argv[])
|
|||||||
params.x509 = 1;
|
params.x509 = 1;
|
||||||
sign_hash = sign_hash_v2;
|
sign_hash = sign_hash_v2;
|
||||||
params.verify_hash = verify_hash_v2;
|
params.verify_hash = verify_hash_v2;
|
||||||
params.user_sig_type = 1;
|
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
params.keyfile = optarg;
|
params.keyfile = optarg;
|
||||||
|
@ -460,8 +460,7 @@ int verify_hash(const unsigned char *hash, int size, unsigned char *sig, int sig
|
|||||||
{
|
{
|
||||||
char *key;
|
char *key;
|
||||||
|
|
||||||
/* Get signature type from sig header if user did not enforce it */
|
/* Get signature type from sig header */
|
||||||
if (!params.user_sig_type) {
|
|
||||||
if (sig[0] == DIGSIG_VERSION_1) {
|
if (sig[0] == DIGSIG_VERSION_1) {
|
||||||
params.verify_hash = verify_hash_v1;
|
params.verify_hash = verify_hash_v1;
|
||||||
/* Read pubkey from RSA key */
|
/* Read pubkey from RSA key */
|
||||||
@ -470,8 +469,8 @@ int verify_hash(const unsigned char *hash, int size, unsigned char *sig, int sig
|
|||||||
params.verify_hash = verify_hash_v2;
|
params.verify_hash = verify_hash_v2;
|
||||||
/* Read pubkey from x509 cert */
|
/* Read pubkey from x509 cert */
|
||||||
params.x509 = 1;
|
params.x509 = 1;
|
||||||
}
|
} else
|
||||||
}
|
return -1;
|
||||||
|
|
||||||
/* Determine what key to use for verification*/
|
/* Determine what key to use for verification*/
|
||||||
key = params.keyfile ? : params.x509 ?
|
key = params.keyfile ? : params.x509 ?
|
||||||
|
@ -129,7 +129,6 @@ struct libevm_params {
|
|||||||
int verbose;
|
int verbose;
|
||||||
const char *hash_algo;
|
const char *hash_algo;
|
||||||
int user_hash_algo;
|
int user_hash_algo;
|
||||||
int user_sig_type;
|
|
||||||
int x509;
|
int x509;
|
||||||
char *keyfile;
|
char *keyfile;
|
||||||
verify_hash_fn_t verify_hash;
|
verify_hash_fn_t verify_hash;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user