summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-04-01 11:05:23 +0000
committerbrian <brian@FreeBSD.org>1999-04-01 11:05:23 +0000
commitfa9cc0ebfb3821fac3240755fae227fa654a37f7 (patch)
treebb7b4a0f0de511cf604efa8c384b2e16552fa1e0 /usr.sbin
parentc3edb55f8c28c9237cefdb5069a21ff3bea87e11 (diff)
downloadFreeBSD-src-fa9cc0ebfb3821fac3240755fae227fa654a37f7.zip
FreeBSD-src-fa9cc0ebfb3821fac3240755fae227fa654a37f7.tar.gz
Drop PAP & CHAP packets if we're not in NETWORK or AUTHENTICATE
phase.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/chap.c9
-rw-r--r--usr.sbin/ppp/pap.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c
index fe76ebc..dde8081 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.46 1999/02/18 19:45:06 brian Exp $
+ * $Id: chap.c,v 1.47 1999/02/20 01:12:45 brian Exp $
*
* TODO:
*/
@@ -543,6 +543,13 @@ chap_Input(struct physical *p, struct mbuf *bp)
int lanman;
#endif
+ if (bundle_Phase(p->dl->bundle) != PHASE_NETWORK &&
+ bundle_Phase(p->dl->bundle) != PHASE_AUTHENTICATE) {
+ log_Printf(LogPHASE, "Unexpected chap input - dropped !\n");
+ mbuf_Free(bp);
+ return;
+ }
+
if ((bp = auth_ReadHeader(&chap->auth, bp)) == NULL &&
ntohs(chap->auth.in.hdr.length) == 0)
log_Printf(LogWARN, "Chap Input: Truncated header !\n");
diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c
index 1459e51..5b3e17a 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.32 1999/02/20 01:12:45 brian Exp $
+ * $Id: pap.c,v 1.33 1999/03/31 14:21:45 brian Exp $
*
* TODO:
*/
@@ -156,6 +156,13 @@ pap_Input(struct physical *p, struct mbuf *bp)
struct authinfo *authp = &p->dl->pap;
u_char nlen, klen, *key;
+ if (bundle_Phase(p->dl->bundle) != PHASE_NETWORK &&
+ bundle_Phase(p->dl->bundle) != PHASE_AUTHENTICATE) {
+ log_Printf(LogPHASE, "Unexpected pap input - dropped !\n");
+ mbuf_Free(bp);
+ return;
+ }
+
if ((bp = auth_ReadHeader(authp, bp)) == NULL &&
ntohs(authp->in.hdr.length) == 0) {
log_Printf(LogWARN, "Pap Input: Truncated header !\n");
OpenPOWER on IntegriCloud