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
 #include <ipxe/hmac.h>
29
 #include <ipxe/hmac.h>
30
 #include <ipxe/list.h>
30
 #include <ipxe/list.h>
31
 #include <ipxe/ethernet.h>
31
 #include <ipxe/ethernet.h>
32
+#include <ipxe/rbg.h>
32
 #include <stdlib.h>
33
 #include <stdlib.h>
33
 #include <string.h>
34
 #include <string.h>
34
 #include <errno.h>
35
 #include <errno.h>
515
 	ctx->state = WPA_WORKING;
516
 	ctx->state = WPA_WORKING;
516
 	memcpy ( ctx->Anonce, pkt->nonce, sizeof ( ctx->Anonce ) );
517
 	memcpy ( ctx->Anonce, pkt->nonce, sizeof ( ctx->Anonce ) );
517
 	if ( ! ctx->have_Snonce ) {
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
 		ctx->have_Snonce = 1;
521
 		ctx->have_Snonce = 1;
520
 	}
522
 	}
521
 
523
 

Loading…
Cancel
Save