summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinoguchi <>2021-09-02 11:37:44 +0000
committerinoguchi <>2021-09-02 11:37:44 +0000
commitb2715265ab668762e0c33452b4ef245ea07954e6 (patch)
treed1477746c200d76b574ea3a2542cbef361c2dca9
parent72ba0c33c49500a675ce77a5d6b0ce33920360d1 (diff)
downloadopenbsd-b2715265ab668762e0c33452b4ef245ea07954e6.tar.gz
openbsd-b2715265ab668762e0c33452b4ef245ea07954e6.tar.bz2
openbsd-b2715265ab668762e0c33452b4ef245ea07954e6.zip
Use defined constants
-rw-r--r--src/usr.bin/openssl/ca.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c
index dcfa67ae56..f9faf5395b 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.44 2021/09/02 11:07:56 inoguchi Exp $ */ 1/* $OpenBSD: ca.c,v 1.45 2021/09/02 11:37:44 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 *
@@ -2152,16 +2152,16 @@ do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
2152 if (rrow != NULL) { 2152 if (rrow != NULL) {
2153 BIO_printf(bio_err, 2153 BIO_printf(bio_err,
2154 "The matching entry has the following details\n"); 2154 "The matching entry has the following details\n");
2155 if (rrow[DB_type][0] == 'E') 2155 if (rrow[DB_type][0] == DB_TYPE_EXP)
2156 p = "Expired"; 2156 p = "Expired";
2157 else if (rrow[DB_type][0] == 'R') 2157 else if (rrow[DB_type][0] == DB_TYPE_REV)
2158 p = "Revoked"; 2158 p = "Revoked";
2159 else if (rrow[DB_type][0] == 'V') 2159 else if (rrow[DB_type][0] == DB_TYPE_VAL)
2160 p = "Valid"; 2160 p = "Valid";
2161 else 2161 else
2162 p = "\ninvalid type, Data base error\n"; 2162 p = "\ninvalid type, Data base error\n";
2163 BIO_printf(bio_err, "Type :%s\n", p); 2163 BIO_printf(bio_err, "Type :%s\n", p);
2164 if (rrow[DB_type][0] == 'R') { 2164 if (rrow[DB_type][0] == DB_TYPE_REV) {
2165 p = rrow[DB_exp_date]; 2165 p = rrow[DB_exp_date];
2166 if (p == NULL) 2166 if (p == NULL)
2167 p = "undef"; 2167 p = "undef";
@@ -2260,7 +2260,7 @@ do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
2260 goto err; 2260 goto err;
2261 } 2261 }
2262 (void) strlcpy(row[DB_file], "unknown", 8); 2262 (void) strlcpy(row[DB_file], "unknown", 8);
2263 row[DB_type][0] = 'V'; 2263 row[DB_type][0] = DB_TYPE_VAL;
2264 row[DB_type][1] = '\0'; 2264 row[DB_type][1] = '\0';
2265 2265
2266 if ((irow = reallocarray(NULL, DB_NUMBER + 1, sizeof(char *))) == 2266 if ((irow = reallocarray(NULL, DB_NUMBER + 1, sizeof(char *))) ==
@@ -2511,7 +2511,7 @@ do_revoke(X509 *x509, CA_DB *db, int type, char *value)
2511 goto err; 2511 goto err;
2512 } 2512 }
2513 (void) strlcpy(row[DB_file], "unknown", 8); 2513 (void) strlcpy(row[DB_file], "unknown", 8);
2514 row[DB_type][0] = 'V'; 2514 row[DB_type][0] = DB_TYPE_VAL;
2515 row[DB_type][1] = '\0'; 2515 row[DB_type][1] = '\0';
2516 2516
2517 if ((irow = reallocarray(NULL, sizeof(char *), 2517 if ((irow = reallocarray(NULL, sizeof(char *),
@@ -2540,7 +2540,7 @@ do_revoke(X509 *x509, CA_DB *db, int type, char *value)
2540 BIO_printf(bio_err, "ERROR:name does not match %s\n", 2540 BIO_printf(bio_err, "ERROR:name does not match %s\n",
2541 row[DB_name]); 2541 row[DB_name]);
2542 goto err; 2542 goto err;
2543 } else if (rrow[DB_type][0] == 'R') { 2543 } else if (rrow[DB_type][0] == DB_TYPE_REV) {
2544 BIO_printf(bio_err, "ERROR:Already revoked, serial number %s\n", 2544 BIO_printf(bio_err, "ERROR:Already revoked, serial number %s\n",
2545 row[DB_serial]); 2545 row[DB_serial]);
2546 goto err; 2546 goto err;
@@ -2552,7 +2552,7 @@ do_revoke(X509 *x509, CA_DB *db, int type, char *value)
2552 BIO_printf(bio_err, "Error in revocation arguments\n"); 2552 BIO_printf(bio_err, "Error in revocation arguments\n");
2553 goto err; 2553 goto err;
2554 } 2554 }
2555 rrow[DB_type][0] = 'R'; 2555 rrow[DB_type][0] = DB_TYPE_REV;
2556 rrow[DB_type][1] = '\0'; 2556 rrow[DB_type][1] = '\0';
2557 rrow[DB_rev_date] = rev_str; 2557 rrow[DB_rev_date] = rev_str;
2558 } 2558 }
@@ -2608,19 +2608,19 @@ get_certificate_status(const char *serial, CA_DB *db)
2608 row[DB_serial]); 2608 row[DB_serial]);
2609 ok = -1; 2609 ok = -1;
2610 goto err; 2610 goto err;
2611 } else if (rrow[DB_type][0] == 'V') { 2611 } else if (rrow[DB_type][0] == DB_TYPE_VAL) {
2612 BIO_printf(bio_err, "%s=Valid (%c)\n", 2612 BIO_printf(bio_err, "%s=Valid (%c)\n",
2613 row[DB_serial], rrow[DB_type][0]); 2613 row[DB_serial], rrow[DB_type][0]);
2614 goto err; 2614 goto err;
2615 } else if (rrow[DB_type][0] == 'R') { 2615 } else if (rrow[DB_type][0] == DB_TYPE_REV) {
2616 BIO_printf(bio_err, "%s=Revoked (%c)\n", 2616 BIO_printf(bio_err, "%s=Revoked (%c)\n",
2617 row[DB_serial], rrow[DB_type][0]); 2617 row[DB_serial], rrow[DB_type][0]);
2618 goto err; 2618 goto err;
2619 } else if (rrow[DB_type][0] == 'E') { 2619 } else if (rrow[DB_type][0] == DB_TYPE_EXP) {
2620 BIO_printf(bio_err, "%s=Expired (%c)\n", 2620 BIO_printf(bio_err, "%s=Expired (%c)\n",
2621 row[DB_serial], rrow[DB_type][0]); 2621 row[DB_serial], rrow[DB_type][0]);
2622 goto err; 2622 goto err;
2623 } else if (rrow[DB_type][0] == 'S') { 2623 } else if (rrow[DB_type][0] == DB_TYPE_SUSP) {
2624 BIO_printf(bio_err, "%s=Suspended (%c)\n", 2624 BIO_printf(bio_err, "%s=Suspended (%c)\n",
2625 row[DB_serial], rrow[DB_type][0]); 2625 row[DB_serial], rrow[DB_type][0]);
2626 goto err; 2626 goto err;
@@ -2671,7 +2671,7 @@ do_updatedb(CA_DB *db)
2671 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) { 2671 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
2672 rrow = sk_OPENSSL_PSTRING_value(db->db->data, i); 2672 rrow = sk_OPENSSL_PSTRING_value(db->db->data, i);
2673 2673
2674 if (rrow[DB_type][0] == 'V') { 2674 if (rrow[DB_type][0] == DB_TYPE_VAL) {
2675 /* ignore entries that are not valid */ 2675 /* ignore entries that are not valid */
2676 if (strncmp(rrow[DB_exp_date], "49", 2) <= 0) 2676 if (strncmp(rrow[DB_exp_date], "49", 2) <= 0)
2677 db_y2k = 1; 2677 db_y2k = 1;
@@ -2681,7 +2681,7 @@ do_updatedb(CA_DB *db)
2681 if (db_y2k == a_y2k) { 2681 if (db_y2k == a_y2k) {
2682 /* all on the same y2k side */ 2682 /* all on the same y2k side */
2683 if (strcmp(rrow[DB_exp_date], a_tm_s) <= 0) { 2683 if (strcmp(rrow[DB_exp_date], a_tm_s) <= 0) {
2684 rrow[DB_type][0] = 'E'; 2684 rrow[DB_type][0] = DB_TYPE_EXP;
2685 rrow[DB_type][1] = '\0'; 2685 rrow[DB_type][1] = '\0';
2686 cnt++; 2686 cnt++;
2687 2687
@@ -2689,7 +2689,7 @@ do_updatedb(CA_DB *db)
2689 rrow[DB_serial]); 2689 rrow[DB_serial]);
2690 } 2690 }
2691 } else if (db_y2k < a_y2k) { 2691 } else if (db_y2k < a_y2k) {
2692 rrow[DB_type][0] = 'E'; 2692 rrow[DB_type][0] = DB_TYPE_EXP;
2693 rrow[DB_type][1] = '\0'; 2693 rrow[DB_type][1] = '\0';
2694 cnt++; 2694 cnt++;
2695 2695