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/chap.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/chap.c')
-rw-r--r-- | usr.sbin/ppp/chap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c index 24127a9..fe76ebc 100644 --- a/usr.sbin/ppp/chap.c +++ b/usr.sbin/ppp/chap.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: chap.c,v 1.45 1999/02/18 19:11:46 brian Exp $ + * $Id: chap.c,v 1.46 1999/02/18 19:45:06 brian Exp $ * * TODO: */ @@ -543,8 +543,9 @@ chap_Input(struct physical *p, struct mbuf *bp) int lanman; #endif - if ((bp = auth_ReadHeader(&chap->auth, bp)) == NULL) - log_Printf(LogERROR, "Chap Input: Truncated header !\n"); + if ((bp = auth_ReadHeader(&chap->auth, bp)) == NULL && + ntohs(chap->auth.in.hdr.length) == 0) + log_Printf(LogWARN, "Chap Input: Truncated header !\n"); else if (chap->auth.in.hdr.code == 0 || chap->auth.in.hdr.code > MAXCHAPCODE) log_Printf(LogPHASE, "Chap Input: %d: Bad CHAP code !\n", chap->auth.in.hdr.code); |