]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/radius.c
Ensure that MPPE keys are available when using a plugin.
[ppp.git] / pppd / plugins / radius / radius.c
index 1fd2593dfd785a70e002c96168911bdc36179e71..48882a9e1c84be070d6a56e21e9c01b7704280e4 100644 (file)
@@ -24,7 +24,7 @@
 *
 ***********************************************************************/
 static char const RCSID[] =
-"$Id: radius.c,v 1.17 2002/10/01 09:27:50 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,
@@ -437,7 +437,7 @@ radius_chap_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));
 
     /*
      * make authentication with RADIUS server
@@ -709,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;    
 }
@@ -777,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;
 }
@@ -844,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,
@@ -944,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,
@@ -1040,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,