misc/76106: Invalid hash-value is output by the `digest' command with sha256 mode.

Kenichi Morioka morioka at openloop.co.jp
Tue Jan 11 08:10:31 PST 2005


>Number:         76106
>Category:       misc
>Synopsis:       Invalid hash-value is output by  the `digest' command with sha256 mode.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 11 16:10:30 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 including 54-byte data, the digest command output invalid hash value.
(where, the input data size is 55-byte as including return code(0x0a).)

In a word, when inputting the 55-byte message data to sha256, output value is invalid.
Such a result is only when using 55-byte input data.
>How-To-Repeat:
      When a file including 54-byte(size of that final data becomes 55-byte) is input to `digest' in sha256-mode.
>Fix:
      I think that it is good to correct `the 64-byte message block generator' in sha256 (SHA256_Update() or SHA256_Final() in sha2.c).
(I think that this cause of this problem is not the implementation of sha256 transform alogorithm but the process of input message block.)

--
Because that the message of 55-bytes is the values that become just 64 bytes when `the message terminator code(0x80)' and `size-field(8-byte)' are added.
Perhaps, I think this block of a lot of one be made at this time.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list