diff --git a/programs/Makefile b/programs/Makefile index 5bf2f0402..c7cc9953e 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -9,14 +9,12 @@ LDFLAGS ?= LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64 LOCAL_CXXFLAGS = $(WARNING_CXXFLAGS) -I../include -D_FILE_OFFSET_BITS=64 LOCAL_LDFLAGS = -L../library \ - -lmbedtls$(SHARED_SUFFIX) \ - -lmbedx509$(SHARED_SUFFIX) \ -lmbedcrypto$(SHARED_SUFFIX) ifndef SHARED -DEP=../library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a +DEP=../library/libmbedcrypto.a else -DEP=../library/libmbedcrypto.$(DLEXT) ../library/libmbedx509.$(DLEXT) ../library/libmbedtls.$(DLEXT) +DEP=../library/libmbedcrypto.$(DLEXT) endif ifdef DEBUG diff --git a/programs/aes/CMakeLists.txt b/programs/aes/CMakeLists.txt index f5a0caabb..6c4c7e10f 100644 --- a/programs/aes/CMakeLists.txt +++ b/programs/aes/CMakeLists.txt @@ -1,8 +1,8 @@ add_executable(aescrypt2 aescrypt2.c) -target_link_libraries(aescrypt2 mbedtls) +target_link_libraries(aescrypt2 mbedcrypto) add_executable(crypt_and_hash crypt_and_hash.c) -target_link_libraries(crypt_and_hash mbedtls) +target_link_libraries(crypt_and_hash mbedcrypto) install(TARGETS aescrypt2 crypt_and_hash DESTINATION "bin" diff --git a/programs/hash/CMakeLists.txt b/programs/hash/CMakeLists.txt index eda975bb0..3c6cca9d4 100644 --- a/programs/hash/CMakeLists.txt +++ b/programs/hash/CMakeLists.txt @@ -1,8 +1,8 @@ add_executable(hello hello.c) -target_link_libraries(hello mbedtls) +target_link_libraries(hello mbedcrypto) add_executable(generic_sum generic_sum.c) -target_link_libraries(generic_sum mbedtls) +target_link_libraries(generic_sum mbedcrypto) install(TARGETS hello generic_sum DESTINATION "bin" diff --git a/programs/pkey/CMakeLists.txt b/programs/pkey/CMakeLists.txt index 944a100a2..14e6b142d 100644 --- a/programs/pkey/CMakeLists.txt +++ b/programs/pkey/CMakeLists.txt @@ -1,56 +1,56 @@ add_executable(dh_genprime dh_genprime.c) -target_link_libraries(dh_genprime mbedtls) +target_link_libraries(dh_genprime mbedcrypto) add_executable(ecdh_curve25519 ecdh_curve25519.c) -target_link_libraries(ecdh_curve25519 mbedtls) +target_link_libraries(ecdh_curve25519 mbedcrypto) add_executable(ecdsa ecdsa.c) -target_link_libraries(ecdsa mbedtls) +target_link_libraries(ecdsa mbedcrypto) add_executable(gen_key gen_key.c) -target_link_libraries(gen_key mbedtls) +target_link_libraries(gen_key mbedcrypto) add_executable(key_app key_app.c) -target_link_libraries(key_app mbedtls) +target_link_libraries(key_app mbedcrypto) add_executable(key_app_writer key_app_writer.c) -target_link_libraries(key_app_writer mbedtls) +target_link_libraries(key_app_writer mbedcrypto) add_executable(mpi_demo mpi_demo.c) -target_link_libraries(mpi_demo mbedtls) +target_link_libraries(mpi_demo mbedcrypto) add_executable(rsa_genkey rsa_genkey.c) -target_link_libraries(rsa_genkey mbedtls) +target_link_libraries(rsa_genkey mbedcrypto) add_executable(rsa_sign rsa_sign.c) -target_link_libraries(rsa_sign mbedtls) +target_link_libraries(rsa_sign mbedcrypto) add_executable(rsa_verify rsa_verify.c) -target_link_libraries(rsa_verify mbedtls) +target_link_libraries(rsa_verify mbedcrypto) add_executable(rsa_sign_pss rsa_sign_pss.c) -target_link_libraries(rsa_sign_pss mbedtls) +target_link_libraries(rsa_sign_pss mbedcrypto) add_executable(rsa_verify_pss rsa_verify_pss.c) -target_link_libraries(rsa_verify_pss mbedtls) +target_link_libraries(rsa_verify_pss mbedcrypto) add_executable(rsa_encrypt rsa_encrypt.c) -target_link_libraries(rsa_encrypt mbedtls) +target_link_libraries(rsa_encrypt mbedcrypto) add_executable(rsa_decrypt rsa_decrypt.c) -target_link_libraries(rsa_decrypt mbedtls) +target_link_libraries(rsa_decrypt mbedcrypto) add_executable(pk_sign pk_sign.c) -target_link_libraries(pk_sign mbedtls) +target_link_libraries(pk_sign mbedcrypto) add_executable(pk_verify pk_verify.c) -target_link_libraries(pk_verify mbedtls) +target_link_libraries(pk_verify mbedcrypto) add_executable(pk_encrypt pk_encrypt.c) -target_link_libraries(pk_encrypt mbedtls) +target_link_libraries(pk_encrypt mbedcrypto) add_executable(pk_decrypt pk_decrypt.c) -target_link_libraries(pk_decrypt mbedtls) +target_link_libraries(pk_decrypt mbedcrypto) install(TARGETS dh_genprime key_app mpi_demo rsa_genkey rsa_sign rsa_verify rsa_encrypt rsa_decrypt pk_encrypt pk_decrypt pk_sign pk_verify gen_key DESTINATION "bin" diff --git a/programs/psa/CMakeLists.txt b/programs/psa/CMakeLists.txt index c80043bc4..814368316 100644 --- a/programs/psa/CMakeLists.txt +++ b/programs/psa/CMakeLists.txt @@ -1,11 +1,11 @@ add_executable(crypto_examples crypto_examples.c) -target_link_libraries(crypto_examples mbedtls) +target_link_libraries(crypto_examples mbedcrypto) add_executable(key_ladder_demo key_ladder_demo.c) -target_link_libraries(key_ladder_demo mbedtls) +target_link_libraries(key_ladder_demo mbedcrypto) add_executable(psa_constant_names psa_constant_names.c) -target_link_libraries(psa_constant_names mbedtls) +target_link_libraries(psa_constant_names mbedcrypto) add_custom_target( psa_constant_names_generated diff --git a/programs/random/CMakeLists.txt b/programs/random/CMakeLists.txt index 30933d88d..630c66e9d 100644 --- a/programs/random/CMakeLists.txt +++ b/programs/random/CMakeLists.txt @@ -1,11 +1,11 @@ add_executable(gen_random_havege gen_random_havege.c) -target_link_libraries(gen_random_havege mbedtls) +target_link_libraries(gen_random_havege mbedcrypto) add_executable(gen_random_ctr_drbg gen_random_ctr_drbg.c) -target_link_libraries(gen_random_ctr_drbg mbedtls) +target_link_libraries(gen_random_ctr_drbg mbedcrypto) add_executable(gen_entropy gen_entropy.c) -target_link_libraries(gen_entropy mbedtls) +target_link_libraries(gen_entropy mbedcrypto) install(TARGETS gen_random_havege gen_random_ctr_drbg gen_entropy DESTINATION "bin" diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 2b455ee01..192ac4cb7 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -1,5 +1,5 @@ set(libs - mbedtls + mbedcrypto ) add_executable(selftest selftest.c) diff --git a/programs/util/CMakeLists.txt b/programs/util/CMakeLists.txt index f9b660453..4c3fb0dfa 100644 --- a/programs/util/CMakeLists.txt +++ b/programs/util/CMakeLists.txt @@ -1,5 +1,5 @@ set(libs - mbedtls + mbedcrypto ) add_executable(strerror strerror.c) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 757ca5b7b..513979454 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ set(libs - mbedtls + mbedcrypto ) find_package(Perl) @@ -29,7 +29,7 @@ function(add_test_suite suite_name) add_custom_command( OUTPUT test_suite_${data_name}.c COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_test_code.py -f ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function -d ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data -t ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function -p ${CMAKE_CURRENT_SOURCE_DIR}/suites/host_test.function -s ${CMAKE_CURRENT_SOURCE_DIR}/suites --helpers-file ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function -o . - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_test_code.py mbedtls ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/host_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_test_code.py mbedcrypto ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/host_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data ) set(exe_name test_suite_${data_name}) diff --git a/tests/Makefile b/tests/Makefile index cb374e530..90880aac1 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -8,8 +8,6 @@ LDFLAGS ?= CRYPTO_INCLUDES ?= -I../include LOCAL_CFLAGS = $(WARNING_CFLAGS) $(CRYPTO_INCLUDES) -I../library -D_FILE_OFFSET_BITS=64 LOCAL_LDFLAGS = -L../library \ - -lmbedtls$(SHARED_SUFFIX) \ - -lmbedx509$(SHARED_SUFFIX) \ -lmbedcrypto$(SHARED_SUFFIX) # Enable definition of various functions used throughout the testsuite diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 65ac9b066..98f322db7 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -14,6 +14,12 @@ OPENSSL ?= openssl FAKETIME ?= faketime +# Tools from Mbed TLS +# Mbed Crypto depends on Mbed TLS programs to generate its test certificates. +# These programs can be installed from Mbed TLS. +MBEDTLS_CERT_WRITE ?= mbedtls_cert_write +MBEDTLS_CERT_REQ ?= mbedtls_cert_req + ## Build the generated test data. Note that since the final outputs ## are committed to the repository, this target should do nothing on a