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

Commit c96a5215 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 am: e7684ce4

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



Change-Id: I5734510b2e6601afa5f3d5e68477e659cf2e3a8e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5f03844a e7684ce4
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) {