diff options
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r-- | usr.sbin/ppp/command.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 6024e1e..62a80e2 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -127,6 +127,7 @@ #define VAR_URGENTPORTS 33 #define VAR_LOGOUT 34 #define VAR_IFQUEUE 35 +#define VAR_KEYBITS 36 /* ``accept|deny|disable|enable'' masks */ #define NEG_HISMASK (1) @@ -147,6 +148,8 @@ #define NEG_PROTOCOMP 51 #define NEG_SHORTSEQ 52 #define NEG_VJCOMP 53 +#define NEG_MPPE 54 +#define NEG_CHAP81 55 const char Version[] = "2.27"; @@ -1574,6 +1577,24 @@ SetVariable(struct cmdargs const *arg) } break; +#ifdef HAVE_DES + case VAR_KEYBITS: + if (arg->argc > arg->argn) { + l->ccp.cfg.mppe.keybits = atoi(arg->argv[arg->argn]); + if (l->ccp.cfg.mppe.keybits != 40 && + l->ccp.cfg.mppe.keybits != 56 && + l->ccp.cfg.mppe.keybits != 128 ) { + log_Printf(LogWARN, "%d: Invalid bits number\n", + l->ccp.cfg.mppe.keybits); + l->ccp.cfg.mppe.keybits = 40; + } + } else { + err = "No bits number pecified\n"; + log_Printf(LogWARN, err); + } + break; +#endif + case VAR_DEVICE: physical_SetDeviceList(cx->physical, arg->argc - arg->argn, arg->argv + arg->argn); @@ -1968,6 +1989,11 @@ static struct cmdtab const SetCommands[] = { {"deflate", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX_OPT, "deflate window sizes", "set deflate out-winsize in-winsize", (const void *) VAR_WINSIZE}, +#ifdef HAVE_DES + {"mppe", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX_OPT, + "MPPE key size", "set mppe {40|56|128}", + (const void *) VAR_KEYBITS}, +#endif {"device", "line", SetVariable, LOCAL_AUTH | LOCAL_CX, "physical device name", "set device|line device-name[,device-name]", (const void *) VAR_DEVICE}, @@ -2414,6 +2440,14 @@ NegotiateSet(struct cmdargs const *arg) cx->physical->link.lcp.cfg.chap80lm &= keep; cx->physical->link.lcp.cfg.chap80lm |= add; break; + case NEG_CHAP81: + cx->physical->link.lcp.cfg.chap81 &= keep; + cx->physical->link.lcp.cfg.chap81 |= add; + break; + case NEG_MPPE: + l->ccp.cfg.neg[CCP_NEG_MPPE] &= keep; + l->ccp.cfg.neg[CCP_NEG_MPPE] |= add; + break; #endif case NEG_DEFLATE: l->ccp.cfg.neg[CCP_NEG_DEFLATE] &= keep; @@ -2517,6 +2551,12 @@ static struct cmdtab const NegotiateCommands[] = { {"LANMan", "chap80lm", NegotiateSet, LOCAL_AUTH | LOCAL_CX, "Microsoft (NT) CHAP", "accept|deny|disable|enable", (const void *)NEG_CHAP80LM}, + {"mschapv2", "chap81", NegotiateSet, LOCAL_AUTH | LOCAL_CX, + "Microsoft CHAP v2", "accept|deny|disable|enable", + (const void *)NEG_CHAP81}, + {"mppe", NULL, NegotiateSet, LOCAL_AUTH | LOCAL_CX_OPT, + "MPPE encryption", "accept|deny|disable|enable", + (const void *)NEG_MPPE}, #endif {"deflate", NULL, NegotiateSet, LOCAL_AUTH | LOCAL_CX_OPT, "Deflate compression", "accept|deny|disable|enable", |