1 PKG_CHECK_MODULES(KEY_MANAGER_DEP
17 FIND_PACKAGE(Threads REQUIRED)
19 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
20 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
22 IF (MOCKUP_SM MATCHES "ON")
23 IF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
24 MESSAGE(FATAL_ERROR "You cannot compile release version with SECURITY MOCKUPS!")
25 ENDIF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
26 MESSAGE("USING MOCKUPS INSTEAD SECURITY MODULES (SECURITY MANAGER AND CYNARA)")
27 SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-mockup.cpp)
28 SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara-mockup.cpp)
29 ELSE (MOCKUP_SM MATCHES "ON")
30 SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-wrapper.cpp)
31 SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara.cpp)
32 ENDIF (MOCKUP_SM MATCHES "ON")
34 SET(KEY_MANAGER_SOURCES
35 ${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
36 ${KEY_MANAGER_PATH}/main/key-manager-main.cpp
37 ${KEY_MANAGER_PATH}/main/smack-check.cpp
38 ${KEY_MANAGER_PATH}/main/socket-2-id.cpp
39 ${KEY_MANAGER_PATH}/main/socket-manager.cpp
40 ${KEY_MANAGER_PATH}/main/thread-service.cpp
41 ${KEY_MANAGER_PATH}/service/access-control.cpp
42 ${KEY_MANAGER_PATH}/service/certificate-config.cpp
43 ${KEY_MANAGER_PATH}/service/certificate-store.cpp
44 ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
45 ${KEY_MANAGER_PATH}/service/ckm-service.cpp
46 ${KEY_MANAGER_PATH}/service/crypto-logic.cpp
47 ${KEY_MANAGER_PATH}/service/db-crypto.cpp
48 ${KEY_MANAGER_PATH}/service/encryption-logic.cpp
49 ${KEY_MANAGER_PATH}/service/encryption-service.cpp
50 ${KEY_MANAGER_PATH}/service/file-lock.cpp
51 ${KEY_MANAGER_PATH}/service/file-system.cpp
52 ${KEY_MANAGER_PATH}/service/for-each-file.cpp
53 ${KEY_MANAGER_PATH}/service/glib-logic.cpp
54 ${KEY_MANAGER_PATH}/service/glib-service.cpp
55 ${KEY_MANAGER_PATH}/service/key-provider.cpp
56 ${KEY_MANAGER_PATH}/service/ocsp.cpp
57 ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
58 ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
59 ${KEY_MANAGER_PATH}/service/ss-migrate.cpp
60 ${KEY_MANAGER_PATH}/initial-values/parser.cpp
61 ${KEY_MANAGER_PATH}/initial-values/BufferHandler.cpp
62 ${KEY_MANAGER_PATH}/initial-values/CertHandler.cpp
63 ${KEY_MANAGER_PATH}/initial-values/DataHandler.cpp
64 ${KEY_MANAGER_PATH}/initial-values/KeyHandler.cpp
65 ${KEY_MANAGER_PATH}/initial-values/PermissionHandler.cpp
66 ${KEY_MANAGER_PATH}/initial-values/InitialValueHandler.cpp
67 ${KEY_MANAGER_PATH}/initial-values/InitialValuesFile.cpp
68 ${KEY_MANAGER_PATH}/initial-values/NoCharactersHandler.cpp
69 ${KEY_MANAGER_PATH}/initial-values/SWKeyFile.cpp
70 ${KEY_MANAGER_PATH}/initial-values/xml-utils.cpp
71 ${KEY_MANAGER_PATH}/initial-values/initial-value-loader.cpp
72 ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
73 ${KEY_MANAGER_PATH}/dpl/db/src/sql_connection.cpp
74 ${KEY_MANAGER_PATH}/dpl/db/src/naive_synchronization_object.cpp
75 ${KEY_MANAGER_PATH}/sqlcipher/sqlcipher.c
76 ${KEY_MANAGER_PATH}/crypto/sw-backend/obj.cpp
77 ${KEY_MANAGER_PATH}/crypto/sw-backend/internals.cpp
78 ${KEY_MANAGER_PATH}/crypto/sw-backend/store.cpp
79 ${KEY_MANAGER_PATH}/crypto/platform/decider.cpp
80 ${KEY_MANAGER_PATH}/crypto/tz-backend/obj.cpp
81 ${KEY_MANAGER_PATH}/crypto/tz-backend/store.cpp
82 ${SECURITY_MANAGER_WRAPPER_PATH}
83 ${CYNARA_WRAPPER_PATH}
86 # -fPIE and -pie flag is added for ASLR
87 SET_SOURCE_FILES_PROPERTIES(
88 ${KEY_MANAGER_SOURCES}
90 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -fPIE")
92 INCLUDE_DIRECTORIES(SYSTEM
93 ${KEY_MANAGER_DEP_INCLUDE_DIRS}
97 ${KEY_MANAGER_SRC_PATH}/include
98 ${KEY_MANAGER_PATH}/main
99 ${KEY_MANAGER_PATH}/common
100 ${KEY_MANAGER_PATH}/service
101 ${KEY_MANAGER_PATH}/initial-values
102 ${KEY_MANAGER_PATH}/sqlcipher
103 ${KEY_MANAGER_PATH}/dpl/core/include
104 ${KEY_MANAGER_PATH}/dpl/log/include
105 ${KEY_MANAGER_PATH}/dpl/db/include
106 ${KEY_MANAGER_PATH}/crypto
109 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
111 # pie flag is added for ASLR
112 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
113 ${CMAKE_THREAD_LIBS_INIT}
114 ${KEY_MANAGER_DEP_LIBRARIES}
115 ${TARGET_KEY_MANAGER_COMMON}
119 ################################################################################
121 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
122 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
124 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
125 SET(KEY_MANAGER_CLIENT_ASYNC_SRC_PATH ${KEY_MANAGER_PATH}/client-async)
126 SET(KEY_MANAGER_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
129 ${KEY_MANAGER_PATH}/client
130 ${KEY_MANAGER_PATH}/client-async
131 ${KEY_MANAGER_PATH}/client-capi
132 ${KEY_MANAGER_PATH}/common
133 ${KEY_MANAGER_PATH}/dpl/core/include
134 ${KEY_MANAGER_PATH}/dpl/log/include
137 SET(KEY_MANAGER_CLIENT_SOURCES
138 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
139 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager.cpp
140 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
141 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async.cpp
142 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async-impl.cpp
143 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/connection-thread.cpp
144 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/async-request.cpp
145 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/service.cpp
146 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/storage-receiver.cpp
147 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/ocsp-receiver.cpp
148 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/encryption-receiver.cpp
149 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/descriptor-set.cpp
150 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
151 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
152 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
155 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
157 SET_TARGET_PROPERTIES(
158 ${TARGET_KEY_MANAGER_CLIENT}
160 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
161 SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
162 VERSION ${KEY_MANAGER_CLIENT_VERSION}
165 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
166 ${KEY_MANAGER_DEP_LIBRARIES}
167 ${TARGET_KEY_MANAGER_COMMON}
170 ################################################################################
172 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
173 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
175 SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
176 SET(KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
179 ${KEY_MANAGER_PATH}/client
180 ${KEY_MANAGER_PATH}/client-capi
181 ${KEY_MANAGER_PATH}/common
182 ${KEY_MANAGER_PATH}/dpl/core/include
183 ${KEY_MANAGER_PATH}/dpl/log/include
186 SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
187 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
188 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
189 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-control.cpp
190 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
193 ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
195 SET_TARGET_PROPERTIES(
196 ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
198 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
199 SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
200 VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
203 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
204 ${KEY_MANAGER_DEP_LIBRARIES}
205 ${TARGET_KEY_MANAGER_COMMON}
208 ################################################################################
209 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
210 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
212 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION ${BIN_DIR})
216 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager.h
217 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager-async.h
218 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
219 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
220 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
221 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
222 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
223 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
224 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
225 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
226 DESTINATION /usr/include/ckm/ckm
229 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-manager.h
230 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-control.h
231 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-error.h
232 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-type.h
233 DESTINATION /usr/include/ckm/ckmc
235 ################################################################################
237 ADD_SUBDIRECTORY(manager)
238 ADD_SUBDIRECTORY(pam_plugin)