Skip to content

Commit e7d2afe

Browse files
committed
crypto: fix builds with older OpenSSL 3.0
Ubuntu 22.04's default libssl-dev still lacks EVP_PKEY_PRIVATE_KEY even when fully updated. Provide the OpenSSL 3.0.12 definition when the headers do not define it so --shared-openssl builds work. Fixes: #66926 Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex
1 parent 727e0ca commit e7d2afe

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎deps/ncrypto/ncrypto.cc‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
nullptr)
4444
#endif
4545

46+
// Ubuntu 22.04's default libssl-dev still lacks EVP_PKEY_PRIVATE_KEY when
47+
// fully updated. The macro was added upstream in OpenSSL 3.0.12.
48+
#if NCRYPTO_USE_OPENSSL3_PROVIDER && !defined(EVP_PKEY_PRIVATE_KEY)
49+
#define EVP_PKEY_PRIVATE_KEY \
50+
(EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY)
51+
#endif
52+
4653
namespace ncrypto {
4754
namespace {
4855
using BignumCtxPointer = DeleteFnPtr<BN_CTX, BN_CTX_free>;

0 commit comments

Comments
 (0)