Fix a bug in the SHA512 implementation that would be triggered if the
last block has exactly the length of a short fragment. This happened incidently with two files in the NetBSD 4.0 release.
This commit is contained in:
parent
647e9d137e
commit
9502292e69
1 changed files with 1 additions and 1 deletions
|
@ -814,7 +814,7 @@ void SHA512_Last(SHA512_CTX* context) {
|
|||
/* Begin padding with a 1 bit: */
|
||||
context->buffer[usedspace++] = 0x80;
|
||||
|
||||
if (usedspace < SHA512_SHORT_BLOCK_LENGTH) {
|
||||
if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) {
|
||||
/* Set-up for the last transform: */
|
||||
MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue