summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-06-12 16:54:32 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-06-13 10:40:17 +0300
commitfbe905ab58ecc31fe64c410c5f580cadc30e7f04 (patch)
treec5f7d1ee0db988ab3e026fe0862a8257ac9ccf7e /client
parentcbc629f70e44f4d38bf8c7554be89005319fd4de (diff)
downloadconnman-fbe905ab58ecc31fe64c410c5f580cadc30e7f04.tar.gz
connman-fbe905ab58ecc31fe64c410c5f580cadc30e7f04.tar.bz2
connman-fbe905ab58ecc31fe64c410c5f580cadc30e7f04.zip
client: Fix passphrase handling
An empty passphrase means that WPS is to be tried next. If WPS is not supported by the service, passphrase can not be left empty.
Diffstat (limited to 'client')
-rw-r--r--client/agent.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/agent.c b/client/agent.c
index 780104bd..12b0a984 100644
--- a/client/agent.c
+++ b/client/agent.c
@@ -418,11 +418,19 @@ static void request_input_ssid_return(char *input,
static void request_input_passphrase_return(char *input, void *user_data)
{
struct agent_data *request = user_data;
+ int len = 0;
/* TBD passphrase length checking */
- if (input != NULL && strlen(input) > 0) {
- request->input[PASSPHRASE].requested = false;
+ if (input != NULL)
+ len = strlen(input);
+
+ if (len == 0 && request->input[WPS].requested == false)
+ return;
+
+ request->input[PASSPHRASE].requested = false;
+
+ if (len > 0) {
request_input_append(request,
request->input[PASSPHRASE].attribute, input);