summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-27 23:23:18 -0400
committerJune McEnroe <june@causal.agency>2020-07-31 12:12:53 -0400
commite5716229ebb96087a36391691f76f46178a2b437 (patch)
treeef058ce5610addfc7c4017171ef9d108fb518c09
parenttls_verify: Use ASN1_STRING_get0_data (diff)
downloadlibretls-e5716229ebb96087a36391691f76f46178a2b437.tar.gz
libretls-e5716229ebb96087a36391691f76f46178a2b437.zip
tls_conninfo: Use ASN1_TIME_to_tm
-rw-r--r--tls_conninfo.c5
1 files changed, 3 insertions, 2 deletions
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 <stdio.h>
+#include <string.h>
 
 #include <openssl/x509.h>
 
@@ -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;