diff options
Diffstat (limited to 'tls_ocsp.c')
-rw-r--r-- | tls_ocsp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tls_ocsp.c b/tls_ocsp.c index 83585fa..7670d1f 100644 --- a/tls_ocsp.c +++ b/tls_ocsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_ocsp.c,v 1.22 2021/10/31 16:39:32 tb Exp $ */ +/* $OpenBSD: tls_ocsp.c,v 1.23 2023/05/14 07:26:25 op Exp $ */ /* * Copyright (c) 2015 Marko Kreen <markokr@gmail.com> * Copyright (c) 2016 Bob Beck <beck@openbsd.org> @@ -17,10 +17,13 @@ */ #include <sys/types.h> +#include <string.h> #include <arpa/inet.h> #include <netinet/in.h> +#include <string.h> + #include <openssl/err.h> #include <openssl/ocsp.h> #include <openssl/x509.h> @@ -62,8 +65,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; |