summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2026-06-01 14:42:49 -0400
committerJune McEnroe <june@causal.agency>2026-06-01 14:42:49 -0400
commitd08958f5d2c4d71d8132ea5c6cb45e48b5c4d83d (patch)
tree01f7eb5bc8d9d0e708ec077364a6b3fda7f1bdde /include
parentImport LibreSSL 3.9.2 (diff)
downloadlibretls-d08958f5d2c4d71d8132ea5c6cb45e48b5c4d83d.tar.gz
libretls-d08958f5d2c4d71d8132ea5c6cb45e48b5c4d83d.zip
Import LibreSSL 4.0.0
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am1
-rw-r--r--include/compat/sys/time.h9
-rw-r--r--include/compat/time.h9
-rw-r--r--include/tls.h18
4 files changed, 25 insertions, 12 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 22819c8..feaaa60 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -17,6 +17,7 @@ noinst_HEADERS += compat/poll.h
 noinst_HEADERS += compat/pthread.h
 noinst_HEADERS += compat/readpassphrase.h
 noinst_HEADERS += compat/resolv.h
+noinst_HEADERS += compat/stdint.h
 noinst_HEADERS += compat/stdio.h
 noinst_HEADERS += compat/stdlib.h
 noinst_HEADERS += compat/string.h
diff --git a/include/compat/sys/time.h b/include/compat/sys/time.h
index 76428c1..2448969 100644
--- a/include/compat/sys/time.h
+++ b/include/compat/sys/time.h
@@ -8,6 +8,15 @@
 
 #ifdef _MSC_VER
 #include <winsock2.h>
+
+#define timeval libressl_timeval
+#define gettimeofday libressl_gettimeofday
+
+struct timeval {
+	long long	tv_sec;
+	long		tv_usec;
+};
+
 int gettimeofday(struct timeval *tp, void *tzp);
 #else
 #include_next <sys/time.h>
diff --git a/include/compat/time.h b/include/compat/time.h
index 2748521..a0f6d29 100644
--- a/include/compat/time.h
+++ b/include/compat/time.h
@@ -24,15 +24,6 @@
 #ifndef LIBCRYPTOCOMPAT_TIME_H
 #define LIBCRYPTOCOMPAT_TIME_H
 
-#ifdef _WIN32
-struct tm *__gmtime_r(const time_t * t, struct tm * tm);
-#define gmtime_r(tp, tm) __gmtime_r(tp, tm)
-#endif
-
-#ifndef HAVE_TIMEGM
-time_t timegm(struct tm *tm);
-#endif
-
 #ifndef CLOCK_MONOTONIC
 #define CLOCK_MONOTONIC CLOCK_REALTIME
 #endif
diff --git a/include/tls.h b/include/tls.h
index 59b2c4c..26d5982 100644
--- a/include/tls.h
+++ b/include/tls.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls.h,v 1.63 2023/07/02 06:37:27 beck Exp $ */
+/* $OpenBSD: tls.h,v 1.67 2024/08/02 15:00:01 tb Exp $ */
 /*
  * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
  *
@@ -40,8 +40,8 @@ typedef SSIZE_T ssize_t;
  * Deprecated versions of TLS. Using these effectively selects
  * the minimum supported version.
  */
-#define TLS_PROTOCOL_TLSv1_0	(1 << 3)
-#define TLS_PROTOCOL_TLSv1_1	(1 << 3)
+#define TLS_PROTOCOL_TLSv1_0	(1 << 1)
+#define TLS_PROTOCOL_TLSv1_1	(1 << 2)
 /* Supported versions of TLS */
 #define TLS_PROTOCOL_TLSv1_2	(1 << 3)
 #define TLS_PROTOCOL_TLSv1_3	(1 << 4)
@@ -83,6 +83,14 @@ typedef SSIZE_T ssize_t;
 #define TLS_MAX_SESSION_ID_LENGTH		32
 #define TLS_TICKET_KEY_SIZE			48
 
+/* Error codes */
+#if defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
+#define TLS_ERROR_UNKNOWN			0x0000
+#define TLS_ERROR_OUT_OF_MEMORY			0x1000
+#define TLS_ERROR_INVALID_CONTEXT		0x2000
+#define TLS_ERROR_INVALID_ARGUMENT		0x2001
+#endif
+
 struct tls;
 struct tls_config;
 
@@ -95,6 +103,10 @@ int tls_init(void);
 
 const char *tls_config_error(struct tls_config *_config);
 const char *tls_error(struct tls *_ctx);
+#if defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
+int tls_config_error_code(struct tls_config *_config);
+int tls_error_code(struct tls *_ctx);
+#endif
 
 struct tls_config *tls_config_new(void);
 void tls_config_free(struct tls_config *_config);