diff options
author | Rich Salz <rsalz@openssl.org> | 2017-04-07 12:07:42 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-04-07 12:19:46 -0400 |
commit | 076fc55527a1499391fa6de109c8387895199ee9 (patch) | |
tree | 8a7d5eba7a2baf36080d6f4925dee48157a2e304 /crypto/ui | |
parent | 2f881d2d9065342454fe352eac9e835cefa0ba90 (diff) |
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/ui')
-rw-r--r-- | crypto/ui/ui_lib.c | 15 | ||||
-rw-r--r-- | crypto/ui/ui_openssl.c | 12 |
2 files changed, 12 insertions, 15 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index 7f30a5b0af..e48e4add1d 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -15,8 +15,6 @@ #include <openssl/err.h> #include "ui_locl.h" -static const UI_METHOD *default_UI_meth = NULL; - UI *UI_new(void) { return (UI_new_method(NULL)); @@ -535,19 +533,6 @@ void *UI_get_ex_data(UI *r, int idx) return (CRYPTO_get_ex_data(&r->ex_data, idx)); } -void UI_set_default_method(const UI_METHOD *meth) -{ - default_UI_meth = meth; -} - -const UI_METHOD *UI_get_default_method(void) -{ - if (default_UI_meth == NULL) { - default_UI_meth = UI_OpenSSL(); - } - return default_UI_meth; -} - const UI_METHOD *UI_get_method(UI *ui) { return ui->meth; diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index 400b0562f4..42c932656c 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -202,6 +202,18 @@ static UI_METHOD ui_openssl = { NULL }; +static const UI_METHOD *default_UI_meth = &ui_openssl; + +void UI_set_default_method(const UI_METHOD *meth) +{ + default_UI_meth = meth; +} + +const UI_METHOD *UI_get_default_method(void) +{ + return default_UI_meth; +} + /* The method with all the built-in thingies */ UI_METHOD *UI_OpenSSL(void) { |