Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2005 16:06:17 GMT
From:      Kenichi Morioka <morioka@openloop.co.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/76106: Invalid hash-value is output by  the `digest' command with sha256 mode.
Message-ID:  <200501111606.j0BG6Hme045496@www.freebsd.org>
Resent-Message-ID: <200501111610.j0BGAU25051233@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501111606.j0BG6Hme045496>