]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove unused function eap_basic_compose
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 31 Jan 2018 05:40:22 +0000 (22:40 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 31 Jan 2018 14:14:44 +0000 (07:14 -0700)
src/modules/rlm_eap/lib/base/eap_types.h
src/modules/rlm_eap/lib/base/eapcommon.c

index d1f322c586ef60b3db9d726026ee1f48392070f1..0ecd8e43c2a8b9cf270a194e3842d0d231a2e455 100644 (file)
@@ -143,7 +143,7 @@ typedef struct CC_HINT(__packed__) eap_packet_raw {
 eap_type_t             eap_name2type(char const *name);
 char const             *eap_type2name(eap_type_t method);
 int                    eap_wireformat(eap_packet_t *reply);
-int                    eap_basic_compose(RADIUS_PACKET *packet, eap_packet_t *reply);
+
 VALUE_PAIR             *eap_packet2vp(RADIUS_PACKET *packet, eap_packet_raw_t const *reply);
 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);
index 29f8acea35eb408cb8761e0c63d1b462934d7304..c1d820d9f069b61a940e32fc3778b9bd5c41abc1 100644 (file)
@@ -173,72 +173,6 @@ int eap_wireformat(eap_packet_t *reply)
        return 0;
 }
 
-
-/*
- *     compose EAP reply packet in EAP-Message attr of RADIUS.  If
- *     EAP exceeds 253, frame it in multiple EAP-Message attrs.
- */
-int eap_basic_compose(RADIUS_PACKET *packet, eap_packet_t *reply)
-{
-       VALUE_PAIR *vp;
-       eap_packet_raw_t *eap_packet;
-       int rcode;
-
-       if (eap_wireformat(reply) < 0) return RLM_MODULE_INVALID;
-       eap_packet = (eap_packet_raw_t *)reply->packet;
-
-       fr_pair_delete_by_num(&(packet->vps), 0, FR_EAP_MESSAGE, TAG_ANY);
-
-       vp = eap_packet2vp(packet, eap_packet);
-       if (!vp) return RLM_MODULE_INVALID;
-       fr_pair_add(&(packet->vps), vp);
-
-       /*
-        *      EAP-Message is always associated with
-        *      Message-Authenticator but not vice-versa.
-        *
-        *      Don't add a Message-Authenticator if it's already
-        *      there.
-        */
-       vp = fr_pair_find_by_num(packet->vps, 0, FR_MESSAGE_AUTHENTICATOR, TAG_ANY);
-       if (!vp) {
-               vp = fr_pair_afrom_num(packet, 0, FR_MESSAGE_AUTHENTICATOR);
-               vp->vp_length = AUTH_VECTOR_LEN;
-               vp->vp_octets = talloc_zero_array(vp, uint8_t, vp->vp_length);
-
-               fr_pair_add(&(packet->vps), vp);
-       }
-
-       /* Set request reply code, but only if it's not already set. */
-       rcode = RLM_MODULE_OK;
-       if (!packet->code) switch (reply->code) {
-       case FR_EAP_CODE_RESPONSE:
-       case FR_EAP_CODE_SUCCESS:
-               packet->code = FR_CODE_ACCESS_ACCEPT;
-               rcode = RLM_MODULE_HANDLED;
-               break;
-
-       case FR_EAP_CODE_FAILURE:
-               packet->code = FR_CODE_ACCESS_REJECT;
-               rcode = RLM_MODULE_REJECT;
-               break;
-
-       case FR_EAP_CODE_REQUEST:
-               packet->code = FR_CODE_ACCESS_CHALLENGE;
-               rcode = RLM_MODULE_HANDLED;
-               break;
-
-       default:
-               /* Should never enter here */
-               ERROR("Reply code %d is unknown, Rejecting the request", reply->code);
-               packet->code = FR_CODE_ACCESS_REJECT;
-               break;
-       }
-
-       return rcode;
-}
-
-
 VALUE_PAIR *eap_packet2vp(RADIUS_PACKET *packet, eap_packet_raw_t const *eap)
 {
        int             total, size;