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