xref: /aosp_15_r20/system/security/keystore/Android.bp (revision e1997b9af69e3155ead6e072d106a0077849ffba)
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}
35
36cc_binary {
37    name: "keystore_cli_v2",
38    defaults: [
39        "keystore_defaults",
40        "keystore2_use_latest_aidl_ndk_shared",
41    ],
42
43    cflags: [
44        "-DKEYMASTER_NAME_TAGS",
45        "-Wno-unused-parameter",
46    ],
47    srcs: [
48        "keystore_cli_v2.cpp",
49        "keystore_client.proto",
50    ],
51    shared_libs: [
52        "android.security.apc-ndk",
53        "libbinder",
54        "libbinder_ndk",
55        "libchrome",
56        "libcrypto",
57        "libkeymint_support",
58        "libprotobuf-cpp-lite",
59        "libutils",
60    ],
61
62    local_include_dirs: ["include"],
63}
64
65// Library used by both keystore and credstore for generating the ASN.1 stored
66// in Tag::ATTESTATION_APPLICATION_ID
67cc_library {
68    name: "libkeystore-attestation-application-id",
69    defaults: [
70        "keystore_defaults",
71        "keystore2_use_latest_aidl_ndk_shared",
72    ],
73
74    srcs: [
75        "keystore_attestation_id.cpp",
76    ],
77    shared_libs: [
78        "android.security.aaid_aidl-cpp",
79        "libbase",
80        "libbinder",
81        "libcrypto",
82        "libhidlbase",
83        "liblog",
84        "libutils",
85    ],
86
87    export_include_dirs: ["include"],
88}
89
90// Library for keystore clients using the WiFi HIDL interface
91cc_library {
92    name: "libkeystore-wifi-hidl",
93    defaults: ["keystore_defaults"],
94
95    srcs: ["keystore_get_wifi_hidl.cpp"],
96    shared_libs: [
97        "[email protected]",
98        "libbase",
99        "libhidlbase",
100        "liblog",
101        "libutils",
102    ],
103
104    export_include_dirs: ["include"],
105
106    vendor: true,
107}
108