From 3a8d4a316eae09966c85e7e5befc682bd4744b34 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 15 Jan 2002 22:09:45 +0000 Subject: [PATCH] openssl 0.9.6a and higher don't have the RSA locking bug that earlier versions did, so don't disable precomputation. Note that while this was fixed for RSA, other algorithms still don't do locking when performing precomputation, and thus we still disable it. --- lib/dns/sec/dst/opensslrsa_link.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/dns/sec/dst/opensslrsa_link.c b/lib/dns/sec/dst/opensslrsa_link.c index b95c311713..28639e49a0 100644 --- a/lib/dns/sec/dst/opensslrsa_link.c +++ b/lib/dns/sec/dst/opensslrsa_link.c @@ -17,7 +17,7 @@ /* * Principal Author: Brian Wellington - * $Id: opensslrsa_link.c,v 1.19 2001/12/12 17:09:39 bwelling Exp $ + * $Id: opensslrsa_link.c,v 1.20 2002/01/15 22:09:45 bwelling Exp $ */ #ifdef OPENSSL @@ -39,6 +39,13 @@ #include #include +#if OPENSSL_VERSION_NUMBER < 0x0090601fL +#define SET_FLAGS(rsa) \ + (rsa)->flags &= ~(RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE); +#else +#define SET_FLAGS(rsa) do { } while (0); +#endif + static isc_result_t opensslrsa_todns(const dst_key_t *key, isc_buffer_t *data); static isc_result_t @@ -229,9 +236,7 @@ opensslrsa_generate(dst_key_t *key, int exp) { ERR_clear_error(); return (DST_R_OPENSSLFAILURE); } - - rsa->flags &= ~(RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE); - + SET_FLAGS(rsa); key->opaque = rsa; return (ISC_R_SUCCESS); @@ -304,7 +309,7 @@ opensslrsa_fromdns(dst_key_t *key, isc_buffer_t *data) { rsa = RSA_new(); if (rsa == NULL) return (ISC_R_NOMEMORY); - rsa->flags &= ~(RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE); + SET_FLAGS(rsa); if (r.length < 1) { RSA_free(rsa); @@ -443,7 +448,7 @@ opensslrsa_fromfile(dst_key_t *key, const char *filename) { rsa = RSA_new(); if (rsa == NULL) DST_RET(ISC_R_NOMEMORY); - rsa->flags &= ~(RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE); + SET_FLAGS(rsa); key->opaque = rsa; for (i = 0; i < priv.nelements; i++) {