blob: e8f1dd8ad791b9923af0e9335df0461c1cc02ec3 [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",
79 "android_keymaster/keymaster_stl.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -070080 ],
Yifan Hongf0b39bb2017-04-18 17:07:58 -070081 header_libs: ["libhardware_headers"],
Shawn Willdenf7375d12020-01-15 17:01:27 -070082 defaults: ["keymaster_defaults" ],
83 clang_cflags: [
Steven Moreland7d6416c2017-04-18 10:06:28 -070084 "-DKEYMASTER_NAME_TAGS",
85 ],
Janis Danisevskisf38a0022017-04-26 14:44:46 -070086 stl: "none",
Steven Moreland7d6416c2017-04-18 10:06:28 -070087 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -070088 host_supported: true,
89 target: {
90 host: {
91 clang_cflags: [
92 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
93 ],
94 },
95 },
Steven Moreland7d6416c2017-04-18 10:06:28 -070096}
97
Janis Danisevskisf38a0022017-04-26 14:44:46 -070098// libkeymaster_portable contains almost everything needed for a keymaster
Steven Moreland7d6416c2017-04-18 10:06:28 -070099// implementation, lacking only a subclass of the (abstract) KeymasterContext
100// class to provide environment-specific services and a wrapper to translate from
101// the function-based keymaster HAL API to the message-based AndroidKeymaster API.
Shawn Willden25814f02018-04-02 10:55:34 -0600102cc_library {
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700103 name: "libkeymaster_portable",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700104 srcs: [
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700105 "android_keymaster/android_keymaster.cpp",
106 "android_keymaster/android_keymaster_messages.cpp",
107 "android_keymaster/android_keymaster_utils.cpp",
108 "android_keymaster/authorization_set.cpp",
109 "android_keymaster/keymaster_enforcement.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700110 "android_keymaster/keymaster_tags.cpp",
111 "android_keymaster/logger.cpp",
112 "android_keymaster/operation.cpp",
113 "android_keymaster/operation_table.cpp",
Qi Wud8b79212021-02-08 01:18:52 +0800114 "android_keymaster/pure_soft_secure_key_storage.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800115 "android_keymaster/remote_provisioning_utils.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700116 "android_keymaster/serializable.cpp",
117 "key_blob_utils/auth_encrypted_key_blob.cpp",
118 "key_blob_utils/integrity_assured_key_blob.cpp",
119 "key_blob_utils/ocb.c",
120 "key_blob_utils/ocb_utils.cpp",
121 "key_blob_utils/software_keyblobs.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700122 "km_openssl/aes_key.cpp",
123 "km_openssl/aes_operation.cpp",
124 "km_openssl/asymmetric_key.cpp",
125 "km_openssl/asymmetric_key_factory.cpp",
126 "km_openssl/attestation_record.cpp",
Mustafa Yigit Bilgen01a9b8b2018-11-07 16:08:08 -0800127 "km_openssl/attestation_utils.cpp",
Shawn Willdena2f1a9b2018-01-09 09:37:43 -0700128 "km_openssl/block_cipher_operation.cpp",
Janis Danisevskis197c17f2020-10-30 15:25:52 -0700129 "km_openssl/certificate_utils.cpp",
Shawn Willden8b940582018-01-02 10:53:39 -0700130 "km_openssl/ckdf.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700131 "km_openssl/ec_key.cpp",
132 "km_openssl/ec_key_factory.cpp",
David Zeuthena843b3d2021-01-19 16:01:00 -0500133 "km_openssl/ecdh_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700134 "km_openssl/ecdsa_operation.cpp",
135 "km_openssl/ecies_kem.cpp",
136 "km_openssl/hkdf.cpp",
137 "km_openssl/hmac.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700138 "km_openssl/hmac_key.cpp",
139 "km_openssl/hmac_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700140 "km_openssl/iso18033kdf.cpp",
141 "km_openssl/kdf.cpp",
142 "km_openssl/nist_curve_key_exchange.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700143 "km_openssl/openssl_err.cpp",
144 "km_openssl/openssl_utils.cpp",
145 "km_openssl/rsa_key.cpp",
146 "km_openssl/rsa_key_factory.cpp",
147 "km_openssl/rsa_operation.cpp",
Janis Danisevskis41d5a742017-05-12 10:43:12 -0700148 "km_openssl/software_random_source.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700149 "km_openssl/symmetric_key.cpp",
Shawn Willden7efc7722018-01-08 22:00:12 -0700150 "km_openssl/triple_des_key.cpp",
151 "km_openssl/triple_des_operation.cpp",
Shawn Willdendd7e8a02018-01-12 13:03:37 -0700152 "km_openssl/wrapped_key.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700153 ],
154
155 shared_libs: [
156 "libcrypto",
Bram Bonné738feea2020-09-15 21:17:07 +0200157 "libcppbor_external",
Max Bires57c187a2021-03-03 16:30:16 -0800158 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700159 ],
Colin Cross79277d32020-12-10 12:08:19 -0800160 export_shared_lib_headers: ["libcppbor_external"],
161 header_libs: ["libhardware_headers"],
162 export_header_lib_headers: ["libhardware_headers"],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700163 defaults: ["keymaster_defaults" ],
Steven Moreland7d6416c2017-04-18 10:06:28 -0700164 cflags: [
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700165 "-DBORINGSSL_NO_CXX",
166 ],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700167 host_supported: true,
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700168 export_include_dirs: ["include"],
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700169 target: {
170 host: {
171 clang_cflags: [
172 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
173 ],
174 },
175 },
Steven Moreland7d6416c2017-04-18 10:06:28 -0700176}
177
178// libsoftkeymaster provides a software-based keymaster HAL implementation.
179// This is used by keystore as a fallback for when the hardware keymaster does
180// not support the request.
Tri Vo0b674d02017-08-04 13:00:33 -0700181cc_library {
Steven Moreland7d6416c2017-04-18 10:06:28 -0700182 name: "libsoftkeymasterdevice",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700183 srcs: [
Janis Danisevskis3bfda162017-05-12 13:10:41 -0700184 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700185 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800186 "contexts/pure_soft_remote_provisioning_context.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700187 "contexts/soft_attestation_context.cpp",
188 "contexts/soft_keymaster_context.cpp",
189 "contexts/soft_keymaster_device.cpp",
190 "contexts/soft_keymaster_logger.cpp",
191 "km_openssl/soft_keymaster_enforcement.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700192 "legacy_support/ec_keymaster1_key.cpp",
193 "legacy_support/ecdsa_keymaster1_operation.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700194 "legacy_support/keymaster1_engine.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700195 "legacy_support/keymaster1_legacy_support.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700196 "legacy_support/rsa_keymaster1_key.cpp",
197 "legacy_support/rsa_keymaster1_operation.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700198 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700199 defaults: ["keymaster_defaults"],
Steven Moreland7d6416c2017-04-18 10:06:28 -0700200 shared_libs: [
201 "libkeymaster_messages",
Janis Danisevskisf38a0022017-04-26 14:44:46 -0700202 "libkeymaster_portable",
Selene Huangb0d38302020-02-14 17:39:36 -0800203 "libsoft_attestation_cert",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700204 "liblog",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700205 "libbase",
Max Bires57c187a2021-03-03 16:30:16 -0800206 "libcppbor_external",
207 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700208 "libcrypto",
209 "libcutils",
210 ],
Steven Moreland7d6416c2017-04-18 10:06:28 -0700211 export_include_dirs: ["include"],
212}
213
Shawn Willden25814f02018-04-02 10:55:34 -0600214cc_library {
Selene Huangb0d38302020-02-14 17:39:36 -0800215 name: "libsoft_attestation_cert",
216 srcs: [
217 "contexts/soft_attestation_cert.cpp",
218 ],
219 defaults: ["keymaster_defaults"],
220 shared_libs: [
221 "libkeymaster_portable",
222 ],
223
A. Cody Schuffelen65667f82020-04-29 14:52:49 -0700224 host_supported: true,
Selene Huangb0d38302020-02-14 17:39:36 -0800225 export_include_dirs: ["include"],
226}
227
228cc_library {
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700229 name: "libpuresoftkeymasterdevice",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700230 srcs: [
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700231 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700232 "contexts/soft_attestation_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700233 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800234 "contexts/pure_soft_remote_provisioning_context.cpp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700235 "contexts/soft_keymaster_logger.cpp",
236 "km_openssl/soft_keymaster_enforcement.cpp",
237 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700238 defaults: ["keymaster_defaults"],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700239 shared_libs: [
240 "libkeymaster_messages",
241 "libkeymaster_portable",
Selene Huangb0d38302020-02-14 17:39:36 -0800242 "libsoft_attestation_cert",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700243 "liblog",
Max Bires57c187a2021-03-03 16:30:16 -0800244 "libcppbor_external",
245 "libcppcose_rkp",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700246 "libcrypto",
247 "libcutils",
Wei Wangc33ecdf2018-06-27 11:53:26 -0700248 "libbase",
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700249 ],
Janis Danisevskis1f8b1c92017-05-08 11:24:41 -0700250 export_include_dirs: ["include"],
251}
252
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700253cc_library {
254 name: "libpuresoftkeymasterdevice_host",
255 srcs: [
256 "contexts/pure_soft_keymaster_context.cpp",
Max Bires57c187a2021-03-03 16:30:16 -0800257 "contexts/pure_soft_remote_provisioning_context.cpp",
Shawn Willden903367c2020-12-15 09:48:08 -0700258 "contexts/soft_attestation_context.cpp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700259 "contexts/soft_keymaster_logger.cpp",
260 "km_openssl/soft_keymaster_enforcement.cpp",
261 ],
262 defaults: ["keymaster_defaults"],
263 host_supported: true,
264 device_supported: false,
265 shared_libs: [
266 "libkeymaster_messages",
267 "libkeymaster_portable",
268 "libsoft_attestation_cert",
269 "liblog",
Max Bires57c187a2021-03-03 16:30:16 -0800270 "libcppbor_external",
271 "libcppcose_rkp",
A. Cody Schuffelen24ba1e22020-05-06 19:41:36 -0700272 "libcrypto",
273 "libcutils",
274 "libbase",
275 ],
276 clang_cflags: [
277 "-DKEYMASTER_NAME_TAGS",
278 "-fno-rtti", // TODO(b/156427382): Remove workaround when possible.
279 ],
280 export_include_dirs: ["include"],
281}
282
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000283cc_library_shared {
284 name: "libkeymaster3device",
285 srcs: [
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700286 "legacy_support/keymaster_passthrough_key.cpp",
287 "legacy_support/keymaster_passthrough_engine.cpp",
288 "legacy_support/keymaster_passthrough_operation.cpp",
289 "contexts/keymaster1_passthrough_context.cpp",
290 "contexts/keymaster2_passthrough_context.cpp",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000291 "ng/AndroidKeymaster3Device.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700292 "android_keymaster/keymaster_configuration.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700293 "legacy_support/ec_keymaster1_key.cpp",
294 "legacy_support/ecdsa_keymaster1_operation.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700295 "legacy_support/keymaster1_engine.cpp",
296 "legacy_support/keymaster1_legacy_support.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700297 "legacy_support/rsa_keymaster1_key.cpp",
298 "legacy_support/rsa_keymaster1_operation.cpp",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000299 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700300 defaults: ["keymaster_defaults"],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000301 shared_libs: [
302 "libkeymaster_messages",
303 "android.hardware.keymaster@3.0",
304 "libcrypto",
305 "libcutils",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700306 "libbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000307 "libhidlbase",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000308 "libkeymaster_portable",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000309 "liblog",
Selene Huangb0d38302020-02-14 17:39:36 -0800310 "libpuresoftkeymasterdevice",
311 "libsoft_attestation_cert",
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000312 "libutils",
313 ],
Janis Danisevskisa68669b2017-02-06 11:46:54 +0000314 export_include_dirs: ["include", "ng/include"],
315}
316
Shawn Willden9e149572017-10-30 16:08:21 -0600317cc_library_shared {
318 name: "libkeymaster4",
Shawn Willden9e149572017-10-30 16:08:21 -0600319 srcs: [
320 "legacy_support/keymaster_passthrough_key.cpp",
321 "legacy_support/keymaster_passthrough_engine.cpp",
322 "legacy_support/keymaster_passthrough_operation.cpp",
Shawn Willdenefd06732017-11-30 19:34:16 -0700323 "ng/AndroidKeymaster4Device.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600324 "android_keymaster/keymaster_configuration.cpp",
Shawn Willden9e149572017-10-30 16:08:21 -0600325 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700326 defaults: ["keymaster_defaults"],
Shawn Willden9e149572017-10-30 16:08:21 -0600327 shared_libs: [
328 "libkeymaster_messages",
329 "android.hardware.keymaster@4.0",
330 "libcrypto",
331 "libcutils",
332 "libbase",
333 "libhidlbase",
Shawn Willden9e149572017-10-30 16:08:21 -0600334 "libkeymaster_portable",
Shawn Willden9e149572017-10-30 16:08:21 -0600335 "libpuresoftkeymasterdevice",
336 "liblog",
337 "libutils",
338 "libkeymaster4support",
339 ],
Shawn Willden6daf9842020-11-19 10:11:47 -0700340 export_include_dirs: [
341 "ng/include",
342 "include"
343 ],
Shawn Willden9e149572017-10-30 16:08:21 -0600344}
345
Shawn Willden8ae41b52019-10-28 12:54:16 -0600346cc_library_shared {
347 name: "libkeymaster41",
348 vendor_available: true,
349 srcs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600350 "ng/AndroidKeymaster41Device.cpp",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600351 ],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700352 defaults: ["keymaster_defaults"],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600353 shared_libs: [
Shawn Willden8ae41b52019-10-28 12:54:16 -0600354 "android.hardware.keymaster@4.0",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700355 "android.hardware.keymaster@4.1",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600356 "libbase",
357 "libcrypto",
358 "libcutils",
359 "libhidlbase",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700360 "libkeymaster4",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600361 "libkeymaster4_1support",
Shawn Willdenf7375d12020-01-15 17:01:27 -0700362 "libkeymaster4support",
Shawn Willden8ae41b52019-10-28 12:54:16 -0600363 "libkeymaster_messages",
364 "libkeymaster_portable",
365 "liblog",
366 "libpuresoftkeymasterdevice",
367 "libutils",
368 ],
Shawn Willden8ae41b52019-10-28 12:54:16 -0600369 export_include_dirs: ["ng/include"],
370}
371
Shawn Willden815e8962020-12-11 13:05:27 +0000372cc_library {
373 name: "libkeymint",
374 vendor_available: true,
375 srcs: [
376 "android_keymaster/keymaster_configuration.cpp",
377 "legacy_support/keymaster_passthrough_engine.cpp",
378 "legacy_support/keymaster_passthrough_key.cpp",
379 "legacy_support/keymaster_passthrough_operation.cpp",
380 "ng/AndroidKeyMintDevice.cpp",
381 "ng/AndroidKeyMintOperation.cpp",
Chirag Pathak7a079942021-01-25 20:16:30 +0000382 "ng/AndroidSharedSecret.cpp",
383 "ng/AndroidSecureClock.cpp",
Shawn Willden815e8962020-12-11 13:05:27 +0000384 "ng/KeyMintUtils.cpp",
385 ],
386 defaults: ["keymaster_defaults"],
387 shared_libs: [
388 "libhidlbase",
Jeongik Chaa3202fa2021-01-26 22:35:10 +0900389 "android.hardware.security.keymint-V1-ndk_platform",
Jeongik Chab40535e2021-02-18 09:38:47 +0900390 "android.hardware.security.sharedsecret-V1-ndk_platform",
391 "android.hardware.security.secureclock-V1-ndk_platform",
Shawn Willden815e8962020-12-11 13:05:27 +0000392 "libbase",
393 "libbinder_ndk",
Max Bires57c187a2021-03-03 16:30:16 -0800394 "libcppbor_external",
Shawn Willden815e8962020-12-11 13:05:27 +0000395 "libcrypto",
396 "libcutils",
397 "libkeymaster_messages",
398 "libkeymaster_messages",
399 "libkeymaster_portable",
400 "liblog",
401 "libpuresoftkeymasterdevice",
402 "libutils",
403 ],
404 export_include_dirs: ["include", "ng/include"],
405}
Selene Huangfb818292020-05-27 04:58:16 -0700406
Max Bires57c187a2021-03-03 16:30:16 -0800407cc_library {
408 name: "libcppcose_rkp",
409 vendor_available: true,
410 host_supported: true,
411 srcs: [
412 "cppcose/cppcose.cpp",
413 ],
414 export_include_dirs: [
415 "include",
416 ],
417 shared_libs: [
418 "libcppbor_external",
419 "libcrypto",
420 "liblog",
421 ],
422}
423
Steven Moreland7d6416c2017-04-18 10:06:28 -0700424// libkeymasterfiles is an empty library that exports all of the files in keymaster as includes.
425cc_library_static {
426 name: "libkeymasterfiles",
427 export_include_dirs: [
428 ".",
429 "include",
430 ],
431}
Corbin Souffrante9474442020-08-28 16:46:58 -0700432
433cc_defaults {
434 name: "keymaster_fuzz_defaults",
435 header_libs: ["libhardware_headers"],
436 shared_libs: [
437 "libkeymaster_messages",
438 ],
439 // Not using defaults because the fuzzer relies on sanitizers that are explicitly disabled there.
440 cflags: [
441 "-Wall",
442 "-Werror",
443 "-Wunused",
444 "-Wno-error=unused-const-variable",
445 "-Wno-error=unused-private-field",
446 "-Wimplicit-fallthrough",
447 "-DKEYMASTER_NAME_TAGS",
448 ],
449 host_supported: true,
450 target: {
451 host: {
452 clang_cflags: [
453 "-fno-rtti", // TODO(b/156427382): Remove when default library removes this
454 ],
455 },
456 },
457}
458
459cc_fuzz {
460 name: "libkeymaster_fuzz_buffer",
461 defaults: ["keymaster_fuzz_defaults"],
462 srcs: [
463 "tests/fuzzers/buffer_fuzz.cpp",
464 ],
465}
466
467cc_fuzz {
468 name: "libkeymaster_fuzz_serializable",
469 defaults: ["keymaster_fuzz_defaults"],
470 srcs: [
471 "tests/fuzzers/message_serializable_fuzz.cpp",
472 ],
473}