Browse Source

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.
Jouni Malinen 16 years ago
parent
commit
f36f51e403
1 changed files with 8 additions and 8 deletions
  1. 8 8
      src/eap_server/eap_fast.c

+ 8 - 8
src/eap_server/eap_fast.c

@@ -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;
 }