summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-09-26 11:13:14 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2018-09-27 13:35:53 +0200
commit5d97e76c7d1d00e6e42216edc9ce2bd1153f02fa (patch)
treed9e348fb125208f5d654ea31b65b13ca4b91c6be
parent0ba0f52cb74375a4a3b2a2f893f7b617510d80fd (diff)
downloadNetworkManager-bg/ap-hidden.tar.gz
wifi: support hidden ssid in AP modebg/ap-hidden
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/48
-rw-r--r--clients/common/settings-docs.h.in2
-rw-r--r--libnm-core/nm-setting-wireless.c16
-rw-r--r--src/supplicant/nm-supplicant-config.c6
-rw-r--r--src/supplicant/nm-supplicant-settings-verify.c1
4 files changed, 19 insertions, 6 deletions
diff --git a/clients/common/settings-docs.h.in b/clients/common/settings-docs.h.in
index 001f732323..f07769c059 100644
--- a/clients/common/settings-docs.h.in
+++ b/clients/common/settings-docs.h.in
@@ -9,7 +9,7 @@
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_CHANNEL N_("Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the \"band\" property to be set.")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS N_("If specified, request that the device use this MAC address instead. This is known as MAC cloning or spoofing. Beside explicitly specifying a MAC address, the special values \"preserve\", \"permanent\", \"random\" and \"stable\" are supported. \"preserve\" means not to touch the MAC address on activation. \"permanent\" means to use the permanent hardware address of the device. \"random\" creates a random MAC address on each connect. \"stable\" creates a hashed MAC address based on connection.stable-id and a machine dependent key. If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to \"preserve\" (older versions of NetworkManager may use a different default value). On D-Bus, this field is expressed as \"assigned-mac-address\" or the deprecated \"cloned-mac-address\".")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK N_("With \"cloned-mac-address\" setting \"random\" or \"stable\", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting \"FE:FF:FF:00:00:00\" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the \"random\" or \"stable\" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of \"FE:FF:FF:00:00:00 68:F7:28:00:00:00\" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of \"02:00:00:00:00:00 00:00:00:00:00:00\" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, \"02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00\" will create a fully scrambled MAC address, randomly locally or globally administered.")
-#define DESCRIBE_DOC_NM_SETTING_WIRELESS_HIDDEN N_("If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution. Note that marking the network as hidden may be a privacy issue for you, as the explicit probe-scans may be distinctly recognizable on the air.")
+#define DESCRIBE_DOC_NM_SETTING_WIRELESS_HIDDEN N_("If TRUE, indicates that the network is a non-broadcasting network that hides its SSID. This works both in infrastructure and AP mode. In infrastructure mode, various workarounds are used for a more reliable discovery of hidden networks, such as probe-scanning the SSID. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution. In AP mode, the created network does not broadcast its SSID. Note that marking the network as hidden may be a privacy issue for you (in infrastructure mode) or client stations (in AP mode), as the explicit probe-scans are distinctly recognizable on the air.")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_MAC_ADDRESS N_("If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST N_("A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg \"00:11:22:33:44:55\").")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION N_("One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address). This property is deprecated for 'cloned-mac-address'. Deprecated: 1")
diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c
index e31d80b9aa..287c27dacb 100644
--- a/libnm-core/nm-setting-wireless.c
+++ b/libnm-core/nm-setting-wireless.c
@@ -1595,14 +1595,20 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
/**
* NMSettingWireless:hidden:
*
- * If %TRUE, indicates this network is a non-broadcasting network that hides
- * its SSID. In this case various workarounds may take place, such as
- * probe-scanning the SSID for more reliable network discovery. However,
+ * If %TRUE, indicates that the network is a non-broadcasting network that
+ * hides its SSID. This works both in infrastructure and AP mode.
+ *
+ * In infrastructure mode, various workarounds are used for a more reliable
+ * discovery of hidden networks, such as probe-scanning the SSID. However,
* these workarounds expose inherent insecurities with hidden SSID networks,
* and thus hidden SSID networks should be used with caution.
*
- * Note that marking the network as hidden may be a privacy issue for you, as
- * the explicit probe-scans may be distinctly recognizable on the air.
+ * In AP mode, the created network does not broadcast its SSID.
+ *
+ * Note that marking the network as hidden may be a privacy issue for you
+ * (in infrastructure mode) or client stations (in AP mode), as the explicit
+ * probe-scans are distinctly recognizable on the air.
+ *
**/
/* ---ifcfg-rh---
* property: hidden
diff --git a/src/supplicant/nm-supplicant-config.c b/src/supplicant/nm-supplicant-config.c
index 9dc28abe1d..551c4f9330 100644
--- a/src/supplicant/nm-supplicant-config.c
+++ b/src/supplicant/nm-supplicant-config.c
@@ -483,6 +483,12 @@ nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self,
if (is_ap) {
if (!nm_supplicant_config_add_option (self, "mode", "2", -1, NULL, error))
return FALSE;
+
+ if ( nm_setting_wireless_get_hidden (setting)
+ && !nm_supplicant_config_add_option (self,
+ "ignore_broadcast_ssid", "1",
+ -1, NULL, error))
+ return FALSE;
}
if ((is_adhoc || is_ap) && fixed_freq) {
diff --git a/src/supplicant/nm-supplicant-settings-verify.c b/src/supplicant/nm-supplicant-settings-verify.c
index 8a0cadc7f6..1e25675ded 100644
--- a/src/supplicant/nm-supplicant-settings-verify.c
+++ b/src/supplicant/nm-supplicant-settings-verify.c
@@ -151,6 +151,7 @@ static const struct Opt opt_table[] = {
{ "mka_ckn", TYPE_BYTES, 0, 65536, FALSE, NULL },
{ "macsec_port", TYPE_INT, 1, 65534, FALSE, NULL },
{ "ieee80211w", TYPE_INT, 0, 2, FALSE, NULL },
+ { "ignore_broadcast_ssid", TYPE_INT, 0, 2, FALSE, NULL },
};
static gboolean