3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

peap: accept EAP type 33 as termination mechanism for PEAPv1

EAP Extensions type 33 is used in PEAPv0 as a termination
mechanism for the tunneled EAP methods. In PEAPv1
the regular EAP-Success/Failure packets must be used to terminate
the method. Some of the server implementations of PEAPv1
rely on EAP Extensions method to terminate the conversation
instead of the required Success/Failure packets. This patch
makes iwd interoperable with such devices.
This commit is contained in:
Tim Kourt 2018-09-06 15:04:16 -07:00 committed by Denis Kenzior
parent 397bf9c0bd
commit 958bd12624

View File

@ -361,30 +361,29 @@ static void eap_peap_phase2_handle_request(struct eap_state *eap,
size_t len) size_t len)
{ {
struct eap_peap_state *peap = eap_get_data(eap); struct eap_peap_state *peap = eap_get_data(eap);
uint8_t id;
if (len > 4 && pkt[4] == EAP_TYPE_EXTENSIONS) {
uint16_t pkt_len;
uint8_t code = pkt[0];
if (code != EAP_CODE_REQUEST)
return;
pkt_len = l_get_be16(pkt + 2);
if (pkt_len != len)
return;
id = pkt[1];
eap_extensions_handle_request(eap, id,
pkt + EAP_EXTENSIONS_HEADER_LEN,
len - EAP_EXTENSIONS_HEADER_LEN);
return;
}
if (peap->version == PEAP_VERSION_0) { if (peap->version == PEAP_VERSION_0) {
uint8_t id;
if (len > 4 && pkt[4] == EAP_TYPE_EXTENSIONS) {
uint16_t pkt_len;
uint8_t code = pkt[0];
if (code != EAP_CODE_REQUEST)
return;
pkt_len = l_get_be16(pkt + 2);
if (pkt_len != len)
return;
id = pkt[1];
eap_extensions_handle_request(eap, id,
pkt + EAP_EXTENSIONS_HEADER_LEN,
len - EAP_EXTENSIONS_HEADER_LEN);
return;
}
if (len < 1) if (len < 1)
return; return;