Re: [PATCH 1/3] wifi: Introduce PassiveWiFiScan option
On Fri, 2015-04-24 at 14:56 +0300, Pasi Sjöholm wrote: > > If you use PassiveWiFiScan only here, then you are still using > > active scan for auto-connection - so still leaking SSIDs - when not > > connected. > > Yes, for hidden networks but not for anything else. This isn't then a very good solution. So if the point is not to leak all known SSIDs all the time while scanning, that needs to be addressed for all scans. I'd still expect hidden networks to be scanned if they did not turn up in the passive WiFi scan. Else there is a subset of networks that can be connected only once; having the user to notice the relationship between full privacy and hidden WiFi networks will fail very reliably... So the idea is not to reveal the WiFi networks used by doing active scans where active scans are not strictly necessary? By doing active scan only for known hidden networks, yes, the device reveals itself - but that is the cost of using hidden networks, right? Cheers, Patrik ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH 1/3] wifi: Introduce PassiveWiFiScan option
Hi Tomasz, >> -} else if (wifi->connected) { +} else if >> (wifi->connected || connman_setting_get_bool("PassiveWiFiScan")) >> { g_supplicant_free_scan_params(scan_params); return >> wifi_scan_simple(device); > > If you use PassiveWiFiScan only here, then you are still using > active scan for auto-connection - so still leaking SSIDs - when not > connected. Yes, for hidden networks but not for anything else. > Is this a wanted behavior? Because then PassiveWiFiScan is > semantically wrong as it does not really completely avoid active > scan. Well, I would say yes because the hidden networks are just fundamentally broken. I can rename PassiveWifiScan into something else. Br, Pasi ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH 1/3] wifi: Introduce PassiveWiFiScan option
Hi Pasi, - } else if (wifi->connected) { + } else if (wifi->connected || connman_setting_get_bool("PassiveWiFiScan")) { g_supplicant_free_scan_params(scan_params); return wifi_scan_simple(device); If you use PassiveWiFiScan only here, then you are still using active scan for auto-connection - so still leaking SSIDs - when not connected. Is this a wanted behavior? Because then PassiveWiFiScan is semantically wrong as it does not really completely avoid active scan. Tomasz ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
[PATCH 1/3] wifi: Introduce PassiveWiFiScan option
From: Pasi Sjöholm Makes it possible to only do passive scanning so that the SSIDs are not revealed during the scans. --- plugins/wifi.c | 2 +- src/main.c | 15 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/wifi.c b/plugins/wifi.c index 42dd407..0fecee7 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -1820,7 +1820,7 @@ static int wifi_scan(enum connman_service_type type, return 0; } - } else if (wifi->connected) { + } else if (wifi->connected || connman_setting_get_bool("PassiveWiFiScan")) { g_supplicant_free_scan_params(scan_params); return wifi_scan_simple(device); } else { diff --git a/src/main.c b/src/main.c index 1c17991..21c6121 100644 --- a/src/main.c +++ b/src/main.c @@ -73,6 +73,7 @@ static struct { bool single_tech; char **tethering_technologies; bool persistent_tethering_mode; + bool passive_wifi_scan; } connman_settings = { .bg_scan = true, .pref_timeservers = NULL, @@ -86,6 +87,7 @@ static struct { .single_tech = false, .tethering_technologies = NULL, .persistent_tethering_mode = false, + .passive_wifi_scan = false, }; #define CONF_BG_SCAN"BackgroundScanning" @@ -100,6 +102,7 @@ static struct { #define CONF_SINGLE_TECH"SingleConnectedTechnology" #define CONF_TETHERING_TECHNOLOGIES "TetheringTechnologies" #define CONF_PERSISTENT_TETHERING_MODE "PersistentTetheringMode" +#define CONF_PASSIVE_WIFI_SCAN "PassiveWiFiScan" static const char *supported_options[] = { CONF_BG_SCAN, @@ -114,6 +117,7 @@ static const char *supported_options[] = { CONF_SINGLE_TECH, CONF_TETHERING_TECHNOLOGIES, CONF_PERSISTENT_TETHERING_MODE, + CONF_PASSIVE_WIFI_SCAN, NULL }; @@ -354,6 +358,14 @@ static void parse_config(GKeyFile *config) connman_settings.persistent_tethering_mode = boolean; g_clear_error(&error); + + boolean = __connman_config_get_bool(config, "General", + CONF_PASSIVE_WIFI_SCAN, + &error); + if (!error) + connman_settings.passive_wifi_scan = boolean; + + g_clear_error(&error); } static int config_init(const char *file) @@ -528,6 +540,9 @@ bool connman_setting_get_bool(const char *key) if (g_str_equal(key, CONF_PERSISTENT_TETHERING_MODE)) return connman_settings.persistent_tethering_mode; + if (g_str_equal(key, CONF_PASSIVE_WIFI_SCAN)) + return connman_settings.passive_wifi_scan; + return false; } -- 2.1.0 ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman