From cae16c843588c836656f5c07f1a4f25323c885dc Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Sun, 16 Jun 2024 15:17:20 +0900 Subject: [PATCH] Fix build error due to undefined variables --- include/picotls/openssl.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/picotls/openssl.h b/include/picotls/openssl.h index c4d4cc5a..205500ad 100644 --- a/include/picotls/openssl.h +++ b/include/picotls/openssl.h @@ -33,17 +33,18 @@ extern "C" { #include #include "../picotls.h" -#if OPENSSL_VERSION_NUMBER >= 0x10100000L -#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) #define PTLS_OPENSSL_HAVE_CHACHA20_POLY1305 1 -#endif +#else +#define PTLS_OPENSSL_HAVE_CHACHA20_POLY1305 0 #endif -#if OPENSSL_VERSION_NUMBER >= 0x10100010L && !defined(LIBRESSL_VERSION_NUMBER) -#if !defined(OPENSSL_NO_ASYNC) +#if OPENSSL_VERSION_NUMBER >= 0x10100010L && !defined(LIBRESSL_VERSION_NUMBER) && \ + !defined(OPENSSL_NO_ASYNC) #include #define PTLS_OPENSSL_HAVE_ASYNC 1 -#endif +#else +#define PTLS_OPENSSL_HAVE_ASYNC 0 #endif extern ptls_key_exchange_algorithm_t ptls_openssl_secp256r1; @@ -64,11 +65,16 @@ extern ptls_key_exchange_algorithm_t ptls_openssl_secp521r1; #define PTLS_OPENSSL_HAVE_X25519 1 #define PTLS_OPENSSL_HAS_X25519 1 /* deprecated; use HAVE_ */ extern ptls_key_exchange_algorithm_t ptls_openssl_x25519; +#else +#define PTLS_OPENSSL_HAVE_X25519 0 +#define PTLS_OPENSSL_HAS_X25519 0 /* deprecated; use HAVE_ */ #endif /* when boringssl is used, existence of libdecrepit is assumed */ #if !defined(OPENSSL_NO_BF) || defined(OPENSSL_IS_BORINGSSL) #define PTLS_OPENSSL_HAVE_BF 1 +#else +#define PTLS_OPENSSL_HAVE_BF 0 #endif extern ptls_key_exchange_algorithm_t *ptls_openssl_key_exchanges[];