diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2022-03-08 12:21:45 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2022-03-17 12:44:53 +0100 |
commit | 41d03a1b17ac3119a76f49e2c40f5d12d2cec544 (patch) | |
tree | 00bb57a9b7aa612619ddb087faaab3b6464fdd18 | |
parent | 91f076d235532805c27915adb0a5d2fc36044424 (diff) |
supplicant: check whether WEP is available
Since version 2.10, it's possible to build wpa_supplicant without WEP
support. In fact, it's disabled by default. Regrettably, there's no
indication in that version as to whether WEP is enabled or not.
A patch has been sent upstream that exposes the information on D-Bus:
https://patchwork.ozlabs.org/project/hostap/patch/20220307085446.706024-1-lkundrak@v3.sk/
This makes use of the above to indicate presence or absence of WEP
support.
-rw-r--r-- | src/core/supplicant/nm-supplicant-manager.c | 9 | ||||
-rw-r--r-- | src/core/supplicant/nm-supplicant-types.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/core/supplicant/nm-supplicant-manager.c b/src/core/supplicant/nm-supplicant-manager.c index 9de845f0e3..2ec7db237a 100644 --- a/src/core/supplicant/nm-supplicant-manager.c +++ b/src/core/supplicant/nm-supplicant-manager.c @@ -920,6 +920,7 @@ _dbus_get_capabilities_cb(GVariant *res, GError *error, gpointer user_data) _caps_set(priv, NM_SUPPL_CAP_TYPE_PMF, NM_TERNARY_FALSE); _caps_set(priv, NM_SUPPL_CAP_TYPE_FILS, NM_TERNARY_FALSE); _caps_set(priv, NM_SUPPL_CAP_TYPE_SUITEB192, NM_TERNARY_FALSE); + _caps_set(priv, NM_SUPPL_CAP_TYPE_WEP, NM_TERNARY_TRUE); if (array) { for (a = array; *a; a++) { if (nm_streq(*a, "ap")) { @@ -954,6 +955,10 @@ _dbus_get_capabilities_cb(GVariant *res, GError *error, gpointer user_data) _caps_set(priv, NM_SUPPL_CAP_TYPE_SUITEB192, NM_TERNARY_TRUE); continue; } + if (nm_streq(*a, "wep_disabled")) { + _caps_set(priv, NM_SUPPL_CAP_TYPE_WEP, NM_TERNARY_FALSE); + continue; + } } } } @@ -994,6 +999,7 @@ _dbus_get_capabilities_cb(GVariant *res, GError *error, gpointer user_data) " FAST%c" " WFD%c" " SUITEB192%c" + " WEP%c" "", NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_AP), NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_PMF), @@ -1004,7 +1010,8 @@ _dbus_get_capabilities_cb(GVariant *res, GError *error, gpointer user_data) NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_MESH), NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_FAST), NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_WFD), - NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_SUITEB192)); + NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_SUITEB192), + NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_WEP)); nm_assert(g_hash_table_size(priv->supp_ifaces) == 0); nm_assert(c_list_is_empty(&priv->supp_lst_head)); diff --git a/src/core/supplicant/nm-supplicant-types.h b/src/core/supplicant/nm-supplicant-types.h index 1f863baa6c..5c047ad683 100644 --- a/src/core/supplicant/nm-supplicant-types.h +++ b/src/core/supplicant/nm-supplicant-types.h @@ -48,6 +48,7 @@ typedef enum { NM_SUPPL_CAP_TYPE_FAST, NM_SUPPL_CAP_TYPE_WFD, NM_SUPPL_CAP_TYPE_SUITEB192, + NM_SUPPL_CAP_TYPE_WEP, /* Note: if you're adding a capability here, log its presence at the * bottom of _dbus_get_capabilities_cb(). */ _NM_SUPPL_CAP_TYPE_NUM, @@ -77,6 +78,7 @@ typedef enum { _NM_SUPPL_CAP_MASK_DEFINE(FT), _NM_SUPPL_CAP_MASK_DEFINE(SAE), _NM_SUPPL_CAP_MASK_DEFINE(SHA384), + _NM_SUPPL_CAP_MASK_DEFINE(WEP), #undef _NM_SUPPL_CAP_MASK_DEFINE } NMSupplCapMask; |