aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-10-08 14:36:52 (GMT)
committerJouni Malinen <j@w1.fi>2010-10-08 14:36:52 (GMT)
commit088a225586ebfca8298bd6e86a2b88e3158d888a (patch)
treecd2f93804b5ac038a969579e012acb650ae84c54 /hostapd
parent2f7d9f2dd9a8664c457a296713a09aeed335dcb5 (diff)
downloadhostap-088a225586ebfca8298bd6e86a2b88e3158d888a.zip
hostap-088a225586ebfca8298bd6e86a2b88e3158d888a.tar.gz
hostap-088a225586ebfca8298bd6e86a2b88e3158d888a.tar.bz2
Fix hostapd_cli get_config not to show key when WPA is disabled
Previously, incorrectly configured passphrase or group cipher type could be shown even if WPA was disabled.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/ctrl_iface.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 0407b6c..af83b8d 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -519,7 +519,7 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
return pos - buf;
pos += ret;
- if (hapd->conf->wps_state &&
+ if (hapd->conf->wps_state && hapd->conf->wpa &&
hapd->conf->ssid.wpa_passphrase) {
ret = os_snprintf(pos, end - pos, "passphrase=%s\n",
hapd->conf->ssid.wpa_passphrase);
@@ -528,7 +528,8 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
pos += ret;
}
- if (hapd->conf->wps_state && hapd->conf->ssid.wpa_psk &&
+ if (hapd->conf->wps_state && hapd->conf->wpa &&
+ hapd->conf->ssid.wpa_psk &&
hapd->conf->ssid.wpa_psk->group) {
char hex[PMK_LEN * 2 + 1];
wpa_snprintf_hex(hex, sizeof(hex),
@@ -593,12 +594,13 @@ static int hostapd_ctrl_iface_get_config(struct hostapd_data *hapd,
pos += ret;
}
- if (hapd->conf->wpa_group == WPA_CIPHER_CCMP) {
+ if (hapd->conf->wpa && hapd->conf->wpa_group == WPA_CIPHER_CCMP) {
ret = os_snprintf(pos, end - pos, "group_cipher=CCMP\n");
if (ret < 0 || ret >= end - pos)
return pos - buf;
pos += ret;
- } else if (hapd->conf->wpa_group == WPA_CIPHER_TKIP) {
+ } else if (hapd->conf->wpa &&
+ hapd->conf->wpa_group == WPA_CIPHER_TKIP) {
ret = os_snprintf(pos, end - pos, "group_cipher=TKIP\n");
if (ret < 0 || ret >= end - pos)
return pos - buf;