From 7bc483497b265ed060423c342644d3e6c7af6d7e Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Wed, 3 Sep 2003 18:26:35 +0000 Subject: zap context correctly, from Juergen Buchmueller deraadt@ ok. --- sys/crypto/sha2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/crypto/sha2.c b/sys/crypto/sha2.c index e25f8818193..af77358c550 100644 --- a/sys/crypto/sha2.c +++ b/sys/crypto/sha2.c @@ -606,7 +606,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { } /* Clean up state data: */ - bzero(context, sizeof(context)); + bzero(context, sizeof(*context)); usedspace = 0; } @@ -627,7 +627,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; @@ -936,7 +936,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[]) { @@ -956,7 +956,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; @@ -1011,7 +1011,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[]) { @@ -1031,7 +1031,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; -- cgit v1.2.3