1// Copyright (C) 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//
15
16// The original Work has been changed by NXP.
17//
18// Licensed under the Apache License, Version 2.0 (the "License");
19// you may not use this file except in compliance with the License.
20// You may obtain a copy of the License at
21//
22// http://www.apache.org/licenses/LICENSE-2.0
23//
24// Unless required by applicable law or agreed to in writing, software
25// distributed under the License is distributed on an "AS IS" BASIS,
26// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27// See the License for the specific language governing permissions and
28// limitations under the License.
29//
30// Copyright 2022-2023 NXP
31//
32
33package {
34    default_applicable_licenses: [
35        "//hardware/nxp/keymint:hardware_nxp_keymint_license",
36    ],
37}
38
39cc_library {
40    name: "libjc_keymint.nxp",
41    defaults: [
42        "keymaster_defaults",
43    ],
44    srcs: [
45        "CborConverter.cpp",
46        "JavacardKeyMintDevice.cpp",
47        "JavacardKeyMintOperation.cpp",
48        "JavacardRemotelyProvisionedComponentDevice.cpp",
49        "JavacardSecureElement.cpp",
50        "JavacardSharedSecret.cpp",
51        "JavacardKeyMintUtils.cpp",
52        "keymint_utils.cpp",
53    ],
54    cflags: [
55        "-O0",
56        "-DNXP_EXTNS",
57        "-Wno-enum-constexpr-conversion",
58    ],
59    shared_libs: [
60        "android.hardware.security.secureclock-V1-ndk",
61        "android.hardware.security.sharedsecret-V1-ndk",
62        "libbase",
63        "libbinder",
64        "libcppbor",
65        "libkeymaster_portable",
66        "libkeymaster_messages",
67        "libsoft_attestation_cert",
68        "liblog",
69        "libcrypto",
70        "libcutils",
71        "libjc_keymint_transport.nxp",
72        "libbinder_ndk",
73        "libmemunreachable",
74        "android.hardware.security.keymint-V2-ndk",
75        "android.hardware.security.rkp-V2-ndk",
76    ],
77    export_include_dirs: [
78        ".",
79    ],
80    product_variables: {
81        debuggable: {
82            cflags: ["-DDCHECK_ALWAYS_ON"],
83        },
84    },
85    vendor_available: true,
86}
87
88cc_binary {
89    name: "android.hardware.security.keymint-service.strongbox.nxp",
90    relative_install_path: "hw",
91    init_rc: ["android.hardware.security.keymint-service.strongbox.nxp.rc"],
92    vintf_fragments: [
93        "android.hardware.security.keymint-service.strongbox.nxp.xml",
94        "android.hardware.security.sharedsecret-service.strongbox.nxp.xml",
95    ],
96    vendor: true,
97    cflags: [
98        "-Wall",
99        "-Wextra",
100        "-DOMAPI_TRANSPORT",
101        "-DNXP_EXTNS",
102    ],
103    shared_libs: [
104        "android.hardware.security.sharedsecret-V1-ndk",
105        "android.se.omapi-V1-ndk",
106        "libbase",
107        "libbinder_ndk",
108        "libcppbor",
109        "libcrypto",
110        "libkeymaster_portable",
111        "libjc_keymint.nxp",
112        "libjc_keymint_transport.nxp",
113        "liblog",
114        "libutils",
115        "libhidlbase",
116        "android.hardware.security.keymint-V2-ndk",
117        "android.hardware.security.rkp-V2-ndk",
118    ],
119    srcs: [
120        "service.cpp",
121    ],
122    required: [
123        "android.hardware.strongbox_keystore.nxp.xml",
124    ],
125}
126
127prebuilt_etc {
128    name: "android.hardware.strongbox_keystore.nxp.xml",
129    sub_dir: "permissions",
130    vendor: true,
131    src: "android.hardware.strongbox_keystore.nxp.xml",
132}
133