diff options
author | beck <> | 2024-03-24 11:30:12 +0000 |
---|---|---|
committer | beck <> | 2024-03-24 11:30:12 +0000 |
commit | 5176ab31ca58949fc78b5b06b23adf63a83b9c44 (patch) | |
tree | af867a635253990b4a88720849f04a8a6bb5d8b3 /src/lib/libtls/tls_ocsp.c | |
parent | c84d6a97971ee756cdbcf3936caaeaa66a6d2289 (diff) | |
download | openbsd-5176ab31ca58949fc78b5b06b23adf63a83b9c44.tar.gz openbsd-5176ab31ca58949fc78b5b06b23adf63a83b9c44.tar.bz2 openbsd-5176ab31ca58949fc78b5b06b23adf63a83b9c44.zip |
Convert libressl to use the BoringSSL style time conversions
This gets rid of our last uses of timegm and gmtime in the
library and things that ship with it. It includes a bit
of refactoring in ocsp_cl.c to remove some obvious ugly.
ok tb@
Diffstat (limited to 'src/lib/libtls/tls_ocsp.c')
-rw-r--r-- | src/lib/libtls/tls_ocsp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_ocsp.c b/src/lib/libtls/tls_ocsp.c index c7eb3e5986..f7d7ba9199 100644 --- a/src/lib/libtls/tls_ocsp.c +++ b/src/lib/libtls/tls_ocsp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_ocsp.c,v 1.24 2023/11/13 10:56:19 tb Exp $ */ | 1 | /* $OpenBSD: tls_ocsp.c,v 1.25 2024/03/24 11:30:12 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Marko Kreen <markokr@gmail.com> | 3 | * Copyright (c) 2015 Marko Kreen <markokr@gmail.com> |
4 | * Copyright (c) 2016 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2016 Bob Beck <beck@openbsd.org> |
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <openssl/err.h> | 26 | #include <openssl/err.h> |
27 | #include <openssl/ocsp.h> | 27 | #include <openssl/ocsp.h> |
28 | #include <openssl/posix_time.h> | ||
28 | #include <openssl/x509.h> | 29 | #include <openssl/x509.h> |
29 | 30 | ||
30 | #include <tls.h> | 31 | #include <tls.h> |
@@ -68,7 +69,7 @@ tls_ocsp_asn1_parse_time(struct tls *ctx, ASN1_GENERALIZEDTIME *gt, time_t *gt_t | |||
68 | return -1; | 69 | return -1; |
69 | if (!ASN1_TIME_to_tm(gt, &tm)) | 70 | if (!ASN1_TIME_to_tm(gt, &tm)) |
70 | return -1; | 71 | return -1; |
71 | if ((*gt_time = timegm(&tm)) == -1) | 72 | if (!OPENSSL_timegm(&tm, gt_time)) |
72 | return -1; | 73 | return -1; |
73 | return 0; | 74 | return 0; |
74 | } | 75 | } |