diff options
| author | Michael Biebl <biebl@debian.org> | 2026-07-03 19:53:18 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2026-07-03 19:53:18 +0200 |
| commit | 537bfce2bda471c92caabd388589230200891509 (patch) | |
| tree | aedeccfaf0ba52c238ecf51fc009c0db5d4b60f0 /src/core/supplicant | |
| parent | 869e9027026cdbb15d4e4a6327ff41d2697858eb (diff) | |
New upstream version 1.58~rc1 upstream/1.58_rc1
Diffstat (limited to 'src/core/supplicant')
| -rw-r--r-- | src/core/supplicant/nm-supplicant-config.c | 98 | ||||
| -rw-r--r-- | src/core/supplicant/nm-supplicant-interface.c | 15 | ||||
| -rw-r--r-- | src/core/supplicant/nm-supplicant-interface.h | 1 | ||||
| -rw-r--r-- | src/core/supplicant/nm-supplicant-settings-verify.c | 3 |
4 files changed, 81 insertions, 36 deletions
diff --git a/src/core/supplicant/nm-supplicant-config.c b/src/core/supplicant/nm-supplicant-config.c index 233afe48..a0ffb483 100644 --- a/src/core/supplicant/nm-supplicant-config.c +++ b/src/core/supplicant/nm-supplicant-config.c @@ -373,14 +373,24 @@ nm_supplicant_config_get_blobs(NMSupplicantConfig *self) } static const char * -wifi_freqs_to_string(gboolean bg_band) +wifi_freqs_to_string(const char *band) { static const char *str_2ghz = NULL; static const char *str_5ghz = NULL; + static const char *str_6ghz = NULL; const char **f_p; const char *f; - f_p = bg_band ? &str_2ghz : &str_5ghz; + if (nm_streq0(band, "a")) + f_p = &str_5ghz; + else if (nm_streq0(band, "bg")) + f_p = &str_2ghz; + else if (nm_streq0(band, "6GHz")) + f_p = &str_6ghz; + else { + nm_assert_not_reached(); + return NULL; + } again: f = g_atomic_pointer_get(f_p); @@ -390,7 +400,13 @@ again: const guint *freqs; int i; - freqs = bg_band ? nm_utils_wifi_2ghz_freqs() : nm_utils_wifi_5ghz_freqs(); + if (f_p == &str_2ghz) + freqs = nm_utils_wifi_2ghz_freqs(); + else if (f_p == &str_5ghz) + freqs = nm_utils_wifi_5ghz_freqs(); + else + freqs = nm_utils_wifi_6ghz_freqs(); + for (i = 0; freqs[i]; i++) { if (i > 0) nm_str_buf_append_c(&strbuf, ' '); @@ -533,38 +549,47 @@ get_ap_params(guint freq, guint channel; guint center_channel = 0; - if (freq < 5000) { - /* the setting is not valid */ - nm_assert_not_reached(); - return; - } - /* Determine the center channel according to the table at * https://en.wikipedia.org/wiki/List_of_WLAN_channels */ - channel = (freq - 5000) / 5; - - if (channel >= 36 && channel <= 48) - center_channel = 42; - else if (channel >= 52 && channel <= 64) - center_channel = 58; - else if (channel >= 100 && channel <= 112) - center_channel = 106; - else if (channel >= 116 && channel <= 128) - center_channel = 122; - else if (channel >= 132 && channel <= 144) - center_channel = 138; - else if (channel >= 149 && channel <= 161) - center_channel = 155; - else if (channel >= 165 && channel <= 177) - center_channel = 171; - - if (center_channel) { + if (freq > 5950) { + /* 6 GHz */ + channel = (freq - 5950) / 5; + channel = ((channel - 1) / 16) * 16 + 7; + *out_ht40 = 1; *out_max_oper_chwidth = 1; - *out_center_freq = 5000 + 5 * center_channel; + *out_center_freq = 5950 + 5 * channel; + } else { + /* 5 GHz */ + if (freq < 5000) { + /* the setting is not valid */ + nm_assert_not_reached(); + return; + } + channel = (freq - 5000) / 5; + + if (channel >= 36 && channel <= 48) + center_channel = 42; + else if (channel >= 52 && channel <= 64) + center_channel = 58; + else if (channel >= 100 && channel <= 112) + center_channel = 106; + else if (channel >= 116 && channel <= 128) + center_channel = 122; + else if (channel >= 132 && channel <= 144) + center_channel = 138; + else if (channel >= 149 && channel <= 161) + center_channel = 155; + else if (channel >= 165 && channel <= 177) + center_channel = 171; + + if (center_channel) { + *out_ht40 = 1; + *out_max_oper_chwidth = 1; + *out_center_freq = 5000 + 5 * center_channel; + } } - return; } @@ -711,10 +736,7 @@ nm_supplicant_config_add_setting_wireless(NMSupplicantConfig *self, } else { const char *freqs = NULL; - if (nm_streq(band, "a")) - freqs = wifi_freqs_to_string(FALSE); - else if (nm_streq(band, "bg")) - freqs = wifi_freqs_to_string(TRUE); + freqs = wifi_freqs_to_string(band); if (freqs && !nm_supplicant_config_add_option(self, @@ -1575,8 +1597,14 @@ nm_supplicant_config_add_setting_8021x(NMSupplicantConfig *self, g_string_free(phase2, TRUE); /* PAC file */ - path = nm_setting_802_1x_get_pac_file(setting); - if (path) { + path = nm_setting_802_1x_get_pac_file(setting); + bytes = priv->private_user && path ? nm_g_hash_table_lookup(files, path) : NULL; + if (bytes) { + if (!nm_supplicant_config_add_blob_for_connection(self, bytes, "pac_file", con_uuid, error)) + return FALSE; + } else if (path) { + /* Private connections cannot use paths */ + g_return_val_if_fail(!priv->private_user, FALSE); if (!add_string_val(self, path, "pac_file", FALSE, NULL, error)) return FALSE; } else { diff --git a/src/core/supplicant/nm-supplicant-interface.c b/src/core/supplicant/nm-supplicant-interface.c index 5c60a7b6..4476c701 100644 --- a/src/core/supplicant/nm-supplicant-interface.c +++ b/src/core/supplicant/nm-supplicant-interface.c @@ -67,6 +67,7 @@ enum { GROUP_STARTED, /* a new Group (interface) was created */ GROUP_FINISHED, /* a Group (interface) has been finished */ PSK_MISMATCH, /* supplicant reported incorrect PSK */ + SAE_MISMATCH, /* supplicant reported incorrect SAE Password */ LAST_SIGNAL }; @@ -3237,6 +3238,11 @@ _signal_handle(NMSupplicantInterface *self, g_signal_emit(self, signals[PSK_MISMATCH], 0); return; } + + if (nm_streq(signal_name, "SaePasswordMismatch")) { + g_signal_emit(self, signals[SAE_MISMATCH], 0); + return; + } return; } @@ -3879,4 +3885,13 @@ nm_supplicant_interface_class_init(NMSupplicantInterfaceClass *klass) NULL, G_TYPE_NONE, 0); + signals[SAE_MISMATCH] = g_signal_new(NM_SUPPLICANT_INTERFACE_SAE_MISMATCH, + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + NULL, + G_TYPE_NONE, + 0); } diff --git a/src/core/supplicant/nm-supplicant-interface.h b/src/core/supplicant/nm-supplicant-interface.h index 961de1b1..e77f5a42 100644 --- a/src/core/supplicant/nm-supplicant-interface.h +++ b/src/core/supplicant/nm-supplicant-interface.h @@ -87,6 +87,7 @@ typedef enum { #define NM_SUPPLICANT_INTERFACE_GROUP_STARTED "group-started" #define NM_SUPPLICANT_INTERFACE_GROUP_FINISHED "group-finished" #define NM_SUPPLICANT_INTERFACE_PSK_MISMATCH "wpa-psk-mismatch" +#define NM_SUPPLICANT_INTERFACE_SAE_MISMATCH "wpa-sae-password-mismatch" typedef struct _NMSupplicantInterfaceClass NMSupplicantInterfaceClass; diff --git a/src/core/supplicant/nm-supplicant-settings-verify.c b/src/core/supplicant/nm-supplicant-settings-verify.c index cca53d82..a1f888ec 100644 --- a/src/core/supplicant/nm-supplicant-settings-verify.c +++ b/src/core/supplicant/nm-supplicant-settings-verify.c @@ -6,6 +6,7 @@ #include "src/core/nm-default-daemon.h" #include "nm-supplicant-settings-verify.h" +#include "libnm-core-aux-intern/nm-libnm-core-utils.h" #include <stdio.h> #include <stdlib.h> @@ -71,7 +72,7 @@ static const struct Opt opt_table[] = { OPT_BYTES("engine_id", 0), OPT_INT("fragment_size", 1, 2000), OPT_KEYWORD("freq_list", NULL), - OPT_INT("frequency", 2412, 5825), + OPT_INT("frequency", _NM_WIFI_FREQ_MIN, _NM_WIFI_FREQ_MAX), OPT_KEYWORD("group", NM_MAKE_STRV("CCMP", "TKIP", "WEP104", "WEP40", "GCMP-256", )), OPT_INT("ht40", 0, 1), OPT_BYTES("identity", 0), |