summaryrefslogtreecommitdiff
path: root/apps/cmp.c
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-04-30 16:57:53 +0200
committerMatt Caswell <matt@openssl.org>2021-05-06 11:43:32 +0100
commitd382e79632677f2457025be3d820e08d7ea12d85 (patch)
tree3a429b630ec1cce9656ee67434324c6930c677f4 /apps/cmp.c
parentb86fa8c55682169c88e14e616170d6caeb208865 (diff)
downloadopenssl-new-d382e79632677f2457025be3d820e08d7ea12d85.tar.gz
Make the -inform option to be respected if possible
Add OSSL_STORE_PARAM_INPUT_TYPE and make it possible to be set when OSSL_STORE_open_ex() or OSSL_STORE_attach() is called. The input type format is enforced only in case the file type file store is used. By default we use FORMAT_UNDEF meaning the input type is not enforced. Fixes #14569 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15100)
Diffstat (limited to 'apps/cmp.c')
-rw-r--r--apps/cmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/cmp.c b/apps/cmp.c
index fdd0043311..f64cb8c813 100644
--- a/apps/cmp.c
+++ b/apps/cmp.c
@@ -131,8 +131,8 @@ static int opt_revreason = CRL_REASON_NONE;
/* credentials format */
static char *opt_certform_s = "PEM";
static int opt_certform = FORMAT_PEM;
-static char *opt_keyform_s = "PEM";
-static int opt_keyform = FORMAT_PEM;
+static char *opt_keyform_s = NULL;
+static int opt_keyform = FORMAT_UNDEF;
static char *opt_otherpass = NULL;
static char *opt_engine = NULL;
@@ -635,7 +635,7 @@ static X509 *load_cert_pwd(const char *uri, const char *pass, const char *desc)
X509 *cert;
char *pass_string = get_passwd(pass, desc);
- cert = load_cert_pass(uri, 0, pass_string, desc);
+ cert = load_cert_pass(uri, FORMAT_UNDEF, 0, pass_string, desc);
clear_free(pass_string);
return cert;
}