SAE: Check random_get_bytes() return value

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-01-01 20:25:38 +02:00
parent 4954c859ea
commit a50414c322

View file

@ -416,8 +416,9 @@ static struct wpabuf * auth_build_token_req(struct hostapd_data *hapd,
os_get_time(&t);
if (hapd->last_sae_token_key_update == 0 ||
t.sec > hapd->last_sae_token_key_update + 60) {
random_get_bytes(hapd->sae_token_key,
sizeof(hapd->sae_token_key));
if (random_get_bytes(hapd->sae_token_key,
sizeof(hapd->sae_token_key)) < 0)
return NULL;
wpa_hexdump(MSG_DEBUG, "SAE: Updated token key",
hapd->sae_token_key, sizeof(hapd->sae_token_key));
hapd->last_sae_token_key_update = t.sec;