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/SWKeyFile.cpp
65 ${KEY_MANAGER_PATH}/initial-values/xml-utils.cpp
66 ${KEY_MANAGER_PATH}/initial-values/initial-value-loader.cpp
67 ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
68 ${KEY_MANAGER_PATH}/dpl/db/src/sql_connection.cpp
69 ${KEY_MANAGER_PATH}/dpl/db/src/naive_synchronization_object.cpp
70 ${KEY_MANAGER_PATH}/sqlcipher/sqlcipher.c
71 ${KEY_MANAGER_PATH}/crypto/sw-backend/obj.cpp
72 ${KEY_MANAGER_PATH}/crypto/sw-backend/internals.cpp
73 ${KEY_MANAGER_PATH}/crypto/sw-backend/store.cpp
74 ${KEY_MANAGER_PATH}/crypto/platform/decider.cpp
75 ${KEY_MANAGER_PATH}/crypto/tz-backend/obj.cpp
76 ${KEY_MANAGER_PATH}/crypto/tz-backend/store.cpp
77 ${SECURITY_MANAGER_WRAPPER_PATH}
78 ${CYNARA_WRAPPER_PATH}
81 # -fPIE and -pie flag is added for ASLR
82 SET_SOURCE_FILES_PROPERTIES(
83 ${KEY_MANAGER_SOURCES}
85 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -fPIE")
87 INCLUDE_DIRECTORIES(SYSTEM
88 ${KEY_MANAGER_DEP_INCLUDE_DIRS}
92 ${KEY_MANAGER_SRC_PATH}/include
93 ${KEY_MANAGER_PATH}/main
94 ${KEY_MANAGER_PATH}/common
95 ${KEY_MANAGER_PATH}/service
96 ${KEY_MANAGER_PATH}/initial-values
97 ${KEY_MANAGER_PATH}/sqlcipher
98 ${KEY_MANAGER_PATH}/dpl/core/include
99 ${KEY_MANAGER_PATH}/dpl/log/include
100 ${KEY_MANAGER_PATH}/dpl/db/include
101 ${KEY_MANAGER_PATH}/crypto
104 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
106 # pie flag is added for ASLR
107 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
108 ${CMAKE_THREAD_LIBS_INIT}
109 ${KEY_MANAGER_DEP_LIBRARIES}
110 ${TARGET_KEY_MANAGER_COMMON}
114 ################################################################################
116 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
117 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
119 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
120 SET(KEY_MANAGER_CLIENT_ASYNC_SRC_PATH ${KEY_MANAGER_PATH}/client-async)
121 SET(KEY_MANAGER_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
124 ${KEY_MANAGER_PATH}/client
125 ${KEY_MANAGER_PATH}/client-async
126 ${KEY_MANAGER_PATH}/client-capi
127 ${KEY_MANAGER_PATH}/common
128 ${KEY_MANAGER_PATH}/dpl/core/include
129 ${KEY_MANAGER_PATH}/dpl/log/include
132 SET(KEY_MANAGER_CLIENT_SOURCES
133 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
134 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
135 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager.cpp
136 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
137 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async.cpp
138 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async-impl.cpp
139 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/connection-thread.cpp
140 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/async-request.cpp
141 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/service.cpp
142 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/storage-receiver.cpp
143 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/ocsp-receiver.cpp
144 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/encryption-receiver.cpp
145 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/descriptor-set.cpp
146 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
147 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-error.cpp
148 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
149 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
152 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
154 SET_TARGET_PROPERTIES(
155 ${TARGET_KEY_MANAGER_CLIENT}
157 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
158 SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
159 VERSION ${KEY_MANAGER_CLIENT_VERSION}
162 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
163 ${KEY_MANAGER_DEP_LIBRARIES}
164 ${TARGET_KEY_MANAGER_COMMON}
167 ################################################################################
169 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
170 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
172 SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
173 SET(KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
176 ${KEY_MANAGER_PATH}/client
177 ${KEY_MANAGER_PATH}/client-capi
178 ${KEY_MANAGER_PATH}/common
179 ${KEY_MANAGER_PATH}/dpl/core/include
180 ${KEY_MANAGER_PATH}/dpl/log/include
183 SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
184 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
185 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
186 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-control.cpp
187 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
190 ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
192 SET_TARGET_PROPERTIES(
193 ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
195 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
196 SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
197 VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
200 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
201 ${KEY_MANAGER_DEP_LIBRARIES}
202 ${TARGET_KEY_MANAGER_COMMON}
205 ################################################################################
206 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
207 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
209 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
213 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager.h
214 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager-async.h
215 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
216 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
217 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
218 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
219 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
220 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
221 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
222 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
223 DESTINATION /usr/include/ckm/ckm
226 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-manager.h
227 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-control.h
228 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-error.h
229 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-type.h
230 DESTINATION /usr/include/ckm/ckmc
232 ################################################################################
234 ADD_SUBDIRECTORY(manager)
235 ADD_SUBDIRECTORY(listener)
236 ADD_SUBDIRECTORY(pam_plugin)