diff mbox

Enable parsing of multiple ciphers.

Message ID 1335185777-29083-1-git-send-email-lukasz.kucharczyk@tieto.com
State Changes Requested
Headers show

Commit Message

Lukasz Kucharczyk April 23, 2012, 12:56 p.m. UTC
It was impossible to set multiple cipher using wpa_cli as
set_network command takes exactly 3 parameters. E.g.: with
this change, following command will be accepted by wpa_cli:

set_network 0 pairwise "CCMP TKIP"

Signed-hostap: Lukasz Kucharczyk <lukasz.kucharczyk@tieto.com>
---
 wpa_supplicant/config.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Comments

Jouni Malinen June 24, 2012, 9:47 p.m. UTC | #1
On Mon, Apr 23, 2012 at 02:56:17PM +0200, Lukasz Kucharczyk wrote:
> It was impossible to set multiple cipher using wpa_cli as
> set_network command takes exactly 3 parameters. E.g.: with
> this change, following command will be accepted by wpa_cli:
> 
> set_network 0 pairwise "CCMP TKIP"

To be exact, it was not possible to do this from the interactive mode in
wpa_cli. It is possible to do this from command line with
wpa_cli set_network 0 pairwise "CCMP TKIP"

> diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
> @@ -833,12 +833,13 @@ static int wpa_config_parse_auth_alg(const struct parse_data *data,

Was this really supposed to be changing wpa_config_parse_auth_alg? Or
wpa_config_parse_cipher()? Or both?
diff mbox

Patch

diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index c423bc3..ba676c0 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -833,12 +833,13 @@  static int wpa_config_parse_auth_alg(const struct parse_data *data,
 	start = buf;
 
 	while (*start != '\0') {
-		while (*start == ' ' || *start == '\t')
+		while (*start == ' ' || *start == '\t' || *start == '"')
 			start++;
 		if (*start == '\0')
 			break;
 		end = start;
-		while (*end != ' ' && *end != '\t' && *end != '\0')
+		while (*end != ' ' && *end != '\t' && *end != '\0' &&
+		       *end != '"')
 			end++;
 		last = *end == '\0';
 		*end = '\0';