diff options
author | Angelo Mantellini <angelo.mantellini@cisco.com> | 2020-01-30 10:18:47 +0100 |
---|---|---|
committer | Angelo Mantellini <angelo.mantellini@cisco.com> | 2020-01-30 10:23:20 +0100 |
commit | ae07b5e795f3675789d8466aa92b0abeed9e8df4 (patch) | |
tree | 24cd3bf8a3fc4c9d60543ddb267bc2e848ca1276 /libparc | |
parent | e0bc3a68a2dcf7fca2ae0a56a1cc628556b354bd (diff) |
[HICN-489] Add iOS support to hicn stack
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com>
Change-Id: Ibd3337e7336eefaaf425dffc4775a0c40499158b
Diffstat (limited to 'libparc')
-rw-r--r-- | libparc/CMakeLists.txt | 7 | ||||
-rw-r--r-- | libparc/parc/CMakeLists.txt | 17 | ||||
-rw-r--r-- | libparc/parc/security/command-line/CMakeLists.txt | 10 | ||||
-rw-r--r-- | libparc/parc/security/parc_DiffieHellmanKeyShare.c | 1 | ||||
-rw-r--r-- | libparc/parc/security/parc_InMemoryVerifier.c | 1 | ||||
-rw-r--r-- | libparc/parc/security/parc_PublicKeySigner.c | 2 | ||||
-rw-r--r-- | libparc/parc/security/parc_X509Certificate.c | 1 |
7 files changed, 18 insertions, 21 deletions
diff --git a/libparc/CMakeLists.txt b/libparc/CMakeLists.txt index 4950bc71..dcef85eb 100644 --- a/libparc/CMakeLists.txt +++ b/libparc/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.2) project(Libparc) +option(DISABLE_EXECUTABLES "Disable executables" OFF) +option(DISABLE_SHARED_LIBRARIES "Disable shared libraries" OFF) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -49,11 +51,6 @@ include_directories(${PROJECT_BINARY_DIR}/parc ${PROJECT_SOURCE_DIR}) if (DOC_ONLY) message("############ Skipping check of required dependencies.") -elseif(COMPILE_FOR_IOS) - find_host_package( LibEvent REQUIRED ) - include_directories(${LIBEVENT_INCLUDE_DIRS}) - find_package ( Threads REQUIRED ) - find_host_package ( OpenSSL REQUIRED ) else() find_package( LibEvent REQUIRED ) include_directories(${LIBEVENT_INCLUDE_DIRS}) diff --git a/libparc/parc/CMakeLists.txt b/libparc/parc/CMakeLists.txt index 62c81b6e..8e2a3875 100644 --- a/libparc/parc/CMakeLists.txt +++ b/libparc/parc/CMakeLists.txt @@ -365,11 +365,11 @@ if(ENABLE_TEST) ) endif() -if(WIN32)
- list(APPEND LIBPARC_SOURCE_FILES
- ${WINDOWS_UTILITY_SOURCE_FILES}
- ${WINDOWS_UTILITY_HEADER_FILES}
- )
+if(WIN32) + list(APPEND LIBPARC_SOURCE_FILES + ${WINDOWS_UTILITY_SOURCE_FILES} + ${WINDOWS_UTILITY_HEADER_FILES} + ) endif() set(LIBPARC_ALGOL_FILES ${LIBPARC_ALGOL_SOURCE_FILES} ${LIBPARC_ALGOL_HEADER_FILES}) @@ -392,7 +392,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS) set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") message( "-- Set \"-undefined dynamic_lookup\" for shared libraries") endif() -if(COMPILE_FOR_IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Android") +if(DISABLE_SHARED_LIBRARIES) add_library(parc STATIC ${LIBPARC_SOURCE_FILES} ${LIBEVENT_LIBRARIES} ${OPENSSL_LIBRARIES}) target_link_libraries(parc ${LIBEVENT_LIBRARIES}) target_link_libraries(parc ${OPENSSL_LIBRARIES}) @@ -416,7 +416,6 @@ else() parc parc.shared ) - endif() @@ -443,7 +442,6 @@ if(ENABLE_TEST) endif() if(ENABLE_TEST) - if(NOT COMPILE_FOR_IOS) add_subdirectory(security/command-line) add_subdirectory(algol/test) add_subdirectory(concurrent/test) @@ -453,10 +451,7 @@ if(ENABLE_TEST) add_subdirectory(testing/test) add_subdirectory(statistics/test) add_subdirectory(memory/test) - endif() else() - if(NOT COMPILE_FOR_IOS) add_subdirectory(security/command-line) - endif() endif() diff --git a/libparc/parc/security/command-line/CMakeLists.txt b/libparc/parc/security/command-line/CMakeLists.txt index 27825978..07ac7673 100644 --- a/libparc/parc/security/command-line/CMakeLists.txt +++ b/libparc/parc/security/command-line/CMakeLists.txt @@ -1,8 +1,10 @@ set(PARC_PUBLICKEY_SRC parc-publickey.c parcPublicKey_About.c - ) +) -add_executable(parc-publickey ${PARC_PUBLICKEY_SRC}) -target_link_libraries(parc-publickey ${PARC_BIN_LIBRARIES}) -install( TARGETS parc-publickey COMPONENT library RUNTIME DESTINATION bin ) +if (NOT DISABLE_EXECUTABLES) + add_executable(parc-publickey ${PARC_PUBLICKEY_SRC}) + target_link_libraries(parc-publickey ${PARC_BIN_LIBRARIES}) + install( TARGETS parc-publickey COMPONENT library RUNTIME DESTINATION bin ) +endif ()
\ No newline at end of file diff --git a/libparc/parc/security/parc_DiffieHellmanKeyShare.c b/libparc/parc/security/parc_DiffieHellmanKeyShare.c index 48c3ee26..0a666135 100644 --- a/libparc/parc/security/parc_DiffieHellmanKeyShare.c +++ b/libparc/parc/security/parc_DiffieHellmanKeyShare.c @@ -25,6 +25,7 @@ #include <openssl/pem.h> #include <openssl/rand.h> +#include <openssl/bn.h> struct parc_diffie_hellman_keyshare { PARCDiffieHellmanGroup groupType; diff --git a/libparc/parc/security/parc_InMemoryVerifier.c b/libparc/parc/security/parc_InMemoryVerifier.c index b713abce..32ffee1c 100644 --- a/libparc/parc/security/parc_InMemoryVerifier.c +++ b/libparc/parc/security/parc_InMemoryVerifier.c @@ -35,6 +35,7 @@ #include <openssl/x509v3.h> #include <openssl/ecdsa.h> +#include <openssl/rsa.h> struct parc_inmemory_verifier { diff --git a/libparc/parc/security/parc_PublicKeySigner.c b/libparc/parc/security/parc_PublicKeySigner.c index 5992c744..ddbcad74 100644 --- a/libparc/parc/security/parc_PublicKeySigner.c +++ b/libparc/parc/security/parc_PublicKeySigner.c @@ -30,7 +30,7 @@ #include <openssl/pkcs12.h> #include <openssl/x509v3.h> #include <openssl/err.h> - +#include <openssl/rsa.h> struct PARCPublicKeySigner { PARCKeyStore *keyStore; PARCSigningAlgorithm signingAlgorithm; diff --git a/libparc/parc/security/parc_X509Certificate.c b/libparc/parc/security/parc_X509Certificate.c index ab29bfa6..accb1f07 100644 --- a/libparc/parc/security/parc_X509Certificate.c +++ b/libparc/parc/security/parc_X509Certificate.c @@ -37,6 +37,7 @@ #include <openssl/x509v3.h> #include <openssl/rand.h> #include <openssl/pkcs12.h> +#include <openssl/x509.h> static PARCCryptoHash *_getPublicKeyDigest(void *interfaceContext); static PARCCryptoHash *_getCertificateDigest(void *interfaceContext); |