• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2020 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
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20cc_library {
21    name: "libcuttlefish_security",
22    defaults: ["hidl_defaults", "cuttlefish_host"],
23    srcs: [
24        "keymaster_channel.cpp",
25    ],
26    header_libs: [
27        "libhardware_headers",
28    ],
29    shared_libs: [
30        "libbase",
31        "libcuttlefish_transport",
32        "libcuttlefish_utils_result",
33        "libgatekeeper",
34        "libkeymaster_messages",
35        "liblog",
36    ],
37    target: {
38        android: {
39            shared_libs: ["libcuttlefish_fs"],
40            srcs: [
41                "confui_sign.cpp",
42                "gatekeeper_channel_sharedfd.cpp",
43                "keymaster_channel_sharedfd.cpp",
44            ],
45        },
46        darwin: {
47            enabled: true,
48        },
49        not_windows: { // Actually means "not-windows host code"
50            shared_libs: ["libcuttlefish_fs"],
51            srcs: [
52                "confui_sign.cpp",
53                "gatekeeper_channel_sharedfd.cpp",
54                "keymaster_channel_sharedfd.cpp",
55            ],
56        },
57        windows: {
58            enabled: true,
59            srcs: [
60                "gatekeeper_channel_windows.cpp",
61                "keymaster_channel_windows.cpp",
62            ],
63        },
64    },
65}
66
67cc_test {
68    name: "libcuttlefish_security_tests",
69    srcs: [
70        "keymaster_channel_test.cpp",
71    ],
72    shared_libs: [
73        "libbase",
74        "libcuttlefish_fs",
75        "libcuttlefish_utils_result",
76        "libcuttlefish_security",
77        "libgatekeeper",
78        "libkeymaster_messages",
79        "liblog",
80    ],
81    static_libs: [
82        "libgmock",
83        "libgtest",
84    ],
85    defaults: ["cuttlefish_buildhost_only"],
86    test_suites: ["general-tests"],
87    test_options: {
88        unit_test: true,
89    },
90}
91