aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-29 11:07:00 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-29 17:44:51 (GMT)
commitf42df144155fb8486f9cee0afc367445b91a9ce6 (patch)
tree5e8c63b477fa18264aafe6680469c60a3e34fc33 /wpa_supplicant/wps_supplicant.c
parentce52d031e5389c81796db863e2cba41b982e1f07 (diff)
downloadhostap-f42df144155fb8486f9cee0afc367445b91a9ce6.zip
hostap-f42df144155fb8486f9cee0afc367445b91a9ce6.tar.gz
hostap-f42df144155fb8486f9cee0afc367445b91a9ce6.tar.bz2
WPS ER: Explicitly clear PSK from stack after use
There is no need to leave the PSK from temporary Credential structure that was built in stack after that Credential has been passed to the WPS module. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index ebbb798..22083bd 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1919,6 +1919,7 @@ int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid,
u8 addr[ETH_ALEN], *use_addr = NULL;
struct wpa_ssid *ssid;
struct wps_credential cred;
+ int ret;
if (uuid_str2bin(uuid, u) == 0)
use_uuid = u;
@@ -1932,7 +1933,9 @@ int wpas_wps_er_set_config(struct wpa_supplicant *wpa_s, const char *uuid,
if (wpas_wps_network_to_cred(ssid, &cred) < 0)
return -1;
- return wps_er_set_config(wpa_s->wps_er, use_uuid, use_addr, &cred);
+ ret = wps_er_set_config(wpa_s->wps_er, use_uuid, use_addr, &cred);
+ os_memset(&cred, 0, sizeof(cred));
+ return ret;
}