summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinoguchi <>2021-07-15 10:15:22 +0000
committerinoguchi <>2021-07-15 10:15:22 +0000
commit726f5c0bc40668607a34efc5f6ba365baecc53b2 (patch)
treed9afb2e743d64f0c1143ee57e8a2174f87cad6e3 /src
parent174f2ffd983f36fed849facf7e7aaf30866d10d7 (diff)
downloadopenbsd-726f5c0bc40668607a34efc5f6ba365baecc53b2.tar.gz
openbsd-726f5c0bc40668607a34efc5f6ba365baecc53b2.tar.bz2
openbsd-726f5c0bc40668607a34efc5f6ba365baecc53b2.zip
Use 'serial' rather than 'ser' in ca.c
input from jsing@
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/ca.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c
index 8d1ea25470..038fe86be9 100644
--- a/src/usr.bin/openssl/ca.c
+++ b/src/usr.bin/openssl/ca.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ca.c,v 1.29 2021/07/15 09:56:32 inoguchi Exp $ */ 1/* $OpenBSD: ca.c,v 1.30 2021/07/15 10:15:22 inoguchi Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -151,7 +151,7 @@ static int do_body(X509 ** xret, EVP_PKEY * pkey, X509 * x509,
151 char *ext_sect, CONF * conf, unsigned long certopt, unsigned long nameopt, 151 char *ext_sect, CONF * conf, unsigned long certopt, unsigned long nameopt,
152 int default_op, int ext_copy, int selfsign); 152 int default_op, int ext_copy, int selfsign);
153static int do_revoke(X509 * x509, CA_DB * db, int ext, char *extval); 153static int do_revoke(X509 * x509, CA_DB * db, int ext, char *extval);
154static int get_certificate_status(const char *ser_status, CA_DB * db); 154static int get_certificate_status(const char *serial, CA_DB * db);
155static int do_updatedb(CA_DB * db); 155static int do_updatedb(CA_DB * db);
156static int check_time_format(const char *str); 156static int check_time_format(const char *str);
157static char * bin2hex(unsigned char *, size_t); 157static char * bin2hex(unsigned char *, size_t);
@@ -167,7 +167,7 @@ static struct {
167 char *certfile; 167 char *certfile;
168 unsigned long chtype; 168 unsigned long chtype;
169 char *configfile; 169 char *configfile;
170 int create_ser; 170 int create_serial;
171 char *crl_ext; 171 char *crl_ext;
172 long crldays; 172 long crldays;
173 long crlhours; 173 long crlhours;
@@ -198,7 +198,7 @@ static struct {
198 int req; 198 int req;
199 char *rev_arg; 199 char *rev_arg;
200 int rev_type; 200 int rev_type;
201 char *ser_status; 201 char *serial_status;
202 char *section; 202 char *section;
203 int selfsign; 203 int selfsign;
204 STACK_OF(OPENSSL_STRING) * sigopts; 204 STACK_OF(OPENSSL_STRING) * sigopts;
@@ -329,7 +329,7 @@ static const struct option ca_options[] = {
329 .name = "create_serial", 329 .name = "create_serial",
330 .desc = "If reading serial fails, create a new random serial", 330 .desc = "If reading serial fails, create a new random serial",
331 .type = OPTION_FLAG, 331 .type = OPTION_FLAG,
332 .opt.flag = &ca_config.create_ser, 332 .opt.flag = &ca_config.create_serial,
333 }, 333 },
334 { 334 {
335 .name = "crl_CA_compromise", 335 .name = "crl_CA_compromise",
@@ -577,7 +577,7 @@ static const struct option ca_options[] = {
577 .argname = "serial", 577 .argname = "serial",
578 .desc = "Shows certificate status given the serial number", 578 .desc = "Shows certificate status given the serial number",
579 .type = OPTION_ARG, 579 .type = OPTION_ARG,
580 .opt.arg = &ca_config.ser_status, 580 .opt.arg = &ca_config.serial_status,
581 }, 581 },
582 { 582 {
583 .name = "subj", 583 .name = "subj",
@@ -674,7 +674,7 @@ ca_main(int argc, char **argv)
674 X509_CRL *crl = NULL; 674 X509_CRL *crl = NULL;
675 X509_REVOKED *r = NULL; 675 X509_REVOKED *r = NULL;
676 ASN1_TIME *tmptm; 676 ASN1_TIME *tmptm;
677 ASN1_INTEGER *tmpser; 677 ASN1_INTEGER *tmpserial;
678 char *f; 678 char *f;
679 const char *p; 679 const char *p;
680 char *const * pp; 680 char *const * pp;
@@ -798,7 +798,7 @@ ca_main(int argc, char **argv)
798 } 798 }
799 /*****************************************************************/ 799 /*****************************************************************/
800 /* report status of cert with serial number given on command line */ 800 /* report status of cert with serial number given on command line */
801 if (ca_config.ser_status) { 801 if (ca_config.serial_status) {
802 if ((dbfile = NCONF_get_string(conf, ca_config.section, 802 if ((dbfile = NCONF_get_string(conf, ca_config.section,
803 ENV_DATABASE)) == NULL) { 803 ENV_DATABASE)) == NULL) {
804 lookup_fail(ca_config.section, ENV_DATABASE); 804 lookup_fail(ca_config.section, ENV_DATABASE);
@@ -811,9 +811,9 @@ ca_main(int argc, char **argv)
811 if (!index_index(db)) 811 if (!index_index(db))
812 goto err; 812 goto err;
813 813
814 if (get_certificate_status(ca_config.ser_status, db) != 1) 814 if (get_certificate_status(ca_config.serial_status, db) != 1)
815 BIO_printf(bio_err, "Error verifying serial %s!\n", 815 BIO_printf(bio_err, "Error verifying serial %s!\n",
816 ca_config.ser_status); 816 ca_config.serial_status);
817 goto err; 817 goto err;
818 } 818 }
819 /*****************************************************************/ 819 /*****************************************************************/
@@ -1131,7 +1131,7 @@ ca_main(int argc, char **argv)
1131 "cannot lookup how many days to certify for\n"); 1131 "cannot lookup how many days to certify for\n");
1132 goto err; 1132 goto err;
1133 } 1133 }
1134 if ((serial = load_serial(serialfile, ca_config.create_ser, NULL)) == 1134 if ((serial = load_serial(serialfile, ca_config.create_serial, NULL)) ==
1135 NULL) { 1135 NULL) {
1136 BIO_printf(bio_err, 1136 BIO_printf(bio_err,
1137 "error while loading serial number\n"); 1137 "error while loading serial number\n");
@@ -1403,13 +1403,13 @@ ca_main(int argc, char **argv)
1403 crl_v2 = 1; 1403 crl_v2 = 1;
1404 if (!BN_hex2bn(&serial, pp[DB_serial])) 1404 if (!BN_hex2bn(&serial, pp[DB_serial]))
1405 goto err; 1405 goto err;
1406 tmpser = BN_to_ASN1_INTEGER(serial, NULL); 1406 tmpserial = BN_to_ASN1_INTEGER(serial, NULL);
1407 BN_free(serial); 1407 BN_free(serial);
1408 serial = NULL; 1408 serial = NULL;
1409 if (!tmpser) 1409 if (!tmpserial)
1410 goto err; 1410 goto err;
1411 X509_REVOKED_set_serialNumber(r, tmpser); 1411 X509_REVOKED_set_serialNumber(r, tmpserial);
1412 ASN1_INTEGER_free(tmpser); 1412 ASN1_INTEGER_free(tmpserial);
1413 X509_CRL_add0_revoked(crl, r); 1413 X509_CRL_add0_revoked(crl, r);
1414 } 1414 }
1415 } 1415 }
@@ -1435,12 +1435,12 @@ ca_main(int argc, char **argv)
1435 ca_config.crl_ext, crl)) 1435 ca_config.crl_ext, crl))
1436 goto err; 1436 goto err;
1437 if (crlnumberfile != NULL) { 1437 if (crlnumberfile != NULL) {
1438 tmpser = BN_to_ASN1_INTEGER(crlnumber, NULL); 1438 tmpserial = BN_to_ASN1_INTEGER(crlnumber, NULL);
1439 if (!tmpser) 1439 if (!tmpserial)
1440 goto err; 1440 goto err;
1441 X509_CRL_add1_ext_i2d(crl, NID_crl_number, 1441 X509_CRL_add1_ext_i2d(crl, NID_crl_number,
1442 tmpser, 0, 0); 1442 tmpserial, 0, 0);
1443 ASN1_INTEGER_free(tmpser); 1443 ASN1_INTEGER_free(tmpserial);
1444 crl_v2 = 1; 1444 crl_v2 = 1;
1445 if (!BN_add_word(crlnumber, 1)) 1445 if (!BN_add_word(crlnumber, 1))
1446 goto err; 1446 goto err;