diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-10-04 11:37:45 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-10-09 11:26:14 +0200 |
commit | 0ff1cb556ca9b8a77a0b5b25522876c889b3835d (patch) | |
tree | 82660c7d0bf60bd87bb923b35626103b7c0a84ee | |
parent | 597e4b2d1ede9dffbdabaa141a333a2c50bf2c21 (diff) | |
download | NetworkManager-0ff1cb556ca9b8a77a0b5b25522876c889b3835d.tar.gz |
libnm/utils: add SAE security type
https://github.com/NetworkManager/NetworkManager/pull/354
-rw-r--r-- | libnm-core/nm-utils.c | 24 | ||||
-rw-r--r-- | libnm-core/nm-utils.h | 4 |
2 files changed, 27 insertions, 1 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 0b3a3ad2fb..8256bd833a 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -1119,6 +1119,7 @@ nm_utils_ap_mode_security_valid (NMUtilsSecurityType type, case NMU_SEC_STATIC_WEP: case NMU_SEC_WPA_PSK: case NMU_SEC_WPA2_PSK: + case NMU_SEC_SAE: return TRUE; default: break; @@ -1276,6 +1277,29 @@ nm_utils_security_valid (NMUtilsSecurityType type, return FALSE; } break; + case NMU_SEC_SAE: + if (!(wifi_caps & NM_WIFI_DEVICE_CAP_RSN)) + return FALSE; + if (have_ap) { + if (adhoc) { + if (!(wifi_caps & NM_WIFI_DEVICE_CAP_IBSS_RSN)) + return FALSE; + if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_CCMP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + return TRUE; + } else { + if (ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_SAE) { + if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_TKIP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)) + return TRUE; + if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_CCMP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + return TRUE; + } + } + return FALSE; + } + break; default: good = FALSE; break; diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h index 9577974cb3..5418a1e69d 100644 --- a/libnm-core/nm-utils.h +++ b/libnm-core/nm-utils.h @@ -50,6 +50,7 @@ char * nm_utils_ssid_to_utf8 (const guint8 *ssid, gsize len); * @NMU_SEC_WPA_ENTERPRISE: WPA1 is used with 802.1x authentication * @NMU_SEC_WPA2_PSK: WPA2/RSN is used with Pre-Shared Keys (PSK) * @NMU_SEC_WPA2_ENTERPRISE: WPA2 is used with 802.1x authentication + * @NMU_SEC_SAE: is used with WPA3 Enterprise * * Describes generic security mechanisms that 802.11 access points may offer. * Used with nm_utils_security_valid() for checking whether a given access @@ -64,7 +65,8 @@ typedef enum { NMU_SEC_WPA_PSK, NMU_SEC_WPA_ENTERPRISE, NMU_SEC_WPA2_PSK, - NMU_SEC_WPA2_ENTERPRISE + NMU_SEC_WPA2_ENTERPRISE, + NMU_SEC_SAE, } NMUtilsSecurityType; gboolean nm_utils_security_valid (NMUtilsSecurityType type, |