diff --git a/tests/ci/run_benchmark_build_tests.sh b/tests/ci/run_benchmark_build_tests.sh index fcc9c15d1b..3cc910f004 100755 --- a/tests/ci/run_benchmark_build_tests.sh +++ b/tests/ci/run_benchmark_build_tests.sh @@ -94,9 +94,9 @@ LD_LIBRARY_PATH="${install_dir}/aws-lc-fips-2021-10-20/lib" "${BUILD_ROOT}/tool/ LD_LIBRARY_PATH="${install_dir}/aws-lc-fips-2022/lib" "${BUILD_ROOT}/tool/aws-lc-fips-2022" -timeout_ms 10 LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_1_0_2_branch}/lib" "${BUILD_ROOT}/tool/open102" -timeout_ms 10 LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_1_1_1_branch}/lib" "${BUILD_ROOT}/tool/open111" -timeout_ms 10 -LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_3_1_branch}/lib" "${BUILD_ROOT}/tool/open31" -timeout_ms 10 -LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_3_2_branch}/lib" "${BUILD_ROOT}/tool/open32" -timeout_ms 10 -LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_master_branch}/lib" "${BUILD_ROOT}/tool/openmaster" -timeout_ms 10 +LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_3_1_branch}/lib64" "${BUILD_ROOT}/tool/open31" -timeout_ms 10 +LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_3_2_branch}/lib64" "${BUILD_ROOT}/tool/open32" -timeout_ms 10 +LD_LIBRARY_PATH="${install_dir}/openssl-${openssl_master_branch}/lib64" "${BUILD_ROOT}/tool/openmaster" -timeout_ms 10 LD_LIBRARY_PATH="${install_dir}/boringssl" "${BUILD_ROOT}/tool/boringssl" -timeout_ms 10 echo "Testing ossl_bm with OpenSSL 1.0 with the legacy build option" diff --git a/tool/benchmark.cc b/tool/benchmark.cc index d97452d154..ecf74e2e38 100644 --- a/tool/benchmark.cc +++ b/tool/benchmark.cc @@ -2,8 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 OR ISC #include "internal.h" +#include int main(int argc, char **argv) { + unsigned long build_version = OPENSSL_VERSION_NUMBER; + unsigned long runtime_version = SSLeay(); + if (build_version != runtime_version) { + fprintf(stderr, "Incorrect version number detected, built with %lx, loaded %lx at runtime.", build_version, runtime_version); + return 1; + } args_list_t args; for (int i = 1; i < argc; i++) { args.push_back(argv[i]); diff --git a/tool/tool.cc b/tool/tool.cc index 9acf549a90..36e5a9a99e 100644 --- a/tool/tool.cc +++ b/tool/tool.cc @@ -17,6 +17,7 @@ #include #include +#include #include #if defined(OPENSSL_WINDOWS) @@ -95,6 +96,12 @@ static tool_func_t FindTool(const std::string &name) { } int main(int argc, char **argv) { + unsigned long build_version = OPENSSL_VERSION_NUMBER; + unsigned long runtime_version = OpenSSL_version_num(); + if (build_version != runtime_version) { + fprintf(stderr, "Incorrect version number detected, built with 0x%lx, loaded 0x%lx at runtime.", build_version, runtime_version); + return 1; + } #if defined(OPENSSL_WINDOWS) // Read and write in binary mode. This makes bssl on Windows consistent with // bssl on other platforms, and also makes it consistent with MSYS's commands