nm-supplicant-interface: enable OWE security when transition mode is available
This pull requests sets the OWE flag for an open network advertising an OWE enabled transition BSSID. This way, hostapd will automatically connect to the OWE secured BSSID advertised in the transition mode information element. Signed-off-by: David Bauer <mail@david-bauer.net> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/442
This commit is contained in:

committed by
Thomas Haller

parent
11797f4ad4
commit
37e7fa38c2
@@ -4354,7 +4354,8 @@ void
|
||||
nm_wifi_utils_parse_ies (const guint8 *bytes,
|
||||
gsize len,
|
||||
guint32 *out_max_rate,
|
||||
gboolean *out_metered)
|
||||
gboolean *out_metered,
|
||||
gboolean *owe_transition_mode)
|
||||
{
|
||||
guint8 id, elem_len;
|
||||
guint32 m;
|
||||
@@ -4395,6 +4396,13 @@ nm_wifi_utils_parse_ies (const guint8 *bytes,
|
||||
&& bytes[3] == 0x11) /* OUI type: Network cost */
|
||||
*out_metered = (bytes[7] > 1); /* Cost level > 1 */
|
||||
}
|
||||
if ( owe_transition_mode
|
||||
&& elem_len >= 10
|
||||
&& bytes[0] == 0x50 /* OUI: WiFi Alliance */
|
||||
&& bytes[1] == 0x6f
|
||||
&& bytes[2] == 0x9a
|
||||
&& bytes[3] == 0x1c) /* OUI type: OWE Transition Mode */
|
||||
*owe_transition_mode = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -476,7 +476,8 @@ const char *nm_utils_parse_dns_domain (const char *domain, gboolean *is_routing)
|
||||
void nm_wifi_utils_parse_ies (const guint8 *bytes,
|
||||
gsize len,
|
||||
guint32 *out_max_rate,
|
||||
gboolean *out_metered);
|
||||
gboolean *out_metered,
|
||||
gboolean *owe_transition_mode);
|
||||
|
||||
guint8 nm_wifi_utils_level_to_quality (int val);
|
||||
|
||||
|
@@ -482,6 +482,7 @@ _bss_info_properties_changed (NMSupplicantInterface *self,
|
||||
const guint8 *arr_data;
|
||||
gsize arr_len;
|
||||
gboolean p_metered;
|
||||
gboolean p_owe_transition_mode = FALSE;
|
||||
guint32 p_max_rate;
|
||||
gboolean p_max_rate_has;
|
||||
gint64 now_msec = 0;
|
||||
@@ -630,11 +631,18 @@ _bss_info_properties_changed (NMSupplicantInterface *self,
|
||||
guint32 rate;
|
||||
|
||||
arr_data = g_variant_get_fixed_array (v_v, &arr_len, 1);
|
||||
nm_wifi_utils_parse_ies (arr_data, arr_len, &rate, &p_metered);
|
||||
nm_wifi_utils_parse_ies (arr_data, arr_len, &rate, &p_metered, &p_owe_transition_mode);
|
||||
p_max_rate = NM_MAX (p_max_rate, rate);
|
||||
p_max_rate_has = TRUE;
|
||||
g_variant_unref (v_v);
|
||||
|
||||
|
||||
/* Add OWE Security type if OWE transition mode is available */
|
||||
if (p_owe_transition_mode)
|
||||
bss_info->rsn_flags |= NM_802_11_AP_SEC_KEY_MGMT_OWE;
|
||||
else
|
||||
bss_info->rsn_flags &= ~NM_802_11_AP_SEC_KEY_MGMT_OWE;
|
||||
|
||||
bss_info->metered = p_metered;
|
||||
}
|
||||
if (p_max_rate_has)
|
||||
|
Reference in New Issue
Block a user