diff options
author | joerg <joerg@pkgsrc.org> | 2008-05-09 16:19:57 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-05-09 16:19:57 +0000 |
commit | 76007a0add09fcab02c6759da5fa97155433454b (patch) | |
tree | 6a61c177c38d64c4d59b7526cdca4249b940a0d8 /pkgtools | |
parent | 8cd354a416b2f9baba2e1ee747c36acfcec51ed9 (diff) | |
download | pkgsrc-76007a0add09fcab02c6759da5fa97155433454b.tar.gz |
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.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/digest/files/sha2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgtools/digest/files/sha2.c b/pkgtools/digest/files/sha2.c index 1fe804fb778..972a24fbbd3 100644 --- a/pkgtools/digest/files/sha2.c +++ b/pkgtools/digest/files/sha2.c @@ -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 { |