]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Check random_get_bytes() return value
authorJouni Malinen <j@w1.fi>
Tue, 1 Jan 2013 18:25:38 +0000 (20:25 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 12 Jan 2013 15:51:53 +0000 (17:51 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

src/ap/ieee802_11.c

index ea19cdde6e7bee4383ff301cec7c3726c6e09a17..95bdc676c7a29ef5ee2286bbe9df71fb4aa35524 100644 (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;