Skip to content

Commit

Permalink
Merge pull request #532 from nak3/fix-libressl
Browse files Browse the repository at this point in the history
Fix build error due to undefined variables
  • Loading branch information
kazuho authored Aug 1, 2024
2 parents 4af9f03 + cae16c8 commit e4f0a27
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions include/picotls/openssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ extern "C" {
#include <openssl/opensslconf.h>
#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 <openssl/async.h>
#define PTLS_OPENSSL_HAVE_ASYNC 1
#endif
#else
#define PTLS_OPENSSL_HAVE_ASYNC 0
#endif

extern ptls_key_exchange_algorithm_t ptls_openssl_secp256r1;
Expand All @@ -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[];
Expand Down

0 comments on commit e4f0a27

Please sign in to comment.