summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/ssl/s3_both.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-10-18 16:13:16 +0000
committerjsing <jsing@openbsd.org>2014-10-18 16:13:16 +0000
commit2a423e6aaa833911b411f5d8bd9e83e4b6a9852b (patch)
treea511a4987f7b972abfef83e5a878713acc1e5697 /lib/libssl/src/ssl/s3_both.c
parentplug file descriptor leaks on read or write failure; (diff)
downloadwireguard-openbsd-2a423e6aaa833911b411f5d8bd9e83e4b6a9852b.tar.xz
wireguard-openbsd-2a423e6aaa833911b411f5d8bd9e83e4b6a9852b.zip
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/src/ssl/s3_both.c')
-rw-r--r--lib/libssl/src/ssl/s3_both.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libssl/src/ssl/s3_both.c b/lib/libssl/src/ssl/s3_both.c
index 6d108c295bb..cd0a4b8013a 100644
--- a/lib/libssl/src/ssl/s3_both.c
+++ b/lib/libssl/src/ssl/s3_both.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_both.c,v 1.30 2014/09/22 13:18:50 jsing Exp $ */
+/* $OpenBSD: s3_both.c,v 1.31 2014/10/18 16:13:16 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -119,7 +119,6 @@
#include <stdio.h>
#include "ssl_locl.h"
#include <openssl/buffer.h>
-#include <openssl/rand.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/x509.h>