summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-06-12 13:54:32 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-06-13 07:40:17 (GMT)
commitfbe905ab58ecc31fe64c410c5f580cadc30e7f04 (patch)
treec5f7d1ee0db988ab3e026fe0862a8257ac9ccf7e /client
parentcbc629f70e44f4d38bf8c7554be89005319fd4de (diff)
downloadconnman-fbe905ab58ecc31fe64c410c5f580cadc30e7f04.zip
connman-fbe905ab58ecc31fe64c410c5f580cadc30e7f04.tar.gz
connman-fbe905ab58ecc31fe64c410c5f580cadc30e7f04.tar.bz2
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 780104b..12b0a98 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);