Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f37af14e authored by Paul Crowley's avatar Paul Crowley Committed by Automerger Merge Worker
Browse files

Test CannotCreateEarlyBootKeys only if metadata encryption is on am: fceb7e53

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1518363

Change-Id: I80a928d3db5c419293228bc22d6edf2613a5a9e2
parents 5147e3b0 fceb7e53
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@

#include <keymasterV4_1/authorization_set.h>

#include <android-base/properties.h>

namespace android::hardware::keymaster::V4_1::test {

using std::string;
@@ -30,6 +32,8 @@ using EarlyBootKeyTest = Keymaster4_1HidlTest;
// creates/uses early boot keys during boot.  It should fail to boot if the early boot key usage
// fails.
TEST_P(EarlyBootKeyTest, CannotCreateEarlyBootKeys) {
    // In R, this works only on devices with metadata encryption.
    if (!android::base::GetBoolProperty("ro.crypto.metadata.enabled", false)) return;
    auto [aesKeyData, hmacKeyData, rsaKeyData, ecdsaKeyData] =
            CreateTestKeys(TAG_EARLY_BOOT_ONLY, ErrorCode::EARLY_BOOT_ENDED);