summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rand
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rand')
-rw-r--r--src/lib/libcrypto/rand/rand_lib.c6
-rw-r--r--src/lib/libcrypto/rand/randfile.c5
2 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c
index 2b2c827740..8342a55f05 100644
--- a/src/lib/libcrypto/rand/rand_lib.c
+++ b/src/lib/libcrypto/rand/rand_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rand_lib.c,v 1.19 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: rand_lib.c,v 1.20 2014/10/22 13:02:04 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 3 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4 * 4 *
@@ -15,12 +15,12 @@
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17 17
18#include <stdlib.h>
19
18#include <openssl/opensslconf.h> 20#include <openssl/opensslconf.h>
19 21
20#include <openssl/rand.h> 22#include <openssl/rand.h>
21 23
22#include <stdlib.h>
23
24/* 24/*
25 * The useful functions in this file are at the bottom. 25 * The useful functions in this file are at the bottom.
26 */ 26 */
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c
index dca49b10aa..e54a009420 100644
--- a/src/lib/libcrypto/rand/randfile.c
+++ b/src/lib/libcrypto/rand/randfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: randfile.c,v 1.39 2014/07/14 00:01:39 deraadt Exp $ */ 1/* $OpenBSD: randfile.c,v 1.40 2014/10/22 13:02:04 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -118,8 +118,7 @@ RAND_write_file(const char *file)
118 for (;;) { 118 for (;;) {
119 i = (n > BUFSIZE) ? BUFSIZE : n; 119 i = (n > BUFSIZE) ? BUFSIZE : n;
120 n -= BUFSIZE; 120 n -= BUFSIZE;
121 if (RAND_bytes(buf, i) <= 0) 121 arc4random_buf(buf, i);
122 rand_err = 1;
123 i = fwrite(buf, 1, i, out); 122 i = fwrite(buf, 1, i, out);
124 if (i <= 0) { 123 if (i <= 0) {
125 ret = 0; 124 ret = 0;