Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "keystore_defaults", |
| 3 | |
| 4 | cflags: [ |
| 5 | "-Wall", |
| 6 | "-Werror", |
| 7 | "-Wextra", |
| 8 | "-Wunused", |
| 9 | ], |
| 10 | |
| 11 | sanitize: { |
| 12 | misc_undefined: ["integer"], |
| 13 | }, |
| 14 | |
| 15 | clang: true, |
| 16 | } |
| 17 | |
| 18 | cc_binary { |
| 19 | name: "keystore", |
| 20 | defaults: ["keystore_defaults"], |
| 21 | |
| 22 | srcs: [ |
| 23 | ":IKeyAttestationApplicationIdProvider.aidl", |
Shawn Willden | fa5702f | 2017-12-03 15:14:58 -0700 | [diff] [blame] | 24 | "KeyStore.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 25 | "auth_token_table.cpp", |
| 26 | "blob.cpp", |
David Zeuthen | c6eb7cd | 2017-11-27 11:33:55 -0500 | [diff] [blame] | 27 | "confirmation_manager.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 28 | "grant_store.cpp", |
Max Bires | 33aac2d | 2018-02-23 10:53:10 -0800 | [diff] [blame] | 29 | "key_config.proto", |
| 30 | "key_proto_handler.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 31 | "key_store_service.cpp", |
| 32 | "keyblob_utils.cpp", |
| 33 | "keymaster_enforcement.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 34 | "keystore_attestation_id.cpp", |
| 35 | "keystore_main.cpp", |
| 36 | "keystore_utils.cpp", |
| 37 | "legacy_keymaster_device_wrapper.cpp", |
| 38 | "operation.cpp", |
Max Bires | 33aac2d | 2018-02-23 10:53:10 -0800 | [diff] [blame] | 39 | "operation_config.proto", |
| 40 | "operation_proto_handler.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 41 | "permissions.cpp", |
| 42 | "user_state.cpp", |
| 43 | ], |
| 44 | shared_libs: [ |
David Zeuthen | c6eb7cd | 2017-11-27 11:33:55 -0500 | [diff] [blame] | 45 | "android.hardware.confirmationui@1.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 46 | "android.hardware.keymaster@3.0", |
Shawn Willden | 0329a82 | 2017-12-04 13:55:14 -0700 | [diff] [blame] | 47 | "android.hardware.keymaster@4.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 48 | "android.system.wifi.keystore@1.0", |
Shawn Willden | c67a8aa | 2017-12-03 17:51:29 -0700 | [diff] [blame] | 49 | "libbase", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 50 | "libbinder", |
| 51 | "libcrypto", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 52 | "libhardware", |
| 53 | "libhidlbase", |
| 54 | "libhidltransport", |
| 55 | "libhwbinder", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 56 | "libkeymaster4support", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 57 | "libkeymaster_messages", |
| 58 | "libkeymaster_portable", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 59 | "libkeystore_aidl", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 60 | "libkeystore_binder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 61 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 62 | "liblog", |
Max Bires | 33aac2d | 2018-02-23 10:53:10 -0800 | [diff] [blame] | 63 | "libprotobuf-cpp-lite", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 64 | "libselinux", |
Max Bires | 33aac2d | 2018-02-23 10:53:10 -0800 | [diff] [blame] | 65 | "libservices", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 66 | "libsoftkeymasterdevice", |
| 67 | "libutils", |
| 68 | "libwifikeystorehal", |
| 69 | ], |
| 70 | init_rc: ["keystore.rc"], |
| 71 | aidl: { |
| 72 | include_dirs: ["frameworks/base/core/java/"], |
| 73 | }, |
| 74 | |
| 75 | product_variables: { |
| 76 | pdk: { |
| 77 | enabled: false, |
| 78 | }, |
Branden Archer | cfe00de | 2019-02-22 08:13:33 -0800 | [diff] [blame] | 79 | debuggable: { |
| 80 | cflags: [ |
| 81 | // Allow VTS tests running as root to have |
| 82 | // additional permissions. |
| 83 | "-DGRANT_ROOT_ALL_PERMISSIONS", |
| 84 | ], |
| 85 | }, |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 86 | }, |
Rubin Xu | 0d0e113 | 2017-12-08 15:50:50 +0000 | [diff] [blame] | 87 | |
| 88 | required: ["keystore_cli_v2"], |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | cc_binary { |
| 92 | name: "keystore_cli", |
| 93 | defaults: ["keystore_defaults"], |
| 94 | tags: ["debug"], |
| 95 | |
| 96 | srcs: ["keystore_cli.cpp"], |
| 97 | shared_libs: [ |
Brian Young | 9371e95 | 2018-02-23 18:03:14 +0000 | [diff] [blame] | 98 | "android.hardware.keymaster@4.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 99 | "libbinder", |
| 100 | "libcrypto", |
| 101 | "libcutils", |
| 102 | "libhidlbase", |
| 103 | "libhwbinder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 104 | "libkeystore_aidl", // for IKeyStoreService.asInterface() |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 105 | "libkeystore_binder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 106 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 107 | "liblog", |
| 108 | "libutils", |
| 109 | ], |
| 110 | } |
| 111 | |
| 112 | cc_binary { |
| 113 | name: "keystore_cli_v2", |
| 114 | defaults: ["keystore_defaults"], |
| 115 | tags: ["debug"], |
| 116 | |
| 117 | cflags: [ |
| 118 | "-DKEYMASTER_NAME_TAGS", |
| 119 | "-Wno-unused-parameter", |
| 120 | ], |
| 121 | srcs: ["keystore_cli_v2.cpp"], |
| 122 | shared_libs: [ |
David Zeuthen | c6eb7cd | 2017-11-27 11:33:55 -0500 | [diff] [blame] | 123 | "android.hardware.confirmationui@1.0", |
David Zeuthen | c6eb7cd | 2017-11-27 11:33:55 -0500 | [diff] [blame] | 124 | "libbinder", |
Brian Young | 9a947d5 | 2018-02-23 18:03:14 +0000 | [diff] [blame] | 125 | "android.hardware.keymaster@4.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 126 | "libchrome", |
David Zeuthen | c6eb7cd | 2017-11-27 11:33:55 -0500 | [diff] [blame] | 127 | "libutils", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 128 | "libhidlbase", |
| 129 | "libhwbinder", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 130 | "libkeymaster4support", |
David Zeuthen | c6eb7cd | 2017-11-27 11:33:55 -0500 | [diff] [blame] | 131 | "libkeystore_aidl", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 132 | "libkeystore_binder", |
David Zeuthen | c6eb7cd | 2017-11-27 11:33:55 -0500 | [diff] [blame] | 133 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 134 | ], |
| 135 | |
| 136 | local_include_dirs: ["include"], |
| 137 | } |
| 138 | |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 139 | cc_library_shared { |
| 140 | name: "libkeystore_parcelables", |
| 141 | defaults: ["keystore_defaults"], |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 142 | export_include_dirs: ["include"], |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 143 | srcs: [ |
| 144 | "KeyAttestationApplicationId.cpp", |
| 145 | "KeyAttestationPackageInfo.cpp", |
| 146 | "KeymasterArguments.cpp", |
| 147 | "KeystoreArguments.cpp", |
| 148 | "OperationResult.cpp", |
| 149 | "Signature.cpp", |
| 150 | "keystore_aidl_hidl_marshalling_utils.cpp", |
| 151 | ], |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 152 | shared_libs: [ |
Shawn Willden | 0329a82 | 2017-12-04 13:55:14 -0700 | [diff] [blame] | 153 | "android.hardware.keymaster@4.0", |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 154 | "libbinder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 155 | "libhardware", |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 156 | "libhidlbase", |
| 157 | "libhwbinder", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 158 | "libkeymaster4support", |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 159 | "liblog", |
| 160 | "libprotobuf-cpp-lite", |
| 161 | "libutils", |
| 162 | ], |
| 163 | export_shared_lib_headers: [ |
Shawn Willden | 0329a82 | 2017-12-04 13:55:14 -0700 | [diff] [blame] | 164 | "android.hardware.keymaster@4.0", |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 165 | "libbinder", |
| 166 | "libhidlbase", |
| 167 | "libhwbinder", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 168 | "libkeymaster4support", |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 169 | ], |
| 170 | } |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 171 | // Library for keystore clients |
| 172 | cc_library_shared { |
| 173 | name: "libkeystore_binder", |
| 174 | defaults: ["keystore_defaults"], |
| 175 | |
| 176 | srcs: [ |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 177 | "keyblob_utils.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 178 | "keystore_client.proto", |
| 179 | "keystore_client_impl.cpp", |
| 180 | "keystore_get.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 181 | ], |
| 182 | shared_libs: [ |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 183 | "android.hardware.keymaster@4.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 184 | "libbinder", |
| 185 | "libhidlbase", |
| 186 | "libhwbinder", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 187 | "libkeymaster4support", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 188 | "libkeystore_aidl", |
| 189 | "libkeystore_parcelables", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 190 | "liblog", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 191 | "libprotobuf-cpp-lite", |
| 192 | "libutils", |
| 193 | ], |
| 194 | |
| 195 | proto: { |
| 196 | type: "lite", |
| 197 | export_proto_headers: true, |
| 198 | }, |
Dmitry Dementyev | a447b3c | 2017-10-27 23:09:53 -0700 | [diff] [blame] | 199 | aidl: { |
| 200 | export_aidl_headers: true, |
| 201 | include_dirs: ["frameworks/base/core/java/"], |
| 202 | }, |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 203 | export_include_dirs: ["include"], |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 204 | export_shared_lib_headers: [ |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 205 | "android.hardware.keymaster@4.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 206 | "libbinder", |
| 207 | "libhidlbase", |
| 208 | "libhwbinder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 209 | "libkeystore_aidl", |
| 210 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 211 | ], |
| 212 | } |
| 213 | |
| 214 | // Library for keystore clients using the WiFi HIDL interface |
| 215 | cc_library_shared { |
| 216 | name: "libkeystore-wifi-hidl", |
| 217 | defaults: ["keystore_defaults"], |
| 218 | |
| 219 | srcs: ["keystore_get_wifi_hidl.cpp"], |
| 220 | shared_libs: [ |
| 221 | "android.system.wifi.keystore@1.0", |
| 222 | "libbase", |
| 223 | "libhidlbase", |
| 224 | "libhidltransport", |
| 225 | "liblog", |
| 226 | "libutils", |
| 227 | ], |
| 228 | |
| 229 | export_include_dirs: ["include"], |
| 230 | |
| 231 | vendor: true, |
| 232 | } |
| 233 | |
| 234 | // Library for unit tests |
| 235 | cc_library_static { |
| 236 | name: "libkeystore_test", |
| 237 | defaults: ["keystore_defaults"], |
| 238 | |
Janis Danisevskis | 8f737ad | 2017-11-21 12:30:15 -0800 | [diff] [blame] | 239 | srcs: [ |
| 240 | "auth_token_table.cpp", |
Janis Danisevskis | 8f737ad | 2017-11-21 12:30:15 -0800 | [diff] [blame] | 241 | ], |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 242 | cflags: [ "-O0", ], |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 243 | static_libs: ["libgtest_main"], |
| 244 | shared_libs: [ |
Shawn Willden | 0329a82 | 2017-12-04 13:55:14 -0700 | [diff] [blame] | 245 | "android.hardware.keymaster@4.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 246 | "libhidlbase", |
| 247 | "libhwbinder", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 248 | "libkeymaster4support", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 249 | "libutils", |
| 250 | ], |
| 251 | export_shared_lib_headers: [ |
Shawn Willden | 0329a82 | 2017-12-04 13:55:14 -0700 | [diff] [blame] | 252 | "android.hardware.keymaster@4.0", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 253 | "libhidlbase", |
| 254 | "libhwbinder", |
Shawn Willden | bb22a6c | 2017-12-06 19:35:28 -0700 | [diff] [blame] | 255 | "libkeymaster4support", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 256 | ], |
| 257 | |
| 258 | export_include_dirs: ["include"], |
| 259 | } |
| 260 | |
Logan Chien | 3bd6a51 | 2018-02-14 13:57:11 +0800 | [diff] [blame] | 261 | filegroup { |
| 262 | name: "keystore_aidl", |
| 263 | srcs: [ |
| 264 | "binder/android/security/IConfirmationPromptCallback.aidl", |
| 265 | "binder/android/security/IKeystoreService.aidl", |
| 266 | ], |
| 267 | } |
| 268 | |
| 269 | cc_library_shared { |
| 270 | name: "libkeystore_aidl", |
| 271 | srcs: [":keystore_aidl"], |
| 272 | aidl: { |
| 273 | export_aidl_headers: true, |
| 274 | include_dirs: [ |
| 275 | "system/security/keystore/binder", |
| 276 | ], |
| 277 | }, |
| 278 | shared_libs: [ |
| 279 | "libbinder", |
| 280 | "libcutils", |
| 281 | "libhardware", |
| 282 | "libhidlbase", |
| 283 | "libhidltransport", |
| 284 | "libhwbinder", |
| 285 | "libkeystore_parcelables", |
| 286 | "liblog", |
| 287 | "libselinux", |
| 288 | "libutils", |
| 289 | ], |
| 290 | export_shared_lib_headers: [ |
| 291 | "libbinder", |
| 292 | "libkeystore_parcelables", |
| 293 | ], |
| 294 | } |
| 295 | |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 296 | subdirs = ["tests"] |