From: Jouni Malinen Date: Wed, 28 Jan 2015 14:15:58 +0000 (+0200) Subject: EAP-PEAP server: Fix Phase 2 TLV length in error case X-Git-Tag: hostap_2_4~289 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfaefd5174a95027cb2ccb8b0a0f9a7b99a849ae;p=thirdparty%2Fhostap.git EAP-PEAP server: Fix Phase 2 TLV length in error case The payload length in a Phase 2 TLV message reporting error was not set correctly. Fix this to not include the TLVs that are included only in success case. Signed-off-by: Jouni Malinen --- diff --git a/src/eap_server/eap_server_peap.c b/src/eap_server/eap_server_peap.c index 98d608bfa..faa0fd2f2 100644 --- a/src/eap_server/eap_server_peap.c +++ b/src/eap_server/eap_server_peap.c @@ -344,12 +344,14 @@ static struct wpabuf * eap_peap_build_phase2_tlv(struct eap_sm *sm, size_t mlen; mlen = 6; /* Result TLV */ - if (data->crypto_binding != NO_BINDING) + if (data->peap_version == 0 && data->tlv_request == TLV_REQ_SUCCESS && + data->crypto_binding != NO_BINDING) { mlen += 60; /* Cryptobinding TLV */ #ifdef EAP_SERVER_TNC - if (data->soh_response) - mlen += wpabuf_len(data->soh_response); + if (data->soh_response) + mlen += wpabuf_len(data->soh_response); #endif /* EAP_SERVER_TNC */ + } buf = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_TLV, mlen, EAP_CODE_REQUEST, id);