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:26:34 +0100 |
commit | b74fc77b447ad6dd47a5d3dbe1dfedde75ff6278 (patch) | |
tree | 675862bbaf7acd0c00481782e49de6b418751bea /apps/ca.c | |
parent | fcdd41fea3ed56660ce03cec7f07217c99d90d31 (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)
(cherry picked from commit ec8a3409487c871b440fa52bff7c3ef33378494a)
Diffstat (limited to 'apps/ca.c')
-rw-r--r-- | apps/ca.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -922,7 +922,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; } @@ -1162,7 +1163,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; } |