diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index fb7e7b6764..5557024eeb 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -535,6 +535,10 @@ typedef struct { wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ uint8_t transition_disable; /**< Whether to enable transition disable feature */ uint8_t sae_ext; /**< Enable SAE EXT feature. SOC_GCMP_SUPPORT is required for this feature. */ + uint8_t transition_disable: 1; /**< Whether to enable transition disable feature */ + uint8_t sae_ext: 1; /**< Enable SAE EXT feature. SOC_GCMP_SUPPORT is required for this feature. */ + uint8_t wpa3_compatible_mode: 1; /**< Whether to enable wpa3 compatible authmode feature */ + uint8_t reserved: 5; /**< Reserved for future feature set */ wifi_bss_max_idle_config_t bss_max_idle_cfg; /**< Configuration for bss max idle, effective if CONFIG_WIFI_BSS_MAX_IDLE_SUPPORT is enabled */ uint16_t gtk_rekey_interval; /**< GTK rekeying interval in seconds. If set to 0, GTK rekeying is disabled. Range: 60 ~ 65535 including 0. */ } wifi_ap_config_t; diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c index 2451ab1e4f..f7caf531bf 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c @@ -111,6 +111,15 @@ void *hostap_init(void) } } #endif /* CONFIG_IEEE80211W */ +//TODO how to set values + if (true) { + hapd->conf->rsn_override_key_mgmt = WPA_KEY_MGMT_SAE; + hapd->conf->rsn_override_pairwise = WPA_CIPHER_CCMP; + hapd->conf->rsn_override_mfp = MGMT_FRAME_PROTECTION_REQUIRED; + auth_conf->rsn_override_key_mgmt = WPA_KEY_MGMT_SAE; + auth_conf->rsn_override_pairwise = WPA_CIPHER_CCMP; + auth_conf->rsn_override_mfp = MGMT_FRAME_PROTECTION_REQUIRED; + } /* TKIP is compulsory in WPA Mode */ if (auth_conf->wpa == WPA_PROTO_WPA && pairwise_cipher == WIFI_CIPHER_TYPE_CCMP) { pairwise_cipher = WIFI_CIPHER_TYPE_TKIP_CCMP; diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c index f0bce5803a..c1df251ea5 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c @@ -396,12 +396,10 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *assoc_req_ie, uint32_t as if (elems.rsn_ie) { elems.rsn_ie = elems.rsn_ie - 2; elems.rsn_ie_len = elems.rsn_ie_len + 2; - wpa_printf(MSG_DEBUG, "STA included RSN IE in (Re)AssocReq"); } if (elems.rsnxe) { elems.rsnxe = elems.rsnxe - 2; elems.rsnxe_len = elems.rsnxe_len + 2; - wpa_printf(MSG_DEBUG, "STA included RSN IE in (Re)AssocReq"); } if (*sta) { diff --git a/components/wpa_supplicant/src/common/ieee802_11_common.c b/components/wpa_supplicant/src/common/ieee802_11_common.c index 64fbf945bd..1f76a92f8a 100644 --- a/components/wpa_supplicant/src/common/ieee802_11_common.c +++ b/components/wpa_supplicant/src/common/ieee802_11_common.c @@ -266,6 +266,33 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen, elems->sae_pk_len = elen - 4; break; #endif /* CONFIG_SAE_PK */ +//TODO think of way to ignore these + case P2P_OUI_TYPE: + /* Wi-Fi Alliance - P2P IE */ + break; + case WFD_OUI_TYPE: + /* Wi-Fi Alliance - WFD IE */ + break; + case HS20_INDICATION_OUI_TYPE: + /* Hotspot 2.0 */ + break; + case HS20_OSEN_OUI_TYPE: + /* Hotspot 2.0 OSEN */ + break; + case MBO_OUI_TYPE: + /* MBO-OCE */ + break; + case HS20_ROAMING_CONS_SEL_OUI_TYPE: + /* Hotspot 2.0 Roaming Consortium Selection */ + break; + case MULTI_AP_OUI_TYPE: + break; + case OWE_OUI_TYPE: + /* OWE Transition Mode element */ + break; + case DPP_CC_OUI_TYPE: + /* DPP Configurator Connectivity element */ + break; case WFA_RSNE_OVERRIDE_OUI_TYPE: elems->rsne_override = pos; elems->rsne_override_len = elen; diff --git a/components/wpa_supplicant/src/common/ieee802_11_defs.h b/components/wpa_supplicant/src/common/ieee802_11_defs.h index 1efb4d3857..7b34269df6 100644 --- a/components/wpa_supplicant/src/common/ieee802_11_defs.h +++ b/components/wpa_supplicant/src/common/ieee802_11_defs.h @@ -299,8 +299,9 @@ #define WLAN_TIMEOUT_KEY_LIFETIME 2 #define WLAN_TIMEOUT_ASSOC_COMEBACK 3 -#define OUI_WFA 0x506f9a +/* DPP Public Action frame identifiers - OUI_WFA */ #define DPP_OUI_TYPE 0x1A +#define OUI_WFA 0x506f9a #define WFA_RSNE_OVERRIDE_OUI_TYPE 0x29 #define WFA_RSNE_OVERRIDE_2_OUI_TYPE 0x2a #define WFA_RSNXE_OVERRIDE_OUI_TYPE 0x2b @@ -308,6 +309,21 @@ #define RSNE_OVERRIDE_2_IE_VENDOR_TYPE 0x506f9a2a #define RSNXE_OVERRIDE_IE_VENDOR_TYPE 0x506f9a2b +#define WFD_OUI_TYPE 10 +#define NAN_OUI_TYPE 0x13 +#define MBO_OUI_TYPE 22 +#define OWE_OUI_TYPE 28 +#define MULTI_AP_OUI_TYPE 0x1B +#define DPP_CC_OUI_TYPE 0x1e +#define SAE_PK_OUI_TYPE 0x1f +#define QM_IE_OUI_TYPE 0x22 +#define WFA_CAPA_OUI_TYPE 0x23 + +#define P2P_OUI_TYPE 9 +#define HS20_INDICATION_OUI_TYPE 16 +#define HS20_OSEN_OUI_TYPE 18 +#define HS20_ROAMING_CONS_SEL_OUI_TYPE 29 + #define WMM_OUI_TYPE 2 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1 diff --git a/examples/wifi/getting_started/softAP/main/softap_example_main.c b/examples/wifi/getting_started/softAP/main/softap_example_main.c index c2bca87431..f4baa2052a 100644 --- a/examples/wifi/getting_started/softAP/main/softap_example_main.c +++ b/examples/wifi/getting_started/softAP/main/softap_example_main.c @@ -78,6 +78,7 @@ void wifi_init_softap(void) #else /* CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT */ .authmode = WIFI_AUTH_WPA2_PSK, #endif + .wpa3_compatible_mode = 1, .pmf_cfg = { .required = true, },