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", |
Shawn Willden | c67a8aa | 2017-12-03 17:51:29 -0700 | [diff] [blame^] | 25 | "Keymaster3.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 26 | "auth_token_table.cpp", |
| 27 | "blob.cpp", |
| 28 | "entropy.cpp", |
| 29 | "grant_store.cpp", |
| 30 | "key_store_service.cpp", |
| 31 | "keyblob_utils.cpp", |
| 32 | "keymaster_enforcement.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 33 | "keystore_attestation_id.cpp", |
| 34 | "keystore_main.cpp", |
| 35 | "keystore_utils.cpp", |
| 36 | "legacy_keymaster_device_wrapper.cpp", |
| 37 | "operation.cpp", |
| 38 | "permissions.cpp", |
| 39 | "user_state.cpp", |
| 40 | ], |
| 41 | shared_libs: [ |
| 42 | "android.hardware.keymaster@3.0", |
| 43 | "android.system.wifi.keystore@1.0", |
Shawn Willden | c67a8aa | 2017-12-03 17:51:29 -0700 | [diff] [blame^] | 44 | "libbase", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 45 | "libbinder", |
| 46 | "libcrypto", |
| 47 | "libcutils", |
| 48 | "libhardware", |
| 49 | "libhidlbase", |
| 50 | "libhidltransport", |
| 51 | "libhwbinder", |
| 52 | "libkeymaster_messages", |
| 53 | "libkeymaster_portable", |
| 54 | "libkeymaster_staging", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 55 | "libkeystore_aidl", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 56 | "libkeystore_binder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 57 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 58 | "liblog", |
| 59 | "libselinux", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 60 | "libsoftkeymasterdevice", |
| 61 | "libutils", |
| 62 | "libwifikeystorehal", |
| 63 | ], |
| 64 | init_rc: ["keystore.rc"], |
| 65 | aidl: { |
| 66 | include_dirs: ["frameworks/base/core/java/"], |
| 67 | }, |
| 68 | |
| 69 | product_variables: { |
| 70 | pdk: { |
| 71 | enabled: false, |
| 72 | }, |
| 73 | }, |
Rubin Xu | 0d0e113 | 2017-12-08 15:50:50 +0000 | [diff] [blame] | 74 | |
| 75 | required: ["keystore_cli_v2"], |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | cc_binary { |
| 79 | name: "keystore_cli", |
| 80 | defaults: ["keystore_defaults"], |
| 81 | tags: ["debug"], |
| 82 | |
| 83 | srcs: ["keystore_cli.cpp"], |
| 84 | shared_libs: [ |
| 85 | "android.hardware.keymaster@3.0", |
| 86 | "libbinder", |
| 87 | "libcrypto", |
| 88 | "libcutils", |
| 89 | "libhidlbase", |
| 90 | "libhwbinder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 91 | "libkeystore_aidl", // for IKeyStoreService.asInterface() |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 92 | "libkeystore_binder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 93 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 94 | "liblog", |
| 95 | "libutils", |
| 96 | ], |
| 97 | } |
| 98 | |
| 99 | cc_binary { |
| 100 | name: "keystore_cli_v2", |
| 101 | defaults: ["keystore_defaults"], |
| 102 | tags: ["debug"], |
| 103 | |
| 104 | cflags: [ |
| 105 | "-DKEYMASTER_NAME_TAGS", |
| 106 | "-Wno-unused-parameter", |
| 107 | ], |
| 108 | srcs: ["keystore_cli_v2.cpp"], |
| 109 | shared_libs: [ |
| 110 | "android.hardware.keymaster@3.0", |
| 111 | "libchrome", |
| 112 | "libhidlbase", |
| 113 | "libhwbinder", |
| 114 | "libkeystore_binder", |
| 115 | ], |
| 116 | |
| 117 | local_include_dirs: ["include"], |
| 118 | } |
| 119 | |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 120 | cc_library_shared { |
| 121 | name: "libkeystore_parcelables", |
| 122 | defaults: ["keystore_defaults"], |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 123 | export_include_dirs: ["include"], |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 124 | srcs: [ |
| 125 | "KeyAttestationApplicationId.cpp", |
| 126 | "KeyAttestationPackageInfo.cpp", |
| 127 | "KeymasterArguments.cpp", |
| 128 | "KeystoreArguments.cpp", |
| 129 | "OperationResult.cpp", |
| 130 | "Signature.cpp", |
| 131 | "keystore_aidl_hidl_marshalling_utils.cpp", |
| 132 | ], |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 133 | shared_libs: [ |
| 134 | "android.hardware.keymaster@3.0", |
| 135 | "libbinder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 136 | "libhardware", |
Dmitry Dementyev | af2968c | 2017-11-21 20:19:03 -0800 | [diff] [blame] | 137 | "libhidlbase", |
| 138 | "libhwbinder", |
| 139 | "liblog", |
| 140 | "libprotobuf-cpp-lite", |
| 141 | "libutils", |
| 142 | ], |
| 143 | export_shared_lib_headers: [ |
| 144 | "android.hardware.keymaster@3.0", |
| 145 | "libbinder", |
| 146 | "libhidlbase", |
| 147 | "libhwbinder", |
| 148 | ], |
| 149 | } |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 150 | // Library for keystore clients |
| 151 | cc_library_shared { |
| 152 | name: "libkeystore_binder", |
| 153 | defaults: ["keystore_defaults"], |
| 154 | |
| 155 | srcs: [ |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 156 | "authorization_set.cpp", |
| 157 | "keyblob_utils.cpp", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 158 | "keystore_client.proto", |
| 159 | "keystore_client_impl.cpp", |
| 160 | "keystore_get.cpp", |
| 161 | "keystore_tags_utils.cpp", |
| 162 | ], |
| 163 | shared_libs: [ |
| 164 | "android.hardware.keymaster@3.0", |
| 165 | "libbinder", |
| 166 | "libhidlbase", |
| 167 | "libhwbinder", |
| 168 | "liblog", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 169 | "libkeystore_aidl", |
| 170 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 171 | "libprotobuf-cpp-lite", |
| 172 | "libutils", |
| 173 | ], |
| 174 | |
| 175 | proto: { |
| 176 | type: "lite", |
| 177 | export_proto_headers: true, |
| 178 | }, |
Dmitry Dementyev | a447b3c | 2017-10-27 23:09:53 -0700 | [diff] [blame] | 179 | aidl: { |
| 180 | export_aidl_headers: true, |
| 181 | include_dirs: ["frameworks/base/core/java/"], |
| 182 | }, |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 183 | export_include_dirs: ["include"], |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 184 | export_shared_lib_headers: [ |
| 185 | "android.hardware.keymaster@3.0", |
| 186 | "libbinder", |
| 187 | "libhidlbase", |
| 188 | "libhwbinder", |
Dmitry Dementyev | ab8aa1c | 2017-11-28 12:13:22 -0800 | [diff] [blame] | 189 | "libkeystore_aidl", |
| 190 | "libkeystore_parcelables", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 191 | ], |
| 192 | } |
| 193 | |
| 194 | // Library for keystore clients using the WiFi HIDL interface |
| 195 | cc_library_shared { |
| 196 | name: "libkeystore-wifi-hidl", |
| 197 | defaults: ["keystore_defaults"], |
| 198 | |
| 199 | srcs: ["keystore_get_wifi_hidl.cpp"], |
| 200 | shared_libs: [ |
| 201 | "android.system.wifi.keystore@1.0", |
| 202 | "libbase", |
| 203 | "libhidlbase", |
| 204 | "libhidltransport", |
| 205 | "liblog", |
| 206 | "libutils", |
| 207 | ], |
| 208 | |
| 209 | export_include_dirs: ["include"], |
| 210 | |
| 211 | vendor: true, |
| 212 | } |
| 213 | |
| 214 | // Library for unit tests |
| 215 | cc_library_static { |
| 216 | name: "libkeystore_test", |
| 217 | defaults: ["keystore_defaults"], |
| 218 | |
Janis Danisevskis | 8f737ad | 2017-11-21 12:30:15 -0800 | [diff] [blame] | 219 | srcs: [ |
| 220 | "auth_token_table.cpp", |
| 221 | "authorization_set.cpp", |
| 222 | ], |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 223 | static_libs: ["libgtest_main"], |
| 224 | shared_libs: [ |
| 225 | "android.hardware.keymaster@3.0", |
| 226 | "libhidlbase", |
| 227 | "libhwbinder", |
Jeff Sharkey | c493cf9 | 2017-10-23 10:39:50 -0600 | [diff] [blame] | 228 | "libutils", |
| 229 | ], |
| 230 | export_shared_lib_headers: [ |
| 231 | "android.hardware.keymaster@3.0", |
| 232 | "libhidlbase", |
| 233 | "libhwbinder", |
| 234 | ], |
| 235 | |
| 236 | export_include_dirs: ["include"], |
| 237 | } |
| 238 | |
| 239 | subdirs = ["tests"] |