mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-15 20:50:41 +01:00
merge: branch 'lr/supplicant-wep'
The "wep_disabled" capability has now been merged into wpa_supplicant: https://patchwork.ozlabs.org/project/hostap/patch/20220307085446.706024-1-lkundrak@v3.sk/ https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1138
This commit is contained in:
commit
b1d11333c0
3 changed files with 38 additions and 9 deletions
|
|
@ -978,14 +978,16 @@ deactivate_reset_hw_addr(NMDevice *device)
|
|||
static gboolean
|
||||
check_connection_compatible(NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSettingWireless *s_wireless;
|
||||
const char *mac;
|
||||
const char *const *mac_blacklist;
|
||||
int i;
|
||||
const char *mode;
|
||||
const char *perm_hw_addr;
|
||||
NMDeviceWifi *self = NM_DEVICE_WIFI(device);
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
|
||||
NMSettingWireless *s_wireless;
|
||||
NMSettingWirelessSecurity *s_wsec;
|
||||
const char *mac;
|
||||
const char *const *mac_blacklist;
|
||||
int i;
|
||||
const char *mode;
|
||||
const char *perm_hw_addr;
|
||||
const char *key_mgmt;
|
||||
|
||||
if (!NM_DEVICE_CLASS(nm_device_wifi_parent_class)
|
||||
->check_connection_compatible(device, connection, error))
|
||||
|
|
@ -1070,6 +1072,20 @@ check_connection_compatible(NMDevice *device, NMConnection *connection, GError *
|
|||
}
|
||||
}
|
||||
|
||||
s_wsec = nm_connection_get_setting_wireless_security(connection);
|
||||
if (s_wsec) {
|
||||
key_mgmt = nm_setting_wireless_security_get_key_mgmt(s_wsec);
|
||||
|
||||
if (nm_supplicant_interface_get_capability(priv->sup_iface, NM_SUPPL_CAP_TYPE_WEP)
|
||||
== NM_TERNARY_FALSE
|
||||
&& NM_IN_STRSET(key_mgmt, "ieee8021x", "none")) {
|
||||
nm_utils_error_set_literal(error,
|
||||
NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
|
||||
"wpa_supplicant does not support WEP encryption");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: check channel/freq/band against bands the hardware supports
|
||||
// FIXME: check encryption against device capabilities
|
||||
// FIXME: check bitrate against device capabilities
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -993,6 +998,8 @@ _dbus_get_capabilities_cb(GVariant *res, GError *error, gpointer user_data)
|
|||
" MESH%c"
|
||||
" 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),
|
||||
|
|
@ -1002,7 +1009,9 @@ _dbus_get_capabilities_cb(GVariant *res, GError *error, gpointer user_data)
|
|||
NM_SUPPL_CAP_TO_CHAR(priv->capabilities, NM_SUPPL_CAP_TYPE_SHA384),
|
||||
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_WFD),
|
||||
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));
|
||||
|
|
|
|||
|
|
@ -48,6 +48,9 @@ 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,
|
||||
} NMSupplCapType;
|
||||
|
||||
|
|
@ -75,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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue