Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 121182 - pycrypto RMD160 on ia64 (and many other 64bit arches)
Summary: pycrypto RMD160 on ia64 (and many other 64bit arches)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 121124
  Show dependency tree
 
Reported: 2006-02-01 07:36 UTC by Aron Griffis (RETIRED)
Modified: 2006-02-02 06:09 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Griffis (RETIRED) gentoo-dev 2006-02-01 07:36:22 UTC
What you see here is the first 6 digits of the RMD160 sum for dev-python/pycrypto/metadata.xml generated on different platforms:

          alpha   amd64   ia64    x86
2.0       b0aeda  11aff8  11aff8  b0aeda
2.0-r1    b0aeda  11aff8  11aff8  b0aeda
2.0.1     b0aeda  b0aeda  11aff8  b0aeda
2.0.1-r1  b0aeda  b0aeda  11aff8  b0aeda

So it appears that alpha is fine, amd64 was fixed in 2.0.1, and ia64 is still broken.  Looking at RIPEMD.c, I think the programmers don't realize that "int" means 32-bits according to the C standard, and "long" means native size of a pointer:

#ifdef __alpha__
typedef    unsigned int        word;   /* unsigned 32-bit integer */
#elif defined(__amd64__)
typedef    uint32_t            word;   /* unsigned 32-bit integer */
#else
typedef    unsigned long        word;   /* unsigned 32-bit integer */
#endif

IMHO this should simply be:

typedef    unsigned int        word;   /* unsigned 32-bit integer */

For the moment, rather than rock the boat, I've added a patch to make ia64 work correctly, see pycrypto-2.0.1-r2.  However I think the existing code is going to have problems on any 64-bit architectures not specifically handled.
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2006-02-01 07:39:05 UTC
Btw, I assigned this to dev-portage because it affects Manifest generation.  Feel free to reassign it as appropriate.  Mainly I'm looking for somebody to agree or disagree with my assessment, then push it upstream
Comment 2 SpanKY gentoo-dev 2006-02-01 07:58:03 UTC
> Looking at RIPEMD.c, I think the programmers don't realize that "int"
> means 32-bits according to the C standard, and "long" means native size of a
> pointer:

it is usually safe to assume int is 32bits, but that isnt good programming imho

> IMHO this should simply be:
> 
> typedef    unsigned int        word;   /* unsigned 32-bit integer */

if you want 32bits, then you should use the uint32_t def
Comment 3 Henrik Grubbström 2006-02-01 08:07:14 UTC
The proper fix ought to be to use uint32_t for all architectures.

I can confirm the bug on my ia64 machine:

# emerge -uD world
Calculating world dependencies ...done!
>>> emerge (1 of 3) sys-libs/timezone-data-2006a to /

!!! Digest verification Failed:
!!!    /usr/portage/sys-libs/timezone-data/timezone-data-2006a.ebuild
!!! Reason: Failed on RMD160 verification
!!! Got:      76142fd7417cdb675bc0a6f5d34b4979ed451237
!!! Expected: 688734ae4535c63334dabac100df4faef08ee990

BTW: Is there any way to get portage to ignore RMD160 sums?
Comment 4 SpanKY gentoo-dev 2006-02-01 08:17:30 UTC
> BTW: Is there any way to get portage to ignore RMD160 sums?

remove the RMD160 line from the digest file
Comment 5 Henrik Grubbström 2006-02-01 08:30:15 UTC
> > BTW: Is there any way to get portage to ignore RMD160 sums?
> 
> remove the RMD160 line from the digest file

... and the Manifest file, and update all the other sums since the files have changed...

That's doable for an ebuild or two, but not much more.
Comment 6 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-02-01 08:47:09 UTC
(In reply to comment #3)
> The proper fix ought to be to use uint32_t for all architectures.
> 
> I can confirm the bug on my ia64 machine:
> 
> # emerge -uD world
> Calculating world dependencies ...done!
> >>> emerge (1 of 3) sys-libs/timezone-data-2006a to /
> 
> !!! Digest verification Failed:
> !!!    /usr/portage/sys-libs/timezone-data/timezone-data-2006a.ebuild
> !!! Reason: Failed on RMD160 verification
> !!! Got:      76142fd7417cdb675bc0a6f5d34b4979ed451237
> !!! Expected: 688734ae4535c63334dabac100df4faef08ee990
> 
> BTW: Is there any way to get portage to ignore RMD160 sums?
> 

Not to be recommended lightly, but FEATURES="-strict" should do it also.
Comment 7 solar (RETIRED) gentoo-dev 2006-02-01 09:00:25 UTC
(In reply to comment #6)
> (In reply to comment #3)
> > BTW: Is there any way to get portage to ignore RMD160 sums?
> > 
> 
> Not to be recommended lightly, but FEATURES="-strict" should do it also.

and or.. emerge --digest foo
Comment 8 Henrik Grubbström 2006-02-01 09:48:00 UTC
(In reply to comment #3)
> BTW: Is there any way to get portage to ignore RMD160 sums?

Editing /usr/lib/portage/pym/portage_checksum.py, and commenting out the line

       hashfunc_map["RMD160"] = rmd160hash

seems to do the trick.

Comment 9 Marius Mauch (RETIRED) gentoo-dev 2006-02-02 03:06:20 UTC
So, we have a universal fix and now the question is who's going to fix the package?
Comment 10 SpanKY gentoo-dev 2006-02-02 05:45:33 UTC
if Aron doesnt commit a "final" fix, i'll take care of it ...
Comment 11 Aron Griffis (RETIRED) gentoo-dev 2006-02-02 06:09:08 UTC
It's in as 2.0.1-r3