From 0a3851217784485092e3eea0c33a2dd61c5c1b93 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 27 Jul 2020 23:32:01 -0400 Subject: tls_ocsp: Use ASN1_TIME_to_tm --- tls_ocsp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tls_ocsp.c b/tls_ocsp.c index 32c372e..d85d79c 100644 --- a/tls_ocsp.c +++ b/tls_ocsp.c @@ -17,6 +17,7 @@ */ #include +#include #include #include @@ -62,8 +63,9 @@ tls_ocsp_asn1_parse_time(struct tls *ctx, ASN1_GENERALIZEDTIME *gt, time_t *gt_t if (gt == NULL) return -1; /* RFC 6960 specifies that all times in OCSP must be GENERALIZEDTIME */ - if (ASN1_time_parse(gt->data, gt->length, &tm, - V_ASN1_GENERALIZEDTIME) == -1) + if (ASN1_GENERALIZEDTIME_check(gt) == 0) + return -1; + if (ASN1_TIME_to_tm(gt, &tm) == 0) return -1; if ((*gt_time = timegm(&tm)) == -1) return -1; -- cgit 1.4.1