aboutsummaryrefslogtreecommitdiff
path: root/crypto/dh/dh_key.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-04-07 12:07:42 -0400
committerRich Salz <rsalz@openssl.org>2017-04-07 12:19:46 -0400
commit076fc55527a1499391fa6de109c8387895199ee9 (patch)
tree8a7d5eba7a2baf36080d6f4925dee48157a2e304 /crypto/dh/dh_key.c
parent2f881d2d9065342454fe352eac9e835cefa0ba90 (diff)
downloadopenssl-076fc55527a1499391fa6de109c8387895199ee9.zip
openssl-076fc55527a1499391fa6de109c8387895199ee9.tar.gz
openssl-076fc55527a1499391fa6de109c8387895199ee9.tar.bz2
Make default_method mostly compile-time
Document thread-safety issues Have RSA_null return NULL (always fails) Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2244)
Diffstat (limited to 'crypto/dh/dh_key.c')
-rw-r--r--crypto/dh/dh_key.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
index 204e5a7..fce9ff4 100644
--- a/crypto/dh/dh_key.c
+++ b/crypto/dh/dh_key.c
@@ -56,11 +56,23 @@ static DH_METHOD dh_ossl = {
NULL
};
+static const DH_METHOD *default_DH_method = &dh_ossl;
+
const DH_METHOD *DH_OpenSSL(void)
{
return &dh_ossl;
}
+void DH_set_default_method(const DH_METHOD *meth)
+{
+ default_DH_method = meth;
+}
+
+const DH_METHOD *DH_get_default_method(void)
+{
+ return default_DH_method;
+}
+
static int generate_key(DH *dh)
{
int ok = 0;