Deleted Added
full compact
chap.c (44159) chap.c (45220)
1/*
2 * PPP CHAP Module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
1/*
2 * PPP CHAP Module
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan, Inc. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * $Id: chap.c,v 1.46 1999/02/18 19:45:06 brian Exp $
20 * $Id: chap.c,v 1.47 1999/02/20 01:12:45 brian Exp $
21 *
22 * TODO:
23 */
24#include <sys/param.h>
25#include <netinet/in.h>
26#include <netinet/in_systm.h>
27#include <netinet/ip.h>
28#include <sys/un.h>

--- 509 unchanged lines hidden (view full) ---

538 struct chap *chap = &p->dl->chap;
539 char *name, *key, *ans;
540 int len, nlen;
541 u_char alen;
542#ifdef HAVE_DES
543 int lanman;
544#endif
545
21 *
22 * TODO:
23 */
24#include <sys/param.h>
25#include <netinet/in.h>
26#include <netinet/in_systm.h>
27#include <netinet/ip.h>
28#include <sys/un.h>

--- 509 unchanged lines hidden (view full) ---

538 struct chap *chap = &p->dl->chap;
539 char *name, *key, *ans;
540 int len, nlen;
541 u_char alen;
542#ifdef HAVE_DES
543 int lanman;
544#endif
545
546 if (bundle_Phase(p->dl->bundle) != PHASE_NETWORK &&
547 bundle_Phase(p->dl->bundle) != PHASE_AUTHENTICATE) {
548 log_Printf(LogPHASE, "Unexpected chap input - dropped !\n");
549 mbuf_Free(bp);
550 return;
551 }
552
546 if ((bp = auth_ReadHeader(&chap->auth, bp)) == NULL &&
547 ntohs(chap->auth.in.hdr.length) == 0)
548 log_Printf(LogWARN, "Chap Input: Truncated header !\n");
549 else if (chap->auth.in.hdr.code == 0 || chap->auth.in.hdr.code > MAXCHAPCODE)
550 log_Printf(LogPHASE, "Chap Input: %d: Bad CHAP code !\n",
551 chap->auth.in.hdr.code);
552 else {
553 len = mbuf_Length(bp);

--- 200 unchanged lines hidden ---
553 if ((bp = auth_ReadHeader(&chap->auth, bp)) == NULL &&
554 ntohs(chap->auth.in.hdr.length) == 0)
555 log_Printf(LogWARN, "Chap Input: Truncated header !\n");
556 else if (chap->auth.in.hdr.code == 0 || chap->auth.in.hdr.code > MAXCHAPCODE)
557 log_Printf(LogPHASE, "Chap Input: %d: Bad CHAP code !\n",
558 chap->auth.in.hdr.code);
559 else {
560 len = mbuf_Length(bp);

--- 200 unchanged lines hidden ---