mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Skip curve25519 upgrade tests on KeyMint v1
Bug: 266010760 Test: VtsAidlKeyMintTargetTest Change-Id: Ib65e8209477251cce15161b2502c893f9983da42
This commit is contained in:
@@ -76,18 +76,14 @@ std::vector<std::string> keyblob_names_tee = {
|
||||
"rsa-key", "p256-key", "ed25519-key", "x25519-key",
|
||||
"rsa-attest-key", "p256-attest-key", "ed25519-attest-key"};
|
||||
|
||||
std::vector<std::string> keyblob_names_tee_no_25519 = {
|
||||
"aes-key", "aes-key-rr", "des-key", "hmac-key",
|
||||
"rsa-key", "p256-key", "rsa-attest-key", "p256-attest-key"};
|
||||
|
||||
std::vector<std::string> keyblob_names_sb = {"aes-key", "aes-key-rr", "des-key",
|
||||
"hmac-key", "rsa-key", "p256-key",
|
||||
"rsa-attest-key", "p256-attest-key"};
|
||||
|
||||
const std::vector<std::string>& keyblob_names(SecurityLevel sec_level) {
|
||||
if (sec_level == SecurityLevel::STRONGBOX) {
|
||||
return keyblob_names_sb;
|
||||
} else {
|
||||
return keyblob_names_tee;
|
||||
}
|
||||
}
|
||||
|
||||
bool requires_rr(const std::string& name) {
|
||||
return name.find("-rr") != std::string::npos;
|
||||
}
|
||||
@@ -194,13 +190,23 @@ std::vector<uint8_t> load_cert(const std::string& subdir, const std::string& nam
|
||||
|
||||
class KeyBlobUpgradeTest : public KeyMintAidlTestBase {
|
||||
protected:
|
||||
const std::vector<std::string>& keyblob_names() {
|
||||
if (SecLevel() == SecurityLevel::STRONGBOX) {
|
||||
return keyblob_names_sb;
|
||||
} else if (!Curve25519Supported()) {
|
||||
return keyblob_names_tee_no_25519;
|
||||
} else {
|
||||
return keyblob_names_tee;
|
||||
}
|
||||
}
|
||||
|
||||
void UpgradeKeyBlobs(bool expectUpgrade) {
|
||||
std::string subdir = keyblob_subdir(keyblob_dir, GetParam(), /* create? */ false);
|
||||
if (subdir.empty()) {
|
||||
GTEST_SKIP() << "No keyblob directory provided";
|
||||
}
|
||||
|
||||
for (std::string name : keyblob_names(SecLevel())) {
|
||||
for (std::string name : keyblob_names()) {
|
||||
for (bool with_hidden : {false, true}) {
|
||||
std::string app_id;
|
||||
std::string app_data;
|
||||
@@ -348,7 +354,7 @@ TEST_P(KeyBlobUpgradeTest, CreateKeyBlobsBefore) {
|
||||
.SetDefaultValidity(),
|
||||
}};
|
||||
|
||||
for (std::string name : keyblob_names(SecLevel())) {
|
||||
for (std::string name : keyblob_names()) {
|
||||
auto entry = keys_info.find(name);
|
||||
ASSERT_NE(entry, keys_info.end()) << "no builder for " << name;
|
||||
auto builder = entry->second;
|
||||
@@ -425,7 +431,7 @@ TEST_P(KeyBlobUpgradeTest, UseKeyBlobsBeforeOrAfter) {
|
||||
"/data/local/tmp/keymint-blobs";
|
||||
}
|
||||
|
||||
for (std::string name : keyblob_names(SecLevel())) {
|
||||
for (std::string name : keyblob_names()) {
|
||||
for (bool with_hidden : {false, true}) {
|
||||
auto builder = AuthorizationSetBuilder();
|
||||
if (with_hidden) {
|
||||
@@ -562,7 +568,7 @@ TEST_P(KeyBlobUpgradeTest, DeleteRRKeyBlobsAfter) {
|
||||
"/data/local/tmp/keymint-blobs";
|
||||
}
|
||||
|
||||
for (std::string name : keyblob_names(SecLevel())) {
|
||||
for (std::string name : keyblob_names()) {
|
||||
for (bool with_hidden : {false, true}) {
|
||||
auto builder = AuthorizationSetBuilder();
|
||||
if (with_hidden) {
|
||||
|
||||
Reference in New Issue
Block a user