diff options
| author | tb <> | 2024-02-18 16:28:38 +0000 |
|---|---|---|
| committer | tb <> | 2024-02-18 16:28:38 +0000 |
| commit | 9b6fdece880dc96473b19c7044c2996ec2371e53 (patch) | |
| tree | 6a60bd14d56bf5ac3d9034a6b7ba3be4736b59dd /src/lib/libcrypto/hidden/openssl | |
| parent | f63cb33bf7e29ee6ba85dbeb12a51f1fba4bab1e (diff) | |
| download | openbsd-9b6fdece880dc96473b19c7044c2996ec2371e53.tar.gz openbsd-9b6fdece880dc96473b19c7044c2996ec2371e53.tar.bz2 openbsd-9b6fdece880dc96473b19c7044c2996ec2371e53.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')
| -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 */ | ||
