From 506da60cad7bf9d952deff2bb855add1369123ff Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Wed, 9 Jan 2019 18:47:26 +0200 Subject: [PATCH] hash init --- client/emv/emv_pki.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/emv/emv_pki.c b/client/emv/emv_pki.c index 602dcacce..593c8a00c 100644 --- a/client/emv/emv_pki.c +++ b/client/emv/emv_pki.c @@ -109,7 +109,8 @@ static unsigned char *emv_pki_decode_message(const struct emv_pk *enc_pk, } va_end(vl); - uint8_t hash[20] = {0}; + uint8_t hash[hash_len]; + memset(hash, 0, hash_len); memcpy(hash, crypto_hash_read(ch), hash_len); if (memcmp(data + data_len - 1 - hash_len, hash, hash_len)) { printf("ERROR: Calculated wrong hash\n");