From ec59f338ce2a8842a8478c243e444aefb1459dfa Mon Sep 17 00:00:00 2001 From: beck <> Date: Sun, 27 Aug 2017 01:39:26 +0000 Subject: Make the symbol for ASN1_time_tm_clamp_notafter visible so libtls can get at it, so libtls can also deal with notafter's past the realm of 32 bit time in portable --- src/lib/libtls/tls_conninfo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/libtls') diff --git a/src/lib/libtls/tls_conninfo.c b/src/lib/libtls/tls_conninfo.c index 87660fa989..e3820988e8 100644 --- a/src/lib/libtls/tls_conninfo.c +++ b/src/lib/libtls/tls_conninfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_conninfo.c,v 1.15 2017/04/05 03:19:22 beck Exp $ */ +/* $OpenBSD: tls_conninfo.c,v 1.16 2017/08/27 01:39:26 beck Exp $ */ /* * Copyright (c) 2015 Joel Sing * Copyright (c) 2015 Bob Beck @@ -23,6 +23,8 @@ #include #include "tls_internal.h" +int ASN1_time_tm_clamp_notafter(struct tm *tm); + int tls_hex_string(const unsigned char *in, size_t inlen, char **out, size_t *outlen) @@ -121,6 +123,8 @@ tls_get_peer_cert_times(struct tls *ctx, time_t *notbefore, goto err; if (ASN1_time_parse(after->data, after->length, &after_tm, 0) == -1) goto err; + if (!ASN1_time_tm_clamp_notafter(&after_tm)) + goto err; if ((*notbefore = timegm(&before_tm)) == -1) goto err; if ((*notafter = timegm(&after_tm)) == -1) -- cgit v1.2.3-55-g6feb