Remove PEAPv2 support
PEAPv2 implementation was not fully completed and there does not seem to be any deployments of PEAPv2 nor any clear sign of such showing up in the future either. As such, there is not much point in maintaining this implementation in hostapd/wpa_supplicant. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
6daf5b9c1c
commit
a190189d22
2 changed files with 2 additions and 209 deletions
|
@ -22,7 +22,6 @@
|
|||
/* Maximum supported PEAP version
|
||||
* 0 = Microsoft's PEAP version 0; draft-kamath-pppext-peapv0-00.txt
|
||||
* 1 = draft-josefsson-ppext-eap-tls-eap-05.txt
|
||||
* 2 = draft-josefsson-ppext-eap-tls-eap-10.txt
|
||||
*/
|
||||
#define EAP_PEAP_VERSION 1
|
||||
|
||||
|
@ -315,8 +314,6 @@ static int eap_tlv_add_cryptobinding(struct eap_sm *sm,
|
|||
len[1] = 1;
|
||||
|
||||
tlv_type = EAP_TLV_CRYPTO_BINDING_TLV;
|
||||
if (data->peap_version >= 2)
|
||||
tlv_type |= EAP_TLV_TYPE_MANDATORY;
|
||||
wpabuf_put_be16(buf, tlv_type);
|
||||
wpabuf_put_be16(buf, 56);
|
||||
|
||||
|
@ -580,33 +577,6 @@ static int eap_tlv_process(struct eap_sm *sm, struct eap_peap_data *data,
|
|||
}
|
||||
|
||||
|
||||
static struct wpabuf * eap_peapv2_tlv_eap_payload(struct wpabuf *buf)
|
||||
{
|
||||
struct wpabuf *e;
|
||||
struct eap_tlv_hdr *tlv;
|
||||
|
||||
if (buf == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Encapsulate EAP packet in EAP-Payload TLV */
|
||||
wpa_printf(MSG_DEBUG, "EAP-PEAPv2: Add EAP-Payload TLV");
|
||||
e = wpabuf_alloc(sizeof(*tlv) + wpabuf_len(buf));
|
||||
if (e == NULL) {
|
||||
wpa_printf(MSG_DEBUG, "EAP-PEAPv2: Failed to allocate memory "
|
||||
"for TLV encapsulation");
|
||||
wpabuf_free(buf);
|
||||
return NULL;
|
||||
}
|
||||
tlv = wpabuf_put(e, sizeof(*tlv));
|
||||
tlv->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
|
||||
EAP_TLV_EAP_PAYLOAD_TLV);
|
||||
tlv->length = host_to_be16(wpabuf_len(buf));
|
||||
wpabuf_put_buf(e, buf);
|
||||
wpabuf_free(buf);
|
||||
return e;
|
||||
}
|
||||
|
||||
|
||||
static int eap_peap_phase2_request(struct eap_sm *sm,
|
||||
struct eap_peap_data *data,
|
||||
struct eap_method_ret *ret,
|
||||
|
@ -837,49 +807,6 @@ continue_req:
|
|||
in_decrypted = nmsg;
|
||||
}
|
||||
|
||||
if (data->peap_version >= 2) {
|
||||
struct eap_tlv_hdr *tlv;
|
||||
struct wpabuf *nmsg;
|
||||
|
||||
if (wpabuf_len(in_decrypted) < sizeof(*tlv) + sizeof(*hdr)) {
|
||||
wpa_printf(MSG_INFO, "EAP-PEAPv2: Too short Phase 2 "
|
||||
"EAP TLV");
|
||||
wpabuf_free(in_decrypted);
|
||||
return 0;
|
||||
}
|
||||
tlv = wpabuf_mhead(in_decrypted);
|
||||
if ((be_to_host16(tlv->tlv_type) & 0x3fff) !=
|
||||
EAP_TLV_EAP_PAYLOAD_TLV) {
|
||||
wpa_printf(MSG_INFO, "EAP-PEAPv2: Not an EAP TLV");
|
||||
wpabuf_free(in_decrypted);
|
||||
return 0;
|
||||
}
|
||||
if (sizeof(*tlv) + be_to_host16(tlv->length) >
|
||||
wpabuf_len(in_decrypted)) {
|
||||
wpa_printf(MSG_INFO, "EAP-PEAPv2: Invalid EAP TLV "
|
||||
"length");
|
||||
wpabuf_free(in_decrypted);
|
||||
return 0;
|
||||
}
|
||||
hdr = (struct eap_hdr *) (tlv + 1);
|
||||
if (be_to_host16(hdr->length) > be_to_host16(tlv->length)) {
|
||||
wpa_printf(MSG_INFO, "EAP-PEAPv2: No room for full "
|
||||
"EAP packet in EAP TLV");
|
||||
wpabuf_free(in_decrypted);
|
||||
return 0;
|
||||
}
|
||||
|
||||
nmsg = wpabuf_alloc(be_to_host16(hdr->length));
|
||||
if (nmsg == NULL) {
|
||||
wpabuf_free(in_decrypted);
|
||||
return 0;
|
||||
}
|
||||
|
||||
wpabuf_put_data(nmsg, hdr, be_to_host16(hdr->length));
|
||||
wpabuf_free(in_decrypted);
|
||||
in_decrypted = nmsg;
|
||||
}
|
||||
|
||||
hdr = wpabuf_mhead(in_decrypted);
|
||||
if (wpabuf_len(in_decrypted) < sizeof(*hdr)) {
|
||||
wpa_printf(MSG_INFO, "EAP-PEAP: Too short Phase 2 "
|
||||
|
@ -996,11 +923,6 @@ continue_req:
|
|||
wpa_hexdump_buf_key(MSG_DEBUG,
|
||||
"EAP-PEAP: Encrypting Phase 2 data", resp);
|
||||
/* PEAP version changes */
|
||||
if (data->peap_version >= 2) {
|
||||
resp = eap_peapv2_tlv_eap_payload(resp);
|
||||
if (resp == NULL)
|
||||
return -1;
|
||||
}
|
||||
if (wpabuf_len(resp) >= 5 &&
|
||||
wpabuf_head_u8(resp)[0] == EAP_CODE_RESPONSE &&
|
||||
eap_get_type(resp) == EAP_TYPE_TLV)
|
||||
|
@ -1091,7 +1013,7 @@ static struct wpabuf * eap_peap_process(struct eap_sm *sm, void *priv,
|
|||
* label, "client EAP encryption", instead. Use the old
|
||||
* label by default, but allow it to be configured with
|
||||
* phase1 parameter peaplabel=1. */
|
||||
if (data->peap_version > 1 || data->force_new_label)
|
||||
if (data->force_new_label)
|
||||
label = "client PEAP encryption";
|
||||
else
|
||||
label = "client EAP encryption";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue