From 649c20ef27ab492505aba937ab97cf5370e0294e Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 30 Sep 2024 23:39:28 +0000 Subject: [PATCH] Remove the used_slots assertion from VtsHalWeaverTargetTest Since fixing the boot-time issues in OMAPI based Weaver HALs has proven to be more difficult than expected, for now the config_disableWeaverOnUnsecuredUsers option is being added as a workaround. It weakens the security benefit of Weaver, but it's better than not being able to enable Weaver at all. As a result of supporting this option, the !used_slots.empty() assertion has to be removed. Bug: 368151356 Test: mmm hardware/interfaces/weaver Change-Id: I2b06e477ee276296e2f8216c2ee99f4c526005a5 --- weaver/vts/VtsHalWeaverTargetTest.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/weaver/vts/VtsHalWeaverTargetTest.cpp b/weaver/vts/VtsHalWeaverTargetTest.cpp index 8952dfcb19..faa84169fe 100644 --- a/weaver/vts/VtsHalWeaverTargetTest.cpp +++ b/weaver/vts/VtsHalWeaverTargetTest.cpp @@ -220,13 +220,10 @@ void WeaverTest::FindFreeSlots() { used_slots.insert(slot); } } - // Starting in Android 14, the system will always use at least one Weaver slot if Weaver is - // supported at all. This is true even if an LSKF hasn't been set yet, since Weaver is used to - // protect the initial binding of each user's synthetic password to ensure that binding can be - // securely deleted if an LSKF is set later. Make sure we saw at least one slot, as otherwise - // the Weaver implementation must have a bug that makes it not fully usable by Android. - ASSERT_FALSE(used_slots.empty()) - << "Could not determine which Weaver slots are in use by the system"; + + // We should assert !used_slots.empty() here, but that can't be done yet due to + // config_disableWeaverOnUnsecuredUsers being supported. The value of that option is not + // accessible from here, so we have to assume it might be set to true. // Find the first free slot. int found = 0;