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).
This commit is contained in:
cinap_lenrek 2016-03-15 22:18:05 +01:00
parent 74d4d8a26e
commit bd0f48b357

View file

@ -243,12 +243,21 @@ setphase(PPP *ppp, int phase)
}
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 @@ pinit(PPP *ppp, Pstate *p)
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 */