Skip to contentSkip to conversation

ima-evm-utils: Change log text of hash in hash_ima

PATCH In review Vitaly Chikunov 2 participants 2 messages Aug 17, 2019 – Aug 20, 2019 Keys-trusted

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ima-evm-utils: Change log text of hash in hash_ima

Output value is not just a hash, but hash prefixed with header. User may be confused to see invalid hash value. Thus, change text so that is obvious this is not a raw hash.

---
 src/evmctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/evmctl.c +1 -1
index ef1f289..53711f4 100644
@@ -606,7 +606,7 @@ static int hash_ima(const char *file)
 	len += offset;
 
 	if (imaevm_params.verbose >= LOG_INFO)
-		log_info("hash(%s): ", imaevm_params.hash_algo);
+		log_info("hdr+hash(%s): ", imaevm_params.hash_algo);
 
 	if (sigdump || imaevm_params.verbose >= LOG_INFO)
 		imaevm_hexdump(hash, len);
Signature · 1 line
2.11.0
#1 lore raw
Quoted 25 lines · Vitaly Chikunov

Output value is not just a hash, but hash prefixed with header. User may be confused to see invalid hash value. Thus, change text so that is obvious this is not a raw hash.

---
 src/evmctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/evmctl.c +1 -1
index ef1f289..53711f4 100644
@@ -606,7 +606,7 @@ static int hash_ima(const char *file)
 	len += offset;
 
 	if (imaevm_params.verbose >= LOG_INFO)
-		log_info("hash(%s): ", imaevm_params.hash_algo);
+		log_info("hdr+hash(%s): ", imaevm_params.hash_algo);
 
 	if (sigdump || imaevm_params.verbose >= LOG_INFO)
 		imaevm_hexdump(hash, len);
Signature · 1 line
2.11.0

Haha, simple but really useful change :)
Thanks.