[pptp-server] MPPE stateless mode fixes

pcj at p.r.i.m.e.n.e.t.c.o.m pcj at p.r.i.m.e.n.e.t.c.o.m
Thu Oct 28 01:21:31 CDT 1999


The following two patches fix pppd to correctly negotiate stateless
mode in MPPE, and make the Linux mppe compressor set the
MPPE_BIT_FLUSHED bit correctly.

Previously the FLUSHED bit was only set when the keys had been
synchronized.  The draft mppe spec requires the bit to be set for
every packet where the key has been changed, i.e. every packet in
stateless mode, and every 0xff packets in stateful mode.

These are relative to ppp-2.3.10 but it should be obvious
where they go in 2.3.8.

--- linux/ppp_mppe.c~  Fri Oct 22 23:21:46 1999
+++ linux/ppp_mppe.c   Wed Oct 27 21:43:46 1999
@@ -163,7 +163,7 @@
     RC4_set_key(&(state->RC4_send_key), state->keylen, state->session_send_key);
     RC4_set_key(&(state->RC4_recv_key), state->keylen, state->session_recv_key);
 
-    state->bits=MPPE_BIT_ENCRYPTED;
+    state->bits |= MPPE_BIT_FLUSHED; 
 }
 
--- pppd/ccp.c~      Fri Oct 22 23:21:46 1999
+++ pppd/ccp.c       Mon Oct 25 23:51:48 1999
@@ -1051,7 +1051,10 @@
                    unsigned char opt_buf[64];
                    opt_buf[0] = CI_MPPE;
                    opt_buf[1] = CILEN_MPPE;
-                   opt_buf[2] = ((p[2] & MPPE_STATELESS) ? 1 : 0);
+                   if(p[2] & MPPE_STATELESS) { 
+                       ho->mppe_stateless=1;
+                       opt_buf[2] = MPPE_STATELESS;
+                   }
                    /* push in our send/receive keys */
                    if(p[5] & MPPE_40BIT) {
                        ho->mppe_40 = 1;

-- 
Paul Janzen 





More information about the pptp-server mailing list