diff options
author | tb <> | 2024-02-18 16:28:38 +0000 |
---|---|---|
committer | tb <> | 2024-02-18 16:28:38 +0000 |
commit | f3cff8b6438de90dfb152c94ee691fd4b59b0890 (patch) | |
tree | 6a60bd14d56bf5ac3d9034a6b7ba3be4736b59dd /src/lib/libcrypto/hidden/openssl/posix_time.h | |
parent | babf480e3dc1d1c868511b40c31061c5ee5d75d1 (diff) | |
download | openbsd-f3cff8b6438de90dfb152c94ee691fd4b59b0890.tar.gz openbsd-f3cff8b6438de90dfb152c94ee691fd4b59b0890.tar.bz2 openbsd-f3cff8b6438de90dfb152c94ee691fd4b59b0890.zip |
Add posix_time.h from BoringSSL
This is prepares to expose some internal API as OPENSSL_tm_to_posix() and
OPENSSL_posix_to_tm(). They will be used in libtls and ocspcheck(8) to get
rid of the portability nightmare that is timegm().
Also fix the location of OPENSSL_gmtime() and OPENSSL_timegm() (this API
is not yet exposed). The former is from OpenSSL and surprisingly lives in
crypto.h, not asn1.h, and the latter is BoringSSL API and lives in the new
posix_time.h.
Initial diff from beck, this pulls in further upstream work after review
feedback.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/hidden/openssl/posix_time.h')
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/posix_time.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/libcrypto/hidden/openssl/posix_time.h b/src/lib/libcrypto/hidden/openssl/posix_time.h new file mode 100644 index 0000000000..306d43eae5 --- /dev/null +++ b/src/lib/libcrypto/hidden/openssl/posix_time.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* $OpenBSD: posix_time.h,v 1.1 2024/02/18 16:28:38 tb Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 2024 Bob Beck <beck@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #ifndef _LIBCRYPTO_POSIX_TIME_H | ||
19 | #define _LIBCRYPTO_POSIX_TIME_H | ||
20 | |||
21 | #ifndef _MSC_VER | ||
22 | #include_next <openssl/posix_time.h> | ||
23 | #else | ||
24 | #include "../include/openssl/posix_time.h" | ||
25 | #endif | ||
26 | #include "crypto_namespace.h" | ||
27 | |||
28 | LCRYPTO_USED(OPENSSL_posix_to_tm); | ||
29 | LCRYPTO_USED(OPENSSL_tm_to_posix); | ||
30 | LCRYPTO_USED(OPENSSL_timegm); | ||
31 | |||
32 | #endif /* _LIBCRYPTO_POSIX_TIME_H */ | ||