drivers: Add separate driver flags for 802.1X and PSK 4-way HS offloads
Allow drivers to indicate support for offloading 4-way handshake for either IEEE 802.1X (WPA2-Enterprise; EAP) and/or WPA/WPA2-PSK (WPA2-Personal) by splitting the WPA_DRIVER_FLAGS_4WAY_HANDSHAKE flag into two separate flags. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
This commit is contained in:
parent
78a9ba72d0
commit
436ee2fd93
9 changed files with 29 additions and 23 deletions
|
@ -931,10 +931,10 @@ struct wpa_driver_associate_params {
|
|||
* passphrase - RSN passphrase for PSK
|
||||
*
|
||||
* This value is made available only for WPA/WPA2-Personal (PSK) and
|
||||
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
|
||||
* the 8..63 character ASCII passphrase, if available. Please note that
|
||||
* this can be %NULL if passphrase was not used to generate the PSK. In
|
||||
* that case, the psk field must be used to fetch the PSK.
|
||||
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
|
||||
* is the 8..63 character ASCII passphrase, if available. Please note
|
||||
* that this can be %NULL if passphrase was not used to generate the
|
||||
* PSK. In that case, the psk field must be used to fetch the PSK.
|
||||
*/
|
||||
const char *passphrase;
|
||||
|
||||
|
@ -942,9 +942,9 @@ struct wpa_driver_associate_params {
|
|||
* psk - RSN PSK (alternative for passphrase for PSK)
|
||||
*
|
||||
* This value is made available only for WPA/WPA2-Personal (PSK) and
|
||||
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
|
||||
* the 32-octet (256-bit) PSK, if available. The driver wrapper should
|
||||
* be prepared to handle %NULL value as an error.
|
||||
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
|
||||
* is the 32-octet (256-bit) PSK, if available. The driver wrapper
|
||||
* should be prepared to handle %NULL value as an error.
|
||||
*/
|
||||
const u8 *psk;
|
||||
|
||||
|
@ -1492,7 +1492,7 @@ struct wpa_driver_capa {
|
|||
#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
|
||||
/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
|
||||
* struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */
|
||||
#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE 0x00000008
|
||||
#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
|
||||
/** Driver is for a wired Ethernet interface */
|
||||
#define WPA_DRIVER_FLAGS_WIRED 0x00000010
|
||||
/** Driver provides separate commands for authentication and association (SME in
|
||||
|
@ -1616,6 +1616,8 @@ struct wpa_driver_capa {
|
|||
#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
|
||||
/** Driver supports FTM responder functionality */
|
||||
#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
|
||||
/** Driver support 4-way handshake offload for WPA-Personal */
|
||||
#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
|
||||
u64 flags;
|
||||
|
||||
#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
|
||||
|
|
|
@ -253,7 +253,8 @@ const char * driver_flag_to_string(u64 flag)
|
|||
DF2S(DRIVER_IE);
|
||||
DF2S(SET_KEYS_AFTER_ASSOC);
|
||||
DF2S(DFS_OFFLOAD);
|
||||
DF2S(4WAY_HANDSHAKE);
|
||||
DF2S(4WAY_HANDSHAKE_PSK);
|
||||
DF2S(4WAY_HANDSHAKE_8021X);
|
||||
DF2S(WIRED);
|
||||
DF2S(SME);
|
||||
DF2S(AP);
|
||||
|
|
|
@ -3031,7 +3031,7 @@ static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss,
|
|||
#endif /* CONFIG_DRIVER_NL80211_QCA */
|
||||
|
||||
if (alg == WPA_ALG_PMK &&
|
||||
(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE))
|
||||
(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X))
|
||||
return nl80211_set_pmk(drv, key, key_len, addr);
|
||||
|
||||
if (alg == WPA_ALG_NONE) {
|
||||
|
@ -5570,7 +5570,7 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv,
|
|||
|
||||
/* Add PSK in case of 4-way handshake offload */
|
||||
if (params->psk &&
|
||||
(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE)) {
|
||||
(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK)) {
|
||||
wpa_hexdump_key(MSG_DEBUG, " * PSK", params->psk, 32);
|
||||
if (nla_put(msg, NL80211_ATTR_PMK, 32, params->psk))
|
||||
return -1;
|
||||
|
|
|
@ -403,10 +403,11 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
|
|||
capa->flags |= WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD;
|
||||
|
||||
if (ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK) &&
|
||||
ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK))
|
||||
capa->flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK;
|
||||
if (ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X))
|
||||
capa->flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE;
|
||||
capa->flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X;
|
||||
|
||||
if (ext_feature_isset(ext_features, len,
|
||||
NL80211_EXT_FEATURE_MFP_OPTIONAL))
|
||||
|
|
|
@ -62,7 +62,8 @@ static int
|
|||
wpa_driver_openbsd_get_capa(void *priv, struct wpa_driver_capa *capa)
|
||||
{
|
||||
os_memset(capa, 0, sizeof(*capa));
|
||||
capa->flags = WPA_DRIVER_FLAGS_4WAY_HANDSHAKE;
|
||||
capa->flags = WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK |
|
||||
WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1647,7 +1647,8 @@ static int wpa_driver_wext_get_range(void *priv)
|
|||
if (range->enc_capa & IW_ENC_CAPA_CIPHER_CCMP)
|
||||
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP;
|
||||
if (range->enc_capa & IW_ENC_CAPA_4WAY_HANDSHAKE)
|
||||
drv->capa.flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE;
|
||||
drv->capa.flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK |
|
||||
WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X;
|
||||
drv->capa.auth = WPA_DRIVER_AUTH_OPEN |
|
||||
WPA_DRIVER_AUTH_SHARED |
|
||||
WPA_DRIVER_AUTH_LEAP;
|
||||
|
@ -1678,7 +1679,7 @@ static int wpa_driver_wext_set_psk(struct wpa_driver_wext_data *drv,
|
|||
|
||||
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
|
||||
|
||||
if (!(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE))
|
||||
if (!(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X))
|
||||
return 0;
|
||||
|
||||
if (!psk)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue