Fall back to L3 if L1 has test keybox am: 31faf51933 am: cbb5bd0f7a

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16507243

Change-Id: I4159f77db5748bde567466157ce5f07be7f64e55
This commit is contained in:
Fred Gylys-Colwell
2022-01-07 06:08:39 +00:00
committed by Automerger Merge Worker
7 changed files with 135 additions and 30 deletions

View File

@@ -225,16 +225,8 @@ TestCryptoSession::TestCryptoSession(metrics::CryptoMetrics* crypto_metrics)
// The first CryptoSession should have initialized OEMCrypto. This is right
// after that, so we should tell oemcrypto to use a test keybox.
if (session_count() == 1) {
OverrideNeedKeyboxForTesting(false);
// However, if the device does not have a keybox, initialization would have
// failed. In that case we should try again.
if (!initialized()) {
// Give up if we cannot initialize at all.
if (OEMCrypto_SUCCESS != OEMCrypto_Initialize()) return;
set_initialized(true);
// This was skipped in Init because initialization failed.
CacheVersion();
}
CryptoSession::SetAllowTestKeybox(true);
ReinitializeForTest();
WvCdmTestBase::InstallTestRootOfTrust();
}
}