summaryrefslogtreecommitdiffstats
path: root/patches/ima-evm-utils-1.1/0007-libimaevm-use-SHA_DIGEST_LENGTH-instead-of-open-codi.patch
blob: 2164c6238e78067c2af89050e092930116789479 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Sat, 26 Mar 2016 22:58:53 +0100
Subject: [PATCH] libimaevm: use SHA_DIGEST_LENGTH instead of open coding it

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 src/libimaevm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libimaevm.c b/src/libimaevm.c
index 8fc23be08bd7..b6c328801708 100644
--- a/src/libimaevm.c
+++ b/src/libimaevm.c
@@ -379,7 +379,7 @@ int verify_hash_v1(const char *file, const unsigned char *hash, int size,
 	SHA_CTX ctx;
 	unsigned char out[1024];
 	RSA *key;
-	unsigned char sighash[20];
+	unsigned char sighash[SHA_DIGEST_LENGTH];
 	struct signature_hdr *hdr = (struct signature_hdr *)sig;
 
 	log_info("hash-v1: ");
@@ -744,7 +744,7 @@ int sign_hash_v1(const char *hashalgo, const unsigned char *hash, int size, cons
 	unsigned char pub[1024];
 	RSA *key;
 	char name[20];
-	unsigned char sighash[20];
+	unsigned char sighash[SHA_DIGEST_LENGTH];
 	struct signature_hdr *hdr;
 	uint16_t *blen;