blob: 6e84ec2741bda4886cd3ba359c5946934ac41749 [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",
David Drysdale207d0a32021-11-05 17:04:54 +0000133 "km_openssl/curve25519_key.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700134 "km_openssl/ec_key.cpp",
135 "km_openssl/ec_key_factory.cpp",
David Zeuthena843b3d2021-01-19 16:01:00 -0500136 "km_openssl/ecdh_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700137 "km_openssl/ecdsa_operation.cpp",
138 "km_openssl/ecies_kem.cpp",
139 "km_openssl/hkdf.cpp",
140 "km_openssl/hmac.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700141 "km_openssl/hmac_key.cpp",
142 "km_openssl/hmac_operation.cpp",
Shawn Willdenfb9b2a42017-12-21 12:35:06 -0700143 "km_openssl/iso18033kdf.cpp",
144 "km_openssl/kdf.cpp",
145 "km_openssl/nist_curve_key_exchange.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700146 "km_openssl/openssl_err.cpp",
147 "km_openssl/openssl_utils.cpp",
148 "km_openssl/rsa_key.cpp",
149 "km_openssl/rsa_key_factory.cpp",
150 "km_openssl/rsa_operation.cpp",
Janis Danisevskis41d5a742017-05-12 10:43:12 -0700151 "km_openssl/software_random_source.cpp",
Janis Danisevskisf54cc932017-05-10 15:29:10 -0700152 "km_openssl/symmetric_key.cpp",
Shawn Willden7efc7722018-01-08 22:00:12 -0700153 "km_openssl/triple_des_key.cpp",
154 "km_openssl/triple_des_operation.cpp",
Shawn Willdendd7e8a02018-01-12 13:03:37 -0700155 "km_openssl/wrapped_key.cpp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700156 ],
157
158 shared_libs: [
159 "libcrypto",
Bram Bonné738feea2020-09-15 21:17:07 +0200160 "libcppbor_external",
Max Bires57c187a2021-03-03 16:30:16 -0800161 "libcppcose_rkp",
Steven Moreland7d6416c2017-04-18 10:06:28 -0700162 ],
Colin Cross79277d32020-12-10 12:08:19 -0800163 export_shared_lib_headers: ["libcppbor_external"],
164 header_libs: ["libhardware_headers"],
165 export_header_lib_headers: ["libhardware_headers"],
Shawn Willdenf7375d12020-01-15 17:01:27 -0700166 defaults: ["keymaster_defaults" ],
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
Jim Blackler4515a7f2021-10-11 13:38:59 +0000178// 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.
181cc_library {
182 name: "libsoftkeymasterdevice",
183 srcs: [
184 "android_keymaster/keymaster_configuration.cpp",
185 "contexts/pure_soft_keymaster_context.cpp",
186 "contexts/pure_soft_remote_provisioning_context.cpp",
187 "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",
192 "legacy_support/ec_keymaster1_key.cpp",
193 "legacy_support/ecdsa_keymaster1_operation.cpp",
194 "legacy_support/keymaster1_engine.cpp",
195 "legacy_support/keymaster1_legacy_support.cpp",
196 "legacy_support/rsa_keymaster1_key.cpp",
197 "legacy_support/rsa_keymaster1_operation.cpp",
198 ],
199 defaults: ["keymaster_defaults"],
200 shared_libs: [
201 "libkeymaster_messages",
202 "libkeymaster_portable",
203 "libsoft_attestation_cert",
204 "liblog",
205 "libbase",
206 "libcppbor_external",
207 "libcppcose_rkp",
208 "libcrypto",
209 "libcutils",
210 ],
211 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",
Jim Blackler4515a7f2021-10-11 13:38:59 +0000289 "contexts/keymaster1_passthrough_context.cpp",
Janis Danisevskis2fea2352017-07-26 16:52:33 -0700290 "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",
Jim Blackler4515a7f2021-10-11 13:38:59 +0000293 "legacy_support/ec_keymaster1_key.cpp",
294 "legacy_support/ecdsa_keymaster1_operation.cpp",
295 "legacy_support/keymaster1_engine.cpp",
296 "legacy_support/keymaster1_legacy_support.cpp",
297 "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 {
Shawn Willden19d8dd22021-04-22 12:50:44 -0600373 name: "lib_android_keymaster_keymint_utils",
374 vendor_available: true,
375 srcs: [
376 "ng/KeyMintUtils.cpp",
377 ],
David Drysdale6a039b22021-11-19 17:39:38 +0000378 defaults: [
379 "keymaster_defaults",
380 "keymint_use_latest_hal_aidl_ndk_shared",
381 ],
Shawn Willden19d8dd22021-04-22 12:50:44 -0600382 shared_libs: [
Shawn Willden19d8dd22021-04-22 12:50:44 -0600383 "libbase",
384 "libhardware",
385 ],
386 export_include_dirs: [
387 "ng/include",
388 "include",
389 ],
390}
391
392cc_library {
Shawn Willden815e8962020-12-11 13:05:27 +0000393 name: "libkeymint",
394 vendor_available: true,
395 srcs: [
396 "android_keymaster/keymaster_configuration.cpp",
397 "legacy_support/keymaster_passthrough_engine.cpp",
398 "legacy_support/keymaster_passthrough_key.cpp",
399 "legacy_support/keymaster_passthrough_operation.cpp",
400 "ng/AndroidKeyMintDevice.cpp",
401 "ng/AndroidKeyMintOperation.cpp",
Max Bires01799e02021-04-19 18:58:04 -0700402 "ng/AndroidRemotelyProvisionedComponentDevice.cpp",
Chirag Pathak7a079942021-01-25 20:16:30 +0000403 "ng/AndroidSharedSecret.cpp",
404 "ng/AndroidSecureClock.cpp",
Shawn Willden815e8962020-12-11 13:05:27 +0000405 ],
David Drysdale6a039b22021-11-19 17:39:38 +0000406 defaults: [
407 "keymaster_defaults",
408 "keymint_use_latest_hal_aidl_ndk_shared",
409 ],
Shawn Willden815e8962020-12-11 13:05:27 +0000410 shared_libs: [
David Drysdale6a039b22021-11-19 17:39:38 +0000411 "libhidlbase",
Jiyong Parke11f34b2021-07-27 12:19:31 +0900412 "android.hardware.security.secureclock-V1-ndk",
413 "android.hardware.security.sharedsecret-V1-ndk",
Shawn Willden19d8dd22021-04-22 12:50:44 -0600414 "lib_android_keymaster_keymint_utils",
Shawn Willden815e8962020-12-11 13:05:27 +0000415 "libbase",
416 "libbinder_ndk",
Max Bires57c187a2021-03-03 16:30:16 -0800417 "libcppbor_external",
Shawn Willden815e8962020-12-11 13:05:27 +0000418 "libcrypto",
419 "libcutils",
420 "libkeymaster_messages",
Shawn Willden815e8962020-12-11 13:05:27 +0000421 "libkeymaster_portable",
422 "liblog",
423 "libpuresoftkeymasterdevice",
424 "libutils",
425 ],
426 export_include_dirs: ["include", "ng/include"],
427}
Selene Huangfb818292020-05-27 04:58:16 -0700428
Max Bires57c187a2021-03-03 16:30:16 -0800429cc_library {
430 name: "libcppcose_rkp",
431 vendor_available: true,
432 host_supported: true,
433 srcs: [
434 "cppcose/cppcose.cpp",
435 ],
436 export_include_dirs: [
437 "include",
438 ],
439 shared_libs: [
440 "libcppbor_external",
441 "libcrypto",
442 "liblog",
443 ],
444}
445
Corbin Souffrante9474442020-08-28 16:46:58 -0700446cc_defaults {
447 name: "keymaster_fuzz_defaults",
448 header_libs: ["libhardware_headers"],
449 shared_libs: [
450 "libkeymaster_messages",
451 ],
452 // Not using defaults because the fuzzer relies on sanitizers that are explicitly disabled there.
453 cflags: [
454 "-Wall",
455 "-Werror",
456 "-Wunused",
457 "-Wno-error=unused-const-variable",
458 "-Wno-error=unused-private-field",
459 "-Wimplicit-fallthrough",
460 "-DKEYMASTER_NAME_TAGS",
461 ],
462 host_supported: true,
463 target: {
464 host: {
465 clang_cflags: [
466 "-fno-rtti", // TODO(b/156427382): Remove when default library removes this
467 ],
468 },
469 },
470}
471
472cc_fuzz {
473 name: "libkeymaster_fuzz_buffer",
474 defaults: ["keymaster_fuzz_defaults"],
475 srcs: [
476 "tests/fuzzers/buffer_fuzz.cpp",
477 ],
478}
479
480cc_fuzz {
481 name: "libkeymaster_fuzz_serializable",
482 defaults: ["keymaster_fuzz_defaults"],
483 srcs: [
484 "tests/fuzzers/message_serializable_fuzz.cpp",
485 ],
486}