From e5716229ebb96087a36391691f76f46178a2b437 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 27 Jul 2020 23:23:18 -0400 Subject: tls_conninfo: Use ASN1_TIME_to_tm --- tls_conninfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tls_conninfo.c') diff --git a/tls_conninfo.c b/tls_conninfo.c index d44dc84..5fb8948 100644 --- a/tls_conninfo.c +++ b/tls_conninfo.c @@ -17,6 +17,7 @@ */ #include +#include #include @@ -119,9 +120,9 @@ tls_get_peer_cert_times(struct tls *ctx, time_t *notbefore, goto err; if ((after = X509_get_notAfter(ctx->ssl_peer_cert)) == NULL) goto err; - if (ASN1_time_parse(before->data, before->length, &before_tm, 0) == -1) + if (ASN1_TIME_to_tm(before, &before_tm) == 0) goto err; - if (ASN1_time_parse(after->data, after->length, &after_tm, 0) == -1) + if (ASN1_TIME_to_tm(after, &after_tm) == 0) goto err; if (!ASN1_time_tm_clamp_notafter(&after_tm)) goto err; -- cgit 1.4.1