From 2ecfc9e3275c04ed837c655da9af28f48e591d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 8 Oct 2006 21:34:42 +0000 Subject: [PATCH] Implement --time= option. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18360 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/hxtool.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/hx509/hxtool.c b/lib/hx509/hxtool.c index 51754088c..65d5cce92 100644 --- a/lib/hx509/hxtool.c +++ b/lib/hx509/hxtool.c @@ -554,6 +554,23 @@ pcert_verify(struct verify_options *opt, int argc, char **argv) if (opt->allow_proxy_certificate_flag) hx509_verify_set_proxy_certificate(ctx, 1); + if (opt->time_string) { + const char *p; + struct tm tm; + time_t t; + + memset(&tm, 0, sizeof(tm)); + + p = strptime (opt->time_string, "%Y-%m-%d", &tm); + if (p == NULL) + errx(1, "Failed to parse time %s, need to be on format %Y-%m-%d", + opt->time_string); + + t = tm2time (tm, 0); + + hx509_verify_set_time(ctx, t); + } + ret = hx509_revoke_init(context, &revoke_ctx); if (ret) errx(1, "hx509_revoke_init: %d", ret);