-/* $OpenBSD: ssl_local.h,v 1.6 2023/05/26 13:44:05 tb Exp $ */
+/* $OpenBSD: ssl_local.h,v 1.7 2023/07/06 07:56:32 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#define LIBRESSL_HAS_DTLS1_2
#endif
-#ifndef LIBRESSL_HAS_TLS1_3_CLIENT
-#define LIBRESSL_HAS_TLS1_3_CLIENT
-#endif
-
-#ifndef LIBRESSL_HAS_TLS1_3_SERVER
-#define LIBRESSL_HAS_TLS1_3_SERVER
-#endif
-
-#if defined(LIBRESSL_HAS_TLS1_3_CLIENT) || defined(LIBRESSL_HAS_TLS1_3_SERVER)
-#define LIBRESSL_HAS_TLS1_3
-#endif
-
/* LOCAL STUFF */
#define SSL_DECRYPT 0
-/* $OpenBSD: ssl_methods.c,v 1.29 2022/11/26 16:08:56 tb Exp $ */
+/* $OpenBSD: ssl_methods.c,v 1.30 2023/07/06 07:56:32 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
return &DTLS_method_data;
}
-#if defined(LIBRESSL_HAS_TLS1_3_CLIENT) && defined(LIBRESSL_HAS_TLS1_3_SERVER)
static const SSL_METHOD TLS_method_data = {
.dtls = 0,
.server = 1,
.get_cipher = ssl3_get_cipher,
.enc_flags = TLSV1_3_ENC_FLAGS,
};
-#endif
static const SSL_METHOD TLS_legacy_method_data = {
.dtls = 0,
.enc_flags = TLSV1_2_ENC_FLAGS,
};
-#if defined(LIBRESSL_HAS_TLS1_3_CLIENT)
static const SSL_METHOD TLS_client_method_data = {
.dtls = 0,
.server = 0,
.enc_flags = TLSV1_3_ENC_FLAGS,
};
-#else
-
-static const SSL_METHOD TLS_legacy_client_method_data = {
- .dtls = 0,
- .server = 0,
- .version = TLS1_2_VERSION,
- .min_tls_version = TLS1_VERSION,
- .max_tls_version = TLS1_2_VERSION,
- .ssl_new = tls1_new,
- .ssl_clear = tls1_clear,
- .ssl_free = tls1_free,
- .ssl_accept = ssl3_accept,
- .ssl_connect = ssl3_connect,
- .ssl_shutdown = ssl3_shutdown,
- .ssl_renegotiate = ssl_undefined_function,
- .ssl_renegotiate_check = ssl_ok,
- .ssl_pending = ssl3_pending,
- .ssl_read_bytes = ssl3_read_bytes,
- .ssl_write_bytes = ssl3_write_bytes,
- .get_cipher = ssl3_get_cipher,
- .enc_flags = TLSV1_2_ENC_FLAGS,
-};
-#endif
-
static const SSL_METHOD TLSv1_method_data = {
.dtls = 0,
.server = 1,
const SSL_METHOD *
TLS_client_method(void)
{
-#if defined(LIBRESSL_HAS_TLS1_3_CLIENT)
return (&TLS_client_method_data);
-#else
- return (&TLS_legacy_client_method_data);
-#endif
}
const SSL_METHOD *
TLS_method(void)
{
-#if defined(LIBRESSL_HAS_TLS1_3_CLIENT) && defined(LIBRESSL_HAS_TLS1_3_SERVER)
return (&TLS_method_data);
-#else
- return tls_legacy_method();
-#endif
}
const SSL_METHOD *