diff options
author | brian <brian@FreeBSD.org> | 1999-02-20 01:12:45 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-02-20 01:12:45 +0000 |
commit | 2967147dea62a3f1669752d06918854f18b2a15a (patch) | |
tree | dcd272396fcc114be3794aceb829ef6e5c85f83b /usr.sbin/ppp/pap.c | |
parent | 320600de887cb3d925e018b981c886c27ce04949 (diff) | |
download | FreeBSD-src-2967147dea62a3f1669752d06918854f18b2a15a.zip FreeBSD-src-2967147dea62a3f1669752d06918854f18b2a15a.tar.gz |
Handle empty PAP & CHAP packets (containing only an FSM header).
Some CHAP implementations send no welcome message with their
SUCCESS/FAILURE packets. This was being mis-identified as
a truncated packet by the new authentication code :-(
Diffstat (limited to 'usr.sbin/ppp/pap.c')
-rw-r--r-- | usr.sbin/ppp/pap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c index 10be577..681f90d 100644 --- a/usr.sbin/ppp/pap.c +++ b/usr.sbin/ppp/pap.c @@ -18,7 +18,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: pap.c,v 1.30 1999/02/02 09:35:17 brian Exp $ + * $Id: pap.c,v 1.31 1999/02/06 02:54:47 brian Exp $ * * TODO: */ @@ -155,8 +155,11 @@ pap_Input(struct physical *p, struct mbuf *bp) struct authinfo *authp = &p->dl->pap; u_char nlen, klen, *key; - if ((bp = auth_ReadHeader(authp, bp)) == NULL) + if ((bp = auth_ReadHeader(authp, bp)) == NULL && + ntohs(authp->in.hdr.length) == 0) { + log_Printf(LogWARN, "Pap Input: Truncated header !\n"); return; + } if (authp->in.hdr.code == 0 || authp->in.hdr.code > MAXPAPCODE) { log_Printf(LogPHASE, "Pap Input: %d: Bad PAP code !\n", authp->in.hdr.code); |