summaryrefslogtreecommitdiff
path: root/pkgtools/digest
diff options
context:
space:
mode:
authorjoerg <joerg>2008-05-09 16:19:57 +0000
committerjoerg <joerg>2008-05-09 16:19:57 +0000
commite7437f8e56b937ec1d34fafda9e2527408586acb (patch)
tree6a61c177c38d64c4d59b7526cdca4249b940a0d8 /pkgtools/digest
parent9bbec086ff04c431d92a7a8cb59a79dfc4191d04 (diff)
downloadpkgsrc-e7437f8e56b937ec1d34fafda9e2527408586acb.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/digest')
-rw-r--r--pkgtools/digest/files/sha2.c2
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 {