Skip to content

Commit 7bb8beb

Browse files
author
David F. Skoll
committed
ECP patches from Frank Cusack:
- If encryption is required, don't bring up IP/IPv6/IPX until the encryption negotiation has completed. - Shut down LCP if the peer sends an LCP ConfRej instead of CCP ConfRej to our MPPE offer. This fixes a bug where the server could not enforce use of encryption in some cases. - Don't send the M=<message> part of an MS-CHAPv2 success packet to peers that don't know how to deal with it. This allows pre-win2k systems to authenticate. - Don't shut down lcp if MPPE was present in peer's CCP offer along with other options. This allows pre-win2k systems to do MPPE (they offer Stac LZS with MPPE). - Add the beginnings of ecp.c. - Other minor changes.
1 parent 85fb3a1 commit 7bb8beb

23 files changed

+186
-98
lines changed

README.MPPE

+9-8
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ RADIUS support for MPPE is from Ralf Hofmann, <[email protected]>.
5858

5959
BUILDING THE PPPD
6060

61-
The userland component of PPPD has no additional requirements above those
62-
for MS-CHAP and MS-CHAPv2. The kernel, however, requires SHA-1 and ARCFOUR.
63-
Public domain implementations of these are provided. Until such time as
64-
MPPE support ships with kernels, you can use the Linux-2.2 implementation
65-
that comes with PPPD. Run the linux/mppe/mppeinstall.sh script, then
66-
rebuild your kernel. The ppp_mppe.o module is added, and the ppp.o module
67-
is modified (unfortunately). You'll need the new ppp.o since it does the
68-
right thing for the 4 extra bytes problem discussed above.
61+
The userland component of PPPD has no additional requirements above
62+
those for MS-CHAP and MS-CHAPv2. The kernel, however, requires SHA-1
63+
and ARCFOUR. Public domain implementations of these are provided. Until
64+
such time as MPPE support ships with kernels, you can use the Linux-2.2
65+
implementation that comes with PPPD. Run the linux/mppe/mppeinstall.sh
66+
script, then rebuild your kernel. The ppp_mppe.o module is added, and the
67+
ppp.o module (2.2) or ppp_generic.o (2.4) is modified (unfortunately).
68+
You'll need the new ppp.o/ppp_generic.o since it does the right thing
69+
for the 4 extra bytes problem discussed above.
6970

7071

7172
CONFIGURATION

README.MSCHAP81

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RFC 2759:
5555

5656
You'll see these in your pppd log as a line similar to:
5757

58-
Remote message: No dialin permission
58+
Remote message: E=649 No dialin permission
5959

6060
Previously, pppd would log this as:
6161

include/linux/ppp_defs.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: ppp_defs.h,v 1.9 2000/03/27 06:03:36 paulus Exp $ */
1+
/* $Id: ppp_defs.h,v 1.10 2002/05/21 17:26:48 dfs Exp $ */
22

33
/*
44
* ppp_defs.h - PPP definitions.
@@ -28,7 +28,7 @@
2828
*/
2929

3030
/*
31-
* ==FILEVERSION 20000114==
31+
* ==FILEVERSION 20020521==
3232
*
3333
* NOTE TO MAINTAINERS:
3434
* If you modify this file at all, please set the above date.
@@ -80,6 +80,8 @@
8080
#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
8181
#define PPP_CCPFRAG 0x80fb /* CCP at link level (below MP bundle) */
8282
#define PPP_CCP 0x80fd /* Compression Control Protocol */
83+
#define PPP_ECPFRAG 0x8055 /* ECP at link level (below MP bundle) */
84+
#define PPP_ECP 0x8053 /* Encryption Control Protocol */
8385
#define PPP_LCP 0xc021 /* Link Control Protocol */
8486
#define PPP_PAP 0xc023 /* Password Authentication Protocol */
8587
#define PPP_LQR 0xc025 /* Link Quality Report protocol */

include/net/ppp_defs.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: ppp_defs.h,v 1.14 1999/08/13 01:55:40 paulus Exp $ */
1+
/* $Id: ppp_defs.h,v 1.15 2002/05/21 17:26:48 dfs Exp $ */
22

33
/*
44
* ppp_defs.h - PPP definitions.
@@ -79,6 +79,7 @@
7979
#define PPP_IPXCP 0x802b /* IPX Control Protocol */
8080
#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
8181
#define PPP_CCP 0x80fd /* Compression Control Protocol */
82+
#define PPP_ECP 0x8053 /* Encryption Control Protocol */
8283
#define PPP_LCP 0xc021 /* Link Control Protocol */
8384
#define PPP_PAP 0xc023 /* Password Authentication Protocol */
8485
#define PPP_LQR 0xc025 /* Link Quality Report protocol */

linux/mppe/ppp_mppe_compress.c

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ==FILEVERSION 20020320==
2+
* ==FILEVERSION 20020521==
33
*
44
* ppp_mppe_compress.c - interface MPPE to the PPP code.
55
* This version is for use with Linux kernel 2.2.19+ and 2.4.x.
@@ -62,13 +62,8 @@ typedef struct ppp_mppe_state {
6262
#define MPPE_CCOUNT(p) ((((p)[4] & 0x0f) << 8) + (p)[5])
6363
#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */
6464

65-
/*
66-
* MPPE overhead/packet.
67-
* Note that we use this differently than other compressors.
68-
*/
6965
#define MPPE_OVHD 2 /* MPPE overhead/packet */
70-
/* Max bogon factor we will tolerate */
71-
#define SANITY_MAX 1600
66+
#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */
7267

7368
static void GetNewKeyFromSHA __P((unsigned char *StartKey,
7469
unsigned char *SessionKey,
@@ -236,17 +231,17 @@ mppe_init(void *arg, unsigned char *options, int optlen, int unit, int debug,
236231

237232
if (debug) {
238233
int i;
239-
char mkey[sizeof(state->master_key) * 3 + 1];
240-
char skey[sizeof(state->session_key) * 3 + 1];
234+
char mkey[sizeof(state->master_key) * 2 + 1];
235+
char skey[sizeof(state->session_key) * 2 + 1];
241236

242237
printk(KERN_DEBUG "%s[%d]: initialized with %d-bit %s mode\n", debugstr,
243238
unit, (state->keylen == 16)? 128: 40,
244239
(state->stateful)? "stateful": "stateless");
245240

246241
for (i = 0; i < sizeof(state->master_key); i++)
247-
sprintf(mkey + i * 2, "%.2x ", state->master_key[i]);
242+
sprintf(mkey + i * 2, "%.2x", state->master_key[i]);
248243
for (i = 0; i < sizeof(state->session_key); i++)
249-
sprintf(skey + i * 2, "%.2x ", state->session_key[i]);
244+
sprintf(skey + i * 2, "%.2x", state->session_key[i]);
250245
printk(KERN_DEBUG "%s[%d]: keys: master: %s initial session: %s\n",
251246
debugstr, unit, mkey, skey);
252247
}
@@ -544,6 +539,7 @@ mppe_incomp(void *arg, unsigned char *ibuf, int icnt)
544539
{
545540
ppp_mppe_state *state = (ppp_mppe_state *) arg;
546541

542+
/* XXX */
547543
if (state->debug &&
548544
(PPP_PROTOCOL(ibuf) >= 0x0021 && PPP_PROTOCOL(ibuf) <= 0x00fa))
549545
printk(KERN_DEBUG "mppe_incomp[%d]: incompressible (unencrypted) data! "

pppd/Makefile.NeXT

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# pppd makefile for NeXT
33
#
44
# $Orignial: Makefile.ultrix,v 1.4 1994/09/01 00:40:40 paulus Exp $
5-
# $Id: Makefile.NeXT,v 1.6 1999/04/12 06:24:44 paulus Exp $
5+
# $Id: Makefile.NeXT,v 1.7 2002/05/21 17:26:48 dfs Exp $
66
#
77

88
ARCHFLAGS =
@@ -11,7 +11,7 @@ BINDIR = /usr/local/ppp/bin
1111
MANDIR = /usr/local/ppp/man
1212

1313
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
14-
auth.o options.o demand.o utils.o sys-NeXT.o
14+
ecp.o auth.o options.o demand.o utils.o sys-NeXT.o
1515

1616
#
1717
# For HPPA and SPARC, define FIXSIGS to get around posix bugs in

pppd/Makefile.aix4

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# pppd makefile for AIX 4.1
3-
# $Id: Makefile.aix4,v 1.4 1999/04/12 06:24:44 paulus Exp $
3+
# $Id: Makefile.aix4,v 1.5 2002/05/21 17:26:48 dfs Exp $
44
#
55
#ifndef BINDIR
66
BINDIR = /usr/sbin
@@ -10,11 +10,11 @@ MANDIR = /usr/man
1010
#ENDIF
1111

1212
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
13-
auth.c options.c demand.c utils.c sys-aix4.c \
13+
ecp.c auth.c options.c demand.c utils.c sys-aix4.c \
1414
gencode.c grammar.c scanner.c nametoaddr.c optimize.c
1515

1616
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
17-
auth.o options.o demand.o utils.o sys-aix4.o \
17+
ecp.o auth.o options.o demand.o utils.o sys-aix4.o \
1818
gencode.o grammar.o scanner.o nametoaddr.o optimize.o
1919

2020
CC = xlc

pppd/Makefile.bsd

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: Makefile.bsd,v 1.15 1999/04/12 06:24:44 paulus Exp $
1+
# $Id: Makefile.bsd,v 1.16 2002/05/21 17:26:48 dfs Exp $
22

33
BINDIR?= /usr/sbin
44
# -D_BITYPES is for FreeBSD, which doesn't define anything to
@@ -8,7 +8,7 @@ CFLAGS+= -g -I../include -DHAVE_PATHS_H -D_BITYPES
88

99
PROG= pppd
1010
SRCS= main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
11-
demand.c auth.c options.c utils.c sys-bsd.c
11+
ecp.c demand.c auth.c options.c utils.c sys-bsd.c
1212
MAN= pppd.cat8
1313
MAN8= pppd.8
1414
BINMODE=4555

pppd/Makefile.linux

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#
22
# pppd makefile for Linux
3-
# $Id: Makefile.linux,v 1.47 2002/04/02 13:54:59 dfs Exp $
3+
# $Id: Makefile.linux,v 1.48 2002/05/21 17:26:48 dfs Exp $
44
#
55

66
# Default installation locations
77
BINDIR = /usr/sbin
88
MANDIR = /usr/man
99

10-
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
10+
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c ecp.c \
1111
ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c cbcp.c \
1212
demand.c utils.c tty.c sha1.c
1313
HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h chap_ms.h md4.h \
1414
ipxcp.h cbcp.h tdb.h sha1.h
1515
MANPAGES = pppd.8
16-
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
16+
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
1717
auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o sha1.o
1818

1919
all: pppd

pppd/Makefile.netbsd-1.2

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
PCAPDIR=${.CURDIR}/../../lib/libpcap
44

55
PROG= pppd
6-
SRCS= auth.c cbcp.c ccp.c chap.c chap_ms.c demand.c fsm.c ipcp.c \
6+
SRCS= auth.c cbcp.c ccp.c ecp.c chap.c chap_ms.c demand.c fsm.c ipcp.c \
77
ipxcp.c lcp.c magic.c main.c options.c sys-bsd.c upap.c
88

99
.PATH: ${PCAPDIR} ${.CURDIR}/../../sys/net

pppd/Makefile.osf

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#
22
# pppd makefile for OSF/1 on DEC Alpha
3-
# $Id: Makefile.osf,v 1.11 2002/03/05 15:14:04 dfs Exp $
3+
# $Id: Makefile.osf,v 1.12 2002/05/21 17:26:48 dfs Exp $
44
#
55

66
BINDIR = /usr/local/etc
77
MANDIR = /usr/local/man
88

9-
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
9+
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c ecp.c \
1010
auth.c options.c demand.c utils.c sys-osf.c md4.c chap_ms.c sha1.c
1111

12-
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
12+
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
1313
auth.o options.o demand.o utils.o sys-osf.o md4.o chap_ms.o sha1.o
1414

1515
CC = cc

pppd/Makefile.sol2

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Makefile for pppd under Solaris 2.
3-
# $Id: Makefile.sol2,v 1.20 2001/03/08 05:01:03 paulus Exp $
3+
# $Id: Makefile.sol2,v 1.21 2002/05/21 17:26:48 dfs Exp $
44
#
55

66
include ../solaris/Makedefs
@@ -10,7 +10,7 @@ CFLAGS = -I../include -DSVR4 -DSOL2 $(COPTS)
1010
LIBS = -lsocket -lnsl
1111

1212
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o tty.o \
13-
ccp.o auth.o options.o demand.o utils.o sys-solaris.o tdb.o
13+
ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o tdb.o
1414

1515
#
1616
# uncomment the following to enable plugins

pppd/Makefile.sunos4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Makefile for pppd under SunOS 4.
3-
# $Id: Makefile.sunos4,v 1.11 2001/03/08 05:01:03 paulus Exp $
3+
# $Id: Makefile.sunos4,v 1.12 2002/05/21 17:26:48 dfs Exp $
44
#
55

66
include ../sunos4/Makedefs
@@ -12,7 +12,7 @@ CFLAGS = $(COPTS) -I../include -DSUNOS4 -DGIDSET_TYPE=int \
1212

1313
all: pppd
1414

15-
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
15+
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
1616
auth.o options.o demand.o utils.o sys-sunos4.o tty.o
1717

1818
pppd: $(OBJS)

pppd/Makefile.svr4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Makefile for pppd under Solaris 2.
3-
# $Id: Makefile.svr4,v 1.14 1999/04/12 06:24:44 paulus Exp $
3+
# $Id: Makefile.svr4,v 1.15 2002/05/21 17:26:48 dfs Exp $
44
#
55

66
include ../svr4/Makedefs
@@ -10,7 +10,7 @@ LIBS = -lsocket -lnsl -lc -L/usr/ucblib -lucb
1010

1111
all: pppd
1212

13-
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
13+
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
1414
auth.o options.o demand.o utils.o sys-svr4.o
1515

1616
pppd: $(OBJS)

pppd/Makefile.ultrix

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#
22
# pppd makefile for Ultrix
3-
# $Id: Makefile.ultrix,v 1.11 1999/04/12 06:24:44 paulus Exp $
3+
# $Id: Makefile.ultrix,v 1.12 2002/05/21 17:26:49 dfs Exp $
44
#
55

66
BINDIR = /usr/local/etc
77
MANDIR = /usr/local/man
88

9-
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
9+
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c ecp.c \
1010
auth.c options.c demand.c utils.c sys-ultrix.c
1111

12-
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
12+
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
1313
auth.o options.o demand.o utils.o sys-ultrix.o
1414

1515
# CC = gcc

0 commit comments

Comments
 (0)