diff options
author | joerg <joerg> | 2008-05-09 16:19:57 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-05-09 16:19:57 +0000 |
commit | ee20a6a2ea5daf2fc514dd8ac500f1390e440c57 (patch) | |
tree | 6a61c177c38d64c4d59b7526cdca4249b940a0d8 /pkgtools | |
parent | 403a0731c00048de9976e8c6c5dfd4cefe0f7515 (diff) | |
download | pkgsrc-ee20a6a2ea5daf2fc514dd8ac500f1390e440c57.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 { |