WPS ER: Do not try to process AP Settings in proxied M7 to ER

In this case, the Enrollee is not an AP, so do not try to process
AP Settings in M7.
This commit is contained in:
Jouni Malinen 2009-11-15 18:54:37 +02:00
parent 564cd7fa2c
commit f6d23cfd9e
3 changed files with 8 additions and 2 deletions

View file

@ -949,6 +949,7 @@ static void wps_er_sta_start(struct wps_er_sta *sta, struct wpabuf *msg)
sta->wps = wps_init(&cfg); sta->wps = wps_init(&cfg);
if (sta->wps == NULL) if (sta->wps == NULL)
return; return;
sta->wps->er = 1;
wps_er_sta_process(sta, msg, WSC_MSG); wps_er_sta_process(sta, msg, WSC_MSG);
} }

View file

@ -34,6 +34,11 @@ struct wps_data {
*/ */
int registrar; int registrar;
/**
* er - Whether the local end is an external registrar
*/
int er;
enum { enum {
/* Enrollee states */ /* Enrollee states */
SEND_M1, RECV_M2, SEND_M3, RECV_M4, SEND_M5, RECV_M6, SEND_M7, SEND_M1, RECV_M2, SEND_M3, RECV_M4, SEND_M5, RECV_M6, SEND_M7,

View file

@ -2215,7 +2215,7 @@ static void wps_cred_update(struct wps_credential *dst,
static int wps_process_ap_settings_r(struct wps_data *wps, static int wps_process_ap_settings_r(struct wps_data *wps,
struct wps_parse_attr *attr) struct wps_parse_attr *attr)
{ {
if (wps->wps->ap) if (wps->wps->ap || wps->er)
return 0; return 0;
/* AP Settings Attributes in M7 when Enrollee is an AP */ /* AP Settings Attributes in M7 when Enrollee is an AP */
@ -2273,7 +2273,7 @@ static enum wps_process_res wps_process_m7(struct wps_data *wps,
decrypted = wps_decrypt_encr_settings(wps, attr->encr_settings, decrypted = wps_decrypt_encr_settings(wps, attr->encr_settings,
attr->encr_settings_len); attr->encr_settings_len);
if (decrypted == NULL) { if (decrypted == NULL) {
wpa_printf(MSG_DEBUG, "WPS: Failed to decrypted Encrypted " wpa_printf(MSG_DEBUG, "WPS: Failed to decrypt Encrypted "
"Settings attribute"); "Settings attribute");
wps->state = SEND_WSC_NACK; wps->state = SEND_WSC_NACK;
return WPS_CONTINUE; return WPS_CONTINUE;