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

Commit e7684ce4 authored by Catherine Vlasov's avatar Catherine Vlasov Committed by Automerger Merge Worker
Browse files

Merge "Add VTS test for attested "rootOfTrust.verifiedBootKey" field on...

Merge "Add VTS test for attested "rootOfTrust.verifiedBootKey" field on VSR-16+." into main am: d5b5dfce

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



Change-Id: I2c870ab3ab78f4bad1d368ac5c0458fdcee98ea4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 363e4e56 d5b5dfce
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -95,6 +95,18 @@ TEST_P(BootloaderStateTest, VbStateIsUnverified) {
            << "Verified boot state must be \"UNVERIFIED\" aka \"orange\".";
}

// Check that the attested Verified Boot key is 32 bytes of zeroes since the bootloader is unlocked.
TEST_P(BootloaderStateTest, VerifiedBootKeyAllZeroes) {
    // Gate this test to avoid waiver issues.
    if (get_vsr_api_level() <= __ANDROID_API_V__) {
        return;
    }

    std::vector<uint8_t> expectedVbKey(32, 0);
    ASSERT_EQ(attestedVbKey_, expectedVbKey) << "Verified Boot key digest must be 32 bytes of "
                                                "zeroes since the bootloader is unlocked.";
}

// Following error codes from avb_slot_data() mean that slot data was loaded
// (even if verification failed).
static inline bool avb_slot_data_loaded(AvbSlotVerifyResult result) {