diff options
Diffstat (limited to '')
| -rw-r--r-- | src/usr.bin/openssl/rand.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/usr.bin/openssl/rand.c b/src/usr.bin/openssl/rand.c index dcc99e7392..6de2208b42 100644 --- a/src/usr.bin/openssl/rand.c +++ b/src/usr.bin/openssl/rand.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rand.c,v 1.4 2014/10/13 02:46:14 bcook Exp $ */ | 1 | /* $OpenBSD: rand.c,v 1.5 2014/10/22 13:54:03 jsing Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -61,7 +61,6 @@ | |||
| 61 | 61 | ||
| 62 | #include <openssl/bio.h> | 62 | #include <openssl/bio.h> |
| 63 | #include <openssl/err.h> | 63 | #include <openssl/err.h> |
| 64 | #include <openssl/rand.h> | ||
| 65 | 64 | ||
| 66 | struct { | 65 | struct { |
| 67 | int base64; | 66 | int base64; |
| @@ -171,9 +170,7 @@ rand_main(int argc, char **argv) | |||
| 171 | chunk = num; | 170 | chunk = num; |
| 172 | if (chunk > (int) sizeof(buf)) | 171 | if (chunk > (int) sizeof(buf)) |
| 173 | chunk = sizeof(buf); | 172 | chunk = sizeof(buf); |
| 174 | r = RAND_bytes(buf, chunk); | 173 | arc4random_buf(buf, chunk); |
| 175 | if (r <= 0) | ||
| 176 | goto err; | ||
| 177 | if (rand_config.hex) { | 174 | if (rand_config.hex) { |
| 178 | for (i = 0; i < chunk; i++) | 175 | for (i = 0; i < chunk; i++) |
| 179 | BIO_printf(out, "%02x", buf[i]); | 176 | BIO_printf(out, "%02x", buf[i]); |
