Skip to content

Commit

Permalink
THRIFT-5821: support building against AWS-LC
Browse files Browse the repository at this point in the history
  • Loading branch information
jeking3 committed Oct 4, 2024
1 parent bf57082 commit 0b7ba6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/cmake/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON

# OpenSSL
if(WITH_CPP OR WITH_C_GLIB)
find_package(OpenSSL QUIET)
find_package(OpenSSL)
CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON
"OPENSSL_FOUND" OFF)
endif()
Expand Down
6 changes: 4 additions & 2 deletions lib/cpp/src/thrift/transport/TSSLSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ void cleanupOpenSSL() {
#if (OPENSSL_VERSION_NUMBER < OPENSSL_ENGINE_CLEANUP_REQUIRED_BEFORE)
ENGINE_cleanup(); // https://www.openssl.org/docs/man1.1.0/crypto/ENGINE_cleanup.html - cleanup call is needed before 1.1.0
#endif
#if !defined(OPENSSL_IS_AWSLC)
CONF_modules_unload(1);
#endif
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
#if OPENSSL_VERSION_NUMBER >= 0x10100000
#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_AWSLC)
// https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_thread_stop.html
OPENSSL_thread_stop();
#else
Expand Down Expand Up @@ -393,7 +395,7 @@ void TSSLSocket::close() {
SSL_free(ssl_);
ssl_ = nullptr;
handshakeCompleted_ = false;
#if OPENSSL_VERSION_NUMBER >= 0x10100000
#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_AWSLC)
// https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_thread_stop.html
OPENSSL_thread_stop();
#else
Expand Down

0 comments on commit 0b7ba6e

Please sign in to comment.