linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4.2 on AMD64 Linux: assumes 4-byte long
@ 2004-06-06  6:19 Guy Rouillier
  2004-06-09  5:48 ` 2.4.2 on AMD64 Linux: assumes 4-byte long - FIXED! Guy Rouillier
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Guy Rouillier @ 2004-06-06  6:19 UTC (permalink / raw)
  To: linux-ppp

I'm new here.  I hope this is the right place to post this question;
please point me to the correct place if I've gotten it wrong.  I've been
trying to get 2.4.2 working on Mandrake 10.0 for AMD64, using kernel
2.6.3.  I've downloaded this version, along with a corresponding 1.4.0
version of pptp, from the pptp-client site.  I'm getting a "Fatal signal
11", which I've traced to the SHA1_Final function on sha1.c during CHAP
Challenge phase of connection setup.

Looking in sha1.h and sha1.c source code, I see data structures and
functions with longs in them, which sets off alarms.  I think there was
an assumption when this code was written that a long is 4 bytes long. 
On an AMD64 64-bit OS, a long is 8 bytes.  What leads me to think this
is #define in sha1.c:

#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 -
(bits))))

Clearly, on a 64-bit long, this won't produce a correct rotate-left.  
I've googled on sha1.c, and I've found several instances where the code
has switched to using u_int32 instead of long, including one by the same
author (Steve Reid) here:

http://cvsweb.stop1984.com/index.cgi/entropy/src/sha1.c?rev=1.12&content-type=text/x-cvsweb-markup

As a test, I tried simply changing all the longs to ints in sha1.h and
sha1.c.  Unfortunately, I went from getting segfaults to getting kernel
panics.  I'm suspecting this is not a valid thing to do, since the
corresponding files that the kernel was built from still have long
declarations.  I'm guessing these need to match, correct?  Or is pppd
standalone, and can I change sha1.c/h without worrying about the kernel
(which I compiled myself from Mandrake sources)?

I also tried simply changing the definition of rol above to use 64
instead of 32.  Predictably, that didn't work.

I'm not an expert in networking.  I'd appreciate any and all suggestions
anyone can provide to get this working.  Thanks.

-- 
Guy Rouillier

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-11  8:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-06  6:19 2.4.2 on AMD64 Linux: assumes 4-byte long Guy Rouillier
2004-06-09  5:48 ` 2.4.2 on AMD64 Linux: assumes 4-byte long - FIXED! Guy Rouillier
2004-06-10  4:13 ` Guy Rouillier
2004-06-10  4:43 ` James Cameron
2004-06-10  5:52 ` Guy Rouillier
2004-06-11  8:12 ` mole

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).