Mailing List Archive

Another sparc patch (was Re: bus error and check fail on solaris 2.6)
Another patch for a mis-aligned memory access, this time in md5.c
(md5_write) :

diff -ur old/cipher/md5.c new/cipher/md5.c
--- old/cipher/md5.c Wed Feb 10 17:22:21 1999
+++ new/cipher/md5.c Wed Feb 24 19:02:43 1999
@@ -268,8 +268,9 @@
ctx->buflen = (left_over + add) & 63;
}

- buffer = (const char *) buffer + add;
len -= add;
+ memmove (buffer, buffer + add, len);
+ /*buffer = (const char *) buffer + add;*/
}

/* Process available complete blocks. */


Well, I don't know if it's The-Right-Thing-To-Do(tm), but at least if
helps the Sparc port by a large margin ;-)
Basically, buffer is later passed to transform() which use it as an
array of unsigned int. On Sparc unsigned int pointers must be aligned
on a 4-byte boundary.
I know this breaks the "const void *", but I don't see any other way
to do this.

With this patch the last failing check is the clearsig test with
--rfc1991. It pass all clearsig tests but the one with
--rfc1991. Unfortunately this one doesn't segfault, but produce a bad
signature instead...


Another thing, in cipher/rndlinux.c you wrote :

#if defined(__sparc__) && defined(__linux__)
#warning something is wrong with UltraPenguin /dev/random
#else
if( !S_ISCHR(sb.st_mode) )
g10_log_fatal("invalid random device!\n" );
#endif

Hmm, this worry me. What's wrong in UltraPenguin's /dev/random ? Does
the RH 5.2 distrib has the same problem ? How do I test for a faulty
/dev/random ?

--
RĂ©mi <rguyom@mail.dotcom.fr> | Don't waste your computer's time :
PGP-encrypt anything important: | http://www.distributed.net/
www.gnupg.org - KeyID:0x85BD8B1B | http://www.distributed.net/cores/
Re: Another sparc patch [ In reply to ]
Remi Guyomarch <rguyom@mail.dotcom.fr> writes:

> Hmm, this worry me. What's wrong in UltraPenguin's /dev/random ? Does
> the RH 5.2 distrib has the same problem ? How do I test for a faulty
> /dev/random ?

I had problems with the /dev/random runnig an very old 2.1 kernel.
I think this is now fixed and I will remove the warning.


--
Werner Koch at guug.de www.gnupg.org keyid 621CC013

Will Internet-SPAM be legalized in Europe on March, 29th? Prohibit that at
http://www.politik-digital.de/spam/
Deine Stimme gegen SPAM! - Votez contre le SPAM! - Vote against SPAM!