Also make clear we cannot use get_ui_method() at this point.
Fixes #13494
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13497)
ret = 0;
if (opt_batch) {
- UI_METHOD *ui_fallback_method;
#ifndef OPENSSL_NO_UI_CONSOLE
- ui_fallback_method = UI_OpenSSL();
-#else
- ui_fallback_method = (UI_METHOD *)UI_null();
+ UI_method_set_reader(UI_OpenSSL(), NULL);
+ /* can't change get_ui_method() here as load_key_certs_crls() uses it */
#endif
- UI_method_set_reader(ui_fallback_method, NULL);
}
if (opt_engine != NULL)
int setup_ui_method(void);
void destroy_ui_method(void);
-const UI_METHOD *get_ui_method(void);
+UI_METHOD *get_ui_method(void);
extern BIO *bio_err;
}
}
-const UI_METHOD *get_ui_method(void)
+UI_METHOD *get_ui_method(void)
{
return ui_method;
}