summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/pap.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-02-20 01:12:45 +0000
committerbrian <brian@FreeBSD.org>1999-02-20 01:12:45 +0000
commit2967147dea62a3f1669752d06918854f18b2a15a (patch)
treedcd272396fcc114be3794aceb829ef6e5c85f83b /usr.sbin/ppp/pap.c
parent320600de887cb3d925e018b981c886c27ce04949 (diff)
downloadFreeBSD-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.c7
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);
OpenPOWER on IntegriCloud