Shift to use the proper attribute id
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_fast / rlm_eap_fast.c
index 2604853..07714a3 100644 (file)
@@ -38,8 +38,8 @@ typedef struct rlm_eap_fast_t {
        char const              *tls_conf_name;                         //!< Name of shared TLS config.
        fr_tls_server_conf_t *tls_conf;
 
-       char const              *default_provisioning_method_name;
-       int                     default_provisioning_method;
+       char const              *default_method_name;
+       int                     default_method;
 
        char const              *virtual_server;                        //!< Virtual server to use for processing
                                                                        //!< inner EAP method.
@@ -62,7 +62,7 @@ typedef struct rlm_eap_fast_t {
 static CONF_PARSER module_config[] = {
        { "tls", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_eap_fast_t, tls_conf_name), NULL },
 
-       { "default_provisioning_eap_type", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_eap_fast_t, default_provisioning_method_name), "mschapv2" },
+       { "default_eap_type", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_eap_fast_t, default_method_name), "mschapv2" },
 
        { "virtual_server", FR_CONF_OFFSET(PW_TYPE_STRING | PW_TYPE_REQUIRED | PW_TYPE_NOT_EMPTY, rlm_eap_fast_t, virtual_server) , NULL},
 
@@ -100,11 +100,11 @@ static int mod_instantiate(CONF_SECTION *cs, void **instance)
                return -1;
        }
 
-       inst->default_provisioning_method = eap_name2type(inst->default_provisioning_method_name);
-       if (!inst->default_provisioning_method) {
+       inst->default_method = eap_name2type(inst->default_method_name);
+       if (!inst->default_method) {
                ERROR("rlm_eap_fast.default_provisioning_eap_type: "
                          "Unknown EAP type %s",
-                                  inst->default_provisioning_method_name);
+                                  inst->default_method_name);
                return -1;
        }
 
@@ -154,7 +154,7 @@ static eap_fast_tunnel_t *eap_fast_alloc(TALLOC_CTX *ctx, rlm_eap_fast_t *inst)
        t->mode = EAP_FAST_UNKNOWN;
        t->stage = TLS_SESSION_HANDSHAKE;
 
-       t->default_method = inst->default_provisioning_method;
+       t->default_method = inst->default_method;
        t->copy_request_to_tunnel = inst->copy_request_to_tunnel;
        t->use_tunneled_reply = inst->use_tunneled_reply;
 
@@ -295,7 +295,7 @@ error:
                goto error;
        }
 
-       fast_da = dict_attrbyname("EAP-FAST-PAC-Opaque-TLV");
+       fast_da = dict_attrbyname("FreeRADIUS-EAP-FAST-PAC-Opaque-TLV");
        rad_assert(fast_da != NULL);
 
        fast_vps = eap_fast_fast2vp((REQUEST *)tls_session, s, (uint8_t *)&opaque_plaintext, plen, fast_da, NULL);
@@ -304,7 +304,7 @@ error:
        for (VALUE_PAIR *vp = fr_cursor_init(&cursor, &fast_vps); vp; vp = fr_cursor_next(&cursor)) {
                char *value;
 
-               switch (vp->da->attr) {
+               switch (vp->da->attr >> 24) {
                case PAC_INFO_PAC_TYPE:
                        rad_assert(t->pac.type == 0);
                        t->pac.type = vp->vp_integer;
@@ -322,7 +322,7 @@ error:
                        memcpy(t->pac.key, vp->vp_octets, PAC_KEY_LENGTH);
                        break;
                default:
-                       value = vp_aprints_value(tls_session, vp, '"');
+                       value = vp_aprints(tls_session, vp, '"');
                        RERROR("unknown TLV: %s", value);
                        talloc_free(value);
                        errmsg = "unknown TLV";