RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES configure.ac rpm/rpmio/ md4.c rmd128.c rmd160....

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Thu 19 Jul 2007 - 21:07:57 CEST
Message-Id: <20070719190757.273603484F4@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
  Module: rpm                              Date:   19-Jul-2007 21:07:57
  Branch: HEAD                             Handle: 2007071920075600

  Modified files:
    rpm                     CHANGES configure.ac
    rpm/rpmio               md4.c rmd128.c rmd160.c rmd256.c rmd320.c
                            salsa10.c salsa20.c tiger.c

  Log:
    Unbreak big-endian handling in memory (memcmp) and cryptography (MD4,
    RMD*, SASLA* and Tiger) functions by providing the missing Autoconf
    define "WORDS_BIGENDIAN". Also, fix the usage of "WORDS_BIGENDIAN",
    too. Thank god platforms nowdays have memcmp(3) and RPM by default
    doesn't _use_ one of the mentioned cryptography functions. Else, it
    would have been ultra-broken on SPARC64 and other big-endian hardware
    architectures.

  Summary:
    Revision    Changes     Path
    1.1498      +1  -0      rpm/CHANGES
    2.208       +1  -0      rpm/configure.ac
    1.5         +2  -2      rpm/rpmio/md4.c
    1.4         +2  -2      rpm/rpmio/rmd128.c
    1.4         +2  -2      rpm/rpmio/rmd160.c
    1.4         +2  -2      rpm/rpmio/rmd256.c
    1.4         +2  -2      rpm/rpmio/rmd320.c
    1.4         +1  -1      rpm/rpmio/salsa10.c
    1.4         +1  -1      rpm/rpmio/salsa20.c
    1.5         +1  -1      rpm/rpmio/tiger.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1497 -r1.1498 CHANGES
  --- rpm/CHANGES	19 Jul 2007 18:55:35 -0000	1.1497
  +++ rpm/CHANGES	19 Jul 2007 19:07:56 -0000	1.1498
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - rse: unbreak big-endian handling in memory and cryptography functions by Autoconf providing WORDS_BIGENDIAN and fixing usage
       - rse: cleanup and fix the code to compile under *non*-GCC compilers (e.g. Sun Studio and Intel C/C++)
       - rse: fix building under --with-dmalloc with DMalloc 5.5.2 where "x{malloc,calloc,realloc,free}" are also overridden
       - rse: provide convenience --enable-build-debug Autoconf option for building RPM with debugging instrumentation
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/configure.ac
  ============================================================================
  $ cvs diff -u -r2.207 -r2.208 configure.ac
  --- rpm/configure.ac	19 Jul 2007 18:26:21 -0000	2.207
  +++ rpm/configure.ac	19 Jul 2007 19:07:56 -0000	2.208
  @@ -414,6 +414,7 @@
   dnl # standard checks
   AM_C_PROTOTYPES
   AC_C_INLINE
  +AC_C_BIGENDIAN
   
   dnl # standard headers (specific)
   AC_HEADER_STDC
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/md4.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.5 md4.c
  --- rpm/rpmio/md4.c	9 Jul 2007 22:31:57 -0000	1.4
  +++ rpm/rpmio/md4.c	19 Jul 2007 19:07:56 -0000	1.5
  @@ -77,12 +77,12 @@
   	uint32_t a, b, c, d;
   
   	register uint32_t* w;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	register byte t;
   	#endif
   
   	w = mp->data;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	t = 16;
   	while (t--)
   	{
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rmd128.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 rmd128.c
  --- rpm/rpmio/rmd128.c	24 Jun 2007 10:27:21 -0000	1.3
  +++ rpm/rpmio/rmd128.c	19 Jul 2007 19:07:56 -0000	1.4
  @@ -137,12 +137,12 @@
   	register uint32_t aa,bb,cc,dd;
   	register uint32_t aaa,bbb,ccc,ddd;
   	register uint32_t* X;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	register byte t;
   	#endif
   
   	X = mp->data;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	t = 16;
   	while (t--)
   	{
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rmd160.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 rmd160.c
  --- rpm/rpmio/rmd160.c	24 Jun 2007 10:27:21 -0000	1.3
  +++ rpm/rpmio/rmd160.c	19 Jul 2007 19:07:56 -0000	1.4
  @@ -154,12 +154,12 @@
   	register uint32_t aa,bb,cc,dd,ee;
   	register uint32_t aaa,bbb,ccc,ddd,eee;
   	register uint32_t* X;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	register byte t;
   	#endif
   
   	X = mp->data;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	t = 16;
   	while (t--)
   	{
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rmd256.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 rmd256.c
  --- rpm/rpmio/rmd256.c	24 Jun 2007 10:27:21 -0000	1.3
  +++ rpm/rpmio/rmd256.c	19 Jul 2007 19:07:56 -0000	1.4
  @@ -140,12 +140,12 @@
   	register uint32_t aaa,bbb,ccc,ddd;
   	register uint32_t tmp;
   	register uint32_t* X;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	register byte t;
   	#endif
   
   	X = mp->data;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	t = 16;
   	while (t--)
   	{
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rmd320.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 rmd320.c
  --- rpm/rpmio/rmd320.c	24 Jun 2007 10:27:21 -0000	1.3
  +++ rpm/rpmio/rmd320.c	19 Jul 2007 19:07:56 -0000	1.4
  @@ -157,12 +157,12 @@
   	register uint32_t aaa,bbb,ccc,ddd,eee;
   	register uint32_t tmp;
   	register uint32_t* X;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	register byte t;
   	#endif
   
   	X = mp->data;
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	t = 16;
   	while (t--)
   	{
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/salsa10.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 salsa10.c
  --- rpm/rpmio/salsa10.c	24 Jun 2007 10:27:21 -0000	1.3
  +++ rpm/rpmio/salsa10.c	19 Jul 2007 19:07:56 -0000	1.4
  @@ -60,7 +60,7 @@
   	int i;
   
   	for (i = 0; i < 16; ++i) {
  -	    #if WORDS_BIGENDIAN		/* XXX untested */
  +	    #ifdef WORDS_BIGENDIAN		/* XXX untested */
   	    X[i] = swapu32(mp->data[i]);
   	    #else
   	    X[i] = mp->data[i];
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/salsa20.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 salsa20.c
  --- rpm/rpmio/salsa20.c	24 Jun 2007 10:27:21 -0000	1.3
  +++ rpm/rpmio/salsa20.c	19 Jul 2007 19:07:56 -0000	1.4
  @@ -60,7 +60,7 @@
   	int i;
   
   	for (i = 0; i < 16; ++i) {
  -	    #if WORDS_BIGENDIAN		/* XXX untested */
  +	    #ifdef WORDS_BIGENDIAN		/* XXX untested */
   	    X[i] = swapu32(mp->data[i]);
   	    #else
   	    X[i] = mp->data[i];
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/tiger.c
  ============================================================================
  $ cvs diff -u -r1.4 -r1.5 tiger.c
  --- rpm/rpmio/tiger.c	9 Jul 2007 22:31:57 -0000	1.4
  +++ rpm/rpmio/tiger.c	19 Jul 2007 19:07:56 -0000	1.5
  @@ -628,7 +628,7 @@
   	uint64_t * w, x[8];
   
   	memcpy(x, mp->data, sizeof(x));
  -	#if WORDS_BIGENDIAN
  +	#ifdef WORDS_BIGENDIAN
   	{	register int t = 8;
   		w = x;
   		while (t--) {
  @@ .
Received on Thu Jul 19 21:07:57 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.