From 20bb7e9b5c932c6afe112630a615f5cc74c6c056 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Sun, 6 Nov 2016 15:53:04 +0100 Subject: [PATCH] sha1: fix context zeroing --- sha2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sha2.c b/sha2.c index dedf5a465b..f6ca3072c6 100644 --- a/sha2.c +++ b/sha2.c @@ -592,7 +592,7 @@ void sha1_Final(SHA1_CTX* context, sha2_byte digest[]) { * No digest buffer, so we can do nothing * except clean up and go home */ - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(SHA1_CTX)); return; } @@ -649,7 +649,7 @@ void sha1_Final(SHA1_CTX* context, sha2_byte digest[]) { #endif /* Clean up: */ - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(SHA1_CTX)); } char *sha1_End(SHA1_CTX* context, char buffer[]) { @@ -666,7 +666,7 @@ char *sha1_End(SHA1_CTX* context, char buffer[]) { } *buffer = (char)0; } else { - MEMSET_BZERO(context, sizeof(context)); + MEMSET_BZERO(context, sizeof(SHA1_CTX)); } MEMSET_BZERO(digest, SHA1_DIGEST_LENGTH); return buffer;