Fixed EAP-FAST peer not to add double Result TLV when ACKing PAC

This commit is contained in:
Jouni Malinen 2008-10-02 17:38:13 +03:00 committed by Jouni Malinen
parent 0930209dc2
commit 75cf93d2c5

View file

@ -506,6 +506,8 @@ static struct wpabuf * eap_fast_tlv_result(int status, int intermediate)
buf = wpabuf_alloc(sizeof(*result)); buf = wpabuf_alloc(sizeof(*result));
if (buf == NULL) if (buf == NULL)
return NULL; return NULL;
wpa_printf(MSG_DEBUG, "EAP-FAST: Add %sResult TLV(status=%d)",
intermediate ? "Intermediate " : "", status);
result = wpabuf_put(buf, sizeof(*result)); result = wpabuf_put(buf, sizeof(*result));
result->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY | result->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
(intermediate ? (intermediate ?
@ -527,12 +529,7 @@ static struct wpabuf * eap_fast_tlv_pac_ack(void)
if (buf == NULL) if (buf == NULL)
return NULL; return NULL;
res = wpabuf_put(buf, sizeof(*res)); wpa_printf(MSG_DEBUG, "EAP-FAST: Add PAC TLV (ack)");
res->tlv_type = host_to_be16(EAP_TLV_RESULT_TLV |
EAP_TLV_TYPE_MANDATORY);
res->length = host_to_be16(sizeof(*res) - sizeof(struct eap_tlv_hdr));
res->status = host_to_be16(EAP_TLV_RESULT_SUCCESS);
ack = wpabuf_put(buf, sizeof(*ack)); ack = wpabuf_put(buf, sizeof(*ack));
ack->tlv_type = host_to_be16(EAP_TLV_PAC_TLV | ack->tlv_type = host_to_be16(EAP_TLV_PAC_TLV |
EAP_TLV_TYPE_MANDATORY); EAP_TLV_TYPE_MANDATORY);