diff --git a/apps/cmp.c b/apps/cmp.c index 68edfd88daa586b899c4f972f8d30f4ade334623..17173374dfe016977d9d1b655ba3edb1bf3f71d6 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -2698,13 +2698,10 @@ int cmp_main(int argc, char **argv) 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) diff --git a/apps/include/apps_ui.h b/apps/include/apps_ui.h index 67d61e13965c56799d491df4262c32fc7645e1ba..59a82d5ecb0709bbddab0affe30ede339d7aa1eb 100644 --- a/apps/include/apps_ui.h +++ b/apps/include/apps_ui.h @@ -21,7 +21,7 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data); 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; diff --git a/apps/lib/apps_ui.c b/apps/lib/apps_ui.c index 880e9a4f6d84257e1a8c7eea00fe151df44872da..6c8c3de1967ff828debe5a1ebced1aa7e20e4d16 100644 --- a/apps/lib/apps_ui.c +++ b/apps/lib/apps_ui.c @@ -136,7 +136,7 @@ void destroy_ui_method(void) } } -const UI_METHOD *get_ui_method(void) +UI_METHOD *get_ui_method(void) { return ui_method; }