curl/lib/vtls
Viktor Szakats c6988f9131
curlx: move Curl_gmtime(), use gmtime_s() on Windows
Move `Curl_gmtime()` to curlx and rename to `curlx_gmtime()`. Then call
the internal wrapper also from the curl tool, to avoid using the banned
`gmtime()` directly, and using better, thread-safe alternatives when
available.

Windows `gmtime_s()` requires mingw-w64 v4+ or MSVC. Use local
workaround to also support mingw-w64 v3. `gmtime_s()` also makes
defining `_CRT_SECURE_NO_WARNINGS` unnecessary.

Also:
- lib: drop unused `parsedate.h` includes.
- drop redundant cast from `gmtime_r()` result.
- autotools: reverse condition in the proto detection to avoid
  misleading readers. (the condition plays no role in detection.)
- note Windows XP's default `msvcrt.dll` doesn't offer secure CRT APIs.
  XP likely needs a newer version of this DLL, or may not run.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-gmtime32-gmtime64
https://learn.microsoft.com/cpp/c-runtime-library/reference/gmtime-s-gmtime32-s-gmtime64-s
https://pubs.opengroup.org/onlinepubs/9799919799/functions/gmtime.html
https://linux.die.net/man/3/gmtime_r

Ref: #19957 (for `localtime_r()`)
Follow-up to 54d9f060b4
Closes #19955
2025-12-16 14:30:05 +01:00
..
apple.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
apple.h apple sectrust: add to features 2025-10-16 10:58:45 +02:00
cipher_suite.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
cipher_suite.h TLS: remove support for Secure Transport and BearSSL 2025-06-11 07:54:19 +02:00
gtls.c curlx: move Curl_gmtime(), use gmtime_s() on Windows 2025-12-16 14:30:05 +01:00
gtls.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
hostcheck.c hostcheck: fail wildcard match if host starts with a dot 2025-12-08 10:42:49 +01:00
hostcheck.h openssl: some small cleanups 2025-07-18 00:40:26 +02:00
keylog.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
keylog.h spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
mbedtls.c curlx: move Curl_gmtime(), use gmtime_s() on Windows 2025-12-16 14:30:05 +01:00
mbedtls.h lib: include files using known path 2025-04-08 17:00:00 +02:00
mbedtls_threadlock.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
mbedtls_threadlock.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
openssl.c lib: keep timestamp in easy handle 2025-12-16 08:48:44 +01:00
openssl.h openssl: simplify HAVE_KEYLOG_CALLBACK guard 2025-12-04 22:49:03 +01:00
rustls.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
rustls.h lib: include files using known path 2025-04-08 17:00:00 +02:00
schannel.c lib: keep timestamp in easy handle 2025-12-16 08:48:44 +01:00
schannel.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
schannel_int.h build: drop support for VS2008 (Windows) 2025-11-15 15:56:19 +01:00
schannel_verify.c curlx: limit use of system allocators to the minimum possible 2025-12-05 15:32:59 +01:00
vtls.c lib: keep timestamp in easy handle 2025-12-16 08:48:44 +01:00
vtls.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
vtls_int.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
vtls_scache.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
vtls_scache.h lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
vtls_spack.c lib/subdirs: fix formatting nits 2025-11-30 11:01:50 +01:00
vtls_spack.h build: fix build errors/warnings in rare configurations 2025-07-23 22:17:03 +02:00
wolfssl.c curlx: move Curl_gmtime(), use gmtime_s() on Windows 2025-12-16 14:30:05 +01:00
wolfssl.h wolfssl: fix possible assert with !HAVE_NO_EX wolfSSL builds 2025-12-07 17:01:45 +01:00
x509asn1.c tidy-up: miscellaneous 2025-12-12 04:18:48 +01:00
x509asn1.h build: address some -Weverything warnings, update picky warnings 2025-09-20 10:16:15 +02:00