Re: [RFC] Exposing network credentials to an application

2014-07-31 Thread Patrik Flykt

Hi,

On Wed, 2014-07-30 at 14:55 -0700, Drew Stebbins wrote:

 There's a chicken-and-egg problem in the use case Grant mentioned
 which unfortunately can't be solved with .config file passing. In the
 presented use case, the user selects and authenticates to a network
 when they set up the first device. The application instructs connman
 to connect to the specified network with the given credentials via the
 services API. Once a connection is made, connman saves its
 configuration for this network somewhere in /var/lib/connman/wifi_*/,
 but ***does not*** create a .config file with this information.

So the use case was that the user him/herself sets up the network and
thus it's not initially provided out-of-band.

 At this point, the application on the first device can't produce
 a .config file for the second device.

Why not? It's just a simple matter of reading doc/config-format.txt and
writing code to do it.

 This seems like a poor solution, however, as the logic to
 create .config files is then duplicated between connman and the
 application.

ConnMan does not have any code for writing .config files, so there is no
code to duplicate.

 Also, any application which may need to retrieve a service's PSK in
 the future is forced to use file I/O rather than the services API to
 inform connman about preferred services.

Parsing a .config file is the only option to retrieve a passphrase as
the passphrase is not available via D-Bus in the first place.

 Also note that the second device might not even run connman (or Linux,
 for that matter). This means that to provision the second device, if
 the WiFi PSK is obscured via the services API, and if the application
 creates a .config file based on the user's input, then the application
 needs logic to parse .config files as well as create them. At this
 point, the application is interacting with connman more through file
 I/O than through D-Bus. It would be easier for the application (and
 application developers :)) if all necessary information to provision a
 new device could be retrieved from connman via the services API.

 What do you think?

You are actually trying to solve a configuration problem, not a ConnMan
related one. I'd start off by check something like
https://01.org/cpclient , continuing by looking at the data format used
for WiFi in NFC, and expanding my knowledge into other configuration and
information syncing protocols. If the data format needs to be shared
between other non-ConnMan devices, the generic solutions are the ones
you want to look for. Converting the OS agnostic WiFi configuration data
to a format understood by ConnMan will then be the easiest of the
problems at hand.


Cheers,

Patrik



___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH] wifi: Don't allow autoscan for p2p interfaces

2014-07-31 Thread Eduardo Abinader
Accordding to p2p spec, a p2p device is not supposed to carry
wifi scan, specially a client device. Thus this patch avoids
autoscan and solves a segmentation fault issue occuring in
g_supplicant_interface_autoscan, due to a null interface
pointer.
---
 plugins/wifi.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index ce6d7e7..a44eb37 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -955,6 +955,9 @@ static void start_autoscan(struct connman_device *device)
if (!wifi)
return;
 
+   if (wifi-p2p_device)
+   return;
+
autoscan = wifi-autoscan;
if (!autoscan)
return;
@@ -1039,6 +1042,9 @@ static void finalize_interface_creation(struct wifi_data 
*wifi)
if (!connman_setting_get_bool(BackgroundScanning))
return;
 
+   if (wifi-p2p_device)
+   return;
+
/* Setting up automatic scanning */
if (g_supplicant_interface_autoscan(interface, AUTOSCAN_DEFAULT,
interface_autoscan_callback, wifi)  0) {
-- 
1.9.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] wifi: Don't allow autoscan for p2p interfaces

2014-07-31 Thread Tomasz Bursztyka

ACK from me.

Thanks Eduardo!
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] peer: Fix a dbus issue when raising PeersChanged signal

2014-07-31 Thread Patrik Flykt
On Tue, 2014-07-29 at 10:42 +0300, Tomasz Bursztyka wrote:
 This fixes a warning issued by DBus telling a dict is expected instead
 of a struct end. Also, using the proper variable when calling
 append_peer_struct so it's more readable.

Applied, thanks!

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] wifi: Don't allow autoscan for p2p interfaces

2014-07-31 Thread Patrik Flykt
On Thu, 2014-07-31 at 07:17 -0400, Eduardo Abinader wrote:
 Accordding to p2p spec, a p2p device is not supposed to carry
 wifi scan, specially a client device. Thus this patch avoids
 autoscan and solves a segmentation fault issue occuring in
 g_supplicant_interface_autoscan, due to a null interface
 pointer.

Applied, thanks!

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH 1/1 v2] wifi: Update p2p scan status, when disabling wifi

2014-07-31 Thread Patrik Flykt
On Tue, 2014-07-29 at 06:45 -0400, Eduardo Abinader wrote:
 Whenever wifi plugin is disabled and p2p find is running,
 a double device unref was occurring. By setting scanning to
 false, avoids duplicated device unref.

Applied, thanks!

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman