aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-30 16:00:55 (GMT)
committerJouni Malinen <j@w1.fi>2009-04-20 09:05:45 (GMT)
commite1a5cf26b158860578d2511e9c34d28ea9802de4 (patch)
tree606b0418c6f99192ae039c4d5ee7fdbf9a10d145
parent6f825a2e4a96df3e8a6d08e839ff872244ddfae2 (diff)
downloadhostap-06-e1a5cf26b158860578d2511e9c34d28ea9802de4.zip
hostap-06-e1a5cf26b158860578d2511e9c34d28ea9802de4.tar.gz
hostap-06-e1a5cf26b158860578d2511e9c34d28ea9802de4.tar.bz2
WPS: Fix local configuration update after AP configuration
Update credential to only include a single authentication and encryption type in case the AP configuration includes more than one option. Without this, the credential would be rejected if the AP was configured to allow more than one authentication type. (cherry picked from commit 73267b9ca433288c207c4e06a938eaa326c8672a)
-rw-r--r--src/wps/wps_registrar.c13
-rw-r--r--wpa_supplicant/wps_supplicant.c10
2 files changed, 23 insertions, 0 deletions
diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index 30581ff..cc03f6d 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -2306,6 +2306,19 @@ static enum wps_process_res wps_process_wsc_done(struct wps_data *wps,
}
if (!wps->wps->ap) {
+ /*
+ * Update credential to only include a single authentication
+ * and encryption type in case the AP configuration includes
+ * more than one option.
+ */
+ if (wps->cred.auth_type & WPS_AUTH_WPA2PSK)
+ wps->cred.auth_type = WPS_AUTH_WPA2PSK;
+ else if (wps->cred.auth_type & WPS_AUTH_WPAPSK)
+ wps->cred.auth_type = WPS_AUTH_WPAPSK;
+ if (wps->cred.encr_type & WPS_ENCR_AES)
+ wps->cred.encr_type = WPS_ENCR_AES;
+ else if (wps->cred.encr_type & WPS_ENCR_TKIP)
+ wps->cred.encr_type = WPS_ENCR_TKIP;
wpa_printf(MSG_DEBUG, "WPS: Update local configuration based "
"on the modified AP configuration");
if (wps->wps->cred_cb)
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 8b14a9a..71e873e 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -208,6 +208,16 @@ static int wpa_supplicant_wps_cred(void *ctx,
if (wpa_s->conf->wps_cred_processing == 1)
return 0;
+ wpa_hexdump_ascii(MSG_DEBUG, "WPS: SSID", cred->ssid, cred->ssid_len);
+ wpa_printf(MSG_DEBUG, "WPS: Authentication Type 0x%x",
+ cred->auth_type);
+ wpa_printf(MSG_DEBUG, "WPS: Encryption Type 0x%x", cred->encr_type);
+ wpa_printf(MSG_DEBUG, "WPS: Network Key Index %d", cred->key_idx);
+ wpa_hexdump_key(MSG_DEBUG, "WPS: Network Key",
+ cred->key, cred->key_len);
+ wpa_printf(MSG_DEBUG, "WPS: MAC Address " MACSTR,
+ MAC2STR(cred->mac_addr));
+
if (cred->auth_type != WPS_AUTH_OPEN &&
cred->auth_type != WPS_AUTH_SHARED &&
cred->auth_type != WPS_AUTH_WPAPSK &&