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;
500'>2020-01-01Document ENVIRONMENT in scoop(1)June McEnroe 2019-12-31Add before and after optionsJune McEnroe 2019-12-31Add scoop IRC output formatJune McEnroe 2019-12-31Add scoop output format optionJune McEnroe 2019-12-31Refactor scoop formatters and group colored outputJune McEnroe 2019-12-31Add strftime format string optionJune McEnroe 2019-12-31Refactor binding in scoopJune McEnroe 2019-12-31Add option to group events by contextJune McEnroe 2019-12-31Add missing includeJune McEnroe 2019-12-31Use standout mode for highlightingJune McEnroe 2019-12-31Rewrite scoop(1) argument descriptionsJune McEnroe 2019-12-31Color both nicks in a changeJune McEnroe 2019-12-31Implement nick-colored outputJune McEnroe 2019-12-31Only enable highlighting on terminal outputJune McEnroe 2019-12-31Set up pager pipeJune McEnroe 2019-12-30Normalize date inputJune McEnroe Mostly this just allows the use of 'now'. 2019-12-30Add initial rough version of scoopJune McEnroe 2019-12-30Join with USING wherever possibleJune McEnroe 2019-12-30Add -D flag to prospective scoop manualJune McEnroe 2019-12-30Order results by ID in outer query in litterboxJune McEnroe 2019-12-30Use X macro for Type enumJune McEnroe 2019-12-30Remove scoop -ABCJune McEnroe I can almost get these to work with an inner and outer SQL query, but when contexts starts overlapping it becomes a disaster, so I'm leavin it out at least for now. 2019-12-30Add limit option for litterbox's search query interfaceJune McEnroe