From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel Subject: Re: md5 broken? Date: Sat, 28 May 2011 14:28:15 +0200 Message-ID: <878vtr9fhc.fsf@gmail.com> References: <87ipsv188f.fsf@gmail.com> <87zkm7t3n4.fsf@rho.meyering.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306585715 9718 80.91.229.12 (28 May 2011 12:28:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 May 2011 12:28:35 +0000 (UTC) Cc: Paul Eggert , emacs-devel@gnu.org To: Jim Meyering Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 28 14:28:26 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QQIcy-0005Fn-Op for ged-emacs-devel@m.gmane.org; Sat, 28 May 2011 14:28:24 +0200 Original-Received: from localhost ([::1]:36874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQIcy-0003nI-Bg for ged-emacs-devel@m.gmane.org; Sat, 28 May 2011 08:28:24 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQIcv-0003n1-D4 for emacs-devel@gnu.org; Sat, 28 May 2011 08:28:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQIcu-0000cR-7i for emacs-devel@gnu.org; Sat, 28 May 2011 08:28:21 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:37311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQIcu-0000cN-3d for emacs-devel@gnu.org; Sat, 28 May 2011 08:28:20 -0400 Original-Received: by wwb39 with SMTP id 39so2245893wwb.30 for ; Sat, 28 May 2011 05:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=Lo+YdLulnqbBUfLW+CcrrEe/Yp26dlH1Emtt4AK3C8o=; b=JtWiGGG3GiyTqI+zvoVqB/gvkM/dxzpZzL2sKb1QEyAqLDyRn6ovWM8HSQO+Lk5nMZ c9l265k+LbZ4HZd5fjA++qJSRc6LFYG8VQfKzO4MY34n/OGIp6YLjp1dw56C9l42ynch c0MVtizYI+dwpescIXmQOl4YJsWaT5ZUZt1BQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=iihchXmIYfK8KS/smVog/SBj+jIzIwaXDh5JixHyLZEaGud7c5D8RkcrZv7ZHb1fGh OW2f7YSXzxpfBXIpBBLWpxx0nVOwGiGXB1dUoe93B2ZaVq2SzE4IebDYaqJjpN14gprY LuywTz/sgSfSeOnqUHDjUQxTsxw3Zi5+jyxVA= Original-Received: by 10.227.2.144 with SMTP id 16mr3199088wbj.9.1306585698890; Sat, 28 May 2011 05:28:18 -0700 (PDT) Original-Received: from lambda (ney92-7-78-233-218-202.fbx.proxad.net [78.233.218.202]) by mx.google.com with ESMTPS id m8sm1813940wbh.62.2011.05.28.05.28.16 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 May 2011 05:28:17 -0700 (PDT) In-Reply-To: <87zkm7t3n4.fsf@rho.meyering.net> (Jim Meyering's message of "Sat, 28 May 2011 14:23:43 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139830 Archived-At: 28/05/11 14:23, Jim Meyering > Antoine Levitt wrote: > ... >> (md5 "truc") >> => 45723a2af3788c4ff17f8d1114760e62 >> (which is the same thing as md5sum) >> >>>>From an emacs just compiled, >> >> (md5 "truc") >> => 45723a2aff78ff4fff7fff1114760e62 >> (it seems some digits have been randomly replaced by f, for some reason) > ... > > Thanks for the report. > That was due to yesterday's crypto_hash_function change. > It switched from unsigned to signed char pointers. > The patch below fixes it by introducing the tiny "to_uchar" function > from coreutils/src/system.h. It's safer to use a tiny helper > function like that rather than a cast. > > I fixed it with this: > > 2011-05-28 Jim Meyering > > avoid a sign-extension bug in crypto_hash_function > * fns.c (to_uchar): Define. > (crypto_hash_function): Use it to convert some newly-signed > variables to unsigned, to avoid sign-extension bugs. For example, > without this change, (md5 "truc") would evaluate to > 45723a2aff78ff4fff7fff1114760e62 rather than the expected > 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in > http://thread.gmane.org/gmane.emacs.devel/139824 Thanks for the fix! Awesome that the word "truc" ("thingy" in french) has made its way into the emacs Changelog ;)