version 1.44, 2021/09/02 11:07:56 |
version 1.45, 2021/09/02 11:37:44 |
|
|
if (rrow != NULL) { |
if (rrow != NULL) { |
BIO_printf(bio_err, |
BIO_printf(bio_err, |
"The matching entry has the following details\n"); |
"The matching entry has the following details\n"); |
if (rrow[DB_type][0] == 'E') |
if (rrow[DB_type][0] == DB_TYPE_EXP) |
p = "Expired"; |
p = "Expired"; |
else if (rrow[DB_type][0] == 'R') |
else if (rrow[DB_type][0] == DB_TYPE_REV) |
p = "Revoked"; |
p = "Revoked"; |
else if (rrow[DB_type][0] == 'V') |
else if (rrow[DB_type][0] == DB_TYPE_VAL) |
p = "Valid"; |
p = "Valid"; |
else |
else |
p = "\ninvalid type, Data base error\n"; |
p = "\ninvalid type, Data base error\n"; |
BIO_printf(bio_err, "Type :%s\n", p); |
BIO_printf(bio_err, "Type :%s\n", p); |
if (rrow[DB_type][0] == 'R') { |
if (rrow[DB_type][0] == DB_TYPE_REV) { |
p = rrow[DB_exp_date]; |
p = rrow[DB_exp_date]; |
if (p == NULL) |
if (p == NULL) |
p = "undef"; |
p = "undef"; |
|
|
goto err; |
goto err; |
} |
} |
(void) strlcpy(row[DB_file], "unknown", 8); |
(void) strlcpy(row[DB_file], "unknown", 8); |
row[DB_type][0] = 'V'; |
row[DB_type][0] = DB_TYPE_VAL; |
row[DB_type][1] = '\0'; |
row[DB_type][1] = '\0'; |
|
|
if ((irow = reallocarray(NULL, DB_NUMBER + 1, sizeof(char *))) == |
if ((irow = reallocarray(NULL, DB_NUMBER + 1, sizeof(char *))) == |
|
|
goto err; |
goto err; |
} |
} |
(void) strlcpy(row[DB_file], "unknown", 8); |
(void) strlcpy(row[DB_file], "unknown", 8); |
row[DB_type][0] = 'V'; |
row[DB_type][0] = DB_TYPE_VAL; |
row[DB_type][1] = '\0'; |
row[DB_type][1] = '\0'; |
|
|
if ((irow = reallocarray(NULL, sizeof(char *), |
if ((irow = reallocarray(NULL, sizeof(char *), |
|
|
BIO_printf(bio_err, "ERROR:name does not match %s\n", |
BIO_printf(bio_err, "ERROR:name does not match %s\n", |
row[DB_name]); |
row[DB_name]); |
goto err; |
goto err; |
} else if (rrow[DB_type][0] == 'R') { |
} else if (rrow[DB_type][0] == DB_TYPE_REV) { |
BIO_printf(bio_err, "ERROR:Already revoked, serial number %s\n", |
BIO_printf(bio_err, "ERROR:Already revoked, serial number %s\n", |
row[DB_serial]); |
row[DB_serial]); |
goto err; |
goto err; |
|
|
BIO_printf(bio_err, "Error in revocation arguments\n"); |
BIO_printf(bio_err, "Error in revocation arguments\n"); |
goto err; |
goto err; |
} |
} |
rrow[DB_type][0] = 'R'; |
rrow[DB_type][0] = DB_TYPE_REV; |
rrow[DB_type][1] = '\0'; |
rrow[DB_type][1] = '\0'; |
rrow[DB_rev_date] = rev_str; |
rrow[DB_rev_date] = rev_str; |
} |
} |
|
|
row[DB_serial]); |
row[DB_serial]); |
ok = -1; |
ok = -1; |
goto err; |
goto err; |
} else if (rrow[DB_type][0] == 'V') { |
} else if (rrow[DB_type][0] == DB_TYPE_VAL) { |
BIO_printf(bio_err, "%s=Valid (%c)\n", |
BIO_printf(bio_err, "%s=Valid (%c)\n", |
row[DB_serial], rrow[DB_type][0]); |
row[DB_serial], rrow[DB_type][0]); |
goto err; |
goto err; |
} else if (rrow[DB_type][0] == 'R') { |
} else if (rrow[DB_type][0] == DB_TYPE_REV) { |
BIO_printf(bio_err, "%s=Revoked (%c)\n", |
BIO_printf(bio_err, "%s=Revoked (%c)\n", |
row[DB_serial], rrow[DB_type][0]); |
row[DB_serial], rrow[DB_type][0]); |
goto err; |
goto err; |
} else if (rrow[DB_type][0] == 'E') { |
} else if (rrow[DB_type][0] == DB_TYPE_EXP) { |
BIO_printf(bio_err, "%s=Expired (%c)\n", |
BIO_printf(bio_err, "%s=Expired (%c)\n", |
row[DB_serial], rrow[DB_type][0]); |
row[DB_serial], rrow[DB_type][0]); |
goto err; |
goto err; |
} else if (rrow[DB_type][0] == 'S') { |
} else if (rrow[DB_type][0] == DB_TYPE_SUSP) { |
BIO_printf(bio_err, "%s=Suspended (%c)\n", |
BIO_printf(bio_err, "%s=Suspended (%c)\n", |
row[DB_serial], rrow[DB_type][0]); |
row[DB_serial], rrow[DB_type][0]); |
goto err; |
goto err; |
|
|
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) { |
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) { |
rrow = sk_OPENSSL_PSTRING_value(db->db->data, i); |
rrow = sk_OPENSSL_PSTRING_value(db->db->data, i); |
|
|
if (rrow[DB_type][0] == 'V') { |
if (rrow[DB_type][0] == DB_TYPE_VAL) { |
/* ignore entries that are not valid */ |
/* ignore entries that are not valid */ |
if (strncmp(rrow[DB_exp_date], "49", 2) <= 0) |
if (strncmp(rrow[DB_exp_date], "49", 2) <= 0) |
db_y2k = 1; |
db_y2k = 1; |
|
|
if (db_y2k == a_y2k) { |
if (db_y2k == a_y2k) { |
/* all on the same y2k side */ |
/* all on the same y2k side */ |
if (strcmp(rrow[DB_exp_date], a_tm_s) <= 0) { |
if (strcmp(rrow[DB_exp_date], a_tm_s) <= 0) { |
rrow[DB_type][0] = 'E'; |
rrow[DB_type][0] = DB_TYPE_EXP; |
rrow[DB_type][1] = '\0'; |
rrow[DB_type][1] = '\0'; |
cnt++; |
cnt++; |
|
|
|
|
rrow[DB_serial]); |
rrow[DB_serial]); |
} |
} |
} else if (db_y2k < a_y2k) { |
} else if (db_y2k < a_y2k) { |
rrow[DB_type][0] = 'E'; |
rrow[DB_type][0] = DB_TYPE_EXP; |
rrow[DB_type][1] = '\0'; |
rrow[DB_type][1] = '\0'; |
cnt++; |
cnt++; |
|
|