ports/76289: [Corrected version of ports/76288] `security/digest' with sha256 output miss-match hash value.
Kenichi Morioka
morioka at openloop.co.jp
Sat Jan 15 19:30:22 UTC 2005
>Number: 76289
>Category: ports
>Synopsis: [Corrected version of ports/76288] `security/digest' with sha256 output miss-match hash value.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Jan 15 19:30:22 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Kenichi Morioka
>Release: 4-10 RELEASE
>Organization:
Openloop Inc.
>Environment:
FreeBSD gw1 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Tue Oct 12 08:45:15 JST 2004 root at gw1:/usr/src/sys/compile/GATEWAY-001 i386
>Description:
When inputting a file consisting of 55-bytes data to security/digest
command with sha256, the hash value is miss match.
=== An example (All data value is hexadecimal representation.) ===
[input data (55 bytes)]
3031323334353637383941424344454630313233343536373839414243444546303132333435363738394142434445463031323334350a
[Output data value (by `security/digest' with sha256)]
e875cdeea84dd34be39352361383e370b01b8844ee5559f7ce3b1060bff043d0 (Miss match!)
[Expected data value]
3f234cc4c9938ee4fff8642ff108808ae303b7ab405c0ea5f9637541000164b5
==============================================================
>How-To-Repeat:
Every time, the miss-match hash-value appears only by inputting the file
consisting of 55-bytes data to `security/digest' command with sha256.
>Fix:
I think that it is good to correct `the 64-bytes message block
generator' in sha256 (SHA256_Update() or SHA256_Final() in sha2.c).
(I think that the cause of this problem is not the implementation of
sha256 transform alogorithm but the process of input-message.)
--
Because that the 55-bytes input-message becomes just 64 bytes block
after `the message terminator code(0x80)' and `size-field(8-bytes field)'
are added.
Perhaps, I think the block of a lot of one be made at this time.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list