blob: 0323aa2b824e811665d5e4425fedc4b6f8f33ac3 [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",
Shawn Willdenf7375d12020-01-15 17:01:27 -070055 "-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.
Alix7fac4522022-04-18 03:58:29 +000060 "-fno-sanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp",
Shawn Willdenf7375d12020-01-15 17:01:27 -070061 ],
Shawn Willden9a3792e2021-04-08 09:38:14 -060062 tidy: true,
63 tidy_checks: [
64 "-performance-noexcept-move-constructor",
65 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -070066 sanitize: {
67 integer_overflow: false,
68 },
Oystein Eftevaag3997dc02023-02-01 23:55:07 +000069 target: {
70 windows: {
71 enabled: true,
72 },
73 },
Shawn Willdenf7375d12020-01-15 17:01:27 -070074}
75
Steven Moreland7d6416c2017-04-18 10:06:28 -070076cc_library_shared {
77 name: "libkeymaster_messages",
78 srcs: [
Janis Danisevskisf54cc932017-05-10 15:29:10 -070079 "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 Moreland7d6416c2017-04-18 10:06:28 -070085 ],
Yifan Hongf0b39bb2017-04-18 17:07:58 -070086 header_libs: ["libhardware_headers"],
Alix7fac4522022-04-18 03:58:29 +000087 defaults: ["keymaster_defaults"],
Alix0c678632022-04-21 03:05:50 +000088 cflags: [
Steven Moreland7d6416c2017-04-18 10:06:28 -070089 "-DKEYMASTER_NAME_TAGS",
90 ],
Steven Moreland7d6416c2017-04-18 10:06:28 -070091 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -070092 host_supported: true,
93 target: {
94 host: {
Alix0c678632022-04-21 03:05:50 +000095 cflags: [
A. Cody Schuffelen65667f82020-04-29 14:52:49 -070096 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
97 ],
98 },
99 },
Steven Moreland7d6416c2017-04-18 10:06:28 -0700100}
101
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700102// libkeymaster_portable contains almost everything needed for a keymaster
Steven Moreland7d6416c2017-04-18 10:06:28 -0700103// 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 Willden25814f02018-04-02 10:55:34 -0600106cc_library {
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700107 name: "libkeymaster_portable",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700108 srcs: [
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700109 "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 Willdenfb9b2a42017-12-21 12:35:06 -0700114 "android_keymaster/keymaster_tags.cpp",
115 "android_keymaster/logger.cpp",
116 "android_keymaster/operation.cpp",
117 "android_keymaster/operation_table.cpp",
Qi Wud8b79212021-02-08 01:18:52 +0800118 "android_keymaster/pure_soft_secure_key_storage.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800119 "android_keymaster/remote_provisioning_utils.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700120 "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 Danisevskisf54cc932017-05-10 15:29:10 -0700126 "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 Bilgen01a9b8b2018-11-07 16:08:08 -0800131 "km_openssl/attestation_utils.cpp",
Shawn Willdena2f1a9b2018-01-09 09:37:43 -0700132 "km_openssl/block_cipher_operation.cpp",
Janis Danisevskis197c17f2020-10-30 15:25:52 -0700133 "km_openssl/certificate_utils.cpp",
Shawn Willden8b940582018-01-02 10:53:39 -0700134 "km_openssl/ckdf.cpp",
David Drysdale207d0a32021-11-05 17:04:54 +0000135 "km_openssl/curve25519_key.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700136 "km_openssl/ec_key.cpp",
137 "km_openssl/ec_key_factory.cpp",
David Zeuthena843b3d2021-01-19 16:01:00 -0500138 "km_openssl/ecdh_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700139 "km_openssl/ecdsa_operation.cpp",
140 "km_openssl/ecies_kem.cpp",
141 "km_openssl/hkdf.cpp",
142 "km_openssl/hmac.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700143 "km_openssl/hmac_key.cpp",
144 "km_openssl/hmac_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700145 "km_openssl/iso18033kdf.cpp",
146 "km_openssl/kdf.cpp",
147 "km_openssl/nist_curve_key_exchange.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700148 "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 Danisevskis41d5a742017-05-12 10:43:12 -0700153 "km_openssl/software_random_source.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700154 "km_openssl/symmetric_key.cpp",
Shawn Willden7efc7722018-01-08 22:00:12 -0700155 "km_openssl/triple_des_key.cpp",
156 "km_openssl/triple_des_operation.cpp",
Shawn Willdendd7e8a02018-01-12 13:03:37 -0700157 "km_openssl/wrapped_key.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700158 ],
159
160 shared_libs: [
161 "libcrypto",
Bram Bonné738feea2020-09-15 21:17:07 +0200162 "libcppbor_external",
Max Bires57c187a2021-03-03 16:30:16 -0800163 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700164 ],
Colin Cross79277d32020-12-10 12:08:19 -0800165 export_shared_lib_headers: ["libcppbor_external"],
166 header_libs: ["libhardware_headers"],
167 export_header_lib_headers: ["libhardware_headers"],
Alix7fac4522022-04-18 03:58:29 +0000168 defaults: ["keymaster_defaults"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700169 host_supported: true,
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700170 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700171 target: {
172 host: {
Alix0c678632022-04-21 03:05:50 +0000173 cflags: [
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700174 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
175 ],
176 },
177 },
Steven Moreland7d6416c2017-04-18 10:06:28 -0700178}
179
Jim Blackler4515a7f2021-10-11 13:38:59 +0000180// 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.
183cc_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 Willden25814f02018-04-02 10:55:34 -0600216cc_library {
Selene Huangb0d38302020-02-14 17:39:36 -0800217 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 Schuffelen65667f82020-04-29 14:52:49 -0700226 host_supported: true,
Selene Huangb0d38302020-02-14 17:39:36 -0800227 export_include_dirs: ["include"],
228}
229
230cc_library {
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700231 name: "libpuresoftkeymasterdevice",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700232 srcs: [
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700233 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700234 "contexts/soft_attestation_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700235 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800236 "contexts/pure_soft_remote_provisioning_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700237 "contexts/soft_keymaster_logger.cpp",
238 "km_openssl/soft_keymaster_enforcement.cpp",
239 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700240 defaults: ["keymaster_defaults"],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700241 shared_libs: [
242 "libkeymaster_messages",
243 "libkeymaster_portable",
Selene Huangb0d38302020-02-14 17:39:36 -0800244 "libsoft_attestation_cert",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700245 "liblog",
Max Bires57c187a2021-03-03 16:30:16 -0800246 "libcppbor_external",
247 "libcppcose_rkp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700248 "libcrypto",
249 "libcutils",
Wei Wangc33ecdf2018-06-27 11:53:26 -0700250 "libbase",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700251 ],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700252 export_include_dirs: ["include"],
253}
254
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700255cc_library {
256 name: "libpuresoftkeymasterdevice_host",
257 srcs: [
258 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800259 "contexts/pure_soft_remote_provisioning_context.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700260 "contexts/soft_attestation_context.cpp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700261 "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 Bires57c187a2021-03-03 16:30:16 -0800272 "libcppbor_external",
273 "libcppcose_rkp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700274 "libcrypto",
275 "libcutils",
276 "libbase",
277 ],
Alix0c678632022-04-21 03:05:50 +0000278 cflags: [
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700279 "-DKEYMASTER_NAME_TAGS",
280 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
281 ],
282 export_include_dirs: ["include"],
283}
284
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000285cc_library_shared {
286 name: "libkeymaster3device",
287 srcs: [
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700288 "legacy_support/keymaster_passthrough_key.cpp",
289 "legacy_support/keymaster_passthrough_engine.cpp",
290 "legacy_support/keymaster_passthrough_operation.cpp",
Jim Blackler4515a7f2021-10-11 13:38:59 +0000291 "contexts/keymaster1_passthrough_context.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700292 "contexts/keymaster2_passthrough_context.cpp",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000293 "ng/AndroidKeymaster3Device.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700294 "android_keymaster/keymaster_configuration.cpp",
Jim Blackler4515a7f2021-10-11 13:38:59 +0000295 "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 Danisevskisa68669b2017-02-06 11:46:54 +0000301 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700302 defaults: ["keymaster_defaults"],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000303 shared_libs: [
304 "libkeymaster_messages",
305 "android.hardware.keymaster@3.0",
306 "libcrypto",
307 "libcutils",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700308 "libbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000309 "libhidlbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000310 "libkeymaster_portable",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000311 "liblog",
Selene Huangb0d38302020-02-14 17:39:36 -0800312 "libpuresoftkeymasterdevice",
313 "libsoft_attestation_cert",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000314 "libutils",
315 ],
Alix7fac4522022-04-18 03:58:29 +0000316 export_include_dirs: [
317 "include",
318 "ng/include",
319 ],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000320}
321
Ayushi Khopkar41b72e62021-07-27 19:20:37 +0530322cc_library {
Shawn Willden9e149572017-10-30 16:08:21 -0600323 name: "libkeymaster4",
Shawn Willden9e149572017-10-30 16:08:21 -0600324 srcs: [
325 "legacy_support/keymaster_passthrough_key.cpp",
326 "legacy_support/keymaster_passthrough_engine.cpp",
327 "legacy_support/keymaster_passthrough_operation.cpp",
Shawn Willdenefd06732017-11-30 19:34:16 -0700328 "ng/AndroidKeymaster4Device.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600329 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600330 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700331 defaults: ["keymaster_defaults"],
Shawn Willden9e149572017-10-30 16:08:21 -0600332 shared_libs: [
333 "libkeymaster_messages",
334 "android.hardware.keymaster@4.0",
335 "libcrypto",
336 "libcutils",
337 "libbase",
338 "libhidlbase",
Shawn Willden9e149572017-10-30 16:08:21 -0600339 "libkeymaster_portable",
Shawn Willden9e149572017-10-30 16:08:21 -0600340 "libpuresoftkeymasterdevice",
341 "liblog",
342 "libutils",
343 "libkeymaster4support",
344 ],
Shawn Willden6daf9842020-11-19 10:11:47 -0700345 export_include_dirs: [
346 "ng/include",
Alix7fac4522022-04-18 03:58:29 +0000347 "include",
Shawn Willden6daf9842020-11-19 10:11:47 -0700348 ],
Shawn Willden9e149572017-10-30 16:08:21 -0600349}
350
Shawn Willden8ae41b52019-10-28 12:54:16 -0600351cc_library_shared {
352 name: "libkeymaster41",
353 vendor_available: true,
354 srcs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600355 "ng/AndroidKeymaster41Device.cpp",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600356 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700357 defaults: ["keymaster_defaults"],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600358 shared_libs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600359 "android.hardware.keymaster@4.0",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700360 "android.hardware.keymaster@4.1",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600361 "libbase",
362 "libcrypto",
363 "libcutils",
364 "libhidlbase",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700365 "libkeymaster4",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600366 "libkeymaster4_1support",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700367 "libkeymaster4support",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600368 "libkeymaster_messages",
369 "libkeymaster_portable",
370 "liblog",
371 "libpuresoftkeymasterdevice",
372 "libutils",
373 ],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600374 export_include_dirs: ["ng/include"],
375}
376
Shawn Willden815e8962020-12-11 13:05:27 +0000377cc_library {
Shawn Willden19d8dd22021-04-22 12:50:44 -0600378 name: "lib_android_keymaster_keymint_utils",
379 vendor_available: true,
380 srcs: [
381 "ng/KeyMintUtils.cpp",
382 ],
David Drysdale6a039b22021-11-19 17:39:38 +0000383 defaults: [
384 "keymaster_defaults",
385 "keymint_use_latest_hal_aidl_ndk_shared",
386 ],
Shawn Willden19d8dd22021-04-22 12:50:44 -0600387 shared_libs: [
Shawn Willden19d8dd22021-04-22 12:50:44 -0600388 "libbase",
389 "libhardware",
390 ],
391 export_include_dirs: [
392 "ng/include",
393 "include",
394 ],
395}
396
397cc_library {
Shawn Willden815e8962020-12-11 13:05:27 +0000398 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 Bires01799e02021-04-19 18:58:04 -0700407 "ng/AndroidRemotelyProvisionedComponentDevice.cpp",
Chirag Pathak7a079942021-01-25 20:16:30 +0000408 "ng/AndroidSharedSecret.cpp",
409 "ng/AndroidSecureClock.cpp",
Shawn Willden815e8962020-12-11 13:05:27 +0000410 ],
David Drysdale6a039b22021-11-19 17:39:38 +0000411 defaults: [
412 "keymaster_defaults",
413 "keymint_use_latest_hal_aidl_ndk_shared",
414 ],
Shawn Willden815e8962020-12-11 13:05:27 +0000415 shared_libs: [
David Drysdale6a039b22021-11-19 17:39:38 +0000416 "libhidlbase",
Seth Moore99ebb382022-11-04 17:39:05 +0000417 "android.hardware.security.rkp-V3-ndk",
Jiyong Parke11f34b2021-07-27 12:19:31 +0900418 "android.hardware.security.secureclock-V1-ndk",
419 "android.hardware.security.sharedsecret-V1-ndk",
Shawn Willden19d8dd22021-04-22 12:50:44 -0600420 "lib_android_keymaster_keymint_utils",
Shawn Willden815e8962020-12-11 13:05:27 +0000421 "libbase",
422 "libbinder_ndk",
Max Bires57c187a2021-03-03 16:30:16 -0800423 "libcppbor_external",
Shawn Willden815e8962020-12-11 13:05:27 +0000424 "libcrypto",
425 "libcutils",
426 "libkeymaster_messages",
Shawn Willden815e8962020-12-11 13:05:27 +0000427 "libkeymaster_portable",
428 "liblog",
429 "libpuresoftkeymasterdevice",
430 "libutils",
431 ],
Alix7fac4522022-04-18 03:58:29 +0000432 export_include_dirs: [
433 "include",
434 "ng/include",
435 ],
Shawn Willden815e8962020-12-11 13:05:27 +0000436}
Selene Huangfb818292020-05-27 04:58:16 -0700437
Max Bires57c187a2021-03-03 16:30:16 -0800438cc_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 Eftevaag3997dc02023-02-01 23:55:07 +0000453 target: {
454 windows: {
455 enabled: true,
456 },
457 },
Max Bires57c187a2021-03-03 16:30:16 -0800458}
459
Corbin Souffrante9474442020-08-28 16:46:58 -0700460cc_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: {
Alix0c678632022-04-21 03:05:50 +0000479 cflags: [
Corbin Souffrante9474442020-08-28 16:46:58 -0700480 "-fno-rtti", // TODO(b/156427382): Remove when default library removes this
481 ],
482 },
483 },
484}
485
486cc_fuzz {
487 name: "libkeymaster_fuzz_buffer",
488 defaults: ["keymaster_fuzz_defaults"],
489 srcs: [
490 "tests/fuzzers/buffer_fuzz.cpp",
491 ],
492}
493
494cc_fuzz {
495 name: "libkeymaster_fuzz_serializable",
496 defaults: ["keymaster_fuzz_defaults"],
497 srcs: [
498 "tests/fuzzers/message_serializable_fuzz.cpp",
499 ],
500}