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_keymint3.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        "keymint_utils.cpp",
52    ],
53    cflags: [
54        "-O0",
55        "-DNXP_EXTNS",
56    ],
57    shared_libs: [
58        "android.hardware.security.rkp-V3-ndk",
59        "android.hardware.security.secureclock-V1-ndk",
60        "android.hardware.security.sharedsecret-V1-ndk",
61        "lib_android_keymaster_keymint_utils",
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-V3-ndk",
75    ],
76    export_include_dirs: [
77        ".",
78    ],
79    product_variables: {
80        debuggable: {
81            cflags: ["-DDCHECK_ALWAYS_ON"],
82        },
83    },
84    vendor_available: true,
85}
86
87cc_binary {
88    name: "android.hardware.security.keymint3-service.strongbox.nxp",
89    relative_install_path: "hw",
90    init_rc: ["android.hardware.security.keymint3-service.strongbox.nxp.rc"],
91    vintf_fragments: [
92        "android.hardware.security.keymint3-service.strongbox.nxp.xml",
93        "android.hardware.security.sharedsecret3-service.strongbox.nxp.xml",
94    ],
95    vendor: true,
96    cflags: [
97        "-Wall",
98        "-Wextra",
99        "-DOMAPI_TRANSPORT",
100        "-DNXP_EXTNS",
101    ],
102    shared_libs: [
103        "android.hardware.security.rkp-V3-ndk",
104        "android.hardware.security.sharedsecret-V1-ndk",
105        "lib_android_keymaster_keymint_utils",
106        "android.se.omapi-V1-ndk",
107        "libbase",
108        "libbinder_ndk",
109        "libcppbor",
110        "libcrypto",
111        "libkeymaster_portable",
112        "libjc_keymint3.nxp",
113        "libjc_keymint_transport.nxp",
114        "liblog",
115        "libutils",
116        "libhidlbase",
117        "android.hardware.security.keymint-V3-ndk",
118    ],
119    srcs: [
120        "service.cpp",
121    ],
122    required: [
123        "android.hardware.hardware_keystore.jc-strongbox-keymint3.nxp.xml",
124    ],
125}
126
127prebuilt_etc {
128    name: "android.hardware.hardware_keystore.jc-strongbox-keymint3.nxp.xml",
129    sub_dir: "permissions",
130    vendor: true,
131    src: "android.hardware.hardware_keystore.jc-strongbox-keymint3.nxp.xml",
132}
133