Allow offline licenses to be loaded and restored in the same session
[ Merge of http://go/wvgerrit/103243 ] In v16, OEMCrypto specifications required that an error be returned if multiple attempts are made to load an offline license into a session. This caused the GTS test testConcurrentDrmCertificates to fail. It was introduced to verify that a license could retrieved and loaded into a session and then restored. This was based on an app use case. Ideally we would like to disallow a this behavior but need to make sure it is not being used by apps. For now this will be allowed. If detected, the CDM will reintialize the OEMCrypto session and allow the license to be restored. Bug: 161551490 Test: WV unit integration tests, GtsMediaTestCases and WidevineConcurrentDrmCertificatesTest#testConcurrentDrmCertificates, MediaDrmTest#testMultipleLoadKeys on a redfin Change-Id: I0834e4419c3a6dccfd77aaea3afa3d65c2c0c742
This commit is contained in:
@@ -239,6 +239,12 @@ class CdmSession {
|
||||
// true otherwise.
|
||||
bool VerifyOfflineUsageEntry();
|
||||
|
||||
// On android, we previously permitted a license to be loaded and restored
|
||||
// in the same session. This method releases resources so that
|
||||
// CdmSession::Init can safely be invoked before a new license is restored.
|
||||
// TODO(b/161865160): Investigate whether we can dispense with this scenario.
|
||||
virtual CdmResponseType ReleaseOfflineResources();
|
||||
|
||||
// These setters are for testing only. Takes ownership of the pointers.
|
||||
void set_license_parser(CdmLicense* license_parser);
|
||||
void set_crypto_session(CryptoSession* crypto_session);
|
||||
@@ -294,6 +300,21 @@ class CdmSession {
|
||||
// license type release and offline related information
|
||||
CdmKeySetId key_set_id_;
|
||||
|
||||
// TODO(b/161865160): Use these variables to cache Init parameters. Remove
|
||||
// when b/ has been addressed.
|
||||
// |cdm_client_property_set_| and |event_listener_| point to a data
|
||||
// member of WVDrmPlugin or WVDrmPlugin itself. It is safe for CdmSession
|
||||
// to make use of these objects without taking ownership since WVDrmPlugin
|
||||
// lifetime exceeds CdmSession (WVDrmPlugin indirectly owns CdmSession
|
||||
// objects). These pointers if set, should be valid till CdmSession
|
||||
// destruction.
|
||||
CdmClientPropertySet* cdm_client_property_set_ = nullptr;
|
||||
CdmSessionId* forced_session_id_ = nullptr;
|
||||
CdmSessionId forced_session_id_value_;
|
||||
WvCdmEventListener* event_listener_ = nullptr;
|
||||
bool has_license_been_loaded_ = false;
|
||||
bool has_license_been_restored_ = false;
|
||||
|
||||
bool mock_license_parser_in_use_;
|
||||
bool mock_policy_engine_in_use_;
|
||||
|
||||
|
||||
@@ -414,6 +414,7 @@ enum CdmResponseType {
|
||||
SHRINK_USAGE_TABLE_HEADER_ENTRY_IN_USE = 359,
|
||||
LICENSE_USAGE_ENTRY_MISSING = 360,
|
||||
LOAD_USAGE_ENTRY_INVALID_SESSION = 361,
|
||||
RESTORE_OFFLINE_LICENSE_ERROR_3 = 362,
|
||||
// Don't forget to add new values to
|
||||
// * core/test/test_printers.cpp.
|
||||
// * android/include/mapErrors-inl.h
|
||||
|
||||
Reference in New Issue
Block a user