summaryrefslogtreecommitdiffstats
path: root/apps/x509.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-05-31 10:03:10 +0200
committerHugo Landau <hlandau@openssl.org>2022-07-14 07:26:37 +0100
commit3c85170e1c2d67ca7fac84af1cfd5cb33fc24abc (patch)
tree82aaf2c1d52c4b4ee001e96fe44433aa8d0caecb /apps/x509.c
parent8ff32e3ecb125fbdea5fad52848942f9a28f8839 (diff)
apps/x509: add warnings for options ignored when -CA is not specified
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18373) (cherry picked from commit c54a6a4b0ef664313fb07617d6a8c26a808719e0)
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/x509.c b/apps/x509.c
index ce7c65cc07..a919d78745 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -660,9 +660,19 @@ int x509_main(int argc, char **argv)
BIO_printf(bio_err, "Cannot use both -key/-signkey and -CA option\n");
goto end;
}
- } else if (CAkeyfile != NULL) {
- BIO_printf(bio_err,
- "Warning: ignoring -CAkey option since no -CA option is given\n");
+ } else {
+#define WARN_NO_CA(opt) BIO_printf(bio_err, \
+ "Warning: ignoring " opt " option since -CA option is not given\n");
+ if (CAkeyfile != NULL)
+ WARN_NO_CA("-CAkey");
+ if (CAkeyformat != FORMAT_UNDEF)
+ WARN_NO_CA("-CAkeyform");
+ if (CAformat != FORMAT_UNDEF)
+ WARN_NO_CA("-CAform");
+ if (CAserial != NULL)
+ WARN_NO_CA("-CAserial");
+ if (CA_createserial)
+ WARN_NO_CA("-CAcreateserial");
}
if (extfile == NULL) {