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.
This commit is contained in:
Jouni Malinen 2009-08-15 20:40:45 +03:00
parent cedf947308
commit 49eba5f82f

View file

@ -188,6 +188,7 @@ static int wpa_supplicant_wps_cred(void *ctx,
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
struct wpa_ssid *ssid = wpa_s->current_ssid; struct wpa_ssid *ssid = wpa_s->current_ssid;
u8 key_idx = 0; u8 key_idx = 0;
u16 auth_type;
if ((wpa_s->conf->wps_cred_processing == 1 || if ((wpa_s->conf->wps_cred_processing == 1 ||
wpa_s->conf->wps_cred_processing == 2) && cred->cred_attr) { wpa_s->conf->wps_cred_processing == 2) && cred->cred_attr) {
@ -220,13 +221,20 @@ static int wpa_supplicant_wps_cred(void *ctx,
wpa_printf(MSG_DEBUG, "WPS: MAC Address " MACSTR, wpa_printf(MSG_DEBUG, "WPS: MAC Address " MACSTR,
MAC2STR(cred->mac_addr)); MAC2STR(cred->mac_addr));
if (cred->auth_type != WPS_AUTH_OPEN && auth_type = cred->auth_type;
cred->auth_type != WPS_AUTH_SHARED && if (auth_type == (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK)) {
cred->auth_type != WPS_AUTH_WPAPSK && wpa_printf(MSG_DEBUG, "WPS: Workaround - convert mixed-mode "
cred->auth_type != WPS_AUTH_WPA2PSK) { "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 " wpa_printf(MSG_DEBUG, "WPS: Ignored credentials for "
"unsupported authentication type %d", "unsupported authentication type 0x%x",
cred->auth_type); auth_type);
return 0; return 0;
} }
@ -300,7 +308,7 @@ static int wpa_supplicant_wps_cred(void *ctx,
break; break;
} }
switch (cred->auth_type) { switch (auth_type) {
case WPS_AUTH_OPEN: case WPS_AUTH_OPEN:
ssid->auth_alg = WPA_AUTH_ALG_OPEN; ssid->auth_alg = WPA_AUTH_ALG_OPEN;
ssid->key_mgmt = WPA_KEY_MGMT_NONE; ssid->key_mgmt = WPA_KEY_MGMT_NONE;