| Index: wpa_supplicant/dbus/dbus_new_handlers.c
|
| diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
|
| index 047909f3ee03eb5758fdde36a36bcf108801c37d..4a2aa1b4fc8fca28799accd74047ffd8a980e70a 100644
|
| --- a/wpa_supplicant/dbus/dbus_new_handlers.c
|
| +++ b/wpa_supplicant/dbus/dbus_new_handlers.c
|
| @@ -195,7 +195,9 @@ static const char *dont_quote[] = {
|
| "bssid", NULL
|
| };
|
|
|
| -static dbus_bool_t should_quote_opt(const char *key)
|
| +static dbus_bool_t should_quote_opt(const char *key,
|
| + size_t value_length,
|
| + char *value)
|
| {
|
| int i = 0;
|
| while (dont_quote[i] != NULL) {
|
| @@ -203,6 +205,17 @@ static dbus_bool_t should_quote_opt(const char *key)
|
| return FALSE;
|
| i++;
|
| }
|
| +
|
| + /*
|
| + * Do not quote psk value which is a raw key.
|
| + */
|
| + if ((os_strcmp(key, "psk") == 0) && (value_length == PMK_LEN*2)) {
|
| + u8 tmp_buf[PMK_LEN];
|
| +
|
| + if (hexstr2bin(value, tmp_buf, PMK_LEN) == 0)
|
| + return FALSE;
|
| + }
|
| +
|
| return TRUE;
|
| }
|
|
|
| @@ -273,11 +286,12 @@ static DBusMessage * set_network_properties(DBusMessage *message,
|
| if (ret <= 0)
|
| goto error;
|
| } else if (entry.type == DBUS_TYPE_STRING) {
|
| - if (should_quote_opt(entry.key)) {
|
| - size = os_strlen(entry.str_value);
|
| - if (size <= 0)
|
| - goto error;
|
| + size = os_strlen(entry.str_value);
|
| + if (size <= 0)
|
| + goto error;
|
|
|
| + if (should_quote_opt(entry.key, size,
|
| + entry.str_value)) {
|
| size += 3;
|
| value = os_zalloc(size);
|
| if (value == NULL)
|
|
|