aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorAndrii Bordunov <andrew.bordunov@gmail.com>2011-10-22 19:21:53 (GMT)
committerJouni Malinen <j@w1.fi>2011-10-22 19:21:53 (GMT)
commit2c4f80d51923a2b109b7cb165844b2c7849dc3e2 (patch)
treee77091d5e2f4a04ad0776c11a936999bed2764e8 /wpa_supplicant/wps_supplicant.c
parentd5695081c20f93f7f5fb99b92f27dd5e762a374b (diff)
downloadhostap-2c4f80d51923a2b109b7cb165844b2c7849dc3e2.zip
hostap-2c4f80d51923a2b109b7cb165844b2c7849dc3e2.tar.gz
hostap-2c4f80d51923a2b109b7cb165844b2c7849dc3e2.tar.bz2
WPS: Use ifdef blocks consistently for CONFIG_WPS_REG_DISABLE_OPEN
The registrar variable is used only if this macro is defined, so no need to set it otherwise.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 3400365..ad521fd 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -194,7 +194,9 @@ static int wpa_supplicant_wps_cred(void *ctx,
struct wpa_ssid *ssid = wpa_s->current_ssid;
u8 key_idx = 0;
u16 auth_type;
+#ifdef CONFIG_WPS_REG_DISABLE_OPEN
int registrar = 0;
+#endif /* CONFIG_WPS_REG_DISABLE_OPEN */
if ((wpa_s->conf->wps_cred_processing == 1 ||
wpa_s->conf->wps_cred_processing == 2) && cred->cred_attr) {
@@ -248,11 +250,13 @@ static int wpa_supplicant_wps_cred(void *ctx,
if (ssid && (ssid->key_mgmt & WPA_KEY_MGMT_WPS)) {
wpa_printf(MSG_DEBUG, "WPS: Replace WPS network block based "
"on the received credential");
+#ifdef CONFIG_WPS_REG_DISABLE_OPEN
if (ssid->eap.identity &&
ssid->eap.identity_len == WSC_ID_REGISTRAR_LEN &&
os_memcmp(ssid->eap.identity, WSC_ID_REGISTRAR,
WSC_ID_REGISTRAR_LEN) == 0)
registrar = 1;
+#endif /* CONFIG_WPS_REG_DISABLE_OPEN */
os_free(ssid->eap.identity);
ssid->eap.identity = NULL;
ssid->eap.identity_len = 0;