aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-08-15 17:40:45 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 18:28:29 (GMT)
commit4a713c41edc3a894beda9477f74d04e0b2292027 (patch)
tree0b484583dd8089cd579c271156e201b5c9f606fd /wpa_supplicant
parentf4403fe8645a6f974fc9cf9caa066eaf3dc102ea (diff)
downloadhostap-06-4a713c41edc3a894beda9477f74d04e0b2292027.zip
hostap-06-4a713c41edc3a894beda9477f74d04e0b2292027.tar.gz
hostap-06-4a713c41edc3a894beda9477f74d04e0b2292027.tar.bz2
WPS: Workaround mixed-mode WPA+WPA2 auth type in credentials
An SMC router was reported to use 0x22 (WPAPSK + WPA2PSK) in the authentication type of the provisioned credential and wpa_supplicant rejected this as invalid. Work around this by replacing WPAPSK + WPA2PSK with WPA2PSK. (cherry picked from commit 49eba5f82fcf05f90aad369744a6f8e669bd3311)
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wps_supplicant.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 71e873e..7953b5e 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -186,6 +186,7 @@ static int wpa_supplicant_wps_cred(void *ctx,
struct wpa_supplicant *wpa_s = ctx;
struct wpa_ssid *ssid = wpa_s->current_ssid;
u8 key_idx = 0;
+ u16 auth_type;
if ((wpa_s->conf->wps_cred_processing == 1 ||
wpa_s->conf->wps_cred_processing == 2) && cred->cred_attr) {
@@ -218,13 +219,20 @@ static int wpa_supplicant_wps_cred(void *ctx,
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 &&
- cred->auth_type != WPS_AUTH_WPA2PSK) {
+ auth_type = cred->auth_type;
+ if (auth_type == (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK)) {
+ wpa_printf(MSG_DEBUG, "WPS: Workaround - convert mixed-mode "
+ "auth_type into WPA2PSK");
+ auth_type = WPS_AUTH_WPA2PSK;
+ }
+
+ if (auth_type != WPS_AUTH_OPEN &&
+ auth_type != WPS_AUTH_SHARED &&
+ auth_type != WPS_AUTH_WPAPSK &&
+ auth_type != WPS_AUTH_WPA2PSK) {
wpa_printf(MSG_DEBUG, "WPS: Ignored credentials for "
- "unsupported authentication type %d",
- cred->auth_type);
+ "unsupported authentication type 0x%x",
+ auth_type);
return 0;
}
@@ -298,7 +306,7 @@ static int wpa_supplicant_wps_cred(void *ctx,
break;
}
- switch (cred->auth_type) {
+ switch (auth_type) {
case WPS_AUTH_OPEN:
ssid->auth_alg = WPA_AUTH_ALG_OPEN;
ssid->key_mgmt = WPA_KEY_MGMT_NONE;