ref: 7e864dd748bce65f4b535480fb3ab4b242434954
parent: d0df3ae2c9da338ccdddb64c7e12b396895e960a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Mar 15 18:18:05 EDT 2016
ppp: md5 and mschap inside chap, do not request encryption with -c or -C (thanks k0ga) p2.patch: Do not request encriptation with -c or -C in ppp (it was a bit annoying request compression, and when the ACK from the server was received then send a NAK). p3.patch: Add support for md5 and mschap in in chap (without this patch ppp was passing to the net stage without worring about chap).
--- a/sys/src/cmd/ip/ppp/ppp.c
+++ b/sys/src/cmd/ip/ppp/ppp.c
@@ -243,12 +243,21 @@
}
break;
case Pauth:
- if(server)
+ if(server) {chapinit(ppp);
- else if(ppp->chap->proto == APpasswd)
- papinit(ppp);
- else
- setphase(ppp, Pnet);
+ } else {+ switch (ppp->chap->proto) {+ case APpasswd:
+ papinit(ppp);
+ break;
+ case APmd5:
+ case APmschap:
+ break;
+ default:
+ setphase(ppp, Pnet);
+ break;
+ }
+ }
break;
case Pnet:
pinit(ppp, ppp->ccp);
@@ -276,7 +285,14 @@
ppp->rctlmap = 0;
ppp->ipcp->state = Sclosed;
ppp->ipcp->optmask = 0xffffffff;
-
+ if(noipcompress) {+ p->optmask &= ~Fac;
+ ppp->ipcp->optmask &= ~Fipaddrs;
+ }
+ if(nocompress) {+ p->optmask &= ~Fpc;
+ ppp->ipcp->optmask &= ~Fipcompress;
+ }
p->echotimeout = 0;
/* quality goo */
--
⑨