X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fradius%2Fradius.c;h=48882a9e1c84be070d6a56e21e9c01b7704280e4;hb=e50870a901749c7390109404e90c095ea3ef7072;hp=53757abcbb1701f0b9952fbe64853b08c4e4b7fe;hpb=dcc1a96716db2df51eb4f593c9e862433298de5c;p=ppp.git diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c index 53757ab..48882a9 100644 --- a/pppd/plugins/radius/radius.c +++ b/pppd/plugins/radius/radius.c @@ -24,7 +24,7 @@ * ***********************************************************************/ static char const RCSID[] = -"$Id: radius.c,v 1.16 2002/10/01 08:36:49 fcusack Exp $"; +"$Id: radius.c,v 1.19 2002/12/23 23:24:37 fcusack Exp $"; #include "pppd.h" #include "chap.h" @@ -276,7 +276,7 @@ radius_pap_auth(char *user, /* Add user specified vp's */ if (rstate.avp) - rc_avpair_insert(&send, NULL, rstate.avp); + rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp)); if (rstate.authserver) { result = rc_auth_using_server(rstate.authserver, @@ -428,12 +428,16 @@ radius_chap_auth(char *user, break; } #endif + } + if (*remote_number) { + rc_avpair_add(&send, PW_CALLING_STATION_ID, remote_number, 0, + VENDOR_NONE); } /* Add user specified vp's */ if (rstate.avp) - rc_avpair_insert(&send, NULL, rstate.avp); + rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp)); /* * make authentication with RADIUS server @@ -705,6 +709,7 @@ radius_setmppekeys(VALUE_PAIR *vp, REQUEST_INFO *req_info, chap_state *cstate) * to generate the start key, sigh. NB: We do not support the LM-Key. */ mppe_set_keys(cstate->challenge, &plain[8]); + mppe_keys_set = 1; return 0; } @@ -773,6 +778,7 @@ radius_setmppekeys2(VALUE_PAIR *vp, REQUEST_INFO *req_info) memcpy(mppe_send_key, plain + 1, 16); else memcpy(mppe_recv_key, plain + 1, 16); + mppe_keys_set = 1; return 0; } @@ -840,7 +846,7 @@ radius_acct_start(void) /* Add user specified vp's */ if (rstate.avp) - rc_avpair_insert(&send, NULL, rstate.avp); + rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp)); if (rstate.acctserver) { result = rc_acct_using_server(rstate.acctserver, @@ -940,7 +946,7 @@ radius_acct_stop(void) /* Add user specified vp's */ if (rstate.avp) - rc_avpair_insert(&send, NULL, rstate.avp); + rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp)); if (rstate.acctserver) { result = rc_acct_using_server(rstate.acctserver, @@ -1036,7 +1042,7 @@ radius_acct_interim(void *ignored) /* Add user specified vp's */ if (rstate.avp) - rc_avpair_insert(&send, NULL, rstate.avp); + rc_avpair_insert(&send, NULL, rc_avpair_copy(rstate.avp)); if (rstate.acctserver) { result = rc_acct_using_server(rstate.acctserver,