From 9615db4bd42c312b1c6927b3ef67ac7ea0d5fde2 Mon Sep 17 00:00:00 2001 From: Sergey Matveychuk Date: Thu, 21 Jul 2005 09:43:26 +0000 Subject: - Fix a bug in SHA256 PR: ports/76289 Reported by: Kenichi Morioka Fixed by: Vsevolod Stakhov (maintainer) --- security/digest/files/patch-sha2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 security/digest/files/patch-sha2.c (limited to 'security/digest/files/patch-sha2.c') diff --git a/security/digest/files/patch-sha2.c b/security/digest/files/patch-sha2.c new file mode 100644 index 000000000000..bedf3e5fc22a --- /dev/null +++ b/security/digest/files/patch-sha2.c @@ -0,0 +1,11 @@ +--- 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 { -- cgit v1.2.3