From 771e7385ead52d0c26703f18e5e3b033db6b7b34 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 12 Jun 2023 11:28:52 -0300 Subject: [PATCH] gost_engine: disable tests, reset patches dir Tests are breaking compilation for mipsel targets because of the removal of the sysmips call. Let's just not build them. While at it, remove patches from 1.1 version and move the current ones to the default 'patches' directory. Signed-off-by: Eneas U de Queiroz (cherry picked from commit 085dc8d965a4baa06e60845e98fa7e23869ad213) --- libs/gost_engine/Makefile | 3 +- .../patches-1.1/010-openssl-deprecated.patch | 11 -- .../020-cmake-allow-cross-compile.patch | 0 .../030-dont-build-provider.patch | 0 .../patches/040-dont-build-tests.patch | 131 ++++++++++++++++++ 5 files changed, 132 insertions(+), 13 deletions(-) delete mode 100644 libs/gost_engine/patches-1.1/010-openssl-deprecated.patch rename libs/gost_engine/{patches-3 => patches}/020-cmake-allow-cross-compile.patch (100%) rename libs/gost_engine/{patches-3 => patches}/030-dont-build-provider.patch (100%) create mode 100644 libs/gost_engine/patches/040-dont-build-tests.patch diff --git a/libs/gost_engine/Makefile b/libs/gost_engine/Makefile index d15a36f39f..dd13d42198 100644 --- a/libs/gost_engine/Makefile +++ b/libs/gost_engine/Makefile @@ -5,8 +5,7 @@ PKG_NAME:=gost_engine PKG_VERSION:=3.0.1 PKG_HASH:=bfeac85883724cfbe0ecc6d942ac0524b908143e019ab3d3b6abe47a3466a628 PKG_LICENSE:=Apache-2.0 -PATCH_DIR=./patches-3 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/gost-engine/engine/archive/v$(PKG_VERSION) diff --git a/libs/gost_engine/patches-1.1/010-openssl-deprecated.patch b/libs/gost_engine/patches-1.1/010-openssl-deprecated.patch deleted file mode 100644 index c28748a91e..0000000000 --- a/libs/gost_engine/patches-1.1/010-openssl-deprecated.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gost_pmeth.c -+++ b/gost_pmeth.c -@@ -608,7 +608,7 @@ static int pkey_gost_mac_ctrl_str(EVP_PK - if (strcmp(type, hexkey_ctrl_string) == 0) { - long keylen; - int ret; -- unsigned char *keybuf = string_to_hex(value, &keylen); -+ unsigned char *keybuf = OPENSSL_hexstr2buf(value, &keylen); - if (!keybuf || keylen != 32) { - GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL_STR, - GOST_R_INVALID_MAC_KEY_LENGTH); diff --git a/libs/gost_engine/patches-3/020-cmake-allow-cross-compile.patch b/libs/gost_engine/patches/020-cmake-allow-cross-compile.patch similarity index 100% rename from libs/gost_engine/patches-3/020-cmake-allow-cross-compile.patch rename to libs/gost_engine/patches/020-cmake-allow-cross-compile.patch diff --git a/libs/gost_engine/patches-3/030-dont-build-provider.patch b/libs/gost_engine/patches/030-dont-build-provider.patch similarity index 100% rename from libs/gost_engine/patches-3/030-dont-build-provider.patch rename to libs/gost_engine/patches/030-dont-build-provider.patch diff --git a/libs/gost_engine/patches/040-dont-build-tests.patch b/libs/gost_engine/patches/040-dont-build-tests.patch new file mode 100644 index 0000000000..13caf63884 --- /dev/null +++ b/libs/gost_engine/patches/040-dont-build-tests.patch @@ -0,0 +1,131 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -213,128 +213,6 @@ set(GOST_PROV_SOURCE_FILES + gost_prov_mac.c + ) + +-set(TEST_ENVIRONMENT_COMMON +- CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} +- PERL5LIB=${CMAKE_CURRENT_SOURCE_DIR}/test +- OPENSSL_PROGRAM=${OPENSSL_PROGRAM} +- OPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} +- ) +- +-set(TEST_ENVIRONMENT_ENGINE +- ${TEST_ENVIRONMENT_COMMON} +- OPENSSL_ENGINES=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} +- OPENSSL_CONF=${CMAKE_CURRENT_SOURCE_DIR}/test/engine.cnf +- ) +- +-set(TEST_ENVIRONMENT_PROVIDER +- ${TEST_ENVIRONMENT_COMMON} +- OPENSSL_MODULES=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} +- OPENSSL_CONF=${CMAKE_CURRENT_SOURCE_DIR}/test/provider.cnf +- ) +- +-add_executable(test_digest test_digest.c) +-target_link_libraries(test_digest OpenSSL::Crypto) +-add_test(NAME digest-with-engine COMMAND test_digest) +-set_tests_properties(digest-with-engine +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +-add_test(NAME digest-with-provider COMMAND test_digest) +-set_tests_properties(digest-with-provider +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_PROVIDER}") +- +-add_executable(test_ciphers test_ciphers.c) +-target_link_libraries(test_ciphers OpenSSL::Crypto) +-add_test(NAME ciphers-with-engine COMMAND test_ciphers) +-set_tests_properties(ciphers-with-engine +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +-add_test(NAME ciphers-with-provider COMMAND test_ciphers) +-set_tests_properties(ciphers-with-provider +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_PROVIDER}") +- +-# test_curves is an internals testing program, it doesn't need a test env +-add_executable(test_curves test_curves.c) +-target_link_libraries(test_curves gost_core gost_err) +-add_test(NAME curves COMMAND test_curves) +- +-add_executable(test_params test_params.c) +-target_link_libraries(test_params OpenSSL::Crypto) +-add_test(NAME parameters-with-engine COMMAND test_params) +-set_tests_properties(parameters-with-engine +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +- +-add_executable(test_derive test_derive.c) +-target_link_libraries(test_derive OpenSSL::Crypto) +-add_test(NAME derive-with-engine COMMAND test_derive) +-set_tests_properties(derive-with-engine +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +- +-add_executable(test_sign test_sign.c) +-target_link_libraries(test_sign OpenSSL::Crypto) +-add_test(NAME sign/verify-with-engine COMMAND test_sign) +-set_tests_properties(sign/verify-with-engine +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +- +-add_executable(test_tls test_tls.c) +-target_link_libraries(test_tls OpenSSL::SSL) +-add_test(NAME TLS-with-engine COMMAND test_tls) +-set_tests_properties(TLS-with-engine +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +- +-add_executable(test_context test_context.c) +-target_link_libraries(test_context OpenSSL::Crypto) +-add_test(NAME context-with-engine COMMAND test_context) +-set_tests_properties(context-with-engine +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +-add_test(NAME context-with-provider COMMAND test_context) +-set_tests_properties(context-with-provider +- PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_PROVIDER}") +- +-# test_keyexpimp is an internals testing program, it doesn't need a test env +-add_executable(test_keyexpimp test_keyexpimp.c) +-#target_compile_definitions(test_keyexpimp PUBLIC -DOPENSSL_LOAD_CONF) +-target_link_libraries(test_keyexpimp gost_core gost_err) +-add_test(NAME keyexpimp COMMAND test_keyexpimp) +- +-# test_gost89 is an internals testing program, it doesn't need a test env +-add_executable(test_gost89 test_gost89.c) +-target_link_libraries(test_gost89 gost_core gost_err) +-add_test(NAME gost89 COMMAND test_gost89) +- +-if(NOT SKIP_PERL_TESTS) +- execute_process(COMMAND perl -MTest2::V0 -e "" +- ERROR_QUIET RESULT_VARIABLE MISSING_TEST2_V0) +- find_program(HAVE_PROVE NAMES prove) +- if(NOT MISSING_TEST2_V0 AND HAVE_PROVE) +- add_test(NAME engine +- COMMAND prove --merge -PWrapOpenSSL ${CMAKE_CURRENT_SOURCE_DIR}/test :: engine) +- set_tests_properties(engine PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +- add_test(NAME provider +- COMMAND prove --merge -PWrapOpenSSL ${CMAKE_CURRENT_SOURCE_DIR}/test :: provider) +- set_tests_properties(provider PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_PROVIDER}") +- else() +- message(STATUS "No Test2::V0 perl module (engine and provider tests skipped)") +- endif() +-endif() +- +-if(NOT MSVC) +- add_executable(sign benchmark/sign.c) +- target_link_libraries(sign gost_core gost_err ${CLOCK_GETTIME_LIB}) +-endif() +- +-# All that may need to load just built engine will have path to it defined. +-set(BINARY_TESTS_TARGETS +- test_digest +- test_ciphers +- test_curves +- test_params +- test_derive +- test_sign +- test_context +- test_keyexpimp +- test_gost89 +- test_tls +- ) +-set_property(TARGET ${BINARY_TESTS_TARGETS} APPEND PROPERTY COMPILE_DEFINITIONS ENGINE_DIR="${OUTPUT_DIRECTORY}") +- + add_library(gost_core STATIC ${GOST_LIB_SOURCE_FILES}) + set_target_properties(gost_core PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_link_libraries(gost_core PRIVATE OpenSSL::Crypto) -- 2.30.2