bzero() 2nd arg mistake. found by openbsd guys. from kame

This commit is contained in:
itojun 2003-09-04 00:12:56 +00:00
parent 1e4d96a37f
commit f13cb0c7b2

View File

@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: sha2.c,v 1.4 2003/07/12 09:37:14 itojun Exp $");
__RCSID("$NetBSD: sha2.c,v 1.5 2003/09/04 00:12:56 itojun Exp $");
#include <sys/types.h>
#include <sys/time.h>
@ -612,7 +612,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
}
/* Clean up state data: */
bzero(context, sizeof(context));
bzero(context, sizeof(*context));
usedspace = 0;
}
@ -633,7 +633,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;
@ -942,7 +942,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[]) {
@ -962,7 +962,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;
@ -1017,7 +1017,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[]) {
@ -1037,7 +1037,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;