-# Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
+# Copyright (c) 2013-2019 Samsung Electronics Co., Ltd All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
MESSAGE("SECURITY_MDFPP_STATE_ENABLE DISABLED !")
ENDIF (DEFINED SECURITY_MDFPP_STATE_ENABLED)
-# password protection flag
-IF (DEFINED PASSWORD_PROTECTION_DISABLE)
- MESSAGE("PASSWORD_PROTECTION_DISABLE ENABLED !")
- ADD_DEFINITIONS("-DPASSWORD_PROTECTION_DISABLE")
-ENDIF (DEFINED PASSWORD_PROTECTION_DISABLE)
-
-# Dependencies
-PKG_CHECK_MODULES(CKM_DEP
- libsmack
+ADD_DEFINITIONS("-DCKM_TEST_DIR=\"${CKM_TEST_DIR}\"")
+ADD_DEFINITIONS("-DCKM_RW_DATA_DIR=\"${CKM_RW_DATA_DIR}\"")
+OPTION("TZ_BACKEND" OFF)
+IF(TZ_BACKEND)
+ ADD_DEFINITIONS("-DTZ_BACKEND")
+ENDIF(TZ_BACKEND)
+
+OPTION("TZ_BACKEND" OFF)
+IF(TZ_BACKEND)
+ ADD_DEFINITIONS("-DTZ_BACKEND")
+ENDIF(TZ_BACKEND)
+
+PKG_CHECK_MODULES(CKM_TEST_COMMON_DEP
+ REQUIRED
+ openssl1.1
key-manager
- dbus-1
- vconf
- REQUIRED)
-
-# Targets definition
-
-SET(CKM_SOURCES
- ${PROJECT_SOURCE_DIR}/src/ckm/access_provider2.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/main.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/capi-testcases.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/capi-certificate-chains.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/capi-access_control.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/async-api.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/ckm-common.cpp
-# ${PROJECT_SOURCE_DIR}/src/ckm/cc-mode.cpp
-# ${PROJECT_SOURCE_DIR}/src/ckm/password-integration.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/system-db.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/initial-values.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/clean-env.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/test-certs.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/algo-params.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/encryption-decryption-env.cpp
- ${PROJECT_SOURCE_DIR}/src/ckm/encryption-decryption.cpp
+ libtzplatform-config
)
-INCLUDE_DIRECTORIES(SYSTEM ${CKM_DEP_INCLUDE_DIRS})
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/common/ )
-INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/ckm/ )
-
-ADD_EXECUTABLE(${TARGET_CKM_TESTS} ${CKM_SOURCES})
-
-TARGET_LINK_LIBRARIES(${TARGET_CKM_TESTS} ${CKM_DEP_LIBRARIES} ${COMMON_TARGET_TEST})
+SET(CKM_TEST_COMMON_SRCS
+ ckm-common.cpp
+ test-certs.cpp
+)
-# Installation
+INCLUDE_DIRECTORIES(SYSTEM ${CKM_TEST_COMMON_DEP_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(
+ .
+ ${PROJECT_SOURCE_DIR}/src/common
+)
-INSTALL(TARGETS ${TARGET_CKM_TESTS} DESTINATION bin)
-INSTALL(FILES
- test1801.pkcs12
- pkcs.p12
- capi-t3096.p12
- XML_1_okay.xml
- XML_2_okay.xml
- XML_3_wrong.xml
- device_key.xml
- DESTINATION /usr/share/ckm-test
- )
+ADD_LIBRARY(${TARGET_CKM_TEST_COMMON} ${CKM_TEST_COMMON_SRCS})
-# C compilation
-SET(TARGET_C_COMPILATION_TEST "ckm-c-compilation-test")
-
-SET(C_COMPILATION_SOURCES
- ${PROJECT_SOURCE_DIR}/src/ckm/c-compilation.c
+TARGET_LINK_LIBRARIES(${TARGET_CKM_TEST_COMMON}
+ ${CKM_TEST_COMMON_DEP_LIBRARIES}
+ ${COMMON_TARGET_TEST}
)
-PKG_CHECK_MODULES(CKM_C_COMPILATION_DEP
- key-manager
- REQUIRED)
-
+# C compilation test
+SET(TARGET_C_COMPILATION_TEST "ckm-c-compilation-test")
+SET(C_COMPILATION_SOURCES c-compilation.c)
+PKG_CHECK_MODULES(CKM_C_COMPILATION_DEP REQUIRED key-manager)
ADD_EXECUTABLE(${TARGET_C_COMPILATION_TEST} ${C_COMPILATION_SOURCES})
-
TARGET_LINK_LIBRARIES(${TARGET_C_COMPILATION_TEST} ${CKM_C_COMPILATION_DEP_LIBRARIES})
+
+INSTALL(DIRECTORY resource/ DESTINATION ${CKM_TEST_DIR})
+
+ADD_SUBDIRECTORY(privileged)
+ADD_SUBDIRECTORY(unprivileged)