[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: sha1sum / md5sum problems
From:       Denis Vlasenko <vda.linux () googlemail ! com>
Date:       2007-01-26 23:29:42
Message-ID: 200701270029.42713.vda.linux () googlemail ! com
[Download RAW message or body]

On Friday 26 January 2007 21:58, MatthewLCreech@eaton.com wrote:
> busybox-bounces@busybox.net wrote:
> > 
> > 1.3.2: "d2affe6e6252c5de244012d941fdb59fc9cdc579"
> > 1.4.0: "T2QVVU6U6252S5TU244012T941VTR59VS9STS579"
> > 
> > The strings are very similar - it appears that all numbers
> > are correct,
> > while letters are offset by a contant amount.  Any ideas?
> > 
> 
> FYI, It seems that "libbb/xfuncs.c:bin2hex()" is buggy.  Not sure what
> the problem is, but I reverted "coreutils/md5_sha1_sum.c" to its
> previous version which doesn't call that function, and it works fine
> now.

Awwww you right. Fix is.

diff -urpN busybox.4/libbb/xfuncs.c busybox.5/libbb/xfuncs.c
--- busybox.4/libbb/xfuncs.c    2007-01-24 22:49:26.000000000 +0100
+++ busybox.5/libbb/xfuncs.c    2007-01-27 00:27:45.000000000 +0100
@@ -343,8 +343,8 @@ char *bin2hex(char *p, const char *cp, i
        while (count) {
                unsigned char c = *cp++;
                /* put lowercase hex digits */
-               *p++ = 0x10 | bb_hexdigits_upcase[c >> 4];
-               *p++ = 0x10 | bb_hexdigits_upcase[c & 0xf];
+               *p++ = 0x20 | bb_hexdigits_upcase[c >> 4];
+               *p++ = 0x20 | bb_hexdigits_upcase[c & 0xf];
                count--;
        }
        return p;

Fixed in svn, thanks!
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic