1//
2// Copyright (C) 2015 The Android Open-Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_binary {
22    name: "android.hardware.keymaster@3.0-service.trusty",
23    defaults: ["hidl_defaults"],
24    relative_install_path: "hw",
25    vendor: true,
26    init_rc: ["3.0/android.hardware.keymaster@3.0-service.trusty.rc"],
27    srcs: [
28        "3.0/service.cpp",
29        "3.0/TrustyKeymaster3Device.cpp",
30        "ipc/trusty_keymaster_ipc.cpp",
31        "TrustyKeymaster.cpp",
32    ],
33
34    local_include_dirs: ["include"],
35
36    shared_libs: [
37        "liblog",
38        "libcutils",
39        "libdl",
40        "libbase",
41        "libutils",
42        "libhardware",
43        "libhidlbase",
44        "libtrusty",
45        "libkeymaster_messages",
46        "libkeymaster3device",
47        "android.hardware.keymaster@3.0"
48    ],
49}
50
51cc_binary {
52    name: "android.hardware.keymaster@4.0-service.trusty",
53    defaults: ["hidl_defaults"],
54    relative_install_path: "hw",
55    vendor: true,
56    init_rc: ["4.0/android.hardware.keymaster@4.0-service.trusty.rc"],
57    srcs: [
58        "4.0/service.cpp",
59        "4.0/TrustyKeymaster4Device.cpp",
60        "ipc/trusty_keymaster_ipc.cpp",
61        "TrustyKeymaster.cpp",
62    ],
63
64    local_include_dirs: ["include"],
65
66    shared_libs: [
67        "liblog",
68        "libcutils",
69        "libdl",
70        "libbase",
71        "libutils",
72        "libhardware",
73        "libhidlbase",
74        "libtrusty",
75        "libkeymaster_messages",
76        "libkeymaster4",
77        "android.hardware.keymaster@4.0"
78    ],
79
80    vintf_fragments: ["4.0/android.hardware.keymaster@4.0-service.trusty.xml"],
81}
82
83cc_binary {
84    name: "android.hardware.security.keymint-service.trusty",
85    relative_install_path: "hw",
86    init_rc: ["keymint/android.hardware.security.keymint-service.trusty.rc"],
87    vintf_fragments: [
88        "keymint/android.hardware.security.keymint-service.trusty.xml",
89    ],
90    vendor: true,
91    cflags: [
92        "-Wall",
93        "-Wextra",
94    ],
95    local_include_dirs: [
96        "include",
97    ],
98    srcs: [
99        "TrustyKeymaster.cpp",
100        "ipc/trusty_keymaster_ipc.cpp",
101        "keymint/TrustyKeyMintDevice.cpp",
102        "keymint/TrustyKeyMintOperation.cpp",
103        "keymint/TrustyRemotelyProvisionedComponentDevice.cpp",
104        "keymint/TrustySecureClock.cpp",
105        "keymint/TrustySharedSecret.cpp",
106        "keymint/service.cpp",
107    ],
108    defaults: [
109        "keymint_use_latest_hal_aidl_ndk_shared",
110    ],
111    shared_libs: [
112        "android.hardware.security.rkp-V3-ndk",
113        "android.hardware.security.secureclock-V1-ndk",
114        "android.hardware.security.sharedsecret-V1-ndk",
115        "lib_android_keymaster_keymint_utils",
116        "libbase",
117        "libbinder_ndk",
118        "libhardware",
119        "libkeymaster_messages",
120        "libkeymint",
121        "liblog",
122        "libtrusty",
123        "libutils",
124    ],
125    required: [
126        "android.hardware.hardware_keystore.xml",
127    ],
128}
129
130prebuilt_etc {
131    name: "keymaster_soft_attestation_keys.xml",
132    vendor: true,
133    src: "set_attestation_key/keymaster_soft_attestation_keys.xml",
134}
135
136cc_library {
137    name: "libtrusty_ipc",
138    vendor: true,
139    srcs: ["ipc/trusty_keymaster_ipc.cpp"],
140    local_include_dirs: ["include"],
141    shared_libs: [
142        "libc",
143        "libcrypto",
144        "liblog",
145        "libtrusty",
146        "libhardware",
147        "libkeymaster_messages",
148        "libutils",
149        "libxml2",
150    ],
151    export_include_dirs: ["include"],
152    cflags: [
153        "-Wall",
154        "-Werror",
155    ],
156}
157
158cc_binary {
159    name: "trusty_keymaster_set_attestation_key",
160    vendor: true,
161
162    srcs: [
163        "set_attestation_key/set_attestation_key.cpp",
164        "ipc/trusty_keymaster_ipc.cpp",
165    ],
166
167    local_include_dirs: ["include"],
168
169    shared_libs: [
170        "libc",
171        "libcrypto",
172        "liblog",
173        "libtrusty",
174        "libhardware",
175        "libkeymaster_messages",
176        "libutils",
177        "libxml2",
178    ],
179    cflags: [
180        "-Wall",
181        "-Werror",
182    ],
183}
184
185cc_binary {
186    name: "trusty_keymaster_set_attestation_ids",
187    vendor: true,
188
189    srcs: [
190        "set_attestation_ids/set_attestation_ids.cpp",
191        "ipc/trusty_keymaster_ipc.cpp",
192    ],
193
194    local_include_dirs: ["include"],
195
196    shared_libs: [
197        "libbase",
198        "libc",
199        "libcrypto",
200        "liblog",
201        "libtrusty",
202        "libhardware",
203        "libkeymaster_messages",
204        "libutils",
205    ],
206    cflags: [
207        "-Wall",
208        "-Werror",
209    ],
210}
211