diff options
| author | jsing <> | 2014-10-18 16:13:16 +0000 | 
|---|---|---|
| committer | jsing <> | 2014-10-18 16:13:16 +0000 | 
| commit | e5f7da89ad91edc7b49a86c9e81df055d649d6da (patch) | |
| tree | 0ec0407532b236ff11b9134f214f8db715d84e63 /src/lib/libssl/t1_srvr.c | |
| parent | 4c6f8c571ce55eaa0d8cf775bcc329734429e32d (diff) | |
| download | openbsd-e5f7da89ad91edc7b49a86c9e81df055d649d6da.tar.gz openbsd-e5f7da89ad91edc7b49a86c9e81df055d649d6da.tar.bz2 openbsd-e5f7da89ad91edc7b49a86c9e81df055d649d6da.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 '')
| -rw-r--r-- | src/lib/libssl/t1_srvr.c | 3 | 
1 files changed, 1 insertions, 2 deletions
| diff --git a/src/lib/libssl/t1_srvr.c b/src/lib/libssl/t1_srvr.c index 99712b6fb6..ba579dd110 100644 --- a/src/lib/libssl/t1_srvr.c +++ b/src/lib/libssl/t1_srvr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: t1_srvr.c,v 1.14 2014/08/10 14:42:56 jsing Exp $ */ | 1 | /* $OpenBSD: t1_srvr.c,v 1.15 2014/10/18 16:13:16 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 | * | 
| @@ -59,7 +59,6 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> | 
| 60 | #include "ssl_locl.h" | 60 | #include "ssl_locl.h" | 
| 61 | #include <openssl/buffer.h> | 61 | #include <openssl/buffer.h> | 
| 62 | #include <openssl/rand.h> | ||
| 63 | #include <openssl/objects.h> | 62 | #include <openssl/objects.h> | 
| 64 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> | 
| 65 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> | 
