summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/enc.c
diff options
context:
space:
mode:
authorjsing <>2014-10-22 13:54:03 +0000
committerjsing <>2014-10-22 13:54:03 +0000
commit85b016137f0bd9cf3b15129668f9d794a71c6d34 (patch)
tree5182be1e2bb99eb4ec60a5c42f2f953b4c1cadf1 /src/usr.bin/openssl/enc.c
parente931cb809e30a11ec87c1f47536227dc2f58dbdb (diff)
downloadopenbsd-85b016137f0bd9cf3b15129668f9d794a71c6d34.tar.gz
openbsd-85b016137f0bd9cf3b15129668f9d794a71c6d34.tar.bz2
openbsd-85b016137f0bd9cf3b15129668f9d794a71c6d34.zip
Use arc4random_buf() instead of RAND(_pseudo)?_bytes().
ok bcook@
Diffstat (limited to 'src/usr.bin/openssl/enc.c')
-rw-r--r--src/usr.bin/openssl/enc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usr.bin/openssl/enc.c b/src/usr.bin/openssl/enc.c
index 1a3b8f21b3..b5aaab9842 100644
--- a/src/usr.bin/openssl/enc.c
+++ b/src/usr.bin/openssl/enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: enc.c,v 1.2 2014/09/01 20:54:37 doug Exp $ */ 1/* $OpenBSD: enc.c,v 1.3 2014/10/22 13:54:03 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 *
@@ -69,7 +69,6 @@
69#include <openssl/evp.h> 69#include <openssl/evp.h>
70#include <openssl/objects.h> 70#include <openssl/objects.h>
71#include <openssl/pem.h> 71#include <openssl/pem.h>
72#include <openssl/rand.h>
73#include <openssl/x509.h> 72#include <openssl/x509.h>
74 73
75int set_hex(char *in, unsigned char *out, int size); 74int set_hex(char *in, unsigned char *out, int size);
@@ -461,8 +460,9 @@ enc_main(int argc, char **argv)
461 "invalid hex salt value\n"); 460 "invalid hex salt value\n");
462 goto end; 461 goto end;
463 } 462 }
464 } else if (RAND_pseudo_bytes(salt, sizeof salt) < 0) 463 } else
465 goto end; 464 arc4random_buf(salt,
465 sizeof(salt));
466 /* 466 /*
467 * If -P option then don't bother 467 * If -P option then don't bother
468 * writing 468 * writing