xref: /aosp_15_r20/external/avb/test/Android.bp (revision d289c2ba6de359471b23d594623b906876bc48a0)
1*d289c2baSAndroid Build Coastguard Worker//
2*d289c2baSAndroid Build Coastguard Worker// Copyright (C) 2018 The Android Open Source Project
3*d289c2baSAndroid Build Coastguard Worker//
4*d289c2baSAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
5*d289c2baSAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
6*d289c2baSAndroid Build Coastguard Worker// You may obtain a copy of the License at
7*d289c2baSAndroid Build Coastguard Worker//
8*d289c2baSAndroid Build Coastguard Worker//      http://www.apache.org/licenses/LICENSE-2.0
9*d289c2baSAndroid Build Coastguard Worker//
10*d289c2baSAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
11*d289c2baSAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
12*d289c2baSAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*d289c2baSAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
14*d289c2baSAndroid Build Coastguard Worker// limitations under the License.
15*d289c2baSAndroid Build Coastguard Worker//
16*d289c2baSAndroid Build Coastguard Worker
17*d289c2baSAndroid Build Coastguard Workerpackage {
18*d289c2baSAndroid Build Coastguard Worker    // See: http://go/android-license-faq
19*d289c2baSAndroid Build Coastguard Worker    // A large-scale-change added 'default_applicable_licenses' to import
20*d289c2baSAndroid Build Coastguard Worker    // all of the 'license_kinds' from "external_avb_license"
21*d289c2baSAndroid Build Coastguard Worker    // to get the below license kinds:
22*d289c2baSAndroid Build Coastguard Worker    //   SPDX-license-identifier-Apache-2.0
23*d289c2baSAndroid Build Coastguard Worker    //   SPDX-license-identifier-MIT
24*d289c2baSAndroid Build Coastguard Worker    default_applicable_licenses: ["external_avb_license"],
25*d289c2baSAndroid Build Coastguard Worker}
26*d289c2baSAndroid Build Coastguard Worker
27*d289c2baSAndroid Build Coastguard Workerpython_test_host {
28*d289c2baSAndroid Build Coastguard Worker    name: "at_auth_unlock_unittest",
29*d289c2baSAndroid Build Coastguard Worker    main: "at_auth_unlock_unittest.py",
30*d289c2baSAndroid Build Coastguard Worker    srcs: [
31*d289c2baSAndroid Build Coastguard Worker        "at_auth_unlock_unittest.py",
32*d289c2baSAndroid Build Coastguard Worker    ],
33*d289c2baSAndroid Build Coastguard Worker    libs: [
34*d289c2baSAndroid Build Coastguard Worker        "at_auth_unlock",
35*d289c2baSAndroid Build Coastguard Worker    ],
36*d289c2baSAndroid Build Coastguard Worker    data: [
37*d289c2baSAndroid Build Coastguard Worker        "data/cert_pik_certificate.bin",
38*d289c2baSAndroid Build Coastguard Worker        "data/cert_puk_certificate.bin",
39*d289c2baSAndroid Build Coastguard Worker        "data/cert_unlock_challenge.bin",
40*d289c2baSAndroid Build Coastguard Worker        "data/cert_unlock_credential.bin",
41*d289c2baSAndroid Build Coastguard Worker        "data/testkey_cert_puk.pem",
42*d289c2baSAndroid Build Coastguard Worker    ],
43*d289c2baSAndroid Build Coastguard Worker    test_config: "at_auth_unlock_unittest.xml",
44*d289c2baSAndroid Build Coastguard Worker}
45*d289c2baSAndroid Build Coastguard Worker
46*d289c2baSAndroid Build Coastguard Workerfilegroup {
47*d289c2baSAndroid Build Coastguard Worker    name: "avb_testkey_rsa8192",
48*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/testkey_rsa8192.pem"],
49*d289c2baSAndroid Build Coastguard Worker}
50*d289c2baSAndroid Build Coastguard Worker
51*d289c2baSAndroid Build Coastguard Workerfilegroup {
52*d289c2baSAndroid Build Coastguard Worker    name: "avb_testkey_rsa4096",
53*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/testkey_rsa4096.pem"],
54*d289c2baSAndroid Build Coastguard Worker}
55*d289c2baSAndroid Build Coastguard Worker
56*d289c2baSAndroid Build Coastguard Workerfilegroup {
57*d289c2baSAndroid Build Coastguard Worker    name: "avb_testkey_rsa2048",
58*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/testkey_rsa2048.pem"],
59*d289c2baSAndroid Build Coastguard Worker}
60*d289c2baSAndroid Build Coastguard Worker
61*d289c2baSAndroid Build Coastguard Worker// libavb_cert test public key.
62*d289c2baSAndroid Build Coastguard Workerfilegroup {
63*d289c2baSAndroid Build Coastguard Worker    name: "avb_cert_testkey_psk",
64*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/testkey_cert_psk.pem"],
65*d289c2baSAndroid Build Coastguard Worker}
66*d289c2baSAndroid Build Coastguard Worker
67*d289c2baSAndroid Build Coastguard Worker// libavb_cert test public key metadata. PSK and PIK versions are both set to 42.
68*d289c2baSAndroid Build Coastguard Workerfilegroup {
69*d289c2baSAndroid Build Coastguard Worker    name: "avb_cert_test_metadata",
70*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/cert_metadata.bin"],
71*d289c2baSAndroid Build Coastguard Worker}
72*d289c2baSAndroid Build Coastguard Worker
73*d289c2baSAndroid Build Coastguard Worker// libavb_cert test permanent attributes for the above public key.
74*d289c2baSAndroid Build Coastguard Workerfilegroup {
75*d289c2baSAndroid Build Coastguard Worker    name: "avb_cert_test_permanent_attributes",
76*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/cert_permanent_attributes.bin"],
77*d289c2baSAndroid Build Coastguard Worker}
78*d289c2baSAndroid Build Coastguard Worker
79*d289c2baSAndroid Build Coastguard Worker// libavb_cert test RNG for an unlock challenge.
80*d289c2baSAndroid Build Coastguard Worker// Note: this is only the 16-byte randomization, not a full
81*d289c2baSAndroid Build Coastguard Worker// `AvbCertUnlockChallenge`.
82*d289c2baSAndroid Build Coastguard Workerfilegroup {
83*d289c2baSAndroid Build Coastguard Worker    name: "avb_cert_test_unlock_challenge",
84*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/cert_unlock_challenge.bin"],
85*d289c2baSAndroid Build Coastguard Worker}
86*d289c2baSAndroid Build Coastguard Worker
87*d289c2baSAndroid Build Coastguard Worker// libavb_cert test unlock credential signing `avb_cert_test_unlock_challenge`.
88*d289c2baSAndroid Build Coastguard Workerfilegroup {
89*d289c2baSAndroid Build Coastguard Worker    name: "avb_cert_test_unlock_credential",
90*d289c2baSAndroid Build Coastguard Worker    srcs: ["data/cert_unlock_credential.bin"],
91*d289c2baSAndroid Build Coastguard Worker}
92*d289c2baSAndroid Build Coastguard Worker
93*d289c2baSAndroid Build Coastguard Workergenrule {
94*d289c2baSAndroid Build Coastguard Worker    name: "avb_testkey_rsa2048_pub_bin",
95*d289c2baSAndroid Build Coastguard Worker    tools: ["avbtool"],
96*d289c2baSAndroid Build Coastguard Worker    srcs: [":avb_testkey_rsa2048"],
97*d289c2baSAndroid Build Coastguard Worker    out: ["data/testkey_rsa2048_pub.bin"],
98*d289c2baSAndroid Build Coastguard Worker    cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
99*d289c2baSAndroid Build Coastguard Worker}
100*d289c2baSAndroid Build Coastguard Worker
101*d289c2baSAndroid Build Coastguard Workergenrule {
102*d289c2baSAndroid Build Coastguard Worker    name: "avb_testkey_rsa4096_pub_bin",
103*d289c2baSAndroid Build Coastguard Worker    tools: ["avbtool"],
104*d289c2baSAndroid Build Coastguard Worker    srcs: [":avb_testkey_rsa4096"],
105*d289c2baSAndroid Build Coastguard Worker    out: ["data/testkey_rsa4096_pub.bin"],
106*d289c2baSAndroid Build Coastguard Worker    cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
107*d289c2baSAndroid Build Coastguard Worker}
108*d289c2baSAndroid Build Coastguard Worker
109*d289c2baSAndroid Build Coastguard Workergenrule {
110*d289c2baSAndroid Build Coastguard Worker    name: "avb_testkey_rsa8192_pub_bin",
111*d289c2baSAndroid Build Coastguard Worker    tools: ["avbtool"],
112*d289c2baSAndroid Build Coastguard Worker    srcs: [":avb_testkey_rsa8192"],
113*d289c2baSAndroid Build Coastguard Worker    out: ["data/testkey_rsa8192_pub.bin"],
114*d289c2baSAndroid Build Coastguard Worker    cmd: "$(location avbtool) extract_public_key --key $(in) --output $(out)",
115*d289c2baSAndroid Build Coastguard Worker}
116