From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 11 16:10:31 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 549D816A4CE for ; Tue, 11 Jan 2005 16:10:31 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11ECA43D41 for ; Tue, 11 Jan 2005 16:10:31 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j0BGAUC9051234 for ; Tue, 11 Jan 2005 16:10:30 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j0BGAU25051233; Tue, 11 Jan 2005 16:10:30 GMT (envelope-from gnats) Resent-Date: Tue, 11 Jan 2005 16:10:30 GMT Resent-Message-Id: <200501111610.j0BGAU25051233@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Kenichi Morioka Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE6B516A4CE for ; Tue, 11 Jan 2005 16:06:17 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 981C643D2F for ; Tue, 11 Jan 2005 16:06:17 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0BG6HYG045497 for ; Tue, 11 Jan 2005 16:06:17 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j0BG6Hme045496; Tue, 11 Jan 2005 16:06:17 GMT (envelope-from nobody) Message-Id: <200501111606.j0BG6Hme045496@www.freebsd.org> Date: Tue, 11 Jan 2005 16:06:17 GMT From: Kenichi Morioka To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: misc/76106: Invalid hash-value is output by the `digest' command with sha256 mode. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2005 16:10:31 -0000 >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: