From 91c4436158c615b0e3bb1b6a02c2c85eea0d1adf Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sat, 24 Oct 2026 15:45:23 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/issues/66926 Signed-off-by: Filip Skokan Assisted-by: Codex PR-URL: https://github.com/nodejs/node/pull/66931 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Antoine du Hamel Reviewed-By: Tim Perry --- deps/ncrypto/ncrypto.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc index d35d601abc7..a48b953dc1b 100644 --- a/deps/ncrypto/ncrypto.cc +++ b/deps/ncrypto/ncrypto.cc @@ -43,6 +43,13 @@ nullptr) #endif +// Ubuntu 22.04's default libssl-dev still lacks EVP_PKEY_PRIVATE_KEY when +// fully updated. The macro was added upstream in OpenSSL 3.0.12. +#if NCRYPTO_USE_OPENSSL3_PROVIDER && !defined(EVP_PKEY_PRIVATE_KEY) +#define EVP_PKEY_PRIVATE_KEY \ + (EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY) +#endif + namespace ncrypto { namespace { using BignumCtxPointer = DeleteFnPtr;