CDM Core: Removed support for v15 licenses.
[ Merge of http://go/wvgerrit/160000 ] OEMCrypto v15 licenses made use of several now-obsolete API functions of OEMCrypto (mainly LoadKeys and RefreshKeys). All license handled by the CDM must be v16 or newer. The CDM can now rely on all license requests/responses containing a core message, using v16 policy timers, and requires loading using LoadLicense() / LoadRenewal(). Bug: 252670759 Test: run_x86_64_tests and policy_engine_unittest Change-Id: I3f65a6ec0326b4c89d1919b8911e065079cb90d2
This commit is contained in:
@@ -155,15 +155,6 @@ class CryptoSession {
|
||||
const std::string& message, std::string* core_message,
|
||||
std::string* signature);
|
||||
virtual CdmResponseType UseSecondaryKey(bool dual_key);
|
||||
// V15 licenses.
|
||||
virtual CdmResponseType LoadKeys(const std::string& message,
|
||||
const std::string& signature,
|
||||
const std::string& mac_key_iv,
|
||||
const std::string& mac_key,
|
||||
const std::vector<CryptoKey>& key_array,
|
||||
const std::string& provider_session_token,
|
||||
const std::string& srm_requirement,
|
||||
CdmLicenseKeyType key_type);
|
||||
// V16 licenses.
|
||||
virtual CdmResponseType LoadLicense(const std::string& signed_message,
|
||||
const std::string& core_message,
|
||||
@@ -174,10 +165,6 @@ class CryptoSession {
|
||||
virtual CdmResponseType PrepareAndSignRenewalRequest(
|
||||
const std::string& message, std::string* core_message,
|
||||
std::string* signature);
|
||||
// V15 licenses.
|
||||
virtual CdmResponseType RefreshKeys(const std::string& message,
|
||||
const std::string& signature,
|
||||
const std::vector<CryptoKey>& key_array);
|
||||
// V16 licenses.
|
||||
virtual CdmResponseType LoadRenewal(const std::string& signed_message,
|
||||
const std::string& core_message,
|
||||
|
||||
@@ -82,10 +82,6 @@ class CdmLicense {
|
||||
|
||||
virtual bool is_offline() const { return is_offline_; }
|
||||
|
||||
virtual bool supports_core_messages() const {
|
||||
return supports_core_messages_;
|
||||
}
|
||||
|
||||
virtual const VersionInfo& GetServiceVersion() {
|
||||
return latest_service_version_;
|
||||
}
|
||||
@@ -110,8 +106,7 @@ class CdmLicense {
|
||||
|
||||
CdmResponseType HandleContentKeyResponse(
|
||||
bool is_restore, const std::string& msg, const std::string& core_message,
|
||||
const std::string& signature, const std::string& mac_key_iv,
|
||||
const std::string& mac_key, const std::vector<CryptoKey>& key_array,
|
||||
const std::string& signature, const std::vector<CryptoKey>& key_array,
|
||||
const video_widevine::License& license);
|
||||
|
||||
// HandleEntitlementKeyResponse loads the entitlement keys in |key_array| into
|
||||
@@ -119,8 +114,7 @@ class CdmLicense {
|
||||
// |wrapped_keys_| and loads them for use.
|
||||
CdmResponseType HandleEntitlementKeyResponse(
|
||||
bool is_restore, const std::string& msg, const std::string& core_message,
|
||||
const std::string& signature, const std::string& mac_key_iv,
|
||||
const std::string& mac_key, const std::vector<CryptoKey>& key_array,
|
||||
const std::string& signature, const std::vector<CryptoKey>& key_array,
|
||||
const video_widevine::License& license);
|
||||
|
||||
// Prepare to reload a key update message. Some special code is needed to work
|
||||
@@ -146,11 +140,6 @@ class CdmLicense {
|
||||
std::string provider_session_token_;
|
||||
bool renew_with_client_id_;
|
||||
bool is_offline_;
|
||||
// Indicates whether the license contains / supports OEMCrypto-level
|
||||
// support for core messages. If the original license was created before
|
||||
// upgrading from V15, or if the licensing server is still running V15,
|
||||
// then the license does not support core messages.
|
||||
bool supports_core_messages_;
|
||||
|
||||
// Associated with ClientIdentification encryption
|
||||
bool use_privacy_mode_;
|
||||
|
||||
@@ -64,7 +64,6 @@ class PolicyEngine {
|
||||
// being restored and transitions and notifications will be deferred until
|
||||
// stored playback times are restored.
|
||||
virtual void SetLicense(const video_widevine::License& license,
|
||||
bool supports_core_messages,
|
||||
bool defer_license_state_update);
|
||||
|
||||
// Used to update the currently loaded entitled content keys.
|
||||
@@ -73,8 +72,7 @@ class PolicyEngine {
|
||||
|
||||
// SetLicenseForRelease is used when releasing a license. The keys in this
|
||||
// license will be ignored, and any old keys will be expired.
|
||||
virtual void SetLicenseForRelease(const video_widevine::License& license,
|
||||
bool supports_core_messages);
|
||||
virtual void SetLicenseForRelease(const video_widevine::License& license);
|
||||
|
||||
// Call this on first decrypt to set the start of playback.
|
||||
virtual bool BeginDecryption(void);
|
||||
@@ -169,8 +167,8 @@ class PolicyEngine {
|
||||
|
||||
void SetSecurityLevelForTest(CdmSecurityLevel security_level);
|
||||
|
||||
LicenseState license_state_;
|
||||
int64_t license_state_update_deadline_;
|
||||
LicenseState license_state_ = kLicenseStateInitial;
|
||||
int64_t license_state_update_deadline_ = 0;
|
||||
|
||||
// This is the license id field from server response. This data gets passed
|
||||
// back to the server in each renewal request. When we get a renewal response
|
||||
@@ -178,11 +176,11 @@ class PolicyEngine {
|
||||
video_widevine::LicenseIdentification license_id_;
|
||||
|
||||
// to assist in clock rollback checks
|
||||
int64_t last_recorded_current_time_;
|
||||
int64_t last_recorded_current_time_ = 0;
|
||||
|
||||
// Used to dispatch CDM events.
|
||||
CdmSessionId session_id_;
|
||||
WvCdmEventListener* event_listener_;
|
||||
WvCdmEventListener* event_listener_ = nullptr;
|
||||
|
||||
// Keys associated with license - holds allowed usage, usage constraints,
|
||||
// and current status (CdmKeyStatus)
|
||||
@@ -193,9 +191,9 @@ class PolicyEngine {
|
||||
video_widevine::License::Policy policy_;
|
||||
|
||||
// Device checks
|
||||
int64_t next_device_check_;
|
||||
uint32_t current_resolution_;
|
||||
CryptoSession* crypto_session_;
|
||||
int64_t next_device_check_ = 0;
|
||||
uint32_t current_resolution_ = 0;
|
||||
CryptoSession* crypto_session_ = nullptr;
|
||||
|
||||
std::unique_ptr<PolicyTimers> policy_timers_;
|
||||
std::unique_ptr<wvutil::Clock> clock_;
|
||||
|
||||
Reference in New Issue
Block a user