X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fradius%2Fradius.c;h=6ddd853db6784ae1ace9c6057830a70336b94208;hb=ab4d4992050ec171e1c72d661a3457efc8e7c141;hp=5f75aaedc54b6afb63b31fa4b07566e551bb5c38;hpb=fcb076c2b24bd8dd73f4be7a9e1712d3a352a376;p=ppp.git diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c index 5f75aae..6ddd853 100644 --- a/pppd/plugins/radius/radius.c +++ b/pppd/plugins/radius/radius.c @@ -26,11 +26,16 @@ static char const RCSID[] = "$Id: radius.c,v 1.32 2008/05/26 09:18:08 paulus Exp $"; +#ifdef HAVE_CONFIG_H +#include +#endif + #include "pppd.h" #include "chap-new.h" #ifdef CHAPMS #include "chap_ms.h" #ifdef MPPE +#include "mppe.h" #include "md5.h" #endif #endif @@ -651,6 +656,9 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info, memcpy(rstate.class, vp->strvalue, rstate.class_len); } /* else too big for our buffer - ignore it */ break; + case PW_FRAMED_MTU: + netif_set_mtu(rstate.client_port,MIN(netif_get_mtu(rstate.client_port),vp->lvalue)); + break; } @@ -740,11 +748,12 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info, * Note that if the policy value was '0' we don't set the key! */ if (mppe_enc_policy && mppe_enc_keys) { - mppe_keys_set = 1; /* Set/modify allowed encryption types. */ if (mppe_enc_types) - set_mppe_enc_types(mppe_enc_policy, mppe_enc_types); + mppe_set_enc_types(mppe_enc_policy, mppe_enc_types); + return 0; } + mppe_clear_keys(); #endif return 0; @@ -800,7 +809,7 @@ radius_setmppekeys(VALUE_PAIR *vp, REQUEST_INFO *req_info, * the NAS (us) doesn't need; we only need the start key. So we have * to generate the start key, sigh. NB: We do not support the LM-Key. */ - mppe_set_keys(challenge, &plain[8]); + mppe_set_chapv1(challenge, &plain[8]); return 0; } @@ -852,7 +861,7 @@ radius_setmppekeys2(VALUE_PAIR *vp, REQUEST_INFO *req_info) for (i = 0; i < 16; i++) plain[i] ^= buf[i]; - if (plain[0] != sizeof(mppe_send_key) /* 16 */) { + if (plain[0] != 16) { error("RADIUS: Incorrect key length (%d) for MS-MPPE-%s-Key attribute", (int) plain[0], type); return -1; @@ -866,9 +875,9 @@ radius_setmppekeys2(VALUE_PAIR *vp, REQUEST_INFO *req_info) plain[16] ^= buf[0]; /* only need the first byte */ if (vp->attribute == PW_MS_MPPE_SEND_KEY) - memcpy(mppe_send_key, plain + 1, 16); + mppe_set_keys(plain + 1, NULL, 16); else - memcpy(mppe_recv_key, plain + 1, 16); + mppe_set_keys(NULL, plain + 1, 16); return 0; }