From: Jouni Malinen Date: Tue, 1 Jan 2013 18:25:38 +0000 (+0200) Subject: SAE: Check random_get_bytes() return value X-Git-Tag: aosp-kk-from-upstream~667 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a50414c322395495f96b58ba7d8b381fa46c3f5a;p=thirdparty%2Fhostap.git SAE: Check random_get_bytes() return value Signed-hostap: Jouni Malinen --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index ea19cdde6..95bdc676c 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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;