summaryrefslogtreecommitdiffstats
path: root/sys/crypto
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2002-02-26 16:58:58 +0000
committerume <ume@FreeBSD.org>2002-02-26 16:58:58 +0000
commitf7cd13562c1a3c4b95feda785b5e7f2402b10cdc (patch)
tree72c85e5141e76da5ba1f665a43c43310c098a9f5 /sys/crypto
parent4446cd5261150f93a54923649f011de1d4f36197 (diff)
downloadFreeBSD-src-f7cd13562c1a3c4b95feda785b5e7f2402b10cdc.zip
FreeBSD-src-f7cd13562c1a3c4b95feda785b5e7f2402b10cdc.tar.gz
off by one error in Aaron Gifford's code. KAME PR 393.
PR: kern/34242 Submitted by: Aaron D. Gifford <agifford@infowest.com> MFC after: 1 week
Diffstat (limited to 'sys/crypto')
-rw-r--r--sys/crypto/sha2/sha2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/crypto/sha2/sha2.c b/sys/crypto/sha2/sha2.c
index 68f1941..86b7cd9 100644
--- a/sys/crypto/sha2/sha2.c
+++ b/sys/crypto/sha2/sha2.c
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $KAME: sha2.c,v 1.6 2001/03/12 11:31:04 itojun Exp $ */
+/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */
/*
* sha2.c
@@ -566,7 +566,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
/* Begin padding with a 1 bit: */
context->buffer[usedspace++] = 0x80;
- if (usedspace < SHA256_SHORT_BLOCK_LENGTH) {
+ if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) {
/* Set-up for the last transform: */
bzero(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace);
} else {
@@ -883,7 +883,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: */
bzero(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace);
} else {
OpenPOWER on IntegriCloud