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>
This commit is contained in:
parent
ce52d031e5
commit
f42df14415
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
u8 addr[ETH_ALEN], *use_addr = NULL;
|
||||||
struct wpa_ssid *ssid;
|
struct wpa_ssid *ssid;
|
||||||
struct wps_credential cred;
|
struct wps_credential cred;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (uuid_str2bin(uuid, u) == 0)
|
if (uuid_str2bin(uuid, u) == 0)
|
||||||
use_uuid = u;
|
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)
|
if (wpas_wps_network_to_cred(ssid, &cred) < 0)
|
||||||
return -1;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue