-PKG_CHECK_MODULES(KEY_MANAGER_DEP
- REQUIRED
- dlog
- openssl
- libsmack
- libcrypto
- libsystemd-daemon
- capi-base-common
- capi-system-info
- libxml-2.0
- security-manager
- cynara-client-async
- cynara-creds-socket
- )
FIND_PACKAGE(Threads REQUIRED)
SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
-IF (MOCKUP_SM MATCHES "ON")
- IF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
- MESSAGE(FATAL_ERROR "You cannot compile release version with SECURITY MOCKUPS!")
- ENDIF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
- MESSAGE("USING MOCKUPS INSTEAD SECURITY MODULES (SECURITY MANAGER AND CYNARA)")
- SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-mockup.cpp)
- SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara-mockup.cpp)
-ELSE (MOCKUP_SM MATCHES "ON")
- SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-wrapper.cpp)
- SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara.cpp)
-ENDIF (MOCKUP_SM MATCHES "ON")
-
SET(KEY_MANAGER_SOURCES
+ ${KEY_MANAGER_PATH}/main/cynara.cpp
${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
- ${KEY_MANAGER_PATH}/main/socket-manager.cpp
${KEY_MANAGER_PATH}/main/key-manager-main.cpp
${KEY_MANAGER_PATH}/main/smack-check.cpp
- ${KEY_MANAGER_PATH}/main/thread-service.cpp
${KEY_MANAGER_PATH}/main/socket-2-id.cpp
- ${KEY_MANAGER_PATH}/service/certificate-store.cpp
- ${KEY_MANAGER_PATH}/service/certificate-config.cpp
- ${KEY_MANAGER_PATH}/service/digest.cpp
- ${KEY_MANAGER_PATH}/service/file-lock.cpp
+ ${KEY_MANAGER_PATH}/main/socket-manager.cpp
+ ${KEY_MANAGER_PATH}/main/thread-service.cpp
${KEY_MANAGER_PATH}/service/access-control.cpp
- ${KEY_MANAGER_PATH}/service/ckm-service.cpp
+ ${KEY_MANAGER_PATH}/service/certificate-config.cpp
+ ${KEY_MANAGER_PATH}/service/certificate-store.cpp
${KEY_MANAGER_PATH}/service/ckm-logic.cpp
- ${KEY_MANAGER_PATH}/service/key-provider.cpp
- ${KEY_MANAGER_PATH}/service/ocsp.cpp
+ ${KEY_MANAGER_PATH}/service/ckm-service.cpp
${KEY_MANAGER_PATH}/service/crypto-logic.cpp
- ${KEY_MANAGER_PATH}/service/file-system.cpp
${KEY_MANAGER_PATH}/service/db-crypto.cpp
- ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
- ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
- ${KEY_MANAGER_PATH}/service/encryption-service.cpp
${KEY_MANAGER_PATH}/service/encryption-logic.cpp
+ ${KEY_MANAGER_PATH}/service/encryption-service.cpp
+ ${KEY_MANAGER_PATH}/service/file-lock.cpp
+ ${KEY_MANAGER_PATH}/service/file-system.cpp
+ ${KEY_MANAGER_PATH}/service/for-each-file.cpp
+ ${KEY_MANAGER_PATH}/service/glib-logic.cpp
+ ${KEY_MANAGER_PATH}/service/glib-service.cpp
+ ${KEY_MANAGER_PATH}/service/key-provider.cpp
+ ${KEY_MANAGER_PATH}/service/ocsp.cpp
+ ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
+ ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
+ ${KEY_MANAGER_PATH}/service/ss-migrate.cpp
+ ${KEY_MANAGER_PATH}/service/ss-crypto.cpp
+ ${KEY_MANAGER_PATH}/service/permission.cpp
${KEY_MANAGER_PATH}/initial-values/parser.cpp
${KEY_MANAGER_PATH}/initial-values/BufferHandler.cpp
${KEY_MANAGER_PATH}/initial-values/CertHandler.cpp
${KEY_MANAGER_PATH}/initial-values/InitialValueHandler.cpp
${KEY_MANAGER_PATH}/initial-values/InitialValuesFile.cpp
${KEY_MANAGER_PATH}/initial-values/NoCharactersHandler.cpp
- ${KEY_MANAGER_PATH}/initial-values/SWKeyFile.cpp
${KEY_MANAGER_PATH}/initial-values/xml-utils.cpp
${KEY_MANAGER_PATH}/initial-values/initial-value-loader.cpp
- ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
${KEY_MANAGER_PATH}/dpl/db/src/sql_connection.cpp
${KEY_MANAGER_PATH}/dpl/db/src/naive_synchronization_object.cpp
- ${KEY_MANAGER_PATH}/sqlcipher/sqlcipher.c
${KEY_MANAGER_PATH}/crypto/sw-backend/obj.cpp
${KEY_MANAGER_PATH}/crypto/sw-backend/internals.cpp
${KEY_MANAGER_PATH}/crypto/sw-backend/store.cpp
+ ${KEY_MANAGER_PATH}/crypto/sw-backend/kbkdf.cpp
+ ${KEY_MANAGER_PATH}/crypto/sw-backend/ctx.cpp
${KEY_MANAGER_PATH}/crypto/platform/decider.cpp
- ${KEY_MANAGER_PATH}/crypto/tz-backend/obj.cpp
- ${KEY_MANAGER_PATH}/crypto/tz-backend/store.cpp
${SECURITY_MANAGER_WRAPPER_PATH}
${CYNARA_WRAPPER_PATH}
+ ${TZ_BACKEND_SOURCES}
+ ${SE_BACKEND_SOURCES}
)
-# -fPIE and -pie flag is added for ASLR
SET_SOURCE_FILES_PROPERTIES(
${KEY_MANAGER_SOURCES}
PROPERTIES
- COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -fPIE")
+ COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden")
INCLUDE_DIRECTORIES(SYSTEM
${KEY_MANAGER_DEP_INCLUDE_DIRS}
INCLUDE_DIRECTORIES(
${KEY_MANAGER_SRC_PATH}/include
+ ${PROJECT_SOURCE_DIR}/common
${KEY_MANAGER_PATH}/main
${KEY_MANAGER_PATH}/common
${KEY_MANAGER_PATH}/service
${KEY_MANAGER_PATH}/initial-values
- ${KEY_MANAGER_PATH}/sqlcipher
${KEY_MANAGER_PATH}/dpl/core/include
${KEY_MANAGER_PATH}/dpl/log/include
${KEY_MANAGER_PATH}/dpl/db/include
${KEY_MANAGER_PATH}/crypto
)
+LINK_DIRECTORIES(${KEY_MANAGER_DEP_LIBRARY_DIRS})
+
ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
-# pie flag is added for ASLR
TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
${CMAKE_THREAD_LIBS_INIT}
${KEY_MANAGER_DEP_LIBRARIES}
${TARGET_KEY_MANAGER_COMMON}
- -ldl -pie
+ ${KM_LINK_EXTRA_DEPS}
+ -ldl
)
-
################################################################################
SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
SET(KEY_MANAGER_CLIENT_SOURCES
${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
- ${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager.cpp
${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async.cpp
${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/encryption-receiver.cpp
${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/descriptor-set.cpp
${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
- ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-error.cpp
${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
)
SET_TARGET_PROPERTIES(
${TARGET_KEY_MANAGER_CLIENT}
PROPERTIES
- COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
+ COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -Wno-deprecated-declarations"
SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
VERSION ${KEY_MANAGER_CLIENT_VERSION}
)
SET_TARGET_PROPERTIES(
${TARGET_KEY_MANAGER_CONTROL_CLIENT}
PROPERTIES
- COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
+ COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -Wno-deprecated-declarations"
SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
)
INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
-INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
+INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION ${BIN_DIR})
INSTALL(FILES
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
+ ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-zero-memory.h
DESTINATION /usr/include/ckm/ckm
)
INSTALL(FILES
)
################################################################################
+CONFIGURE_FILE(
+ ${PROJECT_SOURCE_DIR}/packaging/key-manager.manifest.in
+ ${PROJECT_SOURCE_DIR}/key-manager.manifest @ONLY
+)
+
ADD_SUBDIRECTORY(manager)
-ADD_SUBDIRECTORY(listener)
ADD_SUBDIRECTORY(pam_plugin)