1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "system_security_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    //   SPDX-license-identifier-BSD
8    default_applicable_licenses: ["system_security_license"],
9}
10
11cc_defaults {
12    name: "keystore_defaults",
13
14    cflags: [
15        "-Wall",
16        "-Werror",
17        "-Wextra",
18        "-Wunused",
19    ],
20
21    sanitize: {
22        misc_undefined: [
23             "signed-integer-overflow",
24             "unsigned-integer-overflow",
25             "shift",
26             "integer-divide-by-zero",
27             "implicit-unsigned-integer-truncation",
28             // BUG: 123630767
29             //"implicit-signed-integer-truncation",
30             "implicit-integer-sign-change",
31        ],
32    },
33
34    clang: true,
35}
36
37cc_binary {
38    name: "keystore_cli_v2",
39    defaults: ["keystore_defaults"],
40
41    cflags: [
42        "-DKEYMASTER_NAME_TAGS",
43        "-Wno-unused-parameter",
44    ],
45    srcs: [
46        "keystore_cli_v2.cpp",
47        "keystore_client.proto",
48    ],
49    shared_libs: [
50        "android.security.apc-ndk_platform",
51        "android.system.keystore2-V1-ndk_platform",
52        "libbinder",
53        "libbinder_ndk",
54        "libchrome",
55        "libcrypto",
56        "libkeymint_support",
57        "libprotobuf-cpp-lite",
58        "libutils",
59    ],
60
61    local_include_dirs: ["include"],
62}
63
64// Library used by both keystore and credstore for generating the ASN.1 stored
65// in Tag::ATTESTATION_APPLICATION_ID
66cc_library_shared {
67    name: "libkeystore-attestation-application-id",
68    defaults: ["keystore_defaults"],
69
70    srcs: [
71        ":IKeyAttestationApplicationIdProvider.aidl",
72        "keystore_attestation_id.cpp",
73        "KeyAttestationApplicationId.cpp",
74        "KeyAttestationPackageInfo.cpp",
75        "Signature.cpp",
76    ],
77    shared_libs: [
78        "libbase",
79        "libbinder",
80        "libhidlbase",
81        "liblog",
82        "libutils",
83        "libcrypto",
84    ],
85
86    export_include_dirs: ["include"],
87}
88
89// Library for keystore clients using the WiFi HIDL interface
90cc_library_shared {
91    name: "libkeystore-wifi-hidl",
92    defaults: ["keystore_defaults"],
93
94    srcs: ["keystore_get_wifi_hidl.cpp"],
95    shared_libs: [
96        "android.system.wifi.keystore@1.0",
97        "libbase",
98        "libhidlbase",
99        "liblog",
100        "libutils",
101    ],
102
103    export_include_dirs: ["include"],
104
105    vendor: true,
106}
107