Skip to contentSkip to conversation

ima-evm-utils: Fix ima_verify for v1 signatures

PATCH In review Vitaly Chikunov 2 participants 2 messages Jul 26, 2019 – Jul 30, 2019 Keys-trusted

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ima-evm-utils: Fix ima_verify for v1 signatures

Use user supplied key in verify_hash for DIGSIG_VERSION_1. Otherwise v1 signatures don't pass verification.

---
 src/libimaevm.c | 2 ++
 1 file changed, 2 insertions(+)
src/libimaevm.c +2 -0
index a582872..97f193e 100644
@@ -612,6 +612,8 @@ int verify_hash(const char *file, const unsigned char *hash, int size, unsigned
 		/* Read pubkey from RSA key */
 		if (!imaevm_params.keyfile)
 			key = "/etc/keys/pubkey_evm.pem";
+		else
+			key = imaevm_params.keyfile;
 		return verify_hash_v1(file, hash, size, sig, siglen, key);
 	} else if (sig[0] == DIGSIG_VERSION_2) {
 		return verify_hash_v2(file, hash, size, sig, siglen);
Signature · 1 line
2.11.0