Change the order of Result TLV and PAC TLV to avoid interop issues

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.
This commit is contained in:
Jouni Malinen 2008-10-08 15:50:01 +03:00 committed by Jouni Malinen
parent 1073e0ce46
commit f36f51e403

View file

@ -717,6 +717,14 @@ static struct wpabuf * eap_fast_build_pac(struct eap_sm *sm,
return NULL; 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 */ /* PAC TLV */
wpa_printf(MSG_DEBUG, "EAP-FAST: Add PAC TLV"); wpa_printf(MSG_DEBUG, "EAP-FAST: Add PAC TLV");
pac_tlv = wpabuf_put(buf, sizeof(*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_info->len = host_to_be16(pos - (u8 *) (pac_info + 1));
pac_tlv->length = host_to_be16(pos - (u8 *) (pac_tlv + 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; return buf;
} }