xref: /aosp_15_r20/system/security/identity/Android.bp (revision e1997b9af69e3155ead6e072d106a0077849ffba)
1*e1997b9aSAndroid Build Coastguard Workerpackage {
2*e1997b9aSAndroid Build Coastguard Worker    default_team: "trendy_team_android_hardware_backed_security",
3*e1997b9aSAndroid Build Coastguard Worker    // See: http://go/android-license-faq
4*e1997b9aSAndroid Build Coastguard Worker    // A large-scale-change added 'default_applicable_licenses' to import
5*e1997b9aSAndroid Build Coastguard Worker    // all of the 'license_kinds' from "system_security_license"
6*e1997b9aSAndroid Build Coastguard Worker    // to get the below license kinds:
7*e1997b9aSAndroid Build Coastguard Worker    //   SPDX-license-identifier-Apache-2.0
8*e1997b9aSAndroid Build Coastguard Worker    default_applicable_licenses: ["system_security_license"],
9*e1997b9aSAndroid Build Coastguard Worker}
10*e1997b9aSAndroid Build Coastguard Worker
11*e1997b9aSAndroid Build Coastguard Workercc_defaults {
12*e1997b9aSAndroid Build Coastguard Worker    name: "identity_defaults",
13*e1997b9aSAndroid Build Coastguard Worker    cflags: [
14*e1997b9aSAndroid Build Coastguard Worker        "-Wall",
15*e1997b9aSAndroid Build Coastguard Worker        // "-Werror",
16*e1997b9aSAndroid Build Coastguard Worker        "-Wextra",
17*e1997b9aSAndroid Build Coastguard Worker        "-Wunused",
18*e1997b9aSAndroid Build Coastguard Worker        "-Wno-deprecated-declarations",
19*e1997b9aSAndroid Build Coastguard Worker    ],
20*e1997b9aSAndroid Build Coastguard Worker    sanitize: {
21*e1997b9aSAndroid Build Coastguard Worker        misc_undefined: ["integer"],
22*e1997b9aSAndroid Build Coastguard Worker    },
23*e1997b9aSAndroid Build Coastguard Worker
24*e1997b9aSAndroid Build Coastguard Worker}
25*e1997b9aSAndroid Build Coastguard Worker
26*e1997b9aSAndroid Build Coastguard Workercc_defaults {
27*e1997b9aSAndroid Build Coastguard Worker    name: "credstore_defaults",
28*e1997b9aSAndroid Build Coastguard Worker    defaults: [
29*e1997b9aSAndroid Build Coastguard Worker        "identity_defaults",
30*e1997b9aSAndroid Build Coastguard Worker        "identity_use_latest_hal_aidl_cpp_static",
31*e1997b9aSAndroid Build Coastguard Worker        "keymint_use_latest_hal_aidl_ndk_shared",
32*e1997b9aSAndroid Build Coastguard Worker        "keymint_use_latest_hal_aidl_cpp_static",
33*e1997b9aSAndroid Build Coastguard Worker        "android.hardware.identity-support-lib-deps",
34*e1997b9aSAndroid Build Coastguard Worker    ],
35*e1997b9aSAndroid Build Coastguard Worker    srcs: [
36*e1997b9aSAndroid Build Coastguard Worker        "Credential.cpp",
37*e1997b9aSAndroid Build Coastguard Worker        "CredentialData.cpp",
38*e1997b9aSAndroid Build Coastguard Worker        "CredentialStore.cpp",
39*e1997b9aSAndroid Build Coastguard Worker        "CredentialStoreFactory.cpp",
40*e1997b9aSAndroid Build Coastguard Worker        "Session.cpp",
41*e1997b9aSAndroid Build Coastguard Worker        "Util.cpp",
42*e1997b9aSAndroid Build Coastguard Worker        "WritableCredential.cpp",
43*e1997b9aSAndroid Build Coastguard Worker    ],
44*e1997b9aSAndroid Build Coastguard Worker    shared_libs: [
45*e1997b9aSAndroid Build Coastguard Worker        "[email protected]",
46*e1997b9aSAndroid Build Coastguard Worker        "android.security.authorization-ndk",
47*e1997b9aSAndroid Build Coastguard Worker        "libbase",
48*e1997b9aSAndroid Build Coastguard Worker        "libbinder",
49*e1997b9aSAndroid Build Coastguard Worker        "libbinder_ndk",
50*e1997b9aSAndroid Build Coastguard Worker        "libcrypto",
51*e1997b9aSAndroid Build Coastguard Worker        "libhidlbase",
52*e1997b9aSAndroid Build Coastguard Worker        "liblog",
53*e1997b9aSAndroid Build Coastguard Worker        "libutils",
54*e1997b9aSAndroid Build Coastguard Worker        "libutilscallstack",
55*e1997b9aSAndroid Build Coastguard Worker        "libkeystore-attestation-application-id",
56*e1997b9aSAndroid Build Coastguard Worker    ],
57*e1997b9aSAndroid Build Coastguard Worker    static_libs: [
58*e1997b9aSAndroid Build Coastguard Worker        "android.hardware.keymaster-V3-cpp",
59*e1997b9aSAndroid Build Coastguard Worker        "android.hardware.identity-support-lib",
60*e1997b9aSAndroid Build Coastguard Worker        "android.hardware.security.rkp-V3-cpp",
61*e1997b9aSAndroid Build Coastguard Worker        "android.security.rkp_aidl-cpp",
62*e1997b9aSAndroid Build Coastguard Worker        "libcppbor",
63*e1997b9aSAndroid Build Coastguard Worker        "libcredstore_aidl",
64*e1997b9aSAndroid Build Coastguard Worker        "libkeymaster4support",
65*e1997b9aSAndroid Build Coastguard Worker        "librkp_support",
66*e1997b9aSAndroid Build Coastguard Worker    ],
67*e1997b9aSAndroid Build Coastguard Worker}
68*e1997b9aSAndroid Build Coastguard Worker
69*e1997b9aSAndroid Build Coastguard Workercc_binary {
70*e1997b9aSAndroid Build Coastguard Worker    name: "credstore",
71*e1997b9aSAndroid Build Coastguard Worker    defaults: [
72*e1997b9aSAndroid Build Coastguard Worker        "credstore_defaults",
73*e1997b9aSAndroid Build Coastguard Worker    ],
74*e1997b9aSAndroid Build Coastguard Worker    srcs: [
75*e1997b9aSAndroid Build Coastguard Worker        "main.cpp",
76*e1997b9aSAndroid Build Coastguard Worker    ],
77*e1997b9aSAndroid Build Coastguard Worker    init_rc: ["credstore.rc"],
78*e1997b9aSAndroid Build Coastguard Worker}
79*e1997b9aSAndroid Build Coastguard Worker
80*e1997b9aSAndroid Build Coastguard Workerfilegroup {
81*e1997b9aSAndroid Build Coastguard Worker    name: "credstore_aidl",
82*e1997b9aSAndroid Build Coastguard Worker    srcs: [
83*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/ICredential.aidl",
84*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/IWritableCredential.aidl",
85*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/ICredentialStore.aidl",
86*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/AccessControlProfileParcel.aidl",
87*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/EntryNamespaceParcel.aidl",
88*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/EntryParcel.aidl",
89*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/RequestNamespaceParcel.aidl",
90*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/RequestEntryParcel.aidl",
91*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/ResultNamespaceParcel.aidl",
92*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/ResultEntryParcel.aidl",
93*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/GetEntriesResultParcel.aidl",
94*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/AuthKeyParcel.aidl",
95*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/SecurityHardwareInfoParcel.aidl",
96*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/ICredentialStoreFactory.aidl",
97*e1997b9aSAndroid Build Coastguard Worker        "binder/android/security/identity/ISession.aidl",
98*e1997b9aSAndroid Build Coastguard Worker    ],
99*e1997b9aSAndroid Build Coastguard Worker    path: "binder",
100*e1997b9aSAndroid Build Coastguard Worker}
101*e1997b9aSAndroid Build Coastguard Worker
102*e1997b9aSAndroid Build Coastguard Workercc_library_static {
103*e1997b9aSAndroid Build Coastguard Worker    name: "libcredstore_aidl",
104*e1997b9aSAndroid Build Coastguard Worker    srcs: [
105*e1997b9aSAndroid Build Coastguard Worker        ":credstore_aidl",
106*e1997b9aSAndroid Build Coastguard Worker    ],
107*e1997b9aSAndroid Build Coastguard Worker    aidl: {
108*e1997b9aSAndroid Build Coastguard Worker        export_aidl_headers: true,
109*e1997b9aSAndroid Build Coastguard Worker        include_dirs: [
110*e1997b9aSAndroid Build Coastguard Worker            "system/security/identity/binder",
111*e1997b9aSAndroid Build Coastguard Worker        ],
112*e1997b9aSAndroid Build Coastguard Worker    },
113*e1997b9aSAndroid Build Coastguard Worker    shared_libs: [
114*e1997b9aSAndroid Build Coastguard Worker        "libbinder",
115*e1997b9aSAndroid Build Coastguard Worker        "libutils",
116*e1997b9aSAndroid Build Coastguard Worker    ],
117*e1997b9aSAndroid Build Coastguard Worker    static_libs: [
118*e1997b9aSAndroid Build Coastguard Worker        "libkeymaster4support",
119*e1997b9aSAndroid Build Coastguard Worker    ],
120*e1997b9aSAndroid Build Coastguard Worker    export_shared_lib_headers: [
121*e1997b9aSAndroid Build Coastguard Worker        "libbinder",
122*e1997b9aSAndroid Build Coastguard Worker    ],
123*e1997b9aSAndroid Build Coastguard Worker}
124*e1997b9aSAndroid Build Coastguard Worker
125*e1997b9aSAndroid Build Coastguard Workercc_fuzz {
126*e1997b9aSAndroid Build Coastguard Worker    name: "credstore_service_fuzzer",
127*e1997b9aSAndroid Build Coastguard Worker    defaults: [
128*e1997b9aSAndroid Build Coastguard Worker        "credstore_defaults",
129*e1997b9aSAndroid Build Coastguard Worker        "service_fuzzer_defaults",
130*e1997b9aSAndroid Build Coastguard Worker        "fuzzer_disable_leaks",
131*e1997b9aSAndroid Build Coastguard Worker    ],
132*e1997b9aSAndroid Build Coastguard Worker    srcs: [
133*e1997b9aSAndroid Build Coastguard Worker        "fuzzers/credstore_service_fuzzer.cpp",
134*e1997b9aSAndroid Build Coastguard Worker    ],
135*e1997b9aSAndroid Build Coastguard Worker    fuzz_config: {
136*e1997b9aSAndroid Build Coastguard Worker        triage_assignee: "[email protected]",
137*e1997b9aSAndroid Build Coastguard Worker        cc: [
138*e1997b9aSAndroid Build Coastguard Worker            "[email protected]",
139*e1997b9aSAndroid Build Coastguard Worker            "[email protected]",
140*e1997b9aSAndroid Build Coastguard Worker        ],
141*e1997b9aSAndroid Build Coastguard Worker    },
142*e1997b9aSAndroid Build Coastguard Worker}
143