diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2022-05-30 16:53:05 +0200 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2022-07-14 07:23:58 +0100 |
commit | ec8a3409487c871b440fa52bff7c3ef33378494a (patch) | |
tree | 0a6b5b97453598924479be779e8004d68796a83b /apps/ca.c | |
parent | 10c7887330bb6ca136cd16fe081639f4462a072e (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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |