APPS: Modify apps/cmp.c to use set_base_ui_method() for its -batch option
authorRichard Levitte <levitte@openssl.org>
Wed, 25 Nov 2020 13:13:30 +0000 (14:13 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 26 Nov 2020 16:04:21 +0000 (17:04 +0100)
Fixes #13511

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13512)

apps/cmp.c

index 17173374dfe016977d9d1b655ba3edb1bf3f71d6..c9bbbb32ba85e2f3c0f8935485f0ef65e3f58617 100644 (file)
@@ -2697,12 +2697,8 @@ int cmp_main(int argc, char **argv)
         goto err;
     ret = 0;
 
-    if (opt_batch) {
-#ifndef OPENSSL_NO_UI_CONSOLE
-        UI_method_set_reader(UI_OpenSSL(), NULL);
-        /* can't change get_ui_method() here as load_key_certs_crls() uses it */
-#endif
-    }
+    if (opt_batch)
+        set_base_ui_method(UI_null());
 
     if (opt_engine != NULL)
         engine = setup_engine_methods(opt_engine, 0 /* not: ENGINE_METHOD_ALL */, 0);