]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[802.11] Use rbg_generate() for secure random numbers
authorMichael Brown <mcb30@ipxe.org>
Tue, 13 Mar 2012 04:40:19 +0000 (04:40 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 13 Mar 2012 15:58:04 +0000 (15:58 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/80211/wpa.c

index 90929ea3a05697de15ac88ace85cce0eb377cb07..45def8c1df915619ce414b22dc8ada444cae21b0 100644 (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;
        }