1 IF (DEFINED WATCHDOG_ENABLED)
2 SET(EXTRA_KM_DEPS argos_watchdog)
3 ELSE (DEFINED WATCHDOG_ENABLED)
5 ENDIF (DEFINED WATCHDOG_ENABLED)
7 PKG_CHECK_MODULES(KEY_MANAGER_DEP
24 FIND_PACKAGE(Threads REQUIRED)
26 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
27 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
29 IF (MOCKUP_SM MATCHES "ON")
30 IF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
31 MESSAGE(FATAL_ERROR "You cannot compile release version with SECURITY MOCKUPS!")
32 ENDIF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
33 MESSAGE("USING MOCKUPS INSTEAD SECURITY MODULES (SECURITY MANAGER AND CYNARA)")
34 SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-mockup.cpp)
35 SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara-mockup.cpp)
36 ELSE (MOCKUP_SM MATCHES "ON")
37 SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-wrapper.cpp)
38 SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara.cpp)
39 ENDIF (MOCKUP_SM MATCHES "ON")
41 SET(KEY_MANAGER_SOURCES
42 ${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
43 ${KEY_MANAGER_PATH}/main/key-manager-main.cpp
44 ${KEY_MANAGER_PATH}/main/smack-check.cpp
45 ${KEY_MANAGER_PATH}/main/socket-2-id.cpp
46 ${KEY_MANAGER_PATH}/main/socket-manager.cpp
47 ${KEY_MANAGER_PATH}/main/thread-service.cpp
48 ${KEY_MANAGER_PATH}/service/access-control.cpp
49 ${KEY_MANAGER_PATH}/service/certificate-config.cpp
50 ${KEY_MANAGER_PATH}/service/certificate-store.cpp
51 ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
52 ${KEY_MANAGER_PATH}/service/ckm-service.cpp
53 ${KEY_MANAGER_PATH}/service/crypto-logic.cpp
54 ${KEY_MANAGER_PATH}/service/db-crypto.cpp
55 ${KEY_MANAGER_PATH}/service/encryption-logic.cpp
56 ${KEY_MANAGER_PATH}/service/encryption-service.cpp
57 ${KEY_MANAGER_PATH}/service/file-lock.cpp
58 ${KEY_MANAGER_PATH}/service/file-system.cpp
59 ${KEY_MANAGER_PATH}/service/for-each-file.cpp
60 ${KEY_MANAGER_PATH}/service/glib-logic.cpp
61 ${KEY_MANAGER_PATH}/service/glib-service.cpp
62 ${KEY_MANAGER_PATH}/service/key-provider.cpp
63 ${KEY_MANAGER_PATH}/service/ocsp.cpp
64 ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
65 ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
66 ${KEY_MANAGER_PATH}/service/ss-migrate.cpp
67 ${KEY_MANAGER_PATH}/service/ss-crypto.cpp
68 ${KEY_MANAGER_PATH}/initial-values/parser.cpp
69 ${KEY_MANAGER_PATH}/initial-values/BufferHandler.cpp
70 ${KEY_MANAGER_PATH}/initial-values/CertHandler.cpp
71 ${KEY_MANAGER_PATH}/initial-values/DataHandler.cpp
72 ${KEY_MANAGER_PATH}/initial-values/KeyHandler.cpp
73 ${KEY_MANAGER_PATH}/initial-values/PermissionHandler.cpp
74 ${KEY_MANAGER_PATH}/initial-values/InitialValueHandler.cpp
75 ${KEY_MANAGER_PATH}/initial-values/InitialValuesFile.cpp
76 ${KEY_MANAGER_PATH}/initial-values/NoCharactersHandler.cpp
77 ${KEY_MANAGER_PATH}/initial-values/SWKeyFile.cpp
78 ${KEY_MANAGER_PATH}/initial-values/xml-utils.cpp
79 ${KEY_MANAGER_PATH}/initial-values/initial-value-loader.cpp
80 ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
81 ${KEY_MANAGER_PATH}/dpl/db/src/sql_connection.cpp
82 ${KEY_MANAGER_PATH}/dpl/db/src/naive_synchronization_object.cpp
83 ${KEY_MANAGER_PATH}/sqlcipher/sqlcipher.c
84 ${KEY_MANAGER_PATH}/crypto/sw-backend/obj.cpp
85 ${KEY_MANAGER_PATH}/crypto/sw-backend/internals.cpp
86 ${KEY_MANAGER_PATH}/crypto/sw-backend/store.cpp
87 ${KEY_MANAGER_PATH}/crypto/platform/decider.cpp
88 ${KEY_MANAGER_PATH}/crypto/tz-backend/obj.cpp
89 ${KEY_MANAGER_PATH}/crypto/tz-backend/store.cpp
90 ${SECURITY_MANAGER_WRAPPER_PATH}
91 ${CYNARA_WRAPPER_PATH}
94 # -fPIE and -pie flag is added for ASLR
95 SET_SOURCE_FILES_PROPERTIES(
96 ${KEY_MANAGER_SOURCES}
98 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -fPIE")
100 INCLUDE_DIRECTORIES(SYSTEM
101 ${KEY_MANAGER_DEP_INCLUDE_DIRS}
105 ${KEY_MANAGER_SRC_PATH}/include
106 ${KEY_MANAGER_PATH}/main
107 ${KEY_MANAGER_PATH}/common
108 ${KEY_MANAGER_PATH}/service
109 ${KEY_MANAGER_PATH}/initial-values
110 ${KEY_MANAGER_PATH}/sqlcipher
111 ${KEY_MANAGER_PATH}/dpl/core/include
112 ${KEY_MANAGER_PATH}/dpl/log/include
113 ${KEY_MANAGER_PATH}/dpl/db/include
114 ${KEY_MANAGER_PATH}/crypto
117 LINK_DIRECTORIES(KEY_MANAGER_DEP_LIBRARY_DIRS})
119 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
121 # pie flag is added for ASLR
122 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
123 ${CMAKE_THREAD_LIBS_INIT}
124 ${KEY_MANAGER_DEP_LIBRARIES}
125 ${TARGET_KEY_MANAGER_COMMON}
129 ################################################################################
131 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
132 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
134 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
135 SET(KEY_MANAGER_CLIENT_ASYNC_SRC_PATH ${KEY_MANAGER_PATH}/client-async)
136 SET(KEY_MANAGER_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
139 ${KEY_MANAGER_PATH}/client
140 ${KEY_MANAGER_PATH}/client-async
141 ${KEY_MANAGER_PATH}/client-capi
142 ${KEY_MANAGER_PATH}/common
143 ${KEY_MANAGER_PATH}/dpl/core/include
144 ${KEY_MANAGER_PATH}/dpl/log/include
147 SET(KEY_MANAGER_CLIENT_SOURCES
148 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
149 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager.cpp
150 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
151 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async.cpp
152 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async-impl.cpp
153 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/connection-thread.cpp
154 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/async-request.cpp
155 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/service.cpp
156 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/storage-receiver.cpp
157 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/ocsp-receiver.cpp
158 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/encryption-receiver.cpp
159 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/descriptor-set.cpp
160 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
161 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
162 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
165 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
167 SET_TARGET_PROPERTIES(
168 ${TARGET_KEY_MANAGER_CLIENT}
170 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden -Wno-deprecated-declarations"
171 SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
172 VERSION ${KEY_MANAGER_CLIENT_VERSION}
175 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
176 ${KEY_MANAGER_DEP_LIBRARIES}
177 ${TARGET_KEY_MANAGER_COMMON}
180 ################################################################################
182 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
183 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
185 SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
186 SET(KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
189 ${KEY_MANAGER_PATH}/client
190 ${KEY_MANAGER_PATH}/client-capi
191 ${KEY_MANAGER_PATH}/common
192 ${KEY_MANAGER_PATH}/dpl/core/include
193 ${KEY_MANAGER_PATH}/dpl/log/include
196 SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
197 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
198 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
199 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-control.cpp
200 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
203 ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
205 SET_TARGET_PROPERTIES(
206 ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
208 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden -Wno-deprecated-declarations"
209 SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
210 VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
213 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
214 ${KEY_MANAGER_DEP_LIBRARIES}
215 ${TARGET_KEY_MANAGER_COMMON}
218 ################################################################################
219 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
220 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
222 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION ${BIN_DIR})
226 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager.h
227 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager-async.h
228 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
229 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
230 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
231 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
232 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
233 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
234 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
235 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
236 DESTINATION /usr/include/ckm/ckm
239 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-manager.h
240 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-control.h
241 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-error.h
242 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-type.h
243 DESTINATION /usr/include/ckm/ckmc
245 ################################################################################
247 ADD_SUBDIRECTORY(manager)
248 ADD_SUBDIRECTORY(pam_plugin)