blob: 1d3e3eba0fbfcc3394f111d22e15da82a52bd86b [file] [log] [blame]
Steven Moreland7d6416c2017-04-18 10:06:28 -07001// 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 Badourb6556852021-02-12 17:45:20 -080017package {
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
35license {
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 Willdenf7375d12020-01-15 17:01:27 -070048cc_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 Willden9a3792e2021-04-08 09:38:14 -060065 tidy: true,
66 tidy_checks: [
67 "-performance-noexcept-move-constructor",
68 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -070069 sanitize: {
70 integer_overflow: false,
71 },
72}
73
Steven Moreland7d6416c2017-04-18 10:06:28 -070074cc_library_shared {
75 name: "libkeymaster_messages",
76 srcs: [
Janis Danisevskisf54cc932017-05-10 15:29:10 -070077 "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 Moreland7d6416c2017-04-18 10:06:28 -070083 ],
Yifan Hongf0b39bb2017-04-18 17:07:58 -070084 header_libs: ["libhardware_headers"],
Shawn Willdenf7375d12020-01-15 17:01:27 -070085 defaults: ["keymaster_defaults" ],
86 clang_cflags: [
Steven Moreland7d6416c2017-04-18 10:06:28 -070087 "-DKEYMASTER_NAME_TAGS",
88 ],
Steven Moreland7d6416c2017-04-18 10:06:28 -070089 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -070090 host_supported: true,
91 target: {
92 host: {
93 clang_cflags: [
94 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
95 ],
96 },
97 },
Steven Moreland7d6416c2017-04-18 10:06:28 -070098}
99
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700100// libkeymaster_portable contains almost everything needed for a keymaster
Steven Moreland7d6416c2017-04-18 10:06:28 -0700101// 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 Willden25814f02018-04-02 10:55:34 -0600104cc_library {
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700105 name: "libkeymaster_portable",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700106 srcs: [
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700107 "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 Willdenfb9b2a42017-12-21 12:35:06 -0700112 "android_keymaster/keymaster_tags.cpp",
113 "android_keymaster/logger.cpp",
114 "android_keymaster/operation.cpp",
115 "android_keymaster/operation_table.cpp",
Qi Wud8b79212021-02-08 01:18:52 +0800116 "android_keymaster/pure_soft_secure_key_storage.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800117 "android_keymaster/remote_provisioning_utils.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700118 "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 Danisevskisf54cc932017-05-10 15:29:10 -0700124 "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 Bilgen01a9b8b2018-11-07 16:08:08 -0800129 "km_openssl/attestation_utils.cpp",
Shawn Willdena2f1a9b2018-01-09 09:37:43 -0700130 "km_openssl/block_cipher_operation.cpp",
Janis Danisevskis197c17f2020-10-30 15:25:52 -0700131 "km_openssl/certificate_utils.cpp",
Shawn Willden8b940582018-01-02 10:53:39 -0700132 "km_openssl/ckdf.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700133 "km_openssl/ec_key.cpp",
134 "km_openssl/ec_key_factory.cpp",
David Zeuthena843b3d2021-01-19 16:01:00 -0500135 "km_openssl/ecdh_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700136 "km_openssl/ecdsa_operation.cpp",
137 "km_openssl/ecies_kem.cpp",
138 "km_openssl/hkdf.cpp",
139 "km_openssl/hmac.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700140 "km_openssl/hmac_key.cpp",
141 "km_openssl/hmac_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700142 "km_openssl/iso18033kdf.cpp",
143 "km_openssl/kdf.cpp",
144 "km_openssl/nist_curve_key_exchange.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700145 "km_openssl/openssl_err.cpp",
146 "km_openssl/openssl_utils.cpp",
147 "km_openssl/rsa_key.cpp",
148 "km_openssl/rsa_key_factory.cpp",
149 "km_openssl/rsa_operation.cpp",
Janis Danisevskis41d5a742017-05-12 10:43:12 -0700150 "km_openssl/software_random_source.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700151 "km_openssl/symmetric_key.cpp",
Shawn Willden7efc7722018-01-08 22:00:12 -0700152 "km_openssl/triple_des_key.cpp",
153 "km_openssl/triple_des_operation.cpp",
Shawn Willdendd7e8a02018-01-12 13:03:37 -0700154 "km_openssl/wrapped_key.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700155 ],
156
157 shared_libs: [
158 "libcrypto",
Bram Bonné738feea2020-09-15 21:17:07 +0200159 "libcppbor_external",
Max Bires57c187a2021-03-03 16:30:16 -0800160 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700161 ],
Colin Cross79277d32020-12-10 12:08:19 -0800162 export_shared_lib_headers: ["libcppbor_external"],
163 header_libs: ["libhardware_headers"],
164 export_header_lib_headers: ["libhardware_headers"],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700165 defaults: ["keymaster_defaults" ],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700166 host_supported: true,
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700167 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700168 target: {
169 host: {
170 clang_cflags: [
171 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
172 ],
173 },
174 },
Steven Moreland7d6416c2017-04-18 10:06:28 -0700175}
176
177// libsoftkeymaster provides a software-based keymaster HAL implementation.
178// This is used by keystore as a fallback for when the hardware keymaster does
179// not support the request.
Tri Vo0b674d02017-08-04 13:00:33 -0700180cc_library {
Steven Moreland7d6416c2017-04-18 10:06:28 -0700181 name: "libsoftkeymasterdevice",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700182 srcs: [
Janis Danisevskis3bfda162017-05-12 13:10:41 -0700183 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700184 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800185 "contexts/pure_soft_remote_provisioning_context.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700186 "contexts/soft_attestation_context.cpp",
187 "contexts/soft_keymaster_context.cpp",
188 "contexts/soft_keymaster_device.cpp",
189 "contexts/soft_keymaster_logger.cpp",
190 "km_openssl/soft_keymaster_enforcement.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700191 "legacy_support/ec_keymaster1_key.cpp",
192 "legacy_support/ecdsa_keymaster1_operation.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700193 "legacy_support/keymaster1_engine.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700194 "legacy_support/keymaster1_legacy_support.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700195 "legacy_support/rsa_keymaster1_key.cpp",
196 "legacy_support/rsa_keymaster1_operation.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700197 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700198 defaults: ["keymaster_defaults"],
Steven Moreland7d6416c2017-04-18 10:06:28 -0700199 shared_libs: [
200 "libkeymaster_messages",
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700201 "libkeymaster_portable",
Selene Huangb0d38302020-02-14 17:39:36 -0800202 "libsoft_attestation_cert",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700203 "liblog",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700204 "libbase",
Max Bires57c187a2021-03-03 16:30:16 -0800205 "libcppbor_external",
206 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700207 "libcrypto",
208 "libcutils",
209 ],
Steven Moreland7d6416c2017-04-18 10:06:28 -0700210 export_include_dirs: ["include"],
211}
212
Shawn Willden25814f02018-04-02 10:55:34 -0600213cc_library {
Selene Huangb0d38302020-02-14 17:39:36 -0800214 name: "libsoft_attestation_cert",
215 srcs: [
216 "contexts/soft_attestation_cert.cpp",
217 ],
218 defaults: ["keymaster_defaults"],
219 shared_libs: [
220 "libkeymaster_portable",
221 ],
222
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700223 host_supported: true,
Selene Huangb0d38302020-02-14 17:39:36 -0800224 export_include_dirs: ["include"],
225}
226
227cc_library {
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700228 name: "libpuresoftkeymasterdevice",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700229 srcs: [
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700230 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700231 "contexts/soft_attestation_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700232 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800233 "contexts/pure_soft_remote_provisioning_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700234 "contexts/soft_keymaster_logger.cpp",
235 "km_openssl/soft_keymaster_enforcement.cpp",
236 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700237 defaults: ["keymaster_defaults"],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700238 shared_libs: [
239 "libkeymaster_messages",
240 "libkeymaster_portable",
Selene Huangb0d38302020-02-14 17:39:36 -0800241 "libsoft_attestation_cert",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700242 "liblog",
Max Bires57c187a2021-03-03 16:30:16 -0800243 "libcppbor_external",
244 "libcppcose_rkp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700245 "libcrypto",
246 "libcutils",
Wei Wangc33ecdf2018-06-27 11:53:26 -0700247 "libbase",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700248 ],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700249 export_include_dirs: ["include"],
250}
251
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700252cc_library {
253 name: "libpuresoftkeymasterdevice_host",
254 srcs: [
255 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800256 "contexts/pure_soft_remote_provisioning_context.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700257 "contexts/soft_attestation_context.cpp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700258 "contexts/soft_keymaster_logger.cpp",
259 "km_openssl/soft_keymaster_enforcement.cpp",
260 ],
261 defaults: ["keymaster_defaults"],
262 host_supported: true,
263 device_supported: false,
264 shared_libs: [
265 "libkeymaster_messages",
266 "libkeymaster_portable",
267 "libsoft_attestation_cert",
268 "liblog",
Max Bires57c187a2021-03-03 16:30:16 -0800269 "libcppbor_external",
270 "libcppcose_rkp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700271 "libcrypto",
272 "libcutils",
273 "libbase",
274 ],
275 clang_cflags: [
276 "-DKEYMASTER_NAME_TAGS",
277 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
278 ],
279 export_include_dirs: ["include"],
280}
281
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000282cc_library_shared {
283 name: "libkeymaster3device",
284 srcs: [
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700285 "legacy_support/keymaster_passthrough_key.cpp",
286 "legacy_support/keymaster_passthrough_engine.cpp",
287 "legacy_support/keymaster_passthrough_operation.cpp",
288 "contexts/keymaster1_passthrough_context.cpp",
289 "contexts/keymaster2_passthrough_context.cpp",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000290 "ng/AndroidKeymaster3Device.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700291 "android_keymaster/keymaster_configuration.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700292 "legacy_support/ec_keymaster1_key.cpp",
293 "legacy_support/ecdsa_keymaster1_operation.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700294 "legacy_support/keymaster1_engine.cpp",
295 "legacy_support/keymaster1_legacy_support.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700296 "legacy_support/rsa_keymaster1_key.cpp",
297 "legacy_support/rsa_keymaster1_operation.cpp",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000298 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700299 defaults: ["keymaster_defaults"],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000300 shared_libs: [
301 "libkeymaster_messages",
302 "android.hardware.keymaster@3.0",
303 "libcrypto",
304 "libcutils",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700305 "libbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000306 "libhidlbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000307 "libkeymaster_portable",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000308 "liblog",
Selene Huangb0d38302020-02-14 17:39:36 -0800309 "libpuresoftkeymasterdevice",
310 "libsoft_attestation_cert",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000311 "libutils",
312 ],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000313 export_include_dirs: ["include", "ng/include"],
314}
315
Shawn Willden9e149572017-10-30 16:08:21 -0600316cc_library_shared {
317 name: "libkeymaster4",
Shawn Willden9e149572017-10-30 16:08:21 -0600318 srcs: [
319 "legacy_support/keymaster_passthrough_key.cpp",
320 "legacy_support/keymaster_passthrough_engine.cpp",
321 "legacy_support/keymaster_passthrough_operation.cpp",
Shawn Willdenefd06732017-11-30 19:34:16 -0700322 "ng/AndroidKeymaster4Device.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600323 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600324 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700325 defaults: ["keymaster_defaults"],
Shawn Willden9e149572017-10-30 16:08:21 -0600326 shared_libs: [
327 "libkeymaster_messages",
328 "android.hardware.keymaster@4.0",
329 "libcrypto",
330 "libcutils",
331 "libbase",
332 "libhidlbase",
Shawn Willden9e149572017-10-30 16:08:21 -0600333 "libkeymaster_portable",
Shawn Willden9e149572017-10-30 16:08:21 -0600334 "libpuresoftkeymasterdevice",
335 "liblog",
336 "libutils",
337 "libkeymaster4support",
338 ],
Shawn Willden6daf9842020-11-19 10:11:47 -0700339 export_include_dirs: [
340 "ng/include",
341 "include"
342 ],
Shawn Willden9e149572017-10-30 16:08:21 -0600343}
344
Shawn Willden8ae41b52019-10-28 12:54:16 -0600345cc_library_shared {
346 name: "libkeymaster41",
347 vendor_available: true,
348 srcs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600349 "ng/AndroidKeymaster41Device.cpp",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600350 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700351 defaults: ["keymaster_defaults"],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600352 shared_libs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600353 "android.hardware.keymaster@4.0",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700354 "android.hardware.keymaster@4.1",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600355 "libbase",
356 "libcrypto",
357 "libcutils",
358 "libhidlbase",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700359 "libkeymaster4",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600360 "libkeymaster4_1support",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700361 "libkeymaster4support",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600362 "libkeymaster_messages",
363 "libkeymaster_portable",
364 "liblog",
365 "libpuresoftkeymasterdevice",
366 "libutils",
367 ],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600368 export_include_dirs: ["ng/include"],
369}
370
Shawn Willden815e8962020-12-11 13:05:27 +0000371cc_library {
Shawn Willden19d8dd22021-04-22 12:50:44 -0600372 name: "lib_android_keymaster_keymint_utils",
373 vendor_available: true,
374 srcs: [
375 "ng/KeyMintUtils.cpp",
376 ],
377 defaults: ["keymaster_defaults"],
378 shared_libs: [
Jiyong Parke11f34b2021-07-27 12:19:31 +0900379 "android.hardware.security.keymint-V1-ndk",
Shawn Willden19d8dd22021-04-22 12:50:44 -0600380 "libbase",
381 "libhardware",
382 ],
383 export_include_dirs: [
384 "ng/include",
385 "include",
386 ],
387}
388
389cc_library {
Shawn Willden815e8962020-12-11 13:05:27 +0000390 name: "libkeymint",
391 vendor_available: true,
392 srcs: [
393 "android_keymaster/keymaster_configuration.cpp",
394 "legacy_support/keymaster_passthrough_engine.cpp",
395 "legacy_support/keymaster_passthrough_key.cpp",
396 "legacy_support/keymaster_passthrough_operation.cpp",
397 "ng/AndroidKeyMintDevice.cpp",
398 "ng/AndroidKeyMintOperation.cpp",
Max Bires01799e02021-04-19 18:58:04 -0700399 "ng/AndroidRemotelyProvisionedComponentDevice.cpp",
Chirag Pathak7a079942021-01-25 20:16:30 +0000400 "ng/AndroidSharedSecret.cpp",
401 "ng/AndroidSecureClock.cpp",
Shawn Willden815e8962020-12-11 13:05:27 +0000402 ],
403 defaults: ["keymaster_defaults"],
404 shared_libs: [
405 "libhidlbase",
Jiyong Parke11f34b2021-07-27 12:19:31 +0900406 "android.hardware.security.keymint-V1-ndk",
407 "android.hardware.security.secureclock-V1-ndk",
408 "android.hardware.security.sharedsecret-V1-ndk",
Shawn Willden19d8dd22021-04-22 12:50:44 -0600409 "lib_android_keymaster_keymint_utils",
Shawn Willden815e8962020-12-11 13:05:27 +0000410 "libbase",
411 "libbinder_ndk",
Max Bires57c187a2021-03-03 16:30:16 -0800412 "libcppbor_external",
Shawn Willden815e8962020-12-11 13:05:27 +0000413 "libcrypto",
414 "libcutils",
415 "libkeymaster_messages",
Shawn Willden815e8962020-12-11 13:05:27 +0000416 "libkeymaster_portable",
417 "liblog",
418 "libpuresoftkeymasterdevice",
419 "libutils",
420 ],
421 export_include_dirs: ["include", "ng/include"],
422}
Selene Huangfb818292020-05-27 04:58:16 -0700423
Max Bires57c187a2021-03-03 16:30:16 -0800424cc_library {
425 name: "libcppcose_rkp",
426 vendor_available: true,
427 host_supported: true,
428 srcs: [
429 "cppcose/cppcose.cpp",
430 ],
431 export_include_dirs: [
432 "include",
433 ],
434 shared_libs: [
435 "libcppbor_external",
436 "libcrypto",
437 "liblog",
438 ],
439}
440
Corbin Souffrante9474442020-08-28 16:46:58 -0700441cc_defaults {
442 name: "keymaster_fuzz_defaults",
443 header_libs: ["libhardware_headers"],
444 shared_libs: [
445 "libkeymaster_messages",
446 ],
447 // Not using defaults because the fuzzer relies on sanitizers that are explicitly disabled there.
448 cflags: [
449 "-Wall",
450 "-Werror",
451 "-Wunused",
452 "-Wno-error=unused-const-variable",
453 "-Wno-error=unused-private-field",
454 "-Wimplicit-fallthrough",
455 "-DKEYMASTER_NAME_TAGS",
456 ],
457 host_supported: true,
458 target: {
459 host: {
460 clang_cflags: [
461 "-fno-rtti", // TODO(b/156427382): Remove when default library removes this
462 ],
463 },
464 },
465}
466
467cc_fuzz {
468 name: "libkeymaster_fuzz_buffer",
469 defaults: ["keymaster_fuzz_defaults"],
470 srcs: [
471 "tests/fuzzers/buffer_fuzz.cpp",
472 ],
473}
474
475cc_fuzz {
476 name: "libkeymaster_fuzz_serializable",
477 defaults: ["keymaster_fuzz_defaults"],
478 srcs: [
479 "tests/fuzzers/message_serializable_fuzz.cpp",
480 ],
481}