From ce143f42e4f332cccca777fa4047c1453f3b6ed2 Mon Sep 17 00:00:00 2001 From: Torben Hansen <50673096+torben-hansen@users.noreply.github.com> Date: Wed, 5 Jul 2023 12:28:27 -0700 Subject: [PATCH] Guard new implementation to avoid compilation errors against old OpenSSL version --- tool/speed.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tool/speed.cc b/tool/speed.cc index 6aa4ad974cc..13496c0680f 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -1426,6 +1426,7 @@ static bool SpeedECDSA(const std::string &selected) { SpeedECDSACurve("ECDSA secp256k1", NID_secp256k1, selected); } +#if !defined(OPENSSL_1_0_BENCHMARK) static EVP_PKEY * evp_generate_key(const int curve_nid) { // P NIST curves are abstracted under the same virtual function table which @@ -1544,7 +1545,6 @@ static bool SpeedEvpEcdh(const std::string &selected) { SpeedEvpEcdhCurve("EVP ECDH X25519", NID_X25519, selected); } -#if !defined(OPENSSL_1_0_BENCHMARK) static bool SpeedECMULCurve(const std::string &name, int nid, const std::string &selected) { if (!selected.empty() && name.find(selected) == std::string::npos) { @@ -2565,8 +2565,10 @@ bool Speed(const std::vector &args) { !SpeedECDSA(selected) || !SpeedECKeyGen(selected) || !SpeedECKeyGenerateKey(false, selected) || - !SpeedEvpEcdh(selected) || #if !defined(OPENSSL_1_0_BENCHMARK) + // OpenSSL 1.0.2 is missing functions e.g. |EVP_PKEY_get0_EC_KEY| and + // doesn't implement X255519 either. + !SpeedEvpEcdh(selected) || !SpeedECMUL(selected) || // OpenSSL 1.0 doesn't support Scrypt !SpeedScrypt(selected) ||