mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
wpa_supplicant : Fix association response processing in OWE
This commit is contained in:
parent
ef4b1b7704
commit
2fe39f79d1
@ -52,7 +52,7 @@
|
|||||||
struct wpa_sm gWpaSm;
|
struct wpa_sm gWpaSm;
|
||||||
/* fix buf for tx for now */
|
/* fix buf for tx for now */
|
||||||
#define WPA_TX_MSG_BUFF_MAXLEN 200
|
#define WPA_TX_MSG_BUFF_MAXLEN 200
|
||||||
#define MIN_DH_LEN 4
|
#define MIN_DH_LEN(len) (len < 4)
|
||||||
|
|
||||||
#define ASSOC_IE_LEN 24 + 2 + PMKID_LEN + RSN_SELECTOR_LEN
|
#define ASSOC_IE_LEN 24 + 2 + PMKID_LEN + RSN_SELECTOR_LEN
|
||||||
#define MAX_EAPOL_RETRIES 3
|
#define MAX_EAPOL_RETRIES 3
|
||||||
@ -2949,12 +2949,21 @@ int owe_process_assoc_resp(const u8 *rsn_ie, size_t rsn_len, const uint8_t *dh_i
|
|||||||
if (rsn_ie && rsn_len && wpa_parse_wpa_ie_rsn(rsn_ie, rsn_len + 2, parsed_rsn_data) != 0) {
|
if (rsn_ie && rsn_len && wpa_parse_wpa_ie_rsn(rsn_ie, rsn_len + 2, parsed_rsn_data) != 0) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (!dh_ie || dh_len < MIN_DH_LEN || parsed_rsn_data->num_pmkid == 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "OWE: Invalid parameter");
|
if (dh_ie && MIN_DH_LEN(dh_len)) {
|
||||||
|
wpa_printf(MSG_ERROR, "OWE: Invalid Diffie Hellman IE");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dh_ie && parsed_rsn_data->num_pmkid == 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "OWE: Assoc response should either have pmkid or DH IE");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sm->cur_pmksa) { /* No PMK caching */
|
if (!sm->cur_pmksa) { /* No PMK caching */
|
||||||
|
if (dh_ie == NULL) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
dh_len += 2;
|
dh_len += 2;
|
||||||
|
|
||||||
dh_ie += 3;
|
dh_ie += 3;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user