summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-07-10 17:45:12 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-07-13 06:36:50 -0300
commit4ef05c2ae439652addee08460d9fb0c848315c46 (patch)
tree30c93b6a9431ba3740cfcbb4a99c35ced69ec494
parent8cc446d1ce1f7938c8049d3facb44a8e3bfdac1b (diff)
downloadconnman-4ef05c2ae439652addee08460d9fb0c848315c46.tar.gz
connman-4ef05c2ae439652addee08460d9fb0c848315c46.tar.bz2
connman-4ef05c2ae439652addee08460d9fb0c848315c46.zip
agent: Handle wpspin type as a PreviousPassphrase
-rw-r--r--src/agent.c45
1 files changed, 27 insertions, 18 deletions
diff --git a/src/agent.c b/src/agent.c
index 5ce7ca9f..b597a4fd 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -360,24 +360,33 @@ static void previous_passphrase_handler(DBusMessageIter *iter,
{
enum connman_service_security security;
struct previous_passphrase_data data;
-
- data.passphrase = __connman_service_get_passphrase(service);
- if (data.passphrase == NULL)
- return;
-
- security = __connman_service_get_security(service);
- switch (security) {
- case CONNMAN_SERVICE_SECURITY_WEP:
- data.type = "wep";
- break;
- case CONNMAN_SERVICE_SECURITY_PSK:
- data.type = "psk";
- break;
- /*
- * This should never happen: no passphrase is set if security is not
- * one of the above. */
- default:
- break;
+ struct connman_network *network;
+
+ network = __connman_service_get_network(service);
+ data.passphrase = connman_network_get_string(network, "WiFi.PinWPS");
+
+ if (connman_network_get_bool(network, "WiFi.UseWPS") == TRUE &&
+ data.passphrase != NULL) {
+ data.type = "wpspin";
+ } else {
+ data.passphrase = __connman_service_get_passphrase(service);
+ if (data.passphrase == NULL)
+ return;
+
+ security = __connman_service_get_security(service);
+ switch (security) {
+ case CONNMAN_SERVICE_SECURITY_WEP:
+ data.type = "wep";
+ break;
+ case CONNMAN_SERVICE_SECURITY_PSK:
+ data.type = "psk";
+ break;
+ /*
+ * This should never happen: no passphrase is set if security
+ * is not one of the above. */
+ default:
+ break;
+ }
}
connman_dbus_dict_append_dict(iter, "PreviousPassphrase",