summaryrefslogtreecommitdiff
path: root/lib/dns/openssl_link.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dns/openssl_link.c')
-rw-r--r--lib/dns/openssl_link.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c
index fda610a0..b12e3ea2 100644
--- a/lib/dns/openssl_link.c
+++ b/lib/dns/openssl_link.c
@@ -18,7 +18,7 @@
/*
* Principal Author: Brian Wellington
- * $Id: openssl_link.c,v 1.1.6.9 2006/05/23 23:51:04 marka Exp $
+ * $Id: openssl_link.c,v 1.12 2006/12/13 23:56:24 marka Exp $
*/
#ifdef OPENSSL
@@ -50,6 +50,7 @@
#endif
static RAND_METHOD *rm = NULL;
+
static isc_mutex_t *locks = NULL;
static int nlocks;
@@ -57,7 +58,6 @@ static int nlocks;
static ENGINE *e;
#endif
-
static int
entropy_get(unsigned char *buf, int num) {
isc_result_t result;
@@ -68,6 +68,11 @@ entropy_get(unsigned char *buf, int num) {
}
static int
+entropy_status(void) {
+ return (dst__entropy_status() > 32);
+}
+
+static int
entropy_getpseudo(unsigned char *buf, int num) {
isc_result_t result;
if (num < 0)
@@ -149,6 +154,7 @@ dst__openssl_init() {
goto cleanup_mutexalloc;
CRYPTO_set_locking_callback(lock_callback);
CRYPTO_set_id_callback(id_callback);
+
rm = mem_alloc(sizeof(RAND_METHOD));
if (rm == NULL) {
result = ISC_R_NOMEMORY;
@@ -159,7 +165,7 @@ dst__openssl_init() {
rm->cleanup = NULL;
rm->add = entropy_add;
rm->pseudorand = entropy_getpseudo;
- rm->status = NULL;
+ rm->status = entropy_status;
#ifdef USE_ENGINE
e = ENGINE_new();
if (e == NULL) {
@@ -170,7 +176,7 @@ dst__openssl_init() {
RAND_set_rand_method(rm);
#else
RAND_set_rand_method(rm);
-#endif
+#endif /* USE_ENGINE */
return (ISC_R_SUCCESS);
#ifdef USE_ENGINE