david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[802.11] Use rbg_generate() for secure random numbers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2012-03-13 04:40:19 +00:00
parent a0e559d1f3
commit 554627c960
1 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/hmac.h>
#include <ipxe/list.h>
#include <ipxe/ethernet.h>
#include <ipxe/rbg.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@ -515,7 +516,8 @@ static int wpa_handle_1_of_4 ( struct wpa_common_ctx *ctx,
ctx->state = WPA_WORKING;
memcpy ( ctx->Anonce, pkt->nonce, sizeof ( ctx->Anonce ) );
if ( ! ctx->have_Snonce ) {
get_random_bytes ( ctx->Snonce, sizeof ( ctx->Snonce ) );
rbg_generate ( NULL, 0, 0, ctx->Snonce,
sizeof ( ctx->Snonce ) );
ctx->have_Snonce = 1;
}