From 5fdd8d28a33910f1a47bd036fa6ae9aea56447ed Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 8 Sep 2003 18:32:33 +0000 Subject: [PATCH] Correctly bzero the entire context, not just the first sizeof(void *) bytes. Found by: Juergen Buchmueller --- sys/crypto/sha2/sha2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/crypto/sha2/sha2.c b/sys/crypto/sha2/sha2.c index 492d658e6abc..98e497e3116b 100644 --- a/sys/crypto/sha2/sha2.c +++ b/sys/crypto/sha2/sha2.c @@ -611,7 +611,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { } /* Clean up state data: */ - bzero(context, sizeof(context)); + bzero(context, sizeof(*context)); usedspace = 0; } @@ -632,7 +632,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { } *buffer = (char)0; } else { - bzero(context, sizeof(context)); + bzero(context, sizeof(*context)); } bzero(digest, SHA256_DIGEST_LENGTH); return buffer; @@ -941,7 +941,7 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { } /* Zero out state data */ - bzero(context, sizeof(context)); + bzero(context, sizeof(*context)); } char *SHA512_End(SHA512_CTX* context, char buffer[]) { @@ -961,7 +961,7 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { } *buffer = (char)0; } else { - bzero(context, sizeof(context)); + bzero(context, sizeof(*context)); } bzero(digest, SHA512_DIGEST_LENGTH); return buffer; @@ -1016,7 +1016,7 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { } /* Zero out state data */ - bzero(context, sizeof(context)); + bzero(context, sizeof(*context)); } char *SHA384_End(SHA384_CTX* context, char buffer[]) { @@ -1036,7 +1036,7 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { } *buffer = (char)0; } else { - bzero(context, sizeof(context)); + bzero(context, sizeof(*context)); } bzero(digest, SHA384_DIGEST_LENGTH); return buffer;