summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/dsa/dsa_gen.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-10-22 13:02:03 +0000
committerjsing <jsing@openbsd.org>2014-10-22 13:02:03 +0000
commitef624301d95e1d2367e46a80103e7ba867cb892f (patch)
treee7fb573ba5a2197cf6381ea6fe87308de30b6b53 /lib/libssl/src/crypto/dsa/dsa_gen.c
parentIntroduce a special hack for carp during IPv6 source address selection: (diff)
downloadwireguard-openbsd-ef624301d95e1d2367e46a80103e7ba867cb892f.tar.xz
wireguard-openbsd-ef624301d95e1d2367e46a80103e7ba867cb892f.zip
Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().
arc4random_buf() is guaranteed to always succeed - it is worth noting that a number of the replaced function calls were already missing return value checks. ok deraadt@
Diffstat (limited to 'lib/libssl/src/crypto/dsa/dsa_gen.c')
-rw-r--r--lib/libssl/src/crypto/dsa/dsa_gen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libssl/src/crypto/dsa/dsa_gen.c b/lib/libssl/src/crypto/dsa/dsa_gen.c
index a3d07b901a6..296a544c319 100644
--- a/lib/libssl/src/crypto/dsa/dsa_gen.c
+++ b/lib/libssl/src/crypto/dsa/dsa_gen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_gen.c,v 1.16 2014/07/12 16:03:37 miod Exp $ */
+/* $OpenBSD: dsa_gen.c,v 1.17 2014/10/22 13:02:04 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -61,11 +61,11 @@
#ifndef OPENSSL_NO_SHA
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <openssl/bn.h>
#include <openssl/evp.h>
-#include <openssl/rand.h>
#include <openssl/sha.h>
#include "dsa_locl.h"
@@ -169,7 +169,7 @@ dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, const EVP_MD *evpmd,
goto err;
if (!seed_len) {
- RAND_pseudo_bytes(seed, qsize);
+ arc4random_buf(seed, qsize);
seed_is_random = 1;
} else {
seed_is_random = 0;