diff options
author | Rich Salz <rsalz@openssl.org> | 2017-04-07 12:39:02 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-05-27 13:07:07 -0400 |
commit | b4d6f713d6c5b55a2887d79435490a503da39ae5 (patch) | |
tree | 1f7933ed63dec011d5728e369f34b5bc1c317347 /crypto/dsa | |
parent | ab6abae63c701d6d3a5760d881b9bee235620e4b (diff) |
Make default_method mostly compile-time
Document thread-safety issues
Cherry-pick from 076fc55527a1499391fa6de109c8387895199ee9 but
keeps the RSA_null method.
Reviewed-by: Geoff Thorpe <geoff@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3146)
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_lib.c | 14 | ||||
-rw-r--r-- | crypto/dsa/dsa_ossl.c | 12 |
2 files changed, 12 insertions, 14 deletions
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 42324c70fb..9598846e3b 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -17,20 +17,6 @@ #include <openssl/engine.h> #include <openssl/dh.h> -static const DSA_METHOD *default_DSA_method = NULL; - -void DSA_set_default_method(const DSA_METHOD *meth) -{ - default_DSA_method = meth; -} - -const DSA_METHOD *DSA_get_default_method(void) -{ - if (!default_DSA_method) - default_DSA_method = DSA_OpenSSL(); - return default_DSA_method; -} - DSA *DSA_new(void) { return DSA_new_method(NULL); diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c index f9f6a136fb..479337763b 100644 --- a/crypto/dsa/dsa_ossl.c +++ b/crypto/dsa/dsa_ossl.c @@ -41,6 +41,18 @@ static DSA_METHOD openssl_dsa_meth = { NULL }; +static const DSA_METHOD *default_DSA_method = &openssl_dsa_meth; + +void DSA_set_default_method(const DSA_METHOD *meth) +{ + default_DSA_method = meth; +} + +const DSA_METHOD *DSA_get_default_method(void) +{ + return default_DSA_method; +} + const DSA_METHOD *DSA_OpenSSL(void) { return &openssl_dsa_meth; |