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/file-lock.cpp
42 ${KEY_MANAGER_PATH}/service/access-control.cpp
43 ${KEY_MANAGER_PATH}/service/ckm-service.cpp
44 ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
45 ${KEY_MANAGER_PATH}/service/key-provider.cpp
46 ${KEY_MANAGER_PATH}/service/ocsp.cpp
47 ${KEY_MANAGER_PATH}/service/crypto-logic.cpp
48 ${KEY_MANAGER_PATH}/service/file-system.cpp
49 ${KEY_MANAGER_PATH}/service/db-crypto.cpp
50 ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
51 ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
52 ${KEY_MANAGER_PATH}/service/encryption-service.cpp
53 ${KEY_MANAGER_PATH}/service/encryption-logic.cpp
54 ${KEY_MANAGER_PATH}/initial-values/parser.cpp
55 ${KEY_MANAGER_PATH}/initial-values/BufferHandler.cpp
56 ${KEY_MANAGER_PATH}/initial-values/CertHandler.cpp
57 ${KEY_MANAGER_PATH}/initial-values/DataHandler.cpp
58 ${KEY_MANAGER_PATH}/initial-values/KeyHandler.cpp
59 ${KEY_MANAGER_PATH}/initial-values/PermissionHandler.cpp
60 ${KEY_MANAGER_PATH}/initial-values/InitialValueHandler.cpp
61 ${KEY_MANAGER_PATH}/initial-values/InitialValuesFile.cpp
62 ${KEY_MANAGER_PATH}/initial-values/NoCharactersHandler.cpp
63 ${KEY_MANAGER_PATH}/initial-values/SWKeyFile.cpp
64 ${KEY_MANAGER_PATH}/initial-values/xml-utils.cpp
65 ${KEY_MANAGER_PATH}/initial-values/initial-value-loader.cpp
66 ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
67 ${KEY_MANAGER_PATH}/dpl/db/src/sql_connection.cpp
68 ${KEY_MANAGER_PATH}/dpl/db/src/naive_synchronization_object.cpp
69 ${KEY_MANAGER_PATH}/sqlcipher/sqlcipher.c
70 ${KEY_MANAGER_PATH}/crypto/sw-backend/obj.cpp
71 ${KEY_MANAGER_PATH}/crypto/sw-backend/internals.cpp
72 ${KEY_MANAGER_PATH}/crypto/sw-backend/store.cpp
73 ${KEY_MANAGER_PATH}/crypto/platform/decider.cpp
74 ${KEY_MANAGER_PATH}/crypto/tz-backend/obj.cpp
75 ${KEY_MANAGER_PATH}/crypto/tz-backend/store.cpp
76 ${SECURITY_MANAGER_WRAPPER_PATH}
77 ${CYNARA_WRAPPER_PATH}
80 # -fPIE and -pie flag is added for ASLR
81 SET_SOURCE_FILES_PROPERTIES(
82 ${KEY_MANAGER_SOURCES}
84 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -fPIE")
86 INCLUDE_DIRECTORIES(SYSTEM
87 ${KEY_MANAGER_DEP_INCLUDE_DIRS}
91 ${KEY_MANAGER_SRC_PATH}/include
92 ${KEY_MANAGER_PATH}/main
93 ${KEY_MANAGER_PATH}/common
94 ${KEY_MANAGER_PATH}/service
95 ${KEY_MANAGER_PATH}/initial-values
96 ${KEY_MANAGER_PATH}/sqlcipher
97 ${KEY_MANAGER_PATH}/dpl/core/include
98 ${KEY_MANAGER_PATH}/dpl/log/include
99 ${KEY_MANAGER_PATH}/dpl/db/include
100 ${KEY_MANAGER_PATH}/crypto
103 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
105 # pie flag is added for ASLR
106 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
107 ${CMAKE_THREAD_LIBS_INIT}
108 ${KEY_MANAGER_DEP_LIBRARIES}
109 ${TARGET_KEY_MANAGER_COMMON}
113 ################################################################################
115 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
116 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
118 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
119 SET(KEY_MANAGER_CLIENT_ASYNC_SRC_PATH ${KEY_MANAGER_PATH}/client-async)
120 SET(KEY_MANAGER_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
123 ${KEY_MANAGER_PATH}/client
124 ${KEY_MANAGER_PATH}/client-async
125 ${KEY_MANAGER_PATH}/client-capi
126 ${KEY_MANAGER_PATH}/common
127 ${KEY_MANAGER_PATH}/dpl/core/include
128 ${KEY_MANAGER_PATH}/dpl/log/include
131 SET(KEY_MANAGER_CLIENT_SOURCES
132 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
133 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
134 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager.cpp
135 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
136 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async.cpp
137 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async-impl.cpp
138 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/connection-thread.cpp
139 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/async-request.cpp
140 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/service.cpp
141 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/storage-receiver.cpp
142 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/ocsp-receiver.cpp
143 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/encryption-receiver.cpp
144 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/descriptor-set.cpp
145 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
146 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-error.cpp
147 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
148 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
151 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
153 SET_TARGET_PROPERTIES(
154 ${TARGET_KEY_MANAGER_CLIENT}
156 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
157 SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
158 VERSION ${KEY_MANAGER_CLIENT_VERSION}
161 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
162 ${KEY_MANAGER_DEP_LIBRARIES}
163 ${TARGET_KEY_MANAGER_COMMON}
166 ################################################################################
168 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
169 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
171 SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
172 SET(KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
175 ${KEY_MANAGER_PATH}/client
176 ${KEY_MANAGER_PATH}/client-capi
177 ${KEY_MANAGER_PATH}/common
178 ${KEY_MANAGER_PATH}/dpl/core/include
179 ${KEY_MANAGER_PATH}/dpl/log/include
182 SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
183 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
184 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
185 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-control.cpp
186 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
189 ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
191 SET_TARGET_PROPERTIES(
192 ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
194 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
195 SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
196 VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
199 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
200 ${KEY_MANAGER_DEP_LIBRARIES}
201 ${TARGET_KEY_MANAGER_COMMON}
204 ################################################################################
205 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
206 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
208 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
212 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager.h
213 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager-async.h
214 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
215 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
216 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
217 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
218 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
219 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
220 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
221 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
222 DESTINATION /usr/include/ckm/ckm
225 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-manager.h
226 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-control.h
227 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-error.h
228 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-type.h
229 DESTINATION /usr/include/ckm/ckmc
231 ################################################################################
233 ADD_SUBDIRECTORY(manager)
234 ADD_SUBDIRECTORY(pam_plugin)