bzero() 2nd arg mistake. found by openbsd guys, via kame
This commit is contained in:
parent
9bba9f60b6
commit
1e4d96a37f
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sha2.c,v 1.1 2003/07/22 03:24:25 itojun Exp $ */
|
||||
/* $NetBSD: sha2.c,v 1.2 2003/09/04 00:11:49 itojun Exp $ */
|
||||
/* $KAME: sha2.c,v 1.9 2003/07/20 00:28:38 itojun Exp $ */
|
||||
|
||||
/*
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sha2.c,v 1.1 2003/07/22 03:24:25 itojun Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sha2.c,v 1.2 2003/09/04 00:11:49 itojun Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
@ -609,7 +609,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
|
||||
}
|
||||
|
||||
/* Clean up state data: */
|
||||
bzero(context, sizeof(context));
|
||||
bzero(context, sizeof(*context));
|
||||
usedspace = 0;
|
||||
}
|
||||
|
||||
@ -630,7 +630,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;
|
||||
@ -939,7 +939,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[]) {
|
||||
@ -959,7 +959,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;
|
||||
@ -1014,7 +1014,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[]) {
|
||||
@ -1034,7 +1034,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;
|
||||
|
Loading…
Reference in New Issue
Block a user