Change the order of Result TLV and PAC TLV to avoid interop issues
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 8 Oct 2008 12:50:01 +0000 (15:50 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 8 Oct 2008 12:50:01 +0000 (15:50 +0300)
draft-cam-winget-eap-fast-provisioning-06.txt or RFC 4851 do not seem to
mandate any particular order for TLVs, but some interop issues were noticed
with an EAP-FAST peer implementation when Result TLV followed PAC TLV. The
example in draft-cam-winget-eap-fast-provisioning-06.txt shows the TLVs in
the other order, so change the order here, too, to make it less likely to
hit this type of interop issues.

src/eap_server/eap_fast.c

index 3ac1929..30df86c 100644 (file)
@@ -717,6 +717,14 @@ static struct wpabuf * eap_fast_build_pac(struct eap_sm *sm,
                return NULL;
        }
 
+       /* Result TLV */
+       wpa_printf(MSG_DEBUG, "EAP-FAST: Add Result TLV (status=SUCCESS)");
+       result = wpabuf_put(buf, sizeof(*result));
+       WPA_PUT_BE16((u8 *) &result->tlv_type,
+                    EAP_TLV_TYPE_MANDATORY | EAP_TLV_RESULT_TLV);
+       WPA_PUT_BE16((u8 *) &result->length, 2);
+       WPA_PUT_BE16((u8 *) &result->status, EAP_TLV_RESULT_SUCCESS);
+
        /* PAC TLV */
        wpa_printf(MSG_DEBUG, "EAP-FAST: Add PAC TLV");
        pac_tlv = wpabuf_put(buf, sizeof(*pac_tlv));
@@ -755,14 +763,6 @@ static struct wpabuf * eap_fast_build_pac(struct eap_sm *sm,
        pac_info->len = host_to_be16(pos - (u8 *) (pac_info + 1));
        pac_tlv->length = host_to_be16(pos - (u8 *) (pac_tlv + 1));
 
-       /* Result TLV */
-       wpa_printf(MSG_DEBUG, "EAP-FAST: Add Result TLV (status=SUCCESS)");
-       result = wpabuf_put(buf, sizeof(*result));
-       WPA_PUT_BE16((u8 *) &result->tlv_type,
-                    EAP_TLV_TYPE_MANDATORY | EAP_TLV_RESULT_TLV);
-       WPA_PUT_BE16((u8 *) &result->length, 2);
-       WPA_PUT_BE16((u8 *) &result->status, EAP_TLV_RESULT_SUCCESS);
-
        return buf;
 }