1// Copyright 2020, 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
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "system_security_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["system_security_license"],
22}
23
24rust_library {
25    name: "libkeystore2_km_compat",
26    crate_name: "keystore2_km_compat",
27    srcs: ["lib.rs"],
28    defaults: [
29        "keymint_use_latest_hal_aidl_rust",
30    ],
31    rustlibs: [
32        "android.security.compat-rust",
33    ],
34    shared_libs: [
35        "libkm_compat_service",
36    ],
37}
38
39rust_test {
40    name: "keystore2_km_compat_test",
41    crate_name: "keystore2",
42    srcs: ["lib.rs"],
43    test_suites: ["general-tests"],
44    auto_gen_config: true,
45    defaults: [
46        "keymint_use_latest_hal_aidl_rust",
47    ],
48    rustlibs: [
49        "android.security.compat-rust",
50    ],
51    shared_libs: [
52        "libkm_compat_service",
53    ],
54}
55
56cc_library {
57    name: "libkm_compat",
58    srcs: ["km_compat.cpp"],
59    defaults: [
60        "keymint_use_latest_hal_aidl_ndk_shared",
61        "keystore2_use_latest_aidl_ndk_shared",
62    ],
63    shared_libs: [
64        "android.hardware.keymaster@3.0",
65        "android.hardware.keymaster@4.0",
66        "android.hardware.keymaster@4.1",
67        "android.hardware.security.secureclock-V1-ndk",
68        "android.hardware.security.sharedsecret-V1-ndk",
69        "android.security.compat-ndk",
70        "libbase",
71        "libbinder_ndk",
72        "libcrypto",
73        "libhidlbase",
74        "libkeymaster4_1support",
75        "libkeymint",
76        "libkeymint_support",
77        "libkeystore2_crypto",
78        "libutils",
79    ],
80}
81
82cc_library {
83    name: "libkm_compat_service",
84    srcs: ["km_compat_service.cpp"],
85    defaults: [
86        "keymint_use_latest_hal_aidl_ndk_shared",
87    ],
88    shared_libs: [
89        "android.hardware.security.secureclock-V1-ndk",
90        "android.hardware.security.sharedsecret-V1-ndk",
91        "android.security.compat-ndk",
92        "libbinder_ndk",
93        "libcrypto",
94        "libkeymaster4_1support",
95        "libkeystore2_crypto",
96        "libkm_compat",
97    ],
98}
99
100cc_test {
101    name: "keystore2_km_compat_test_cpp",
102    cflags: [
103        "-Wall",
104        "-Werror",
105        "-Wextra",
106    ],
107    srcs: [
108        "certificate_test.cpp",
109        "gtest_main.cpp",
110        "parameter_conversion_test.cpp",
111        "slot_test.cpp",
112    ],
113    defaults: [
114        "keymint_use_latest_hal_aidl_ndk_shared",
115        "keystore2_use_latest_aidl_ndk_shared",
116    ],
117    shared_libs: [
118        "android.hardware.keymaster@3.0",
119        "android.hardware.keymaster@4.0",
120        "android.hardware.keymaster@4.1",
121        "android.hardware.security.secureclock-V1-ndk",
122        "android.hardware.security.sharedsecret-V1-ndk",
123        "android.security.compat-ndk",
124        "libbase",
125        "libbinder_ndk",
126        "libcrypto",
127        "libhidlbase",
128        "libkeymaster4_1support",
129        "libkeymint_support",
130        "libkeystore2_crypto",
131        "libkm_compat",
132        "libkm_compat_service",
133        "libutils",
134    ],
135}
136