Use MediaDrm property to ignore installed keybox

Merge from Widevine repo of http://go/wvgerrit/135984

If the MediaDrm property string debugIgnoreKeyboxCount is set to 1,
then the keybox will be ignored on the next initialization. This will
force an OTA keybox reprovisioning.

Equivalently, a 1 may be written to the file
L1/debug_ignore_keybox_count.txt.

In order to test a failed reprovisioning step, a value of 2 may be
used.

Bug: 187646550
Change-Id: Ie7d34a8b355398855f4ec43dd95dd73c5907bdeb
This commit is contained in:
Fred Gylys-Colwell
2021-10-13 21:06:10 +00:00
parent d92c9b9bd2
commit 938bc7bbad
9 changed files with 144 additions and 2 deletions

View File

@@ -303,6 +303,12 @@ class CdmEngine {
virtual size_t SessionSize() const { return session_map_.Size(); }
// This tells the OEMCrypto adapter to ignore the next |count| keyboxes and
// report that it needs provisioning instead.
static CdmResponseType SetDebugIgnoreKeyboxCount(uint32_t count) {
return CryptoSession::SetDebugIgnoreKeyboxCount(count);
}
static CdmResponseType ParseDecryptHashString(const std::string& hash_string,
CdmSessionId* id,
uint32_t* frame_number,

View File

@@ -295,6 +295,10 @@ class CryptoSession {
bool needs_keybox_provisioning() const { return needs_keybox_provisioning_; }
// This tells the OEMCrypto adapter to ignore the next |count| keyboxes and
// report that it needs provisioning instead.
static CdmResponseType SetDebugIgnoreKeyboxCount(uint32_t count);
// Returns a system-wide singleton instance of SystemFallbackPolicy
// to be used for communicating OTA keybox provisioning state between
// apps. Returns a null pointer if OTA provisioning is not supported,

View File

@@ -15,6 +15,10 @@ namespace wvcdm {
OEMCryptoResult OEMCrypto_InitializeAndCheckKeybox(
bool* needs_keybox_provisioning);
// This tells the OEMCrypto adapter to ignore the next |count| keyboxes and
// report that it needs provisioning instead.
OEMCryptoResult OEMCrypto_SetDebugIgnoreKeyboxCount(uint32_t count);
// This attempts to open a session at the desired security level.
// If one level is not available, the other will be used instead.
OEMCryptoResult OEMCrypto_OpenSession(OEMCrypto_SESSION* session,