[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: md5 broken?
From: |
Antoine Levitt |
Subject: |
Re: md5 broken? |
Date: |
Sat, 28 May 2011 14:28:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
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 <address@hidden>
>
> 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 ;)
- md5 broken?, Antoine Levitt, 2011/05/28
- Re: md5 broken?, Jim Meyering, 2011/05/28
- Re: md5 broken?,
Antoine Levitt <=
- Re: md5 broken?, Eli Zaretskii, 2011/05/28
- Re: md5 broken?, Jim Meyering, 2011/05/28
- Re: md5 broken?, Eli Zaretskii, 2011/05/28
- Re: md5 broken?, Paul Eggert, 2011/05/28
- Re: md5 broken?, Eli Zaretskii, 2011/05/28
- Re: md5 broken?, Paul Eggert, 2011/05/28
- Re: md5 broken?, Eli Zaretskii, 2011/05/28
- INLINE -> inline (was: md5 broken?), Paul Eggert, 2011/05/28
- Re: INLINE -> inline (was: md5 broken?), Eli Zaretskii, 2011/05/29
- Re: INLINE -> inline, Jim Meyering, 2011/05/29