From fbe905ab58ecc31fe64c410c5f580cadc30e7f04 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Wed, 12 Jun 2013 16:54:32 +0300 Subject: 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. --- client/agent.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'client/agent.c') 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); -- cgit v1.2.3