Add support for indicating missing driver AKM capability flags

Add support for missing driver AKM capability flags from the list of
RSN_AUTH_KEY_MGMT_* flags and make these available through the
'GET_CAPABILITY key_mgmt' control interface command.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Tanmay Garg 2020-05-18 15:52:44 +05:30 committed by Jouni Malinen
parent 18f3f99ac4
commit 63653307df
3 changed files with 94 additions and 0 deletions

View File

@ -1747,6 +1747,13 @@ struct wpa_driver_capa {
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256 0x00040000
#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE 0x00100000
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384 0x00200000
#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM 0x00400000
#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN 0x00800000
/** Bitfield of supported key management suites */
unsigned int key_mgmt;
unsigned int key_mgmt_iftype[WPA_IF_MAX];

View File

@ -281,6 +281,27 @@ static unsigned int get_akm_suites_info(struct nlattr *tb)
case RSN_AUTH_KEY_MGMT_FT_PSK:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK;
break;
case RSN_AUTH_KEY_MGMT_802_1X_SHA256:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256;
break;
case RSN_AUTH_KEY_MGMT_PSK_SHA256:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256;
break;
case RSN_AUTH_KEY_MGMT_TPK_HANDSHAKE:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE;
break;
case RSN_AUTH_KEY_MGMT_FT_SAE:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE;
break;
case RSN_AUTH_KEY_MGMT_FT_802_1X_SHA384:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384;
break;
case RSN_AUTH_KEY_MGMT_CCKM:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_CCKM;
break;
case RSN_AUTH_KEY_MGMT_OSEN:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_OSEN;
break;
case RSN_AUTH_KEY_MGMT_802_1X_SUITE_B:
key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B;
break;

View File

@ -4221,6 +4221,27 @@ static int ctrl_iface_get_capability_key_mgmt(int res, bool strict,
pos += ret;
}
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK) {
ret = os_snprintf(pos, end - pos, " WAPI-PSK");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE) {
ret = os_snprintf(pos, end - pos, " TPK-HANDSHAKE");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_CCKM) {
ret = os_snprintf(pos, end - pos, " CCKM");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#ifdef CONFIG_SUITEB
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B) {
ret = os_snprintf(pos, end - pos, " WPA-EAP-SUITE-B");
@ -4288,6 +4309,28 @@ static int ctrl_iface_get_capability_key_mgmt(int res, bool strict,
return pos - buf;
pos += ret;
}
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT) {
ret = os_snprintf(pos, end - pos, " FT-EAP");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#ifdef CONFIG_SAE
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE) {
ret = os_snprintf(pos, end - pos, " FT-SAE");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#endif /* CONFIG_SAE */
#ifdef CONFIG_SHA384
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384) {
ret = os_snprintf(pos, end - pos, " FT-EAP-SHA384");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#endif /* CONFIG_SHA384 */
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_SAE
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_SAE) {
@ -4297,6 +4340,29 @@ static int ctrl_iface_get_capability_key_mgmt(int res, bool strict,
pos += ret;
}
#endif /* CONFIG_SAE */
#ifdef CONFIG_SHA256
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256) {
ret = os_snprintf(pos, end - pos, " WPA-EAP-SHA256");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256) {
ret = os_snprintf(pos, end - pos, " WPA-PSK-SHA256");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#endif /* CONFIG_SHA256 */
#ifdef CONFIG_HS20
if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_OSEN) {
ret = os_snprintf(pos, end - pos, " OSEN");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#endif /* CONFIG_HS20 */
return pos - buf;
}