Skip to content

Commit

Permalink
Guard new implementation to avoid compilation errors against old Open…
Browse files Browse the repository at this point in the history
…SSL version
  • Loading branch information
torben-hansen committed Jul 5, 2023
1 parent a405b9d commit ce143f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tool/speed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -2565,8 +2565,10 @@ bool Speed(const std::vector<std::string> &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) ||
Expand Down

0 comments on commit ce143f4

Please sign in to comment.