diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-04-30 16:57:53 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-05-06 11:43:32 +0100 |
commit | d382e79632677f2457025be3d820e08d7ea12d85 (patch) | |
tree | 3a429b630ec1cce9656ee67434324c6930c677f4 /apps/x509.c | |
parent | b86fa8c55682169c88e14e616170d6caeb208865 (diff) |
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/x509.c')
-rw-r--r-- | apps/x509.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/x509.c b/apps/x509.c index a9c5d41096..9632d72260 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -266,9 +266,9 @@ int x509_main(int argc, char **argv) char *prog; int days = UNSET_DAYS; /* not explicitly set */ int x509toreq = 0, modulus = 0, print_pubkey = 0, pprint = 0; - int CAformat = FORMAT_PEM, CAkeyformat = FORMAT_PEM; + int CAformat = FORMAT_UNDEF, CAkeyformat = FORMAT_UNDEF; int fingerprint = 0, reqfile = 0, checkend = 0; - int informat = FORMAT_PEM, outformat = FORMAT_PEM, keyformat = FORMAT_PEM; + int informat = FORMAT_UNDEF, outformat = FORMAT_PEM, keyformat = FORMAT_UNDEF; int next_serial = 0, subject_hash = 0, issuer_hash = 0, ocspid = 0; int noout = 0, CA_createserial = 0, email = 0; int ocsp_uri = 0, trustout = 0, clrtrust = 0, clrreject = 0, aliasout = 0; @@ -719,7 +719,7 @@ int x509_main(int argc, char **argv) } } } else { - x = load_cert_pass(infile, 1, passin, "certificate"); + x = load_cert_pass(infile, informat, 1, passin, "certificate"); if (x == NULL) goto end; } @@ -734,7 +734,7 @@ int x509_main(int argc, char **argv) goto end; if (CAfile != NULL) { - xca = load_cert_pass(CAfile, 1, passin, "CA certificate"); + xca = load_cert_pass(CAfile, CAformat, 1, passin, "CA certificate"); if (xca == NULL) goto end; } |