diff --git a/CMakeLists.txt b/CMakeLists.txt index d133de1fe..72c81b131 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(POLARSSL C) +project(MBEDTLS C) string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") @@ -98,8 +98,8 @@ if(ENABLE_TESTING) ADD_CUSTOM_TARGET(lcov COMMAND rm -rf Coverage - COMMAND lcov --capture --initial --directory library/CMakeFiles/polarssl.dir -o files.info - COMMAND lcov --capture --directory library/CMakeFiles/polarssl.dir -o tests.info + COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info + COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info COMMAND lcov --remove all.info -o final.info '*.h' COMMAND gendesc tests/Descriptions.txt -o descriptions diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 17a098c34..2c568584f 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,6 +1,6 @@ -option(INSTALL_POLARSSL_HEADERS "Install mbed TLS headers." ON) +option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) -if(INSTALL_POLARSSL_HEADERS) +if(INSTALL_MBEDTLS_HEADERS) file(GLOB headers "polarssl/*.h") @@ -8,4 +8,4 @@ install(FILES ${headers} DESTINATION include/polarssl PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) -endif(INSTALL_POLARSSL_HEADERS) +endif(INSTALL_MBEDTLS_HEADERS) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 4de96c93e..f738b3b2e 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,5 +1,5 @@ -option(USE_STATIC_POLARSSL_LIBRARY "Build mbed TLS static library." ON) -option(USE_SHARED_POLARSSL_LIBRARY "Build mbed TLS shared library." OFF) +option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON) +option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF) option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF) set(src @@ -85,51 +85,51 @@ if(CMAKE_COMPILER_IS_CLANG) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wunreachable-code") endif(CMAKE_COMPILER_IS_CLANG) -if (NOT USE_STATIC_POLARSSL_LIBRARY AND NOT USE_SHARED_POLARSSL_LIBRARY) - message(FATAL_ERROR "Need to choose static or shared polarssl build!") -endif(NOT USE_STATIC_POLARSSL_LIBRARY AND NOT USE_SHARED_POLARSSL_LIBRARY) +if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) + message(FATAL_ERROR "Need to choose static or shared mbedtls build!") +endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) -if(USE_STATIC_POLARSSL_LIBRARY AND USE_SHARED_POLARSSL_LIBRARY) +if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY) # if we build both static an shared, then let # tests and programs link to the shared lib target - set(polarssl_static_target "polarssl_static") -elseif(USE_STATIC_POLARSSL_LIBRARY) - set(polarssl_static_target "polarssl") + set(mbedtls_static_target "mbedtls_static") +elseif(USE_STATIC_MBEDTLS_LIBRARY) + set(mbedtls_static_target "mbedtls") endif() -if(USE_STATIC_POLARSSL_LIBRARY) - add_library(${polarssl_static_target} STATIC ${src}) - set_target_properties(${polarssl_static_target} PROPERTIES OUTPUT_NAME polarssl) - target_link_libraries(${polarssl_static_target} ${libs}) +if(USE_STATIC_MBEDTLS_LIBRARY) + add_library(${mbedtls_static_target} STATIC ${src}) + set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls) + target_link_libraries(${mbedtls_static_target} ${libs}) if(ZLIB_FOUND) - target_link_libraries(${polarssl_static_target} ${ZLIB_LIBRARIES}) + target_link_libraries(${mbedtls_static_target} ${ZLIB_LIBRARIES}) endif(ZLIB_FOUND) if(LINK_WITH_PTHREAD) - target_link_libraries(${polarssl_static_target} pthread) + target_link_libraries(${mbedtls_static_target} pthread) endif() - install(TARGETS ${polarssl_static_target} + install(TARGETS ${mbedtls_static_target} DESTINATION ${LIB_INSTALL_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endif() -if(USE_SHARED_POLARSSL_LIBRARY) - add_library(polarssl SHARED ${src}) - set_target_properties(polarssl PROPERTIES VERSION 1.3.9 SOVERSION 7) +if(USE_SHARED_MBEDTLS_LIBRARY) + add_library(mbedtls SHARED ${src}) + set_target_properties(mbedtls PROPERTIES VERSION 1.3.9 SOVERSION 7) - target_link_libraries(polarssl ${libs}) + target_link_libraries(mbedtls ${libs}) if(ZLIB_FOUND) - target_link_libraries(polarssl ${ZLIB_LIBRARIES}) + target_link_libraries(mbedtls ${ZLIB_LIBRARIES}) endif(ZLIB_FOUND) if(LINK_WITH_PTHREAD) - target_link_libraries(polarssl pthread) + target_link_libraries(mbedtls pthread) endif() - install(TARGETS polarssl + install(TARGETS mbedtls DESTINATION ${LIB_INSTALL_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -endif(USE_SHARED_POLARSSL_LIBRARY) +endif(USE_SHARED_MBEDTLS_LIBRARY) diff --git a/programs/aes/CMakeLists.txt b/programs/aes/CMakeLists.txt index 9bac94a72..f5a0caabb 100644 --- a/programs/aes/CMakeLists.txt +++ b/programs/aes/CMakeLists.txt @@ -1,8 +1,8 @@ add_executable(aescrypt2 aescrypt2.c) -target_link_libraries(aescrypt2 polarssl) +target_link_libraries(aescrypt2 mbedtls) add_executable(crypt_and_hash crypt_and_hash.c) -target_link_libraries(crypt_and_hash polarssl) +target_link_libraries(crypt_and_hash mbedtls) install(TARGETS aescrypt2 crypt_and_hash DESTINATION "bin" diff --git a/programs/hash/CMakeLists.txt b/programs/hash/CMakeLists.txt index 870b8a0b7..f7a768966 100644 --- a/programs/hash/CMakeLists.txt +++ b/programs/hash/CMakeLists.txt @@ -1,17 +1,17 @@ add_executable(hello hello.c) -target_link_libraries(hello polarssl) +target_link_libraries(hello mbedtls) add_executable(generic_sum generic_sum.c) -target_link_libraries(generic_sum polarssl) +target_link_libraries(generic_sum mbedtls) add_executable(md5sum md5sum.c) -target_link_libraries(md5sum polarssl) +target_link_libraries(md5sum mbedtls) add_executable(sha1sum sha1sum.c) -target_link_libraries(sha1sum polarssl) +target_link_libraries(sha1sum mbedtls) add_executable(sha2sum sha2sum.c) -target_link_libraries(sha2sum polarssl) +target_link_libraries(sha2sum mbedtls) install(TARGETS hello md5sum sha1sum sha2sum generic_sum DESTINATION "bin" diff --git a/programs/pkey/CMakeLists.txt b/programs/pkey/CMakeLists.txt index 291ff99c8..8dc7def6e 100644 --- a/programs/pkey/CMakeLists.txt +++ b/programs/pkey/CMakeLists.txt @@ -1,59 +1,59 @@ add_executable(dh_client dh_client.c) -target_link_libraries(dh_client polarssl) +target_link_libraries(dh_client mbedtls) add_executable(dh_genprime dh_genprime.c) -target_link_libraries(dh_genprime polarssl) +target_link_libraries(dh_genprime mbedtls) add_executable(dh_server dh_server.c) -target_link_libraries(dh_server polarssl) +target_link_libraries(dh_server mbedtls) add_executable(ecdsa ecdsa.c) -target_link_libraries(ecdsa polarssl) +target_link_libraries(ecdsa mbedtls) add_executable(gen_key gen_key.c) -target_link_libraries(gen_key polarssl) +target_link_libraries(gen_key mbedtls) add_executable(key_app key_app.c) -target_link_libraries(key_app polarssl) +target_link_libraries(key_app mbedtls) add_executable(key_app_writer key_app_writer.c) -target_link_libraries(key_app_writer polarssl) +target_link_libraries(key_app_writer mbedtls) add_executable(mpi_demo mpi_demo.c) -target_link_libraries(mpi_demo polarssl) +target_link_libraries(mpi_demo mbedtls) add_executable(rsa_genkey rsa_genkey.c) -target_link_libraries(rsa_genkey polarssl) +target_link_libraries(rsa_genkey mbedtls) add_executable(rsa_sign rsa_sign.c) -target_link_libraries(rsa_sign polarssl) +target_link_libraries(rsa_sign mbedtls) add_executable(rsa_verify rsa_verify.c) -target_link_libraries(rsa_verify polarssl) +target_link_libraries(rsa_verify mbedtls) add_executable(rsa_sign_pss rsa_sign_pss.c) -target_link_libraries(rsa_sign_pss polarssl) +target_link_libraries(rsa_sign_pss mbedtls) add_executable(rsa_verify_pss rsa_verify_pss.c) -target_link_libraries(rsa_verify_pss polarssl) +target_link_libraries(rsa_verify_pss mbedtls) add_executable(rsa_encrypt rsa_encrypt.c) -target_link_libraries(rsa_encrypt polarssl) +target_link_libraries(rsa_encrypt mbedtls) add_executable(rsa_decrypt rsa_decrypt.c) -target_link_libraries(rsa_decrypt polarssl) +target_link_libraries(rsa_decrypt mbedtls) add_executable(pk_sign pk_sign.c) -target_link_libraries(pk_sign polarssl) +target_link_libraries(pk_sign mbedtls) add_executable(pk_verify pk_verify.c) -target_link_libraries(pk_verify polarssl) +target_link_libraries(pk_verify mbedtls) add_executable(pk_encrypt pk_encrypt.c) -target_link_libraries(pk_encrypt polarssl) +target_link_libraries(pk_encrypt mbedtls) add_executable(pk_decrypt pk_decrypt.c) -target_link_libraries(pk_decrypt polarssl) +target_link_libraries(pk_decrypt mbedtls) install(TARGETS dh_client dh_genprime dh_server 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/random/CMakeLists.txt b/programs/random/CMakeLists.txt index ae02bd103..30933d88d 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 polarssl) +target_link_libraries(gen_random_havege mbedtls) add_executable(gen_random_ctr_drbg gen_random_ctr_drbg.c) -target_link_libraries(gen_random_ctr_drbg polarssl) +target_link_libraries(gen_random_ctr_drbg mbedtls) add_executable(gen_entropy gen_entropy.c) -target_link_libraries(gen_entropy polarssl) +target_link_libraries(gen_entropy mbedtls) install(TARGETS gen_random_havege gen_random_ctr_drbg gen_entropy DESTINATION "bin" diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt index e0cfba050..9ba924105 100644 --- a/programs/ssl/CMakeLists.txt +++ b/programs/ssl/CMakeLists.txt @@ -2,7 +2,7 @@ set(THREADS_USE_PTHREADS_WIN32 true) find_package(Threads) set(libs - polarssl + mbedtls ) set(targets diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 758b7a55d..da3376e64 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -1,7 +1,7 @@ FIND_PACKAGE(OpenSSL) set(libs - polarssl + mbedtls ) if(USE_PKCS11_HELPER_LIBRARY) diff --git a/programs/util/CMakeLists.txt b/programs/util/CMakeLists.txt index aedd94f58..f302de74e 100644 --- a/programs/util/CMakeLists.txt +++ b/programs/util/CMakeLists.txt @@ -1,5 +1,5 @@ set(libs - polarssl + mbedtls ) add_executable(strerror strerror.c) diff --git a/programs/x509/CMakeLists.txt b/programs/x509/CMakeLists.txt index fe46da5db..4e39e4563 100644 --- a/programs/x509/CMakeLists.txt +++ b/programs/x509/CMakeLists.txt @@ -1,5 +1,5 @@ set(libs - polarssl + mbedtls ) if(USE_PKCS11_HELPER_LIBRARY) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3cd7e3781..68e670708 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ set(libs - polarssl + mbedtls ) if(USE_PKCS11_HELPER_LIBRARY) @@ -20,7 +20,7 @@ function(add_test_suite suite_name) add_custom_command( OUTPUT test_suite_${data_name}.c COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl ${CMAKE_CURRENT_SOURCE_DIR}/suites test_suite_${suite_name} test_suite_${data_name} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl polarssl suites/helpers.function suites/main_test.function suites/test_suite_${suite_name}.function suites/test_suite_${data_name}.data + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl mbedtls suites/helpers.function suites/main_test.function suites/test_suite_${suite_name}.function suites/test_suite_${data_name}.data ) include_directories(${CMAKE_CURRENT_SOURCE_DIR})