feat(wifi): Pull in wpa_supplicant upstream code for SAE EXT key

SAE: Internal WPA_KEY_MGMT_* defines for extended key AKMs

Define new WPA_KEY_MGMT_* values for the new SAE AKM suite selectors
with variable length keys. This includes updates to various mapping and
checking of the SAE key_mgmt values.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2023-10-09 08:55:55 +05:30 committed by Shreyas Sheth
parent 7dbfd8c6da
commit 21ac680eac
3 changed files with 14 additions and 0 deletions

View File

@ -48,6 +48,7 @@ typedef enum { FALSE = 0, TRUE = 1 } Boolean;
#define WPA_KEY_MGMT_IEEE8021X_SUITE_B BIT(16) #define WPA_KEY_MGMT_IEEE8021X_SUITE_B BIT(16)
#define WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 BIT(17) #define WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 BIT(17)
#define WPA_KEY_MGMT_OWE BIT(22) #define WPA_KEY_MGMT_OWE BIT(22)
#define WPA_KEY_MGMT_SAE_EXT_KEY BIT(26)
static inline int wpa_key_mgmt_wpa_ieee8021x(int akm) static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
{ {
@ -70,6 +71,7 @@ static inline int wpa_key_mgmt_wpa_psk(int akm)
WPA_KEY_MGMT_FT_PSK | WPA_KEY_MGMT_FT_PSK |
WPA_KEY_MGMT_PSK_SHA256 | WPA_KEY_MGMT_PSK_SHA256 |
WPA_KEY_MGMT_SAE | WPA_KEY_MGMT_SAE |
WPA_KEY_MGMT_SAE_EXT_KEY |
WPA_KEY_MGMT_FT_SAE)); WPA_KEY_MGMT_FT_SAE));
} }
@ -83,9 +85,15 @@ static inline int wpa_key_mgmt_ft(int akm)
static inline int wpa_key_mgmt_sae(int akm) static inline int wpa_key_mgmt_sae(int akm)
{ {
return !!(akm & (WPA_KEY_MGMT_SAE | return !!(akm & (WPA_KEY_MGMT_SAE |
WPA_KEY_MGMT_SAE_EXT_KEY |
WPA_KEY_MGMT_FT_SAE)); WPA_KEY_MGMT_FT_SAE));
} }
static inline int wpa_key_mgmt_sae_ext_key(int akm)
{
return !!(akm & (WPA_KEY_MGMT_SAE_EXT_KEY));
}
static inline int wpa_key_mgmt_sha256(int akm) static inline int wpa_key_mgmt_sha256(int akm)
{ {
return !!(akm & (WPA_KEY_MGMT_PSK_SHA256 | return !!(akm & (WPA_KEY_MGMT_PSK_SHA256 |

View File

@ -335,6 +335,8 @@ static int rsn_key_mgmt_to_bitfield(const u8 *s)
#ifdef CONFIG_WPA3_SAE #ifdef CONFIG_WPA3_SAE
if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_SAE) if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_SAE)
return WPA_KEY_MGMT_SAE; return WPA_KEY_MGMT_SAE;
if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_SAE_EXT_KEY)
return WPA_KEY_MGMT_SAE_EXT_KEY;
#endif /* CONFIG_WPA3_SAE */ #endif /* CONFIG_WPA3_SAE */
#ifdef CONFIG_OWE_STA #ifdef CONFIG_OWE_STA
if(RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_OWE) if(RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_OWE)
@ -969,6 +971,8 @@ u32 wpa_akm_to_suite(int akm)
return RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192; return RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192;
if (akm & WPA_KEY_MGMT_SAE) if (akm & WPA_KEY_MGMT_SAE)
return RSN_AUTH_KEY_MGMT_SAE; return RSN_AUTH_KEY_MGMT_SAE;
if (akm & WPA_KEY_MGMT_SAE_EXT_KEY)
return RSN_AUTH_KEY_MGMT_SAE_EXT_KEY;
if (akm & WPA_KEY_MGMT_FT_SAE) if (akm & WPA_KEY_MGMT_FT_SAE)
return RSN_AUTH_KEY_MGMT_FT_SAE; return RSN_AUTH_KEY_MGMT_FT_SAE;
if (akm & WPA_KEY_MGMT_OWE) if (akm & WPA_KEY_MGMT_OWE)

View File

@ -191,6 +191,8 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
#ifdef CONFIG_WPA3_SAE #ifdef CONFIG_WPA3_SAE
} else if (key_mgmt == WPA_KEY_MGMT_SAE) { } else if (key_mgmt == WPA_KEY_MGMT_SAE) {
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_SAE); RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_SAE);
} else if (key_mgmt == WPA_KEY_MGMT_SAE_EXT_KEY) {
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_SAE_EXT_KEY);
#endif /* CONFIG_WPA3_SAE */ #endif /* CONFIG_WPA3_SAE */
#ifdef CONFIG_OWE_STA #ifdef CONFIG_OWE_STA
} else if (key_mgmt == WPA_KEY_MGMT_OWE) { } else if (key_mgmt == WPA_KEY_MGMT_OWE) {