Browse Source

[802.11] Use rbg_generate() for secure random numbers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
554627c960
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/net/80211/wpa.c

+ 3
- 1
src/net/80211/wpa.c View File

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

Loading…
Cancel
Save