Remove duplicate chbind functions now located in eap_chbind.*
authorKevin Wasserman <kevin.wasserman@painless-security.com>
Thu, 26 Jun 2014 17:07:59 +0000 (13:07 -0400)
committerKevin Wasserman <kevin.wasserman@painless-security.com>
Thu, 26 Jun 2014 17:07:59 +0000 (13:07 -0400)
src/modules/rlm_eap/libeap/eap_types.h
src/modules/rlm_eap/libeap/eapcommon.c

index 9677c72..1f92ee2 100644 (file)
@@ -168,7 +168,5 @@ extern VALUE_PAIR *eap_packet2vp(RADIUS_PACKET *packet, eap_packet_raw_t const *
 extern eap_packet_raw_t *eap_vp2packet(TALLOC_CTX *ctx, VALUE_PAIR *vps);
 void eap_add_reply(REQUEST *request,
                   char const *name, uint8_t const *value, int len);
-extern VALUE_PAIR *eap_chbind_packet2vp(REQUEST *, const eap_chbind_packet_t *packet, size_t len);
-extern size_t eap_chbind_vp2packet(VALUE_PAIR *vps, eap_chbind_packet_t **packet);
 
 #endif /* _EAP_TYPES_H */
index f6cb605..1ea38db 100644 (file)
@@ -398,87 +398,3 @@ void eap_add_reply(REQUEST *request,
        pairmemcpy(vp, value, len);
 }
 
-VALUE_PAIR *eap_chbind_packet2vp(REQUEST *request, const eap_chbind_packet_t *packet, size_t len)
-{
-       size_t          size;
-       const uint8_t   *ptr;
-       VALUE_PAIR      *head = NULL;
-       uint8_t *octets = NULL;
-       
-       VALUE_PAIR      **tail = &head;
-       VALUE_PAIR      *vp;
-
-       ptr = (const uint8_t *) packet;
-
-       do {
-               size = len;
-               if (size > 247) size = 247;
-
-               vp = paircreate(request, PW_UKERNA_CHBIND, VENDORPEC_UKERNA);
-               if (!vp) {
-                       pairfree(&head);
-                       return NULL;
-               }
-               octets = talloc_array(vp, uint8_t, size);
-               rad_assert(octets);
-               memcpy(octets, ptr, size);
-               vp->vp_octets = octets;
-               vp->length = size;
-
-               *tail = vp;
-               tail = &(vp->next);
-
-               ptr += size;
-               len -= size;
-       } while (len > 0);
-
-       return head;
-}
-
-
-/*
- * Handles multiple EAP-channel-binding Message attrs
- * ie concatenates all to get the complete EAP-channel-binding packet.
- */
-size_t eap_chbind_vp2packet(VALUE_PAIR *vps, eap_chbind_packet_t **result)
-{
-       VALUE_PAIR *first, *vp;
-       eap_chbind_packet_t *eap_chbind_packet;
-       unsigned char *ptr;
-       size_t len;
-
-       first = pairfind(vps, PW_UKERNA_CHBIND, VENDORPEC_UKERNA, TAG_ANY);
-
-       /*
-        *      Compute total length
-        */
-       len = 0;
-       for (vp = first; vp; 
-            vp = pairfind(vp->next, PW_UKERNA_CHBIND, VENDORPEC_UKERNA, TAG_ANY)) {
-               len += vp->length;
-       }
-
-       /*
-        *      Now that we know the length, allocate memory.
-        */
-       eap_chbind_packet = (eap_chbind_packet_t *) malloc(len);
-       if (eap_chbind_packet == NULL) {
-               radlog(L_ERR, "rlm_eap: out of memory");
-               return 0;
-       }
-
-       /*
-        *      Copy the data from EAP-Message's over to our EAP packet.
-        */
-       ptr = (unsigned char *)eap_chbind_packet;
-
-       /* RADIUS ensures order of attrs, so just concatenate all */
-       for (vp = first; vp; 
-            vp = pairfind(vp->next, PW_UKERNA_CHBIND, VENDORPEC_UKERNA, TAG_ANY)) {
-               memcpy(ptr, vp->vp_octets, vp->length);
-               ptr += vp->length;
-       }
-
-       *result = eap_chbind_packet;
-       return len;
-}