This is a forward ported version of ppp-2.4.3-mppe-mppc-1.1.patch.gz found on
http://mppe-mppc.alphacron.de/ .
-Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
+Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
*/
--- a/pppd/ccp.c
+++ b/pppd/ccp.c
-@@ -62,12 +62,10 @@ static int setdeflate __P((char **));
+@@ -61,12 +61,10 @@ static int setdeflate __P((char **));
static char bsd_value[8];
static char deflate_value[8];
static option_t ccp_option_list[] = {
{ "noccp", o_bool, &ccp_protent.enabled_flag,
-@@ -108,54 +106,36 @@ static option_t ccp_option_list[] = {
+@@ -107,54 +105,36 @@ static option_t ccp_option_list[] = {
"don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
&ccp_allowoptions[0].predictor_1 },
#endif /* MPPE */
{ NULL }
-@@ -241,7 +221,7 @@ static fsm_callbacks ccp_callbacks = {
+@@ -240,7 +220,7 @@ static fsm_callbacks ccp_callbacks = {
*/
#define ANY_COMPRESS(opt) ((opt).deflate || (opt).bsd_compress \
|| (opt).predictor_1 || (opt).predictor_2 \
/*
* Local state (mainly for handling reset-reqs and reset-acks).
-@@ -344,6 +324,100 @@ setdeflate(argv)
+@@ -343,6 +323,100 @@ setdeflate(argv)
return 1;
}
/*
* ccp_init - initialize CCP.
*/
-@@ -378,6 +452,30 @@ ccp_init(unit)
+@@ -377,6 +451,30 @@ ccp_init(unit)
ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
ccp_allowoptions[0].predictor_1 = 1;
}
/*
-@@ -455,11 +553,11 @@ ccp_input(unit, p, len)
+@@ -454,11 +552,11 @@ ccp_input(unit, p, len)
if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
notice("Compression disabled by peer.");
#ifdef MPPE
}
/*
-@@ -487,6 +585,15 @@ ccp_extcode(f, code, id, p, len)
+@@ -486,6 +584,15 @@ ccp_extcode(f, code, id, p, len)
break;
/* send a reset-ack, which the transmitter will see and
reset its compression state. */
fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
break;
-@@ -515,12 +622,11 @@ ccp_protrej(unit)
+@@ -514,12 +621,11 @@ ccp_protrej(unit)
fsm_lowerdown(&ccp_fsm[unit]);
#ifdef MPPE
}
/*
-@@ -537,7 +643,7 @@ ccp_resetci(f)
+@@ -536,7 +642,7 @@ ccp_resetci(f)
all_rejected[f->unit] = 0;
#ifdef MPPE
ccp_options *ao = &ccp_allowoptions[f->unit];
int auth_mschap_bits = auth_done[f->unit];
int numbits;
-@@ -551,80 +657,109 @@ ccp_resetci(f)
+@@ -550,80 +656,109 @@ ccp_resetci(f)
* NB: If MPPE is required, all other compression opts are invalid.
* So, we return right away if we can't do it.
*/
opt_buf[0] = CI_BSD_COMPRESS;
opt_buf[1] = CILEN_BSD_COMPRESS;
@@ -679,7 +814,8 @@ ccp_cilen(f)
- + (go->deflate? CILEN_DEFLATE: 0)
+ + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
+ (go->predictor_1? CILEN_PREDICTOR_1: 0)
+ (go->predictor_2? CILEN_PREDICTOR_2: 0)
- + (go->mppe? CILEN_MPPE: 0);
bool deflate_draft; /* use draft RFC code for deflate? */
+ bool lzs; /* do Stac LZS? */
+ bool mppc; /* do MPPC? */
- bool mppe; /* do MPPE? */
+ u_char mppe; /* MPPE bitfield */
+ bool mppe_40; /* allow 40 bit encryption? */
+ bool mppe_56; /* allow 56 bit encryption? */
+ bool mppe_128; /* allow 128 bit encryption? */
--- a/pppd/chap_ms.c
+++ b/pppd/chap_ms.c
-@@ -898,13 +898,17 @@ set_mppe_enc_types(int policy, int types
+@@ -962,13 +962,17 @@ set_mppe_enc_types(int policy, int types
/*
* Disable undesirable encryption types. Note that we don't ENABLE
* any encryption types, to avoid overriding manual configuration.