1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00
freebsd-ports/security/digest/files/patch-sha2.c
Sergey Matveychuk 9615db4bd4 - Fix a bug in SHA256
PR:		ports/76289
Reported by:	Kenichi Morioka <morioka@openloop.co.jp>
Fixed by:	Vsevolod Stakhov <vsevolod@highsecure.ru> (maintainer)
2005-07-21 09:43:26 +00:00

12 lines
419 B
C

--- sha2.c.orig Thu Jul 21 00:39:56 2005
+++ sha2.c Thu Jul 21 02:30:00 2005
@@ -588,7 +588,7 @@
/* 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: */
MEMSET_BZERO(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace);
} else {