summaryrefslogtreecommitdiff
path: root/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-10-18 16:13:17 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-10-18 16:13:17 +0000
commit3465ce2c19b9ddffe3dd38ffa43cb0c34a887fc0 (patch)
tree2ea8a086dee1ff8f7cfe139f44085ae62a3167d0 /lib/libssl/t1_lib.c
parent7a7f4302a87b8f5db4f5b202649ea5e3fa7d0f57 (diff)
Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().
arc4random provides high quality pseudo-random numbers, hence there is no need to differentiate between "strong" and "pseudo". Furthermore, the arc4random_buf() function is guaranteed to succeed, which avoids the need to check for and handle failure, simplifying the code. It is worth noting that a number of the replaced RAND_bytes() and RAND_pseudo_bytes() calls were missing return value checks and these functions can fail for a number of reasons (at least in OpenSSL - thankfully they were converted to wrappers around arc4random_buf() some time ago in LibreSSL). ok beck@ deraadt@ miod@
Diffstat (limited to 'lib/libssl/t1_lib.c')
-rw-r--r--lib/libssl/t1_lib.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c
index 22e84fe1223..604187f2feb 100644
--- a/lib/libssl/t1_lib.c
+++ b/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t1_lib.c,v 1.64 2014/10/15 14:02:16 jsing Exp $ */
+/* $OpenBSD: t1_lib.c,v 1.65 2014/10/18 16:13:16 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -115,7 +115,6 @@
#include <openssl/hmac.h>
#include <openssl/objects.h>
#include <openssl/ocsp.h>
-#include <openssl/rand.h>
#include "ssl_locl.h"