]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Remove some redundant error messages in the apps
authorMatt Caswell <matt@openssl.org>
Mon, 9 Nov 2020 10:48:56 +0000 (10:48 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 10 Nov 2020 14:04:58 +0000 (14:04 +0000)
We change the load_key() and load_pubkey() functions to make them more
consistent with the load_keyparams() function modified as a result of
PR #13317.

The error message on a NULL key is removed, because an error message has
already been displayed by load_key_certs_crls().

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13355)

apps/lib/apps.c

index b1158a9ebc36cb2e71fffcde24d0423b10d97e22..b790f60992a69a614ce91b4785a02a8ce7ad1863 100644 (file)
@@ -562,10 +562,6 @@ EVP_PKEY *load_key(const char *uri, int format, int may_stdin,
                                   &pkey, NULL, NULL, NULL, NULL, NULL, NULL);
     }
 
-    if (pkey == NULL) {
-        BIO_printf(bio_err, "Unable to load %s\n", desc);
-        ERR_print_errors(bio_err);
-    }
     return pkey;
 }
 
@@ -591,10 +587,7 @@ EVP_PKEY *load_pubkey(const char *uri, int format, int maybe_stdin,
         (void)load_key_certs_crls(uri, maybe_stdin, pass, desc,
                                   NULL, &pkey, NULL, NULL, NULL, NULL, NULL);
     }
-    if (pkey == NULL) {
-        BIO_printf(bio_err, "Unable to load %s\n", desc);
-        ERR_print_errors(bio_err);
-    }
+
     return pkey;
 }