1 PKG_CHECK_MODULES(KEY_MANAGER_DEP
15 FIND_PACKAGE(Threads REQUIRED)
17 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
18 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
20 IF (MOCKUP_SM MATCHES "ON")
21 IF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
22 MESSAGE(FATAL_ERROR "You cannot compile release version with SECURITY MOCKUPS!")
23 ENDIF (CMAKE_BUILD_TYPE MATCHES "RELEASE")
24 MESSAGE("USING MOCKUPS INSTEAD SECURITY MODULES (SECURITY MANAGER AND CYNARA)")
25 SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-mockup.cpp)
26 SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara-mockup.cpp)
27 ELSE (MOCKUP_SM MATCHES "ON")
28 SET(SECURITY_MANAGER_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/socket-2-id-wrapper.cpp)
29 SET(CYNARA_WRAPPER_PATH ${KEY_MANAGER_PATH}/main/cynara.cpp)
30 ENDIF (MOCKUP_SM MATCHES "ON")
32 SET(KEY_MANAGER_SOURCES
33 ${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
34 ${KEY_MANAGER_PATH}/main/socket-manager.cpp
35 ${KEY_MANAGER_PATH}/main/key-manager-main.cpp
36 ${KEY_MANAGER_PATH}/main/smack-check.cpp
37 ${KEY_MANAGER_PATH}/main/thread-service.cpp
38 ${KEY_MANAGER_PATH}/main/socket-2-id.cpp
39 ${KEY_MANAGER_PATH}/service/certificate-store.cpp
40 ${KEY_MANAGER_PATH}/service/certificate-config.cpp
41 ${KEY_MANAGER_PATH}/service/digest.cpp
42 ${KEY_MANAGER_PATH}/service/file-lock.cpp
43 ${KEY_MANAGER_PATH}/service/access-control.cpp
44 ${KEY_MANAGER_PATH}/service/ckm-service.cpp
45 ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
46 ${KEY_MANAGER_PATH}/service/key-provider.cpp
47 ${KEY_MANAGER_PATH}/service/ocsp.cpp
48 ${KEY_MANAGER_PATH}/service/crypto-logic.cpp
49 ${KEY_MANAGER_PATH}/service/file-system.cpp
50 ${KEY_MANAGER_PATH}/service/db-crypto.cpp
51 ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
52 ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
53 ${KEY_MANAGER_PATH}/service/encryption-service.cpp
54 ${KEY_MANAGER_PATH}/service/encryption-logic.cpp
55 ${KEY_MANAGER_PATH}/initial-values/parser.cpp
56 ${KEY_MANAGER_PATH}/initial-values/BufferHandler.cpp
57 ${KEY_MANAGER_PATH}/initial-values/CertHandler.cpp
58 ${KEY_MANAGER_PATH}/initial-values/DataHandler.cpp
59 ${KEY_MANAGER_PATH}/initial-values/KeyHandler.cpp
60 ${KEY_MANAGER_PATH}/initial-values/PermissionHandler.cpp
61 ${KEY_MANAGER_PATH}/initial-values/InitialValueHandler.cpp
62 ${KEY_MANAGER_PATH}/initial-values/InitialValuesFile.cpp
63 ${KEY_MANAGER_PATH}/initial-values/NoCharactersHandler.cpp
64 ${KEY_MANAGER_PATH}/initial-values/xml-utils.cpp
65 ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
66 ${KEY_MANAGER_PATH}/dpl/db/src/sql_connection.cpp
67 ${KEY_MANAGER_PATH}/dpl/db/src/naive_synchronization_object.cpp
68 ${KEY_MANAGER_PATH}/sqlcipher/sqlcipher.c
69 ${KEY_MANAGER_PATH}/crypto/sw-backend/obj.cpp
70 ${KEY_MANAGER_PATH}/crypto/sw-backend/internals.cpp
71 ${KEY_MANAGER_PATH}/crypto/sw-backend/store.cpp
72 ${KEY_MANAGER_PATH}/crypto/platform/decider.cpp
73 ${KEY_MANAGER_PATH}/crypto/tz-backend/obj.cpp
74 ${KEY_MANAGER_PATH}/crypto/tz-backend/store.cpp
75 ${SECURITY_MANAGER_WRAPPER_PATH}
76 ${CYNARA_WRAPPER_PATH}
79 # -fPIE and -pie flag is added for ASLR
80 SET_SOURCE_FILES_PROPERTIES(
81 ${KEY_MANAGER_SOURCES}
83 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -fPIE")
85 INCLUDE_DIRECTORIES(SYSTEM
86 ${KEY_MANAGER_DEP_INCLUDE_DIRS}
90 ${KEY_MANAGER_SRC_PATH}/include
91 ${KEY_MANAGER_PATH}/main
92 ${KEY_MANAGER_PATH}/common
93 ${KEY_MANAGER_PATH}/service
94 ${KEY_MANAGER_PATH}/initial-values
95 ${KEY_MANAGER_PATH}/sqlcipher
96 ${KEY_MANAGER_PATH}/dpl/core/include
97 ${KEY_MANAGER_PATH}/dpl/log/include
98 ${KEY_MANAGER_PATH}/dpl/db/include
99 ${KEY_MANAGER_PATH}/crypto
102 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
104 # pie flag is added for ASLR
105 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
106 ${CMAKE_THREAD_LIBS_INIT}
107 ${KEY_MANAGER_DEP_LIBRARIES}
108 ${TARGET_KEY_MANAGER_COMMON}
112 ################################################################################
114 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
115 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
117 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
118 SET(KEY_MANAGER_CLIENT_ASYNC_SRC_PATH ${KEY_MANAGER_PATH}/client-async)
119 SET(KEY_MANAGER_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
122 ${KEY_MANAGER_PATH}/client
123 ${KEY_MANAGER_PATH}/client-async
124 ${KEY_MANAGER_PATH}/client-capi
125 ${KEY_MANAGER_PATH}/common
126 ${KEY_MANAGER_PATH}/dpl/core/include
127 ${KEY_MANAGER_PATH}/dpl/log/include
130 SET(KEY_MANAGER_CLIENT_SOURCES
131 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
132 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
133 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager.cpp
134 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
135 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async.cpp
136 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async-impl.cpp
137 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/connection-thread.cpp
138 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/async-request.cpp
139 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/service.cpp
140 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/storage-receiver.cpp
141 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/ocsp-receiver.cpp
142 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/encryption-receiver.cpp
143 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/descriptor-set.cpp
144 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
145 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-error.cpp
146 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
147 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
150 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
152 SET_TARGET_PROPERTIES(
153 ${TARGET_KEY_MANAGER_CLIENT}
155 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
156 SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
157 VERSION ${KEY_MANAGER_CLIENT_VERSION}
160 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
161 ${KEY_MANAGER_DEP_LIBRARIES}
162 ${TARGET_KEY_MANAGER_COMMON}
165 ################################################################################
167 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
168 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
170 SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
171 SET(KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
174 ${KEY_MANAGER_PATH}/client
175 ${KEY_MANAGER_PATH}/client-capi
176 ${KEY_MANAGER_PATH}/common
177 ${KEY_MANAGER_PATH}/dpl/core/include
178 ${KEY_MANAGER_PATH}/dpl/log/include
181 SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
182 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
183 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
184 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-control.cpp
185 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
188 ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
190 SET_TARGET_PROPERTIES(
191 ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
193 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
194 SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
195 VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
198 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
199 ${KEY_MANAGER_DEP_LIBRARIES}
200 ${TARGET_KEY_MANAGER_COMMON}
203 ################################################################################
204 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
205 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
207 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
211 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager.h
212 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager-async.h
213 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
214 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
215 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
216 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
217 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
218 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
219 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
220 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
221 DESTINATION /usr/include/ckm/ckm
224 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-manager.h
225 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-control.h
226 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-error.h
227 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-type.h
228 DESTINATION /usr/include/ckm/ckmc
230 ################################################################################
232 ADD_SUBDIRECTORY(manager)
233 ADD_SUBDIRECTORY(listener)
234 ADD_SUBDIRECTORY(pam_plugin)