Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 1 | // Copyright (C) 2014 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // libkeymaster_messages contains just the code necessary to communicate with a |
| 16 | // AndroidKeymaster implementation, e.g. one running in TrustZone. |
Bob Badour | b655685 | 2021-02-12 17:45:20 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["system_keymaster_license"], |
| 19 | } |
| 20 | |
| 21 | // Added automatically by a large-scale-change that took the approach of |
| 22 | // 'apply every license found to every target'. While this makes sure we respect |
| 23 | // every license restriction, it may not be entirely correct. |
| 24 | // |
| 25 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 26 | // |
| 27 | // Please consider splitting the single license below into multiple licenses, |
| 28 | // taking care not to lose any license_kind information, and overriding the |
| 29 | // default license using the 'licenses: [...]' property on targets as needed. |
| 30 | // |
| 31 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 32 | // to attach the license to, and including a comment whether the files may be |
| 33 | // used in the current project. |
| 34 | // See: http://go/android-license-faq |
| 35 | license { |
| 36 | name: "system_keymaster_license", |
| 37 | visibility: [":__subpackages__"], |
| 38 | license_kinds: [ |
| 39 | "SPDX-license-identifier-Apache-2.0", |
| 40 | "SPDX-license-identifier-ISC", |
| 41 | "legacy_unencumbered", |
| 42 | ], |
| 43 | license_text: [ |
| 44 | "NOTICE", |
| 45 | ], |
| 46 | } |
| 47 | |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 48 | cc_defaults { |
| 49 | name: "keymaster_defaults", |
| 50 | vendor_available: true, |
| 51 | cflags: [ |
| 52 | "-Wall", |
| 53 | "-Werror", |
| 54 | "-Wunused", |
| 55 | ], |
| 56 | clang: true, |
| 57 | clang_cflags: [ |
| 58 | "-Wno-error=unused-const-variable", |
| 59 | "-Wno-error=unused-private-field", |
| 60 | "-Wimplicit-fallthrough", |
| 61 | // TODO(krasin): reenable coverage flags, when the new Clang toolchain is released. |
| 62 | // Currently, if enabled, these flags will cause an internal error in Clang. |
| 63 | "-fno-sanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" |
| 64 | ], |
Shawn Willden | 9a3792e | 2021-04-08 09:38:14 -0600 | [diff] [blame] | 65 | tidy: true, |
| 66 | tidy_checks: [ |
| 67 | "-performance-noexcept-move-constructor", |
| 68 | ], |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 69 | sanitize: { |
| 70 | integer_overflow: false, |
| 71 | }, |
| 72 | } |
| 73 | |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 74 | cc_library_shared { |
| 75 | name: "libkeymaster_messages", |
| 76 | srcs: [ |
Janis Danisevskis | f54cc93 | 2017-05-10 15:29:10 -0700 | [diff] [blame] | 77 | "android_keymaster/android_keymaster_messages.cpp", |
| 78 | "android_keymaster/android_keymaster_utils.cpp", |
| 79 | "android_keymaster/authorization_set.cpp", |
| 80 | "android_keymaster/keymaster_tags.cpp", |
| 81 | "android_keymaster/logger.cpp", |
| 82 | "android_keymaster/serializable.cpp", |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 83 | ], |
Yifan Hong | f0b39bb | 2017-04-18 17:07:58 -0700 | [diff] [blame] | 84 | header_libs: ["libhardware_headers"], |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 85 | defaults: ["keymaster_defaults" ], |
| 86 | clang_cflags: [ |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 87 | "-DKEYMASTER_NAME_TAGS", |
| 88 | ], |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 89 | export_include_dirs: ["include"], |
A. Cody Schuffelen | 65667f8 | 2020-04-29 14:52:49 -0700 | [diff] [blame] | 90 | host_supported: true, |
| 91 | target: { |
| 92 | host: { |
| 93 | clang_cflags: [ |
| 94 | "-fno-rtti", // TODO(b/156427382): Remove workaround when possible. |
| 95 | ], |
| 96 | }, |
| 97 | }, |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 98 | } |
| 99 | |
Janis Danisevskis | f38a002 | 2017-04-26 14:44:46 -0700 | [diff] [blame] | 100 | // libkeymaster_portable contains almost everything needed for a keymaster |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 101 | // implementation, lacking only a subclass of the (abstract) KeymasterContext |
| 102 | // class to provide environment-specific services and a wrapper to translate from |
| 103 | // the function-based keymaster HAL API to the message-based AndroidKeymaster API. |
Shawn Willden | 25814f0 | 2018-04-02 10:55:34 -0600 | [diff] [blame] | 104 | cc_library { |
Janis Danisevskis | f38a002 | 2017-04-26 14:44:46 -0700 | [diff] [blame] | 105 | name: "libkeymaster_portable", |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 106 | srcs: [ |
Shawn Willden | fb9b2a4 | 2017-12-21 12:35:06 -0700 | [diff] [blame] | 107 | "android_keymaster/android_keymaster.cpp", |
| 108 | "android_keymaster/android_keymaster_messages.cpp", |
| 109 | "android_keymaster/android_keymaster_utils.cpp", |
| 110 | "android_keymaster/authorization_set.cpp", |
| 111 | "android_keymaster/keymaster_enforcement.cpp", |
Shawn Willden | fb9b2a4 | 2017-12-21 12:35:06 -0700 | [diff] [blame] | 112 | "android_keymaster/keymaster_tags.cpp", |
| 113 | "android_keymaster/logger.cpp", |
| 114 | "android_keymaster/operation.cpp", |
| 115 | "android_keymaster/operation_table.cpp", |
Qi Wu | d8b7921 | 2021-02-08 01:18:52 +0800 | [diff] [blame] | 116 | "android_keymaster/pure_soft_secure_key_storage.cpp", |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 117 | "android_keymaster/remote_provisioning_utils.cpp", |
Shawn Willden | fb9b2a4 | 2017-12-21 12:35:06 -0700 | [diff] [blame] | 118 | "android_keymaster/serializable.cpp", |
| 119 | "key_blob_utils/auth_encrypted_key_blob.cpp", |
| 120 | "key_blob_utils/integrity_assured_key_blob.cpp", |
| 121 | "key_blob_utils/ocb.c", |
| 122 | "key_blob_utils/ocb_utils.cpp", |
| 123 | "key_blob_utils/software_keyblobs.cpp", |
Janis Danisevskis | f54cc93 | 2017-05-10 15:29:10 -0700 | [diff] [blame] | 124 | "km_openssl/aes_key.cpp", |
| 125 | "km_openssl/aes_operation.cpp", |
| 126 | "km_openssl/asymmetric_key.cpp", |
| 127 | "km_openssl/asymmetric_key_factory.cpp", |
| 128 | "km_openssl/attestation_record.cpp", |
Mustafa Yigit Bilgen | 01a9b8b | 2018-11-07 16:08:08 -0800 | [diff] [blame] | 129 | "km_openssl/attestation_utils.cpp", |
Shawn Willden | a2f1a9b | 2018-01-09 09:37:43 -0700 | [diff] [blame] | 130 | "km_openssl/block_cipher_operation.cpp", |
Janis Danisevskis | 197c17f | 2020-10-30 15:25:52 -0700 | [diff] [blame] | 131 | "km_openssl/certificate_utils.cpp", |
Shawn Willden | 8b94058 | 2018-01-02 10:53:39 -0700 | [diff] [blame] | 132 | "km_openssl/ckdf.cpp", |
David Drysdale | 207d0a3 | 2021-11-05 17:04:54 +0000 | [diff] [blame] | 133 | "km_openssl/curve25519_key.cpp", |
Janis Danisevskis | f54cc93 | 2017-05-10 15:29:10 -0700 | [diff] [blame] | 134 | "km_openssl/ec_key.cpp", |
| 135 | "km_openssl/ec_key_factory.cpp", |
David Zeuthen | a843b3d | 2021-01-19 16:01:00 -0500 | [diff] [blame] | 136 | "km_openssl/ecdh_operation.cpp", |
Shawn Willden | fb9b2a4 | 2017-12-21 12:35:06 -0700 | [diff] [blame] | 137 | "km_openssl/ecdsa_operation.cpp", |
| 138 | "km_openssl/ecies_kem.cpp", |
| 139 | "km_openssl/hkdf.cpp", |
| 140 | "km_openssl/hmac.cpp", |
Janis Danisevskis | f54cc93 | 2017-05-10 15:29:10 -0700 | [diff] [blame] | 141 | "km_openssl/hmac_key.cpp", |
| 142 | "km_openssl/hmac_operation.cpp", |
Shawn Willden | fb9b2a4 | 2017-12-21 12:35:06 -0700 | [diff] [blame] | 143 | "km_openssl/iso18033kdf.cpp", |
| 144 | "km_openssl/kdf.cpp", |
| 145 | "km_openssl/nist_curve_key_exchange.cpp", |
Janis Danisevskis | f54cc93 | 2017-05-10 15:29:10 -0700 | [diff] [blame] | 146 | "km_openssl/openssl_err.cpp", |
| 147 | "km_openssl/openssl_utils.cpp", |
| 148 | "km_openssl/rsa_key.cpp", |
| 149 | "km_openssl/rsa_key_factory.cpp", |
| 150 | "km_openssl/rsa_operation.cpp", |
Janis Danisevskis | 41d5a74 | 2017-05-12 10:43:12 -0700 | [diff] [blame] | 151 | "km_openssl/software_random_source.cpp", |
Janis Danisevskis | f54cc93 | 2017-05-10 15:29:10 -0700 | [diff] [blame] | 152 | "km_openssl/symmetric_key.cpp", |
Shawn Willden | 7efc772 | 2018-01-08 22:00:12 -0700 | [diff] [blame] | 153 | "km_openssl/triple_des_key.cpp", |
| 154 | "km_openssl/triple_des_operation.cpp", |
Shawn Willden | dd7e8a0 | 2018-01-12 13:03:37 -0700 | [diff] [blame] | 155 | "km_openssl/wrapped_key.cpp", |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 156 | ], |
| 157 | |
| 158 | shared_libs: [ |
| 159 | "libcrypto", |
Bram Bonné | 738feea | 2020-09-15 21:17:07 +0200 | [diff] [blame] | 160 | "libcppbor_external", |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 161 | "libcppcose_rkp", |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 162 | ], |
Colin Cross | 79277d3 | 2020-12-10 12:08:19 -0800 | [diff] [blame] | 163 | export_shared_lib_headers: ["libcppbor_external"], |
| 164 | header_libs: ["libhardware_headers"], |
| 165 | export_header_lib_headers: ["libhardware_headers"], |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 166 | defaults: ["keymaster_defaults" ], |
A. Cody Schuffelen | 65667f8 | 2020-04-29 14:52:49 -0700 | [diff] [blame] | 167 | host_supported: true, |
Janis Danisevskis | f38a002 | 2017-04-26 14:44:46 -0700 | [diff] [blame] | 168 | export_include_dirs: ["include"], |
A. Cody Schuffelen | 65667f8 | 2020-04-29 14:52:49 -0700 | [diff] [blame] | 169 | target: { |
| 170 | host: { |
| 171 | clang_cflags: [ |
| 172 | "-fno-rtti", // TODO(b/156427382): Remove workaround when possible. |
| 173 | ], |
| 174 | }, |
| 175 | }, |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 176 | } |
| 177 | |
Jim Blackler | 4515a7f | 2021-10-11 13:38:59 +0000 | [diff] [blame] | 178 | // libsoftkeymaster provides a software-based keymaster HAL implementation. |
| 179 | // This is used by keystore as a fallback for when the hardware keymaster does |
| 180 | // not support the request. |
| 181 | cc_library { |
| 182 | name: "libsoftkeymasterdevice", |
| 183 | srcs: [ |
| 184 | "android_keymaster/keymaster_configuration.cpp", |
| 185 | "contexts/pure_soft_keymaster_context.cpp", |
| 186 | "contexts/pure_soft_remote_provisioning_context.cpp", |
| 187 | "contexts/soft_attestation_context.cpp", |
| 188 | "contexts/soft_keymaster_context.cpp", |
| 189 | "contexts/soft_keymaster_device.cpp", |
| 190 | "contexts/soft_keymaster_logger.cpp", |
| 191 | "km_openssl/soft_keymaster_enforcement.cpp", |
| 192 | "legacy_support/ec_keymaster1_key.cpp", |
| 193 | "legacy_support/ecdsa_keymaster1_operation.cpp", |
| 194 | "legacy_support/keymaster1_engine.cpp", |
| 195 | "legacy_support/keymaster1_legacy_support.cpp", |
| 196 | "legacy_support/rsa_keymaster1_key.cpp", |
| 197 | "legacy_support/rsa_keymaster1_operation.cpp", |
| 198 | ], |
| 199 | defaults: ["keymaster_defaults"], |
| 200 | shared_libs: [ |
| 201 | "libkeymaster_messages", |
| 202 | "libkeymaster_portable", |
| 203 | "libsoft_attestation_cert", |
| 204 | "liblog", |
| 205 | "libbase", |
| 206 | "libcppbor_external", |
| 207 | "libcppcose_rkp", |
| 208 | "libcrypto", |
| 209 | "libcutils", |
| 210 | ], |
| 211 | export_include_dirs: ["include"], |
| 212 | } |
| 213 | |
Shawn Willden | 25814f0 | 2018-04-02 10:55:34 -0600 | [diff] [blame] | 214 | cc_library { |
Selene Huang | b0d3830 | 2020-02-14 17:39:36 -0800 | [diff] [blame] | 215 | name: "libsoft_attestation_cert", |
| 216 | srcs: [ |
| 217 | "contexts/soft_attestation_cert.cpp", |
| 218 | ], |
| 219 | defaults: ["keymaster_defaults"], |
| 220 | shared_libs: [ |
| 221 | "libkeymaster_portable", |
| 222 | ], |
| 223 | |
A. Cody Schuffelen | 65667f8 | 2020-04-29 14:52:49 -0700 | [diff] [blame] | 224 | host_supported: true, |
Selene Huang | b0d3830 | 2020-02-14 17:39:36 -0800 | [diff] [blame] | 225 | export_include_dirs: ["include"], |
| 226 | } |
| 227 | |
| 228 | cc_library { |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 229 | name: "libpuresoftkeymasterdevice", |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 230 | srcs: [ |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 231 | "android_keymaster/keymaster_configuration.cpp", |
Shawn Willden | 903367c | 2020-12-15 09:48:08 -0700 | [diff] [blame] | 232 | "contexts/soft_attestation_context.cpp", |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 233 | "contexts/pure_soft_keymaster_context.cpp", |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 234 | "contexts/pure_soft_remote_provisioning_context.cpp", |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 235 | "contexts/soft_keymaster_logger.cpp", |
| 236 | "km_openssl/soft_keymaster_enforcement.cpp", |
| 237 | ], |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 238 | defaults: ["keymaster_defaults"], |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 239 | shared_libs: [ |
| 240 | "libkeymaster_messages", |
| 241 | "libkeymaster_portable", |
Selene Huang | b0d3830 | 2020-02-14 17:39:36 -0800 | [diff] [blame] | 242 | "libsoft_attestation_cert", |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 243 | "liblog", |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 244 | "libcppbor_external", |
| 245 | "libcppcose_rkp", |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 246 | "libcrypto", |
| 247 | "libcutils", |
Wei Wang | c33ecdf | 2018-06-27 11:53:26 -0700 | [diff] [blame] | 248 | "libbase", |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 249 | ], |
Janis Danisevskis | 1f8b1c9 | 2017-05-08 11:24:41 -0700 | [diff] [blame] | 250 | export_include_dirs: ["include"], |
| 251 | } |
| 252 | |
A. Cody Schuffelen | 24ba1e2 | 2020-05-06 19:41:36 -0700 | [diff] [blame] | 253 | cc_library { |
| 254 | name: "libpuresoftkeymasterdevice_host", |
| 255 | srcs: [ |
| 256 | "contexts/pure_soft_keymaster_context.cpp", |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 257 | "contexts/pure_soft_remote_provisioning_context.cpp", |
Shawn Willden | 903367c | 2020-12-15 09:48:08 -0700 | [diff] [blame] | 258 | "contexts/soft_attestation_context.cpp", |
A. Cody Schuffelen | 24ba1e2 | 2020-05-06 19:41:36 -0700 | [diff] [blame] | 259 | "contexts/soft_keymaster_logger.cpp", |
| 260 | "km_openssl/soft_keymaster_enforcement.cpp", |
| 261 | ], |
| 262 | defaults: ["keymaster_defaults"], |
| 263 | host_supported: true, |
| 264 | device_supported: false, |
| 265 | shared_libs: [ |
| 266 | "libkeymaster_messages", |
| 267 | "libkeymaster_portable", |
| 268 | "libsoft_attestation_cert", |
| 269 | "liblog", |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 270 | "libcppbor_external", |
| 271 | "libcppcose_rkp", |
A. Cody Schuffelen | 24ba1e2 | 2020-05-06 19:41:36 -0700 | [diff] [blame] | 272 | "libcrypto", |
| 273 | "libcutils", |
| 274 | "libbase", |
| 275 | ], |
| 276 | clang_cflags: [ |
| 277 | "-DKEYMASTER_NAME_TAGS", |
| 278 | "-fno-rtti", // TODO(b/156427382): Remove workaround when possible. |
| 279 | ], |
| 280 | export_include_dirs: ["include"], |
| 281 | } |
| 282 | |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 283 | cc_library_shared { |
| 284 | name: "libkeymaster3device", |
| 285 | srcs: [ |
Janis Danisevskis | 2fea235 | 2017-07-26 16:52:33 -0700 | [diff] [blame] | 286 | "legacy_support/keymaster_passthrough_key.cpp", |
| 287 | "legacy_support/keymaster_passthrough_engine.cpp", |
| 288 | "legacy_support/keymaster_passthrough_operation.cpp", |
Jim Blackler | 4515a7f | 2021-10-11 13:38:59 +0000 | [diff] [blame] | 289 | "contexts/keymaster1_passthrough_context.cpp", |
Janis Danisevskis | 2fea235 | 2017-07-26 16:52:33 -0700 | [diff] [blame] | 290 | "contexts/keymaster2_passthrough_context.cpp", |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 291 | "ng/AndroidKeymaster3Device.cpp", |
Janis Danisevskis | 2fea235 | 2017-07-26 16:52:33 -0700 | [diff] [blame] | 292 | "android_keymaster/keymaster_configuration.cpp", |
Jim Blackler | 4515a7f | 2021-10-11 13:38:59 +0000 | [diff] [blame] | 293 | "legacy_support/ec_keymaster1_key.cpp", |
| 294 | "legacy_support/ecdsa_keymaster1_operation.cpp", |
| 295 | "legacy_support/keymaster1_engine.cpp", |
| 296 | "legacy_support/keymaster1_legacy_support.cpp", |
| 297 | "legacy_support/rsa_keymaster1_key.cpp", |
| 298 | "legacy_support/rsa_keymaster1_operation.cpp", |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 299 | ], |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 300 | defaults: ["keymaster_defaults"], |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 301 | shared_libs: [ |
| 302 | "libkeymaster_messages", |
| 303 | "android.hardware.keymaster@3.0", |
| 304 | "libcrypto", |
| 305 | "libcutils", |
Janis Danisevskis | 2fea235 | 2017-07-26 16:52:33 -0700 | [diff] [blame] | 306 | "libbase", |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 307 | "libhidlbase", |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 308 | "libkeymaster_portable", |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 309 | "liblog", |
Selene Huang | b0d3830 | 2020-02-14 17:39:36 -0800 | [diff] [blame] | 310 | "libpuresoftkeymasterdevice", |
| 311 | "libsoft_attestation_cert", |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 312 | "libutils", |
| 313 | ], |
Janis Danisevskis | a68669b | 2017-02-06 11:46:54 +0000 | [diff] [blame] | 314 | export_include_dirs: ["include", "ng/include"], |
| 315 | } |
| 316 | |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 317 | cc_library_shared { |
| 318 | name: "libkeymaster4", |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 319 | srcs: [ |
| 320 | "legacy_support/keymaster_passthrough_key.cpp", |
| 321 | "legacy_support/keymaster_passthrough_engine.cpp", |
| 322 | "legacy_support/keymaster_passthrough_operation.cpp", |
Shawn Willden | efd0673 | 2017-11-30 19:34:16 -0700 | [diff] [blame] | 323 | "ng/AndroidKeymaster4Device.cpp", |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 324 | "android_keymaster/keymaster_configuration.cpp", |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 325 | ], |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 326 | defaults: ["keymaster_defaults"], |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 327 | shared_libs: [ |
| 328 | "libkeymaster_messages", |
| 329 | "android.hardware.keymaster@4.0", |
| 330 | "libcrypto", |
| 331 | "libcutils", |
| 332 | "libbase", |
| 333 | "libhidlbase", |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 334 | "libkeymaster_portable", |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 335 | "libpuresoftkeymasterdevice", |
| 336 | "liblog", |
| 337 | "libutils", |
| 338 | "libkeymaster4support", |
| 339 | ], |
Shawn Willden | 6daf984 | 2020-11-19 10:11:47 -0700 | [diff] [blame] | 340 | export_include_dirs: [ |
| 341 | "ng/include", |
| 342 | "include" |
| 343 | ], |
Shawn Willden | 9e14957 | 2017-10-30 16:08:21 -0600 | [diff] [blame] | 344 | } |
| 345 | |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 346 | cc_library_shared { |
| 347 | name: "libkeymaster41", |
| 348 | vendor_available: true, |
| 349 | srcs: [ |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 350 | "ng/AndroidKeymaster41Device.cpp", |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 351 | ], |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 352 | defaults: ["keymaster_defaults"], |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 353 | shared_libs: [ |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 354 | "android.hardware.keymaster@4.0", |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 355 | "android.hardware.keymaster@4.1", |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 356 | "libbase", |
| 357 | "libcrypto", |
| 358 | "libcutils", |
| 359 | "libhidlbase", |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 360 | "libkeymaster4", |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 361 | "libkeymaster4_1support", |
Shawn Willden | f7375d1 | 2020-01-15 17:01:27 -0700 | [diff] [blame] | 362 | "libkeymaster4support", |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 363 | "libkeymaster_messages", |
| 364 | "libkeymaster_portable", |
| 365 | "liblog", |
| 366 | "libpuresoftkeymasterdevice", |
| 367 | "libutils", |
| 368 | ], |
Shawn Willden | 8ae41b5 | 2019-10-28 12:54:16 -0600 | [diff] [blame] | 369 | export_include_dirs: ["ng/include"], |
| 370 | } |
| 371 | |
Shawn Willden | 815e896 | 2020-12-11 13:05:27 +0000 | [diff] [blame] | 372 | cc_library { |
Shawn Willden | 19d8dd2 | 2021-04-22 12:50:44 -0600 | [diff] [blame] | 373 | name: "lib_android_keymaster_keymint_utils", |
| 374 | vendor_available: true, |
| 375 | srcs: [ |
| 376 | "ng/KeyMintUtils.cpp", |
| 377 | ], |
David Drysdale | 6a039b2 | 2021-11-19 17:39:38 +0000 | [diff] [blame] | 378 | defaults: [ |
| 379 | "keymaster_defaults", |
| 380 | "keymint_use_latest_hal_aidl_ndk_shared", |
| 381 | ], |
Shawn Willden | 19d8dd2 | 2021-04-22 12:50:44 -0600 | [diff] [blame] | 382 | shared_libs: [ |
Shawn Willden | 19d8dd2 | 2021-04-22 12:50:44 -0600 | [diff] [blame] | 383 | "libbase", |
| 384 | "libhardware", |
| 385 | ], |
| 386 | export_include_dirs: [ |
| 387 | "ng/include", |
| 388 | "include", |
| 389 | ], |
| 390 | } |
| 391 | |
| 392 | cc_library { |
Shawn Willden | 815e896 | 2020-12-11 13:05:27 +0000 | [diff] [blame] | 393 | name: "libkeymint", |
| 394 | vendor_available: true, |
| 395 | srcs: [ |
| 396 | "android_keymaster/keymaster_configuration.cpp", |
| 397 | "legacy_support/keymaster_passthrough_engine.cpp", |
| 398 | "legacy_support/keymaster_passthrough_key.cpp", |
| 399 | "legacy_support/keymaster_passthrough_operation.cpp", |
| 400 | "ng/AndroidKeyMintDevice.cpp", |
| 401 | "ng/AndroidKeyMintOperation.cpp", |
Max Bires | 01799e0 | 2021-04-19 18:58:04 -0700 | [diff] [blame] | 402 | "ng/AndroidRemotelyProvisionedComponentDevice.cpp", |
Chirag Pathak | 7a07994 | 2021-01-25 20:16:30 +0000 | [diff] [blame] | 403 | "ng/AndroidSharedSecret.cpp", |
| 404 | "ng/AndroidSecureClock.cpp", |
Shawn Willden | 815e896 | 2020-12-11 13:05:27 +0000 | [diff] [blame] | 405 | ], |
David Drysdale | 6a039b2 | 2021-11-19 17:39:38 +0000 | [diff] [blame] | 406 | defaults: [ |
| 407 | "keymaster_defaults", |
| 408 | "keymint_use_latest_hal_aidl_ndk_shared", |
| 409 | ], |
Shawn Willden | 815e896 | 2020-12-11 13:05:27 +0000 | [diff] [blame] | 410 | shared_libs: [ |
David Drysdale | 6a039b2 | 2021-11-19 17:39:38 +0000 | [diff] [blame] | 411 | "libhidlbase", |
Jiyong Park | e11f34b | 2021-07-27 12:19:31 +0900 | [diff] [blame] | 412 | "android.hardware.security.secureclock-V1-ndk", |
| 413 | "android.hardware.security.sharedsecret-V1-ndk", |
Shawn Willden | 19d8dd2 | 2021-04-22 12:50:44 -0600 | [diff] [blame] | 414 | "lib_android_keymaster_keymint_utils", |
Shawn Willden | 815e896 | 2020-12-11 13:05:27 +0000 | [diff] [blame] | 415 | "libbase", |
| 416 | "libbinder_ndk", |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 417 | "libcppbor_external", |
Shawn Willden | 815e896 | 2020-12-11 13:05:27 +0000 | [diff] [blame] | 418 | "libcrypto", |
| 419 | "libcutils", |
| 420 | "libkeymaster_messages", |
Shawn Willden | 815e896 | 2020-12-11 13:05:27 +0000 | [diff] [blame] | 421 | "libkeymaster_portable", |
| 422 | "liblog", |
| 423 | "libpuresoftkeymasterdevice", |
| 424 | "libutils", |
| 425 | ], |
| 426 | export_include_dirs: ["include", "ng/include"], |
| 427 | } |
Selene Huang | fb81829 | 2020-05-27 04:58:16 -0700 | [diff] [blame] | 428 | |
Max Bires | 57c187a | 2021-03-03 16:30:16 -0800 | [diff] [blame] | 429 | cc_library { |
| 430 | name: "libcppcose_rkp", |
| 431 | vendor_available: true, |
| 432 | host_supported: true, |
| 433 | srcs: [ |
| 434 | "cppcose/cppcose.cpp", |
| 435 | ], |
| 436 | export_include_dirs: [ |
| 437 | "include", |
| 438 | ], |
| 439 | shared_libs: [ |
| 440 | "libcppbor_external", |
| 441 | "libcrypto", |
| 442 | "liblog", |
| 443 | ], |
| 444 | } |
| 445 | |
Corbin Souffrant | e947444 | 2020-08-28 16:46:58 -0700 | [diff] [blame] | 446 | cc_defaults { |
| 447 | name: "keymaster_fuzz_defaults", |
| 448 | header_libs: ["libhardware_headers"], |
| 449 | shared_libs: [ |
| 450 | "libkeymaster_messages", |
| 451 | ], |
| 452 | // Not using defaults because the fuzzer relies on sanitizers that are explicitly disabled there. |
| 453 | cflags: [ |
| 454 | "-Wall", |
| 455 | "-Werror", |
| 456 | "-Wunused", |
| 457 | "-Wno-error=unused-const-variable", |
| 458 | "-Wno-error=unused-private-field", |
| 459 | "-Wimplicit-fallthrough", |
| 460 | "-DKEYMASTER_NAME_TAGS", |
| 461 | ], |
| 462 | host_supported: true, |
| 463 | target: { |
| 464 | host: { |
| 465 | clang_cflags: [ |
| 466 | "-fno-rtti", // TODO(b/156427382): Remove when default library removes this |
| 467 | ], |
| 468 | }, |
| 469 | }, |
| 470 | } |
| 471 | |
| 472 | cc_fuzz { |
| 473 | name: "libkeymaster_fuzz_buffer", |
| 474 | defaults: ["keymaster_fuzz_defaults"], |
| 475 | srcs: [ |
| 476 | "tests/fuzzers/buffer_fuzz.cpp", |
| 477 | ], |
| 478 | } |
| 479 | |
| 480 | cc_fuzz { |
| 481 | name: "libkeymaster_fuzz_serializable", |
| 482 | defaults: ["keymaster_fuzz_defaults"], |
| 483 | srcs: [ |
| 484 | "tests/fuzzers/message_serializable_fuzz.cpp", |
| 485 | ], |
| 486 | } |