{ .name = "country", .type = OPTION_STRING },
{ .name = "expiration_date", .type = OPTION_STRING },
{ .name = "activation_date", .type = OPTION_STRING },
+ { .name = "crl_revocation_date", .type = OPTION_STRING },
+ { .name = "crl_this_update_date", .type = OPTION_STRING },
+ { .name = "crl_next_update_date", .type = OPTION_STRING },
{ .name = "policy*", .type = OPTION_MULTI_LINE }, /* not a multi-line but there are multi as it is a wildcard */
{ .name = "pkcs12_key_name", .type = OPTION_STRING },
{ .name = "proxy_policy_language", .type = OPTION_STRING },
char *pkcs12_key_name;
char *expiration_date;
char *activation_date;
+ char *revocation_date;
+ char *this_update_date;
+ char *next_update_date;
int64_t serial;
int expiration_days;
int ca;
if (val != NULL && val->valType == OPARG_TYPE_STRING)
cfg.activation_date = strdup(val->v.strVal);
+ val = optionGetValue(pov, "crl_revocation_date");
+ if (val != NULL && val->valType == OPARG_TYPE_STRING)
+ cfg.revocation_date = strdup(val->v.strVal);
+
+ val = optionGetValue(pov, "crl_this_update_date");
+ if (val != NULL && val->valType == OPARG_TYPE_STRING)
+ cfg.this_update_date = strdup(val->v.strVal);
+
+ val = optionGetValue(pov, "crl_next_update_date");
+ if (val != NULL && val->valType == OPARG_TYPE_STRING)
+ cfg.next_update_date = strdup(val->v.strVal);
+
for (i = 0; i < MAX_POLICIES; i++) {
snprintf(tmpstr, sizeof(tmpstr), "policy%d", i + 1);
val = optionGetValue(pov, tmpstr);
return time(NULL);
}
+time_t get_crl_revocation_date(void)
+{
+
+ if (batch && cfg.revocation_date != NULL) {
+ return get_date(cfg.revocation_date);
+ }
+
+ return time(NULL);
+}
+
+time_t get_crl_this_update_date(void)
+{
+
+ if (batch && cfg.this_update_date != NULL) {
+ return get_date(cfg.this_update_date);
+ }
+
+ return time(NULL);
+}
+
static
time_t days_to_secs(int days)
{
time_t get_crl_next_update(void)
{
- return get_int_date(NULL, cfg.crl_next_update, "The next CRL will be issued in (days): ");
+ return get_int_date(cfg.next_update_date, cfg.crl_next_update, "The next CRL will be issued in (days): ");
}
const char *get_proxy_policy(char **policy, size_t * policylen)
size_t size, crl_size;
int result;
unsigned int i;
- time_t secs, now = time(0);
+ time_t secs, this_update, exp;
crls = load_crl_list(0, &crl_size, cinfo);
if (crls != NULL) {
crts = load_cert_list(0, &size, cinfo);
+ exp = get_crl_revocation_date();
+
for (i = 0; i < size; i++) {
- result = gnutls_x509_crl_set_crt(crl, crts[i], now);
+ result = gnutls_x509_crl_set_crt(crl, crts[i], exp);
if (result < 0) {
fprintf(stderr, "crl_set_crt: %s\n",
gnutls_strerror(result));
}
gnutls_free(crts);
- result = gnutls_x509_crl_set_this_update(crl, now);
+ this_update = get_crl_this_update_date();
+
+ result = gnutls_x509_crl_set_this_update(crl, this_update);
if (result < 0) {
fprintf(stderr, "this_update: %s\n",
gnutls_strerror(result));