use correct packet for channel binding. Closes #1990
authorAlan T. DeKok <aland@freeradius.org>
Tue, 16 May 2017 12:07:12 +0000 (08:07 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 16 May 2017 12:07:36 +0000 (08:07 -0400)
src/modules/rlm_eap/libeap/eap_chbind.c
src/modules/rlm_eap/libeap/eap_chbind.h
src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c

index 3f0fd73..5378d8b 100644 (file)
@@ -280,15 +280,15 @@ chbind_packet_t *eap_chbind_vp2packet(TALLOC_CTX *ctx, VALUE_PAIR *vps)
        return packet;
 }
 
-VALUE_PAIR *eap_chbind_packet2vp(REQUEST *request, chbind_packet_t *packet)
+VALUE_PAIR *eap_chbind_packet2vp(RADIUS_PACKET *packet, chbind_packet_t *chbind)
 {
        VALUE_PAIR      *vp;
 
-       if (!packet) return NULL; /* don't produce garbage */
+       if (!chbind) return NULL; /* don't produce garbage */
 
-       vp = fr_pair_afrom_num(request->packet, PW_UKERNA_CHBIND, VENDORPEC_UKERNA);
+       vp = fr_pair_afrom_num(packet, PW_UKERNA_CHBIND, VENDORPEC_UKERNA);
        if (!vp) return NULL;
-       fr_pair_value_memcpy(vp, (uint8_t *) packet, talloc_array_length((uint8_t *)packet));
+       fr_pair_value_memcpy(vp, (uint8_t *) chbind, talloc_array_length((uint8_t *)chbind));
 
        return vp;
 }
index 914e364..346b712 100644 (file)
@@ -58,7 +58,7 @@ typedef struct CHBIND_REQ {
 /* Channel binding function prototypes */
 PW_CODE chbind_process(REQUEST *request, CHBIND_REQ *chbind_req);
 
-VALUE_PAIR *eap_chbind_packet2vp(REQUEST *request, chbind_packet_t *packet);
+VALUE_PAIR *eap_chbind_packet2vp(RADIUS_PACKET *packet, chbind_packet_t *chbind);
 chbind_packet_t *eap_chbind_vp2packet(TALLOC_CTX *ctx, VALUE_PAIR *vps);
 
 #endif /*_EAP_CHBIND_H*/
index 912060f..524e874 100644 (file)
@@ -1183,7 +1183,7 @@ int eapttls_process(eap_handler_t *handler, tls_session_t *tls_session)
                if (req->response) {
                        RDEBUG("sending chbind response");
                        fr_pair_add(&fake->reply->vps,
-                               eap_chbind_packet2vp(fake, req->response));
+                                   eap_chbind_packet2vp(fake->reply, req->response));
                } else {
                        RDEBUG("no chbind response");
                }