blob: 35de07b43daa2b7796ce57c9e797cdfb698242b5 [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 ],
65 sanitize: {
66 integer_overflow: false,
67 },
68}
69
Steven Moreland7d6416c2017-04-18 10:06:28 -070070cc_library_shared {
71 name: "libkeymaster_messages",
72 srcs: [
Janis Danisevskisf54cc932017-05-10 15:29:10 -070073 "android_keymaster/android_keymaster_messages.cpp",
74 "android_keymaster/android_keymaster_utils.cpp",
75 "android_keymaster/authorization_set.cpp",
76 "android_keymaster/keymaster_tags.cpp",
77 "android_keymaster/logger.cpp",
78 "android_keymaster/serializable.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -070079 ],
Yifan Hongf0b39bb2017-04-18 17:07:58 -070080 header_libs: ["libhardware_headers"],
Shawn Willdenf7375d12020-01-15 17:01:27 -070081 defaults: ["keymaster_defaults" ],
82 clang_cflags: [
Steven Moreland7d6416c2017-04-18 10:06:28 -070083 "-DKEYMASTER_NAME_TAGS",
84 ],
Steven Moreland7d6416c2017-04-18 10:06:28 -070085 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -070086 host_supported: true,
87 target: {
88 host: {
89 clang_cflags: [
90 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
91 ],
92 },
93 },
Steven Moreland7d6416c2017-04-18 10:06:28 -070094}
95
Janis Danisevskisf38a0022017-04-26 14:44:46 -070096// libkeymaster_portable contains almost everything needed for a keymaster
Steven Moreland7d6416c2017-04-18 10:06:28 -070097// implementation, lacking only a subclass of the (abstract) KeymasterContext
98// class to provide environment-specific services and a wrapper to translate from
99// the function-based keymaster HAL API to the message-based AndroidKeymaster API.
Shawn Willden25814f02018-04-02 10:55:34 -0600100cc_library {
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700101 name: "libkeymaster_portable",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700102 srcs: [
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700103 "android_keymaster/android_keymaster.cpp",
104 "android_keymaster/android_keymaster_messages.cpp",
105 "android_keymaster/android_keymaster_utils.cpp",
106 "android_keymaster/authorization_set.cpp",
107 "android_keymaster/keymaster_enforcement.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700108 "android_keymaster/keymaster_tags.cpp",
109 "android_keymaster/logger.cpp",
110 "android_keymaster/operation.cpp",
111 "android_keymaster/operation_table.cpp",
Qi Wud8b79212021-02-08 01:18:52 +0800112 "android_keymaster/pure_soft_secure_key_storage.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800113 "android_keymaster/remote_provisioning_utils.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700114 "android_keymaster/serializable.cpp",
115 "key_blob_utils/auth_encrypted_key_blob.cpp",
116 "key_blob_utils/integrity_assured_key_blob.cpp",
117 "key_blob_utils/ocb.c",
118 "key_blob_utils/ocb_utils.cpp",
119 "key_blob_utils/software_keyblobs.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700120 "km_openssl/aes_key.cpp",
121 "km_openssl/aes_operation.cpp",
122 "km_openssl/asymmetric_key.cpp",
123 "km_openssl/asymmetric_key_factory.cpp",
124 "km_openssl/attestation_record.cpp",
Mustafa Yigit Bilgen01a9b8b2018-11-07 16:08:08 -0800125 "km_openssl/attestation_utils.cpp",
Shawn Willdena2f1a9b2018-01-09 09:37:43 -0700126 "km_openssl/block_cipher_operation.cpp",
Janis Danisevskis197c17f2020-10-30 15:25:52 -0700127 "km_openssl/certificate_utils.cpp",
Shawn Willden8b940582018-01-02 10:53:39 -0700128 "km_openssl/ckdf.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700129 "km_openssl/ec_key.cpp",
130 "km_openssl/ec_key_factory.cpp",
David Zeuthena843b3d2021-01-19 16:01:00 -0500131 "km_openssl/ecdh_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700132 "km_openssl/ecdsa_operation.cpp",
133 "km_openssl/ecies_kem.cpp",
134 "km_openssl/hkdf.cpp",
135 "km_openssl/hmac.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700136 "km_openssl/hmac_key.cpp",
137 "km_openssl/hmac_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700138 "km_openssl/iso18033kdf.cpp",
139 "km_openssl/kdf.cpp",
140 "km_openssl/nist_curve_key_exchange.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700141 "km_openssl/openssl_err.cpp",
142 "km_openssl/openssl_utils.cpp",
143 "km_openssl/rsa_key.cpp",
144 "km_openssl/rsa_key_factory.cpp",
145 "km_openssl/rsa_operation.cpp",
Janis Danisevskis41d5a742017-05-12 10:43:12 -0700146 "km_openssl/software_random_source.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700147 "km_openssl/symmetric_key.cpp",
Shawn Willden7efc7722018-01-08 22:00:12 -0700148 "km_openssl/triple_des_key.cpp",
149 "km_openssl/triple_des_operation.cpp",
Shawn Willdendd7e8a02018-01-12 13:03:37 -0700150 "km_openssl/wrapped_key.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700151 ],
152
153 shared_libs: [
154 "libcrypto",
Bram Bonné738feea2020-09-15 21:17:07 +0200155 "libcppbor_external",
Max Bires57c187a2021-03-03 16:30:16 -0800156 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700157 ],
Colin Cross79277d32020-12-10 12:08:19 -0800158 export_shared_lib_headers: ["libcppbor_external"],
159 header_libs: ["libhardware_headers"],
160 export_header_lib_headers: ["libhardware_headers"],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700161 defaults: ["keymaster_defaults" ],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700162 host_supported: true,
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700163 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700164 target: {
165 host: {
166 clang_cflags: [
167 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
168 ],
169 },
170 },
Steven Moreland7d6416c2017-04-18 10:06:28 -0700171}
172
173// libsoftkeymaster provides a software-based keymaster HAL implementation.
174// This is used by keystore as a fallback for when the hardware keymaster does
175// not support the request.
Tri Vo0b674d02017-08-04 13:00:33 -0700176cc_library {
Steven Moreland7d6416c2017-04-18 10:06:28 -0700177 name: "libsoftkeymasterdevice",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700178 srcs: [
Janis Danisevskis3bfda162017-05-12 13:10:41 -0700179 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700180 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800181 "contexts/pure_soft_remote_provisioning_context.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700182 "contexts/soft_attestation_context.cpp",
183 "contexts/soft_keymaster_context.cpp",
184 "contexts/soft_keymaster_device.cpp",
185 "contexts/soft_keymaster_logger.cpp",
186 "km_openssl/soft_keymaster_enforcement.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700187 "legacy_support/ec_keymaster1_key.cpp",
188 "legacy_support/ecdsa_keymaster1_operation.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700189 "legacy_support/keymaster1_engine.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700190 "legacy_support/keymaster1_legacy_support.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700191 "legacy_support/rsa_keymaster1_key.cpp",
192 "legacy_support/rsa_keymaster1_operation.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700193 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700194 defaults: ["keymaster_defaults"],
Steven Moreland7d6416c2017-04-18 10:06:28 -0700195 shared_libs: [
196 "libkeymaster_messages",
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700197 "libkeymaster_portable",
Selene Huangb0d38302020-02-14 17:39:36 -0800198 "libsoft_attestation_cert",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700199 "liblog",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700200 "libbase",
Max Bires57c187a2021-03-03 16:30:16 -0800201 "libcppbor_external",
202 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700203 "libcrypto",
204 "libcutils",
205 ],
Steven Moreland7d6416c2017-04-18 10:06:28 -0700206 export_include_dirs: ["include"],
207}
208
Shawn Willden25814f02018-04-02 10:55:34 -0600209cc_library {
Selene Huangb0d38302020-02-14 17:39:36 -0800210 name: "libsoft_attestation_cert",
211 srcs: [
212 "contexts/soft_attestation_cert.cpp",
213 ],
214 defaults: ["keymaster_defaults"],
215 shared_libs: [
216 "libkeymaster_portable",
217 ],
218
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700219 host_supported: true,
Selene Huangb0d38302020-02-14 17:39:36 -0800220 export_include_dirs: ["include"],
221}
222
223cc_library {
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700224 name: "libpuresoftkeymasterdevice",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700225 srcs: [
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700226 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700227 "contexts/soft_attestation_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700228 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800229 "contexts/pure_soft_remote_provisioning_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700230 "contexts/soft_keymaster_logger.cpp",
231 "km_openssl/soft_keymaster_enforcement.cpp",
232 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700233 defaults: ["keymaster_defaults"],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700234 shared_libs: [
235 "libkeymaster_messages",
236 "libkeymaster_portable",
Selene Huangb0d38302020-02-14 17:39:36 -0800237 "libsoft_attestation_cert",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700238 "liblog",
Max Bires57c187a2021-03-03 16:30:16 -0800239 "libcppbor_external",
240 "libcppcose_rkp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700241 "libcrypto",
242 "libcutils",
Wei Wangc33ecdf2018-06-27 11:53:26 -0700243 "libbase",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700244 ],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700245 export_include_dirs: ["include"],
246}
247
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700248cc_library {
249 name: "libpuresoftkeymasterdevice_host",
250 srcs: [
251 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800252 "contexts/pure_soft_remote_provisioning_context.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700253 "contexts/soft_attestation_context.cpp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700254 "contexts/soft_keymaster_logger.cpp",
255 "km_openssl/soft_keymaster_enforcement.cpp",
256 ],
257 defaults: ["keymaster_defaults"],
258 host_supported: true,
259 device_supported: false,
260 shared_libs: [
261 "libkeymaster_messages",
262 "libkeymaster_portable",
263 "libsoft_attestation_cert",
264 "liblog",
Max Bires57c187a2021-03-03 16:30:16 -0800265 "libcppbor_external",
266 "libcppcose_rkp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700267 "libcrypto",
268 "libcutils",
269 "libbase",
270 ],
271 clang_cflags: [
272 "-DKEYMASTER_NAME_TAGS",
273 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
274 ],
275 export_include_dirs: ["include"],
276}
277
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000278cc_library_shared {
279 name: "libkeymaster3device",
280 srcs: [
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700281 "legacy_support/keymaster_passthrough_key.cpp",
282 "legacy_support/keymaster_passthrough_engine.cpp",
283 "legacy_support/keymaster_passthrough_operation.cpp",
284 "contexts/keymaster1_passthrough_context.cpp",
285 "contexts/keymaster2_passthrough_context.cpp",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000286 "ng/AndroidKeymaster3Device.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700287 "android_keymaster/keymaster_configuration.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700288 "legacy_support/ec_keymaster1_key.cpp",
289 "legacy_support/ecdsa_keymaster1_operation.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700290 "legacy_support/keymaster1_engine.cpp",
291 "legacy_support/keymaster1_legacy_support.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700292 "legacy_support/rsa_keymaster1_key.cpp",
293 "legacy_support/rsa_keymaster1_operation.cpp",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000294 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700295 defaults: ["keymaster_defaults"],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000296 shared_libs: [
297 "libkeymaster_messages",
298 "android.hardware.keymaster@3.0",
299 "libcrypto",
300 "libcutils",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700301 "libbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000302 "libhidlbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000303 "libkeymaster_portable",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000304 "liblog",
Selene Huangb0d38302020-02-14 17:39:36 -0800305 "libpuresoftkeymasterdevice",
306 "libsoft_attestation_cert",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000307 "libutils",
308 ],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000309 export_include_dirs: ["include", "ng/include"],
310}
311
Shawn Willden9e149572017-10-30 16:08:21 -0600312cc_library_shared {
313 name: "libkeymaster4",
Shawn Willden9e149572017-10-30 16:08:21 -0600314 srcs: [
315 "legacy_support/keymaster_passthrough_key.cpp",
316 "legacy_support/keymaster_passthrough_engine.cpp",
317 "legacy_support/keymaster_passthrough_operation.cpp",
Shawn Willdenefd06732017-11-30 19:34:16 -0700318 "ng/AndroidKeymaster4Device.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600319 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600320 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700321 defaults: ["keymaster_defaults"],
Shawn Willden9e149572017-10-30 16:08:21 -0600322 shared_libs: [
323 "libkeymaster_messages",
324 "android.hardware.keymaster@4.0",
325 "libcrypto",
326 "libcutils",
327 "libbase",
328 "libhidlbase",
Shawn Willden9e149572017-10-30 16:08:21 -0600329 "libkeymaster_portable",
Shawn Willden9e149572017-10-30 16:08:21 -0600330 "libpuresoftkeymasterdevice",
331 "liblog",
332 "libutils",
333 "libkeymaster4support",
334 ],
Shawn Willden6daf9842020-11-19 10:11:47 -0700335 export_include_dirs: [
336 "ng/include",
337 "include"
338 ],
Shawn Willden9e149572017-10-30 16:08:21 -0600339}
340
Shawn Willden8ae41b52019-10-28 12:54:16 -0600341cc_library_shared {
342 name: "libkeymaster41",
343 vendor_available: true,
344 srcs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600345 "ng/AndroidKeymaster41Device.cpp",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600346 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700347 defaults: ["keymaster_defaults"],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600348 shared_libs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600349 "android.hardware.keymaster@4.0",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700350 "android.hardware.keymaster@4.1",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600351 "libbase",
352 "libcrypto",
353 "libcutils",
354 "libhidlbase",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700355 "libkeymaster4",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600356 "libkeymaster4_1support",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700357 "libkeymaster4support",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600358 "libkeymaster_messages",
359 "libkeymaster_portable",
360 "liblog",
361 "libpuresoftkeymasterdevice",
362 "libutils",
363 ],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600364 export_include_dirs: ["ng/include"],
365}
366
Shawn Willden815e8962020-12-11 13:05:27 +0000367cc_library {
368 name: "libkeymint",
369 vendor_available: true,
370 srcs: [
371 "android_keymaster/keymaster_configuration.cpp",
372 "legacy_support/keymaster_passthrough_engine.cpp",
373 "legacy_support/keymaster_passthrough_key.cpp",
374 "legacy_support/keymaster_passthrough_operation.cpp",
375 "ng/AndroidKeyMintDevice.cpp",
376 "ng/AndroidKeyMintOperation.cpp",
Max Bires01799e02021-04-19 18:58:04 -0700377 "ng/AndroidRemotelyProvisionedComponentDevice.cpp",
Chirag Pathak7a079942021-01-25 20:16:30 +0000378 "ng/AndroidSharedSecret.cpp",
379 "ng/AndroidSecureClock.cpp",
Shawn Willden815e8962020-12-11 13:05:27 +0000380 "ng/KeyMintUtils.cpp",
381 ],
382 defaults: ["keymaster_defaults"],
383 shared_libs: [
384 "libhidlbase",
Jeongik Chaa3202fa2021-01-26 22:35:10 +0900385 "android.hardware.security.keymint-V1-ndk_platform",
Jeongik Chab40535e2021-02-18 09:38:47 +0900386 "android.hardware.security.sharedsecret-V1-ndk_platform",
387 "android.hardware.security.secureclock-V1-ndk_platform",
Shawn Willden815e8962020-12-11 13:05:27 +0000388 "libbase",
389 "libbinder_ndk",
Max Bires57c187a2021-03-03 16:30:16 -0800390 "libcppbor_external",
Shawn Willden815e8962020-12-11 13:05:27 +0000391 "libcrypto",
392 "libcutils",
393 "libkeymaster_messages",
394 "libkeymaster_messages",
395 "libkeymaster_portable",
396 "liblog",
397 "libpuresoftkeymasterdevice",
398 "libutils",
399 ],
400 export_include_dirs: ["include", "ng/include"],
401}
Selene Huangfb818292020-05-27 04:58:16 -0700402
Max Bires57c187a2021-03-03 16:30:16 -0800403cc_library {
404 name: "libcppcose_rkp",
405 vendor_available: true,
406 host_supported: true,
407 srcs: [
408 "cppcose/cppcose.cpp",
409 ],
410 export_include_dirs: [
411 "include",
412 ],
413 shared_libs: [
414 "libcppbor_external",
415 "libcrypto",
416 "liblog",
417 ],
418}
419
Steven Moreland7d6416c2017-04-18 10:06:28 -0700420// libkeymasterfiles is an empty library that exports all of the files in keymaster as includes.
421cc_library_static {
422 name: "libkeymasterfiles",
423 export_include_dirs: [
424 ".",
425 "include",
426 ],
427}
Corbin Souffrante9474442020-08-28 16:46:58 -0700428
429cc_defaults {
430 name: "keymaster_fuzz_defaults",
431 header_libs: ["libhardware_headers"],
432 shared_libs: [
433 "libkeymaster_messages",
434 ],
435 // Not using defaults because the fuzzer relies on sanitizers that are explicitly disabled there.
436 cflags: [
437 "-Wall",
438 "-Werror",
439 "-Wunused",
440 "-Wno-error=unused-const-variable",
441 "-Wno-error=unused-private-field",
442 "-Wimplicit-fallthrough",
443 "-DKEYMASTER_NAME_TAGS",
444 ],
445 host_supported: true,
446 target: {
447 host: {
448 clang_cflags: [
449 "-fno-rtti", // TODO(b/156427382): Remove when default library removes this
450 ],
451 },
452 },
453}
454
455cc_fuzz {
456 name: "libkeymaster_fuzz_buffer",
457 defaults: ["keymaster_fuzz_defaults"],
458 srcs: [
459 "tests/fuzzers/buffer_fuzz.cpp",
460 ],
461}
462
463cc_fuzz {
464 name: "libkeymaster_fuzz_serializable",
465 defaults: ["keymaster_fuzz_defaults"],
466 srcs: [
467 "tests/fuzzers/message_serializable_fuzz.cpp",
468 ],
469}