summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-05-30 16:53:05 +0200
committerHugo Landau <hlandau@openssl.org>2022-07-14 07:23:58 +0100
commitec8a3409487c871b440fa52bff7c3ef33378494a (patch)
tree0a6b5b97453598924479be779e8004d68796a83b /apps/ca.c
parent10c7887330bb6ca136cd16fe081639f4462a072e (diff)
APPS/x509: With -CA but both -CAserial and -CAcreateserial not given, use random serial.
Also improve openssl-x509.pod.in and error handling of load_serial() in apps.c. 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)
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 460099a63e..ff4a8d91e8 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -925,7 +925,8 @@ end_of_options:
goto end;
}
} else {
- if ((serial = load_serial(serialfile, create_ser, NULL)) == NULL) {
+ serial = load_serial(serialfile, NULL, create_ser, NULL);
+ if (serial == NULL) {
BIO_printf(bio_err, "error while loading serial number\n");
goto end;
}
@@ -1165,7 +1166,8 @@ end_of_options:
if ((crlnumberfile = NCONF_get_string(conf, section, ENV_CRLNUMBER))
!= NULL)
- if ((crlnumber = load_serial(crlnumberfile, 0, NULL)) == NULL) {
+ if ((crlnumber = load_serial(crlnumberfile, NULL, 0, NULL))
+ == NULL) {
BIO_printf(bio_err, "error while loading CRL number\n");
goto end;
}