SAE: Check random_get_bytes() return value
Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
4954c859ea
commit
a50414c322
|
@ -416,8 +416,9 @@ static struct wpabuf * auth_build_token_req(struct hostapd_data *hapd,
|
||||||
os_get_time(&t);
|
os_get_time(&t);
|
||||||
if (hapd->last_sae_token_key_update == 0 ||
|
if (hapd->last_sae_token_key_update == 0 ||
|
||||||
t.sec > hapd->last_sae_token_key_update + 60) {
|
t.sec > hapd->last_sae_token_key_update + 60) {
|
||||||
random_get_bytes(hapd->sae_token_key,
|
if (random_get_bytes(hapd->sae_token_key,
|
||||||
sizeof(hapd->sae_token_key));
|
sizeof(hapd->sae_token_key)) < 0)
|
||||||
|
return NULL;
|
||||||
wpa_hexdump(MSG_DEBUG, "SAE: Updated token key",
|
wpa_hexdump(MSG_DEBUG, "SAE: Updated token key",
|
||||||
hapd->sae_token_key, sizeof(hapd->sae_token_key));
|
hapd->sae_token_key, sizeof(hapd->sae_token_key));
|
||||||
hapd->last_sae_token_key_update = t.sec;
|
hapd->last_sae_token_key_update = t.sec;
|
||||||
|
|
Loading…
Reference in a new issue