linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guy Rouillier <guy-rouillier@speakeasy.net>
To: linux-ppp@vger.kernel.org
Subject: 2.4.2 on AMD64 Linux: assumes 4-byte long
Date: Sun, 06 Jun 2004 06:19:36 +0000	[thread overview]
Message-ID: <20040606021936.14c69b54@localhost> (raw)

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

             reply	other threads:[~2004-06-06  6:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-06  6:19 Guy Rouillier [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040606021936.14c69b54@localhost \
    --to=guy-rouillier@speakeasy.net \
    --cc=linux-ppp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).