supplicant: detect the SAE interface capability
There isn't a global SAE capability in wpa_supplicant, use the per-interface one.
This commit is contained in:
@@ -1171,6 +1171,7 @@ parse_capabilities(NMSupplicantInterface *self, GVariant *capabilities)
|
|||||||
const gboolean old_prop_scan_ssid = priv->prop_scan_ssid;
|
const gboolean old_prop_scan_ssid = priv->prop_scan_ssid;
|
||||||
const guint32 old_max_scan_ssids = priv->max_scan_ssids;
|
const guint32 old_max_scan_ssids = priv->max_scan_ssids;
|
||||||
gboolean have_ft = FALSE;
|
gboolean have_ft = FALSE;
|
||||||
|
gboolean have_sae = FALSE;
|
||||||
gint32 max_scan_ssids;
|
gint32 max_scan_ssids;
|
||||||
const char ** array;
|
const char ** array;
|
||||||
|
|
||||||
@@ -1178,12 +1179,16 @@ parse_capabilities(NMSupplicantInterface *self, GVariant *capabilities)
|
|||||||
|
|
||||||
if (g_variant_lookup(capabilities, "KeyMgmt", "^a&s", &array)) {
|
if (g_variant_lookup(capabilities, "KeyMgmt", "^a&s", &array)) {
|
||||||
have_ft = g_strv_contains(array, "wpa-ft-psk");
|
have_ft = g_strv_contains(array, "wpa-ft-psk");
|
||||||
|
have_sae = g_strv_contains(array, "sae");
|
||||||
g_free(array);
|
g_free(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->iface_capabilities = NM_SUPPL_CAP_MASK_SET(priv->iface_capabilities,
|
priv->iface_capabilities = NM_SUPPL_CAP_MASK_SET(priv->iface_capabilities,
|
||||||
NM_SUPPL_CAP_TYPE_FT,
|
NM_SUPPL_CAP_TYPE_FT,
|
||||||
have_ft ? NM_TERNARY_TRUE : NM_TERNARY_FALSE);
|
have_ft ? NM_TERNARY_TRUE : NM_TERNARY_FALSE);
|
||||||
|
priv->iface_capabilities = NM_SUPPL_CAP_MASK_SET(priv->iface_capabilities,
|
||||||
|
NM_SUPPL_CAP_TYPE_SAE,
|
||||||
|
have_sae ? NM_TERNARY_TRUE : NM_TERNARY_FALSE);
|
||||||
|
|
||||||
if (g_variant_lookup(capabilities, "Modes", "^a&s", &array)) {
|
if (g_variant_lookup(capabilities, "Modes", "^a&s", &array)) {
|
||||||
/* Setting p2p_capable might toggle _prop_p2p_available_get(). However,
|
/* Setting p2p_capable might toggle _prop_p2p_available_get(). However,
|
||||||
@@ -1278,6 +1283,10 @@ _get_capability(NMSupplicantInterfacePrivate *priv, NMSupplCapType type)
|
|||||||
value = iface_value;
|
value = iface_value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NM_SUPPL_CAP_TYPE_SAE:
|
||||||
|
nm_assert(NM_SUPPL_CAP_MASK_GET(priv->global_capabilities, type) == NM_TERNARY_DEFAULT);
|
||||||
|
value = NM_SUPPL_CAP_MASK_GET(priv->iface_capabilities, type);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
nm_assert(NM_SUPPL_CAP_MASK_GET(priv->iface_capabilities, type) == NM_TERNARY_DEFAULT);
|
nm_assert(NM_SUPPL_CAP_MASK_GET(priv->iface_capabilities, type) == NM_TERNARY_DEFAULT);
|
||||||
value = NM_SUPPL_CAP_MASK_GET(priv->global_capabilities, type);
|
value = NM_SUPPL_CAP_MASK_GET(priv->global_capabilities, type);
|
||||||
@@ -1305,9 +1314,13 @@ nm_supplicant_interface_get_capabilities(NMSupplicantInterface *self)
|
|||||||
caps = NM_SUPPL_CAP_MASK_SET(caps,
|
caps = NM_SUPPL_CAP_MASK_SET(caps,
|
||||||
NM_SUPPL_CAP_TYPE_FT,
|
NM_SUPPL_CAP_TYPE_FT,
|
||||||
_get_capability(priv, NM_SUPPL_CAP_TYPE_FT));
|
_get_capability(priv, NM_SUPPL_CAP_TYPE_FT));
|
||||||
|
caps = NM_SUPPL_CAP_MASK_SET(caps,
|
||||||
|
NM_SUPPL_CAP_TYPE_SAE,
|
||||||
|
_get_capability(priv, NM_SUPPL_CAP_TYPE_SAE));
|
||||||
|
|
||||||
nm_assert(!NM_FLAGS_ANY(priv->iface_capabilities,
|
nm_assert(!NM_FLAGS_ANY(priv->iface_capabilities,
|
||||||
~(NM_SUPPL_CAP_MASK_T_AP_MASK | NM_SUPPL_CAP_MASK_T_FT_MASK)));
|
~(NM_SUPPL_CAP_MASK_T_AP_MASK | NM_SUPPL_CAP_MASK_T_FT_MASK
|
||||||
|
| NM_SUPPL_CAP_MASK_T_SAE_MASK)));
|
||||||
|
|
||||||
#if NM_MORE_ASSERTS > 10
|
#if NM_MORE_ASSERTS > 10
|
||||||
{
|
{
|
||||||
|
@@ -41,6 +41,7 @@ typedef enum {
|
|||||||
NM_SUPPL_CAP_TYPE_FILS,
|
NM_SUPPL_CAP_TYPE_FILS,
|
||||||
NM_SUPPL_CAP_TYPE_P2P,
|
NM_SUPPL_CAP_TYPE_P2P,
|
||||||
NM_SUPPL_CAP_TYPE_FT,
|
NM_SUPPL_CAP_TYPE_FT,
|
||||||
|
NM_SUPPL_CAP_TYPE_SAE,
|
||||||
NM_SUPPL_CAP_TYPE_SHA384,
|
NM_SUPPL_CAP_TYPE_SHA384,
|
||||||
NM_SUPPL_CAP_TYPE_MESH,
|
NM_SUPPL_CAP_TYPE_MESH,
|
||||||
NM_SUPPL_CAP_TYPE_FAST,
|
NM_SUPPL_CAP_TYPE_FAST,
|
||||||
@@ -71,6 +72,7 @@ typedef enum {
|
|||||||
_NM_SUPPL_CAP_MASK_DEFINE(MESH),
|
_NM_SUPPL_CAP_MASK_DEFINE(MESH),
|
||||||
_NM_SUPPL_CAP_MASK_DEFINE(WFD),
|
_NM_SUPPL_CAP_MASK_DEFINE(WFD),
|
||||||
_NM_SUPPL_CAP_MASK_DEFINE(FT),
|
_NM_SUPPL_CAP_MASK_DEFINE(FT),
|
||||||
|
_NM_SUPPL_CAP_MASK_DEFINE(SAE),
|
||||||
_NM_SUPPL_CAP_MASK_DEFINE(SHA384),
|
_NM_SUPPL_CAP_MASK_DEFINE(SHA384),
|
||||||
#undef _NM_SUPPL_CAP_MASK_DEFINE
|
#undef _NM_SUPPL_CAP_MASK_DEFINE
|
||||||
} NMSupplCapMask;
|
} NMSupplCapMask;
|
||||||
|
Reference in New Issue
Block a user