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/rsa/rsa_lib.c | |
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/rsa/rsa_lib.c')
-rw-r--r-- | crypto/rsa/rsa_lib.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index 48e9100a97..e1377a0690 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -15,31 +15,9 @@ #include <openssl/engine.h> #include "rsa_locl.h" -static const RSA_METHOD *default_RSA_meth = NULL; - RSA *RSA_new(void) { - RSA *r = RSA_new_method(NULL); - - return r; -} - -void RSA_set_default_method(const RSA_METHOD *meth) -{ - default_RSA_meth = meth; -} - -const RSA_METHOD *RSA_get_default_method(void) -{ - if (default_RSA_meth == NULL) { -#ifdef RSA_NULL - default_RSA_meth = RSA_null_method(); -#else - default_RSA_meth = RSA_PKCS1_OpenSSL(); -#endif - } - - return default_RSA_meth; + return RSA_new_method(NULL); } const RSA_METHOD *RSA_get_method(const RSA *rsa) |