9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <miller@hamnavoe.demon.co.uk>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] connecting to ISP with PAP?
Date: Thu,  9 Nov 2000 15:01:12 +0000	[thread overview]
Message-ID: <E13ttKv-00094Y-0K@tele-post-20.mail.demon.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

> I know CHAP is supported, but is it possible to
> connect to my ISP with PAP?

Attached is an update to /sys/src/cmd/ip/ppp (14 Oct version) to support
PAP authentication.  Note that although PAP is less secure than CHAP
(password is transmitted in cleartext), the specification says that
servers which provide both must offer CHAP first.

The command I use to connect to Demon UK is:

% ip/ppp -fP -m 1500 -p telco!0845-212-0666 -s $host:$pass

-- Richard


[-- Attachment #2: ppp.bod --]
[-- Type: text/plain, Size: 4129 bytes --]

#!/bin/rc
#
# command: boddle /sys/src/cmd/ip/ppp .
# srcdir: /sys/src/cmd/ip/ppp
# version: 973778772
# date: Thu Nov 9 14:06:12 GMT 2000
#
myname=$0
doextract=no

fn usage{
  echo $myname: usage: $myname '[-X] [src-directory]' >[1=2]
  exit usage
}

fn sigint{
  rm -rf 973778772
  exit interrupt
}

while(~ $1 -*){
  switch($1){
  case -X
          doextract=yes
  case -*
          usage
  }
  shift
}

switch($#*){
case 0
  srcdir=/sys/src/cmd/ip/ppp
case 1
  srcdir=$1
case *
  usage
}

if(! ~ $doextract yes){
  echo This shell file contains a bundle of diffs representing changes
  echo to original source files in the Plan 9 distribution. It will run
  echo against the files in
  echo ' ' $srcdir
  echo '(unless overridden by the optional source directory argument)'
  echo and create a directory 973778772 containing the updated files.
  echo It will NOT automatically update the original files.
  echo
  echo Invoke with argument -X to perform the actual extraction.
  exit 0
}

rm -rf 973778772
mkdir 973778772

target=973778772/ppp.c
echo -n '973778772/ppp.c: '
if(! test -f $srcdir/ppp.c || ! test -r $srcdir/ppp.c){
  echo $srcdir/ppp.c unreadable
  exit unreadable
}
sum=`{sum < $srcdir/ppp.c}
if(! ~ 904fd29c49640  $sum(1)^$sum(2)){
  echo $srcdir/ppp.c is not the original distribution file
  exit original
}
cp $srcdir/ppp.c 973778772/ppp.c
sed s/.// <<'//GO.SYSIN DD VADIM ppp.c' | ed 973778772/ppp.c >/dev/null >[2=1] 
-1919a
-static void
-papinit(PPP *ppp)
-{
-	Block *b;
-	Lcpmsg *m;
-	Chap *c;
-	int len, nlen, slen;
-
-	c = ppp->chap;
-	c->id++;
-	netlog("PPP: pap: send authreq %d %s %s\n", c->id, ppp->chapname, ppp->secret);
-
-	nlen = strlen(ppp->chapname);
-	slen = strlen(ppp->secret);
-	len = 4 + 1 + nlen + 1 + slen;
-	b = alloclcp(Pauthreq, c->id, len, &m);
-
-	*b->wptr++ = nlen;
-	memmove(b->wptr, ppp->chapname, nlen);
-	b->wptr += nlen;
-	*b->wptr++ = slen;
-	memmove(b->wptr, ppp->secret, slen);
-	b->wptr += slen;
-	hnputs(m->len, len);
-	putframe(ppp, Ppasswd, b);
-	freeb(b);
-}
-
-static void
-getpap(PPP *ppp, Block *b)
-{
-	Lcpmsg *m;
-	int len;
-
-	m = (Lcpmsg*)b->rptr;
-	len = 4;
-	if(BLEN(b) < 4 || BLEN(b) < (len = nhgets(m->len))){
-		syslog(0, LOG, "short pap message (%ld < %d)", BLEN(b), len);
-		freeb(b);
-		return;
-	}
-	if(len < sizeof(Lcpmsg))
-		m->data[0] = 0;
-
-	qlock(ppp);
-	switch(m->code){
-	case Pauthack:
-		netlog("PPP: pap succeeded\n");
-		setphase(ppp, Pnet);
-		break;
-	case Pauthnak:
-		netlog("PPP: pap failed (%d:%.*s)\n", m->data[0], m->data[0], (char*)m->data+1);
-		dying = 1;
-	}
-	qunlock(ppp);
-	freeb(b);
-}
-.
-1415a
-		case Ppasswd:
-			getpap(ppp, b);
-			break;
-.
-942a
-			if(pap)
-				ppp->chap->proto = APpasswd;
-.
-799a
-				if(proto == Ppasswd && !server){
-					pap = 1;
-					continue;
-				}
-.
-754a
-	pap = 0;
-.
-738c
-	ulong rejecting, nacking, flags, proto, pap;
-.
-240a
-		else if(ppp->chap->proto == APpasswd)
-			papinit(ppp);
-.
-91a
-static	void		papinit(PPP*);
-static	void		getpap(PPP*, Block*);
-.
-wq
//GO.SYSIN DD VADIM ppp.c
sum=`{sum < 973778772/ppp.c}
if(~ 76e4eaf151025  $sum(1)^$sum(2))
  echo
if not{
  echo 973778772/ppp.c checksum error creating updated file
  exit checksum
}
target=973778772/ppp.h
echo -n '973778772/ppp.h: '
if(! test -f $srcdir/ppp.h || ! test -r $srcdir/ppp.h){
  echo $srcdir/ppp.h unreadable
  exit unreadable
}
sum=`{sum < $srcdir/ppp.h}
if(! ~ 386b09777989  $sum(1)^$sum(2)){
  echo $srcdir/ppp.h is not the original distribution file
  exit original
}
cp $srcdir/ppp.h 973778772/ppp.h
sed s/.// <<'//GO.SYSIN DD VADIM ppp.h' | ed 973778772/ppp.h >/dev/null >[2=1] 
-134a
-
-	/* Pap codes */
-	Pauthreq=	1,
-	Pauthack=	2,
-	Pauthnak=	3,
-.
-113a
-	APpasswd=	Ppasswd,		/* use Pap, not Chap */
-.
-wq
//GO.SYSIN DD VADIM ppp.h
sum=`{sum < 973778772/ppp.h}
if(~ b5120e548094  $sum(1)^$sum(2))
  echo
if not{
  echo 973778772/ppp.h checksum error creating updated file
  exit checksum
}

             reply	other threads:[~2000-11-09 15:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-09 15:01 Richard Miller [this message]
2000-11-11  9:23 ` William Staniewicz
  -- strict thread matches above, loose matches on Subject: below --
2000-11-20 21:11 David Gordon Hogan
2000-11-21  9:37 ` Greg Shubin
2000-11-14 21:27 Richard Miller
2000-11-14 20:24 presotto
2000-11-14 20:18 rob pike
2000-11-14 20:43 ` Boyd Roberts
2000-11-14 19:55 rob pike
2000-11-14 20:02 ` Boyd Roberts
2000-11-14 19:51 David Gordon Hogan
2000-11-14 20:01 ` Boyd Roberts
2000-11-20 10:54 ` Greg Shubin
2000-11-14 19:41 presotto
     [not found] <dhog@plan9.bell-labs.com>
2000-11-14 19:19 ` David Gordon Hogan
2000-11-14 19:45   ` Boyd Roberts
2000-11-14 20:08   ` Scott Schwartz
2000-11-14 18:50 William Staniewicz
2000-11-13 19:37 William Staniewicz
2000-11-13 15:49 presotto
2000-11-13 17:22 ` William Staniewicz
2000-11-13 15:35 William Staniewicz
2000-11-13 12:21 Richard Miller
2000-11-11 14:08 nigel
2000-11-09 15:30 Richard Miller
2000-11-08 22:53 William Staniewicz

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=E13ttKv-00094Y-0K@tele-post-20.mail.demon.net \
    --to=miller@hamnavoe.demon.co.uk \
    --cc=9fans@cse.psu.edu \
    /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).