Fall back to L3 if L1 has test keybox
Merge from Widevine repo of http://go/wvgerrit/142150 (part 2) For an EVT device, without a keybox or with a test keybox, we want it to fall back to L3. However, when running the unit or integration tests it should continue running tests with test keybox. This will allow us to test L1 oemcrypto on an EVT device, while still using an EVT device for dogfooding video content at the L3 level. Bug: 210807585 Bug: 210823889 Change-Id: I30c35134239db35bb39f11f75220063181987763
This commit is contained in:
@@ -358,6 +358,21 @@ void CryptoSession::Init() {
|
||||
}
|
||||
}
|
||||
|
||||
void CryptoSession::ReinitializeForTest() {
|
||||
if (initialized_) {
|
||||
initialized_ = false;
|
||||
if (OEMCrypto_SUCCESS != OEMCrypto_Terminate()) return;
|
||||
}
|
||||
// Give up if we cannot initialize at all.
|
||||
if (OEMCrypto_SUCCESS != OEMCrypto_Initialize()) return;
|
||||
initialized_ = true;
|
||||
// For integration and unit tests we will install a test keybox and do not
|
||||
// need to do keybox provisioning.
|
||||
needs_keybox_provisioning_ = false;
|
||||
// This was skipped in Init because initialization failed.
|
||||
CacheVersion();
|
||||
}
|
||||
|
||||
void CryptoSession::CacheVersion() {
|
||||
uint32_t version;
|
||||
std::string api_version =
|
||||
@@ -3061,6 +3076,11 @@ CdmResponseType CryptoSession::SetDebugIgnoreKeyboxCount(uint32_t count) {
|
||||
return MapOEMCryptoResult(status, UNKNOWN_ERROR, "SetDebugIgnoreKeyboxCount");
|
||||
}
|
||||
|
||||
CdmResponseType CryptoSession::SetAllowTestKeybox(bool allow) {
|
||||
OEMCryptoResult status = OEMCrypto_SetAllowTestKeybox(allow);
|
||||
return MapOEMCryptoResult(status, UNKNOWN_ERROR, "SetAllowTestKeybox");
|
||||
}
|
||||
|
||||
okp::SystemFallbackPolicy* CryptoSession::GetOkpFallbackPolicy() {
|
||||
const auto getter = [&]() -> okp::SystemFallbackPolicy* {
|
||||
// If not set, then OTA keybox provisioning is not supported or
|
||||
|
||||
Reference in New Issue
Block a user