From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 11 11:38:43 2014 Received: (at submit) by debbugs.gnu.org; 11 Jul 2014 15:38:43 +0000 Received: from localhost ([127.0.0.1]:53617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5cuF-0003Rh-Ce for submit@debbugs.gnu.org; Fri, 11 Jul 2014 11:38:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48591) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5WVn-0006ST-IK for submit@debbugs.gnu.org; Fri, 11 Jul 2014 04:49:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5WVa-00028A-UR for submit@debbugs.gnu.org; Fri, 11 Jul 2014 04:48:54 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5WVa-000285-R8 for submit@debbugs.gnu.org; Fri, 11 Jul 2014 04:48:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5WVU-0007P4-IN for bug-coreutils@gnu.org; Fri, 11 Jul 2014 04:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5WVN-00020d-S6 for bug-coreutils@gnu.org; Fri, 11 Jul 2014 04:48:40 -0400 Received: from smtpout5.laposte.net ([193.253.67.230]:25933 helo=smtpout.laposte.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5WVN-0001yy-Ij for bug-coreutils@gnu.org; Fri, 11 Jul 2014 04:48:33 -0400 Received: from wwinf8306 ([10.99.54.222]) by mwinf8509-out with ME id QwoW1o00q4nfl4A03woWXo; Fri, 11 Jul 2014 10:48:30 +0200 Date: Fri, 11 Jul 2014 10:48:30 +0200 From: xavier.richez@laposte.net To: bug-coreutils@gnu.org Message-ID: <1480076693.606576.1405068510263.JavaMail.www@wwinf8306> Subject: md5sum adds a new line at the end of the input MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_606575_2120228252.1405068510261" X-Originating-IP: [193.91.42.226] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 11 Jul 2014 11:38:38 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: xavier.richez@laposte.net List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) ------=_Part_606575_2120228252.1405068510261 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hello, I implemented my own MD5 generator. It provides the same results as all the online MD5 generators, like for instance http://onlinemd5.com/. But it gives a different result than the GNU md5sum tool. So I investigated this : it seems that md5sum adds a newline at the end of the input ! That is quite easy to test : - go to http://onlinemd5.com/, type "test" as text input. The MD5 sum is 098f6bcd4621d373cade4e832627b4f6 - now type in a prompt : "echo test | md5sum". The MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249 - back to onlinemd5.com, type "test" and press enter to add a new line in the input. Now the MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249 !! This behaviour was detected on RedHat Enterprise Linux 6.3 with GNU Coreutils 8.4. I was able to reproduce it using the latest 8.22 version (fresh build) on the same machine, and on CentOS 5.10 with Coreutils 5.97. Did someone know about this ? Best regards, Xavier Richez. ------=_Part_606575_2120228252.1405068510261 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello,

I implemented my own MD5 generator.
It provides the = same results as all the online MD5 generators, like for instance http://onl= inemd5.com/.

But it gives a different result than the GNU md5sum= tool.
So I investigated this : it seems that md5sum adds a newline at= the end of the input !

That is quite easy to test :
- go = to http://onlinemd5.com/, type "test" as text input. The MD5 sum = is 098f6bcd4621d373cade4e832627b4f6
- now type in a prompt : "ech= o test | md5sum". The MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249
- back to onlinemd5.com, type "test" and press enter to add a ne= w line in the input. Now the MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249 !!=

This behaviour was detected on RedHat Enterprise Linux 6.3 with= GNU Coreutils 8.4.
I was able to reproduce it using the latest 8.22 v= ersion (fresh build) on the same machine, and on CentOS 5.10 with Coreutils= 5.97.

Did someone know about this ?

Best regards,Xavier Richez.

------=_Part_606575_2120228252.1405068510261-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 11 11:45:21 2014 Received: (at 17997) by debbugs.gnu.org; 11 Jul 2014 15:45:21 +0000 Received: from localhost ([127.0.0.1]:53630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5d0f-0003ez-9s for submit@debbugs.gnu.org; Fri, 11 Jul 2014 11:45:21 -0400 Received: from mail4.vodafone.ie ([213.233.128.170]:49643) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5d0Z-0003eY-Ni; Fri, 11 Jul 2014 11:45:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvcEANIFwFNtTEBb/2dsb2JhbAANTINgg0upV5QqhikBgSABgSGEeAEBAQQjDwFGEAsNCwICBRYLAgIJAwIBAgFFEwEFAgEBiCoDFqxSd5FYE4cSF4Esjh0HFoJhgUwFnE+FcpAl Received: from unknown (HELO [192.168.1.79]) ([109.76.64.91]) by mail3.vodafone.ie with ESMTP; 11 Jul 2014 16:45:03 +0100 Message-ID: <53C0067F.9020308@draigBrady.com> Date: Fri, 11 Jul 2014 16:45:03 +0100 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: xavier.richez@laposte.net Subject: Re: bug#17997: md5sum adds a new line at the end of the input References: <1480076693.606576.1405068510263.JavaMail.www@wwinf8306> In-Reply-To: <1480076693.606576.1405068510263.JavaMail.www@wwinf8306> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17997 Cc: 17997@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tag 17997 notabug close 17997 stop On 07/11/2014 09:48 AM, xavier.richez@laposte.net wrote: > Hello, > > I implemented my own MD5 generator. > It provides the same results as all the online MD5 generators, like for instance http://onlinemd5.com/. > > But it gives a different result than the GNU md5sum tool. > So I investigated this : it seems that md5sum adds a newline at the end of the input ! > > That is quite easy to test : > - go to http://onlinemd5.com/, type "test" as text input. The MD5 sum is 098f6bcd4621d373cade4e832627b4f6 > - now type in a prompt : "echo test | md5sum". The MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249 > - back to onlinemd5.com, type "test" and press enter to add a new line in the input. Now the MD5 sum is d8e8fca2dc0f896fd7cb4cb0031ba249 !! > > This behaviour was detected on RedHat Enterprise Linux 6.3 with GNU Coreutils 8.4. > I was able to reproduce it using the latest 8.22 version (fresh build) on the same machine, and on CentOS 5.10 with Coreutils 5.97. > > Did someone know about this ? echo adds the newline. $ printf 'test' | md5sum 098f6bcd4621d373cade4e832627b4f6 - thanks, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 11 11:47:33 2014 Received: (at 17997-done) by debbugs.gnu.org; 11 Jul 2014 15:47:33 +0000 Received: from localhost ([127.0.0.1]:53643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5d2n-0003k1-Lr for submit@debbugs.gnu.org; Fri, 11 Jul 2014 11:47:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24211) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5d2h-0003ji-J8; Fri, 11 Jul 2014 11:47:27 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6BFlFRk032141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jul 2014 11:47:18 -0400 Received: from [10.3.113.16] ([10.3.113.16]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6BFlD6j000305; Fri, 11 Jul 2014 11:47:13 -0400 Message-ID: <53C00700.20902@redhat.com> Date: Fri, 11 Jul 2014 09:47:12 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: xavier.richez@laposte.net, 17997-done@debbugs.gnu.org Subject: Re: bug#17997: md5sum adds a new line at the end of the input References: <1480076693.606576.1405068510263.JavaMail.www@wwinf8306> In-Reply-To: <1480076693.606576.1405068510263.JavaMail.www@wwinf8306> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0281OnQ1hfo6VkH2OLvQ3Er5X7FVXbu1S" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 17997-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0281OnQ1hfo6VkH2OLvQ3Er5X7FVXbu1S Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 17997 notabug thanks On 07/11/2014 02:48 AM, xavier.richez@laposte.net wrote: > Hello, >=20 > I implemented my own MD5 generator. > It provides the same results as all the online MD5 generators, like for= instance http://onlinemd5.com/. >=20 > But it gives a different result than the GNU md5sum tool. > So I investigated this : it seems that md5sum adds a newline at the end= of the input ! No, YOU are adding a newline into the input you are feeding to md5sum. >=20 > That is quite easy to test : > - go to http://onlinemd5.com/, type "test" as text input. The MD5 sum i= s 098f6bcd4621d373cade4e832627b4f6 > - now type in a prompt : "echo test | md5sum". The MD5 sum is d8e8fca2d= c0f896fd7cb4cb0031ba249 Try this: echo test | od -tx1z printf test | od -tx1z Notice the difference? If you use echo, you are passing a newline into md5sum, and md5sum is doing the right thing. Use printf instead of echo, and you will get the results you want. As this is a usage error and not a bug, I'm closing this report. But feel free to ask further questions as needed. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0281OnQ1hfo6VkH2OLvQ3Er5X7FVXbu1S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTwAcAAAoJEKeha0olJ0NqaP8H/37ydVJVecenCZlIXnbe7gBw cD8S9OzcXDYZF/4sfkPXwY+br5bHZuW7RuoBbQICt+NzquLPov0IJnmQcEQpSfBD EmfOpSziL/hywn0/XvKe93GMSeLWEosEojnXjwFBRWwVyr+jODz7qb/RXnKAbv9F mlA6qo9yxNmDUWw7RphXGdkrb+0h02abta3JFTdflDkro++082J+vzF5Zl3kQMe9 AJsRwMDDg1/w2Wognqew5aTDakum+sT8J0Nv8SDu/dQMzPip48LicRG0Jt7PkNtB bP0JF5id/ObFoYqSVaRkJ8yi0/950oYkXCKhopHKaElVn0lHrOLLtk3tt8eWAv8= =lX73 -----END PGP SIGNATURE----- --0281OnQ1hfo6VkH2OLvQ3Er5X7FVXbu1S-- From unknown Sat Jun 14 03:56:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 09 Aug 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator