Skip to content

Commit 7311fc0

Browse files
committed
Hide outdated API in OpenSSL
1 parent 585e652 commit 7311fc0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

contrib/openssl-cmake/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,7 @@ set(SSL_SRC
13031303
# SRP API is deprecated in OpenSSL 3.0.
13041304
# https://docs.openssl.org/3.1/man3/SRP_Calc_B/#history
13051305
add_definitions(-DOPENSSL_NO_DEPRECATED)
1306+
add_definitions(-DOPENSSL_API_COMPAT=30000) # 3.0
13061307
add_definitions(-DOPENSSL_NO_ENGINE)
13071308
add_definitions(-DOPENSSL_NO_SRP)
13081309

src/Common/OpenSSLHelpers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <openssl/evp.h>
99
#include <openssl/sha.h>
1010
#include <openssl/kdf.h>
11+
#include <openssl/core_names.h>
1112

1213

1314
namespace DB
@@ -73,7 +74,7 @@ std::vector<uint8_t> hmacSHA256(const std::vector<uint8_t> & key, const std::str
7374
throw Exception(ErrorCodes::OPENSSL_ERROR, "EVP_MAC_CTX_new failed: {}", getOpenSSLErrors());
7475

7576
OSSL_PARAM params[] = {
76-
OSSL_PARAM_utf8_string("digest", const_cast<char*>("SHA256"), 0),
77+
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_DIGEST, const_cast<char*>("SHA256"), 0),
7778
OSSL_PARAM_END
7879
};
7980

0 commit comments

Comments
 (0)