Correctly bzero the entire context, not just the first sizeof(void *) bytes.
Found by: Juergen Buchmueller <pullmoll@stop1984.com>
This commit is contained in:
parent
292bbfd103
commit
5fdd8d28a3
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user