Merges to android Pi release (part: 1)
Below are a set of CLs being merged from the wv cdm repo to the android repo. * Fix handling of OEM Cert public key. Author: Srujan Gaddam <srujzs@google.com> [ Merge of http://go/wvgerrit/27921 ] This is a potential fix for b/36656190. Set aside public key on first call to get the public key, and use it afterwards. This gets rid of extra calls to OEMCrypto_GetOEMPublicCertificate(), which has side-effect of staging the OEM private key. This also fixes a problem where the public cert string was not being trimmed to match the size returned by OEMCrypto_GetOEMPublicCertificate(). * Complete provisioning request/response for Provisioning 3.0 Author: Gene Morgan <gmorgan@google.com> [ Merge of http://go/wvgerrit/27780 ] Fix bug on provisioning request path where GenerateDerivedKeys() was being called when preparing to generate the signature. Add message signature verification, and call correct OEMCrypto routine to rewrap the private key (OEMCrypto_RewrapDeviceRSAKey30). * Implement Cdm::deleteAllUsageRecords() Author: Gene Morgan <gmorgan@google.com> [ Merge of http://go/wvgerrit/27780 ] Delete all usage records for current origin. Removes usage records from file system and retains the PSTs. The deletes any usage entries matching those PSTs held by OEMCrypto. BUG: 35319024 * Remove stringencoders library from third_party. Author: Jacob Trimble <modmaker@google.com> [ Merge of http://go/wvgerrit/27585 ] We have a fork of the stringencoders library that we use for base64 encoding. This reimplements base64 encoding to remove the extra dependency and to reduce the amount of code. * Add Cdm::deleteUsageRecord() based on key_set_id. Author: Gene Morgan <gmorgan@google.com> [ Merge of http://go/wvgerrit/27605 ] Delete specified usage record from file system usage info and from OEMCrypto. BUG: 35319024 * Modifiable OEMCrypto Author: Fred Gylys-Colwell <fredgc@google.com> [ Merge of http://go/wvgerrit/24729 ] This CL adds a new variant of the OEMCrypto mock code that adjusts its behavior based on a configuration file. This is intended for testing. For example, a tester can set current_hdcp to 2 in the options.txt file, push it to the device, and verify that a license is granted for HDCP 2.0. Then the tester can edit the value of current_hdcp to 1 and push the file to the device. Playback should stop because the license is no longer valid. This variant uses a real level 1 liboemcrypto.so to push data to a secure buffer. That means we can test playback for a license that requires secure buffers on an Android device with real secure buffers. BUG: 35141278 BUG: 37353534 BUG: 71650075 Test: Not currently passing. Will be addressed in a subsequent commit in the chain. Change-Id: I58443c510919e992bb455192e70373490a00e2b6
This commit is contained in:
@@ -3,20 +3,21 @@
|
||||
#ifndef WVCDM_CORE_CDM_ENGINE_H_
|
||||
#define WVCDM_CORE_CDM_ENGINE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cdm_session_map.h"
|
||||
#include "certificate_provisioning.h"
|
||||
#include "clock.h"
|
||||
#include "crypto_session.h"
|
||||
#include "file_store.h"
|
||||
#include "initialization_data.h"
|
||||
#include "lock.h"
|
||||
#include "metrics_collections.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "scoped_ptr.h"
|
||||
#include "timer_metric.h"
|
||||
#include "service_certificate.h"
|
||||
#include "timer_metric.h"
|
||||
#include "wv_cdm_constants.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
@@ -28,11 +29,9 @@ class CryptoEngine;
|
||||
class UsagePropertySet;
|
||||
class WvCdmEventListener;
|
||||
|
||||
typedef std::map<CdmSessionId, CdmSession*> CdmSessionMap;
|
||||
typedef std::map<
|
||||
CdmKeySetId,
|
||||
std::pair<CdmSessionId, int64_t /* expiration time in seconds */> >
|
||||
CdmReleaseKeySetMap;
|
||||
// Keep expiration time for each key set
|
||||
typedef std::map<CdmKeySetId,
|
||||
std::pair<CdmSessionId, int64_t> > CdmReleaseKeySetMap;
|
||||
|
||||
class CdmEngine {
|
||||
public:
|
||||
@@ -91,26 +90,7 @@ class CdmEngine {
|
||||
const CdmSessionId& session_id, const CdmKeySetId& key_set_id,
|
||||
const InitializationData& init_data, const CdmLicenseType license_type,
|
||||
CdmAppParameterMap& app_parameters, CdmKeyRequest* key_request);
|
||||
// This API may
|
||||
// (a) accept license response, extract key info and load keys.
|
||||
// (b) accept a renewal response and update license policy information.
|
||||
// (c) accept a release response and release an offline license or secure
|
||||
// stop.
|
||||
// (d) accept a service certificate and cache that information for the
|
||||
// the lifetime of the session.
|
||||
//
|
||||
// |session_id| identifies the session that generated the request and can
|
||||
// process the response. Should be empty if a release response.
|
||||
// |key_data| is the license, renewal, release response or service
|
||||
// certificate response.
|
||||
// |key_set_id| should be non-null and specified if license release.
|
||||
// If offline license or streaming license associated with
|
||||
// a secure stop, |key_set_id| should be non-null and will
|
||||
// be filled in on return. Use the |key_set_id| with
|
||||
// RestoreKeys (to reload offline session) or
|
||||
// GenerateKeyRequest (to release offline session/secure stop).
|
||||
// |key_set_id| will be cleared if release or streaming
|
||||
// (not associated with a secure stop).
|
||||
// Accept license response and extract key info.
|
||||
virtual CdmResponseType AddKey(const CdmSessionId& session_id,
|
||||
const CdmKeyResponse& key_data,
|
||||
CdmKeySetId* key_set_id);
|
||||
@@ -178,25 +158,46 @@ class CdmEngine {
|
||||
// system. This will force the device to reprovision itself.
|
||||
virtual CdmResponseType Unprovision(CdmSecurityLevel security_level);
|
||||
|
||||
// Delete OEMCrypto usage tables. Used by Unprovision().
|
||||
virtual CdmResponseType DeleteUsageTable(CdmSecurityLevel security_level);
|
||||
|
||||
// Return the list of key_set_ids stored on the current (origin-specific)
|
||||
// file system.
|
||||
virtual CdmResponseType ListStoredLicenses(
|
||||
CdmSecurityLevel security_level, std::vector<std::string>* key_set_ids);
|
||||
|
||||
// Delete OEMCrypto usage tables. Used by Unprovision().
|
||||
CdmResponseType DeleteUsageTable(CdmSecurityLevel security_level);
|
||||
// Return the list of key_set_ids stored as usage records on the
|
||||
// current (origin-specific) file system.
|
||||
virtual CdmResponseType ListUsageRecords(
|
||||
const std::string& app_id, CdmSecurityLevel security_level,
|
||||
std::vector<std::string>* ksids);
|
||||
|
||||
// Delete the usage record for the given key_set_id. This removes the
|
||||
// usage record in the file system and the OEMCrypto usage record.
|
||||
virtual CdmResponseType DeleteUsageRecord(const std::string& app_id,
|
||||
CdmSecurityLevel security_level,
|
||||
const std::string& key_set_id);
|
||||
|
||||
// Usage related methods for streaming licenses
|
||||
// Retrieve a random usage info from the list of all usage infos for this app
|
||||
// id.
|
||||
virtual CdmResponseType GetUsageInfo(const std::string& app_id,
|
||||
CdmUsageInfo* usage_info);
|
||||
|
||||
// Retrieve the usage info for the specified pst.
|
||||
// Returns UNKNOWN_ERROR if no usage info was found.
|
||||
virtual CdmResponseType GetUsageInfo(const std::string& app_id,
|
||||
const CdmSecureStopId& ssid,
|
||||
CdmUsageInfo* usage_info);
|
||||
|
||||
// Release all usage records for the current origin.
|
||||
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id,
|
||||
CdmSecurityLevel security_level);
|
||||
|
||||
// Release all usage records for the current origin. Span all
|
||||
// security levels.
|
||||
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id);
|
||||
|
||||
virtual CdmResponseType ReleaseUsageInfo(
|
||||
const CdmUsageInfoReleaseMessage& message);
|
||||
virtual CdmResponseType LoadUsageSession(const CdmKeySetId& key_set_id,
|
||||
@@ -236,7 +237,7 @@ class CdmEngine {
|
||||
CdmSigningAlgorithm algorithm,
|
||||
const std::string& signature);
|
||||
|
||||
virtual size_t SessionSize() const { return sessions_.size(); }
|
||||
virtual size_t SessionSize() const { return session_map_.Size(); }
|
||||
|
||||
// Is the key known to any session?
|
||||
virtual bool IsKeyLoaded(const KeyId& key_id);
|
||||
@@ -256,7 +257,7 @@ class CdmEngine {
|
||||
// dead lock.
|
||||
virtual void OnTimerEvent();
|
||||
|
||||
virtual metrics::EngineMetrics* GetMetrics() { return &metrics_; }
|
||||
virtual metrics::MetricsGroup* GetMetrics() { return &metrics_; }
|
||||
|
||||
private:
|
||||
// private methods
|
||||
@@ -279,7 +280,6 @@ class CdmEngine {
|
||||
|
||||
// instance variables
|
||||
|
||||
|
||||
/*
|
||||
* The metrics group must be the first variable declared to ensure
|
||||
* that it is the last member destroyed so that no child members
|
||||
@@ -287,10 +287,10 @@ class CdmEngine {
|
||||
* ensure that all data has been properly recorded in the group before
|
||||
* it is published.
|
||||
*/
|
||||
metrics::EngineMetrics metrics_;
|
||||
metrics::MetricsGroup metrics_;
|
||||
metrics::TimerMetric life_span_;
|
||||
|
||||
CdmSessionMap sessions_;
|
||||
CdmSessionMap session_map_;
|
||||
CdmReleaseKeySetMap release_key_sets_;
|
||||
scoped_ptr<CertificateProvisioning> cert_provisioning_;
|
||||
SecurityLevel cert_provisioning_requested_security_level_;
|
||||
@@ -311,14 +311,7 @@ class CdmEngine {
|
||||
scoped_ptr<UsagePropertySet> usage_property_set_;
|
||||
int64_t last_usage_information_update_time_;
|
||||
|
||||
// Locks the list of sessions, |sessions_|, for the event timer. It will be
|
||||
// locked in OpenSession, CloseSession. It is also locked in OnTimerEvent and
|
||||
// OnKeyReleaseEvent while the list of event listeners is being generated.
|
||||
// The layer above the CDM implementation is expected to handle thread
|
||||
// synchronization to make sure other functions that access sessions do not
|
||||
// occur simultaneously with OpenSession or CloseSession.
|
||||
Lock session_list_lock_;
|
||||
|
||||
// Protect release_key_sets_ from non-thread-safe operations.
|
||||
Lock release_key_sets_lock_;
|
||||
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(CdmEngine);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "file_store.h"
|
||||
#include "initialization_data.h"
|
||||
#include "license.h"
|
||||
#include "metrics_collections.h"
|
||||
#include "metrics_group.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "policy_engine.h"
|
||||
#include "scoped_ptr.h"
|
||||
@@ -24,28 +24,16 @@ namespace wvcdm {
|
||||
class CdmClientPropertySet;
|
||||
class ServiceCertificate;
|
||||
class WvCdmEventListener;
|
||||
class UsageTableHeader;
|
||||
|
||||
class CdmSession {
|
||||
public:
|
||||
// Creates a new instance of the CdmSession with the given |file_system|
|
||||
// and |metrics| parameters. Both parameters are owned by the caller and
|
||||
// must remain in scope througout the scope of the new instance.
|
||||
CdmSession(FileSystem* file_system, metrics::SessionMetrics* metrics);
|
||||
CdmSession(FileSystem* file_system);
|
||||
virtual ~CdmSession();
|
||||
|
||||
// Initializes this instance of CdmSession with the given property set.
|
||||
// |cdm_client_property_set| MAY be null, is owned by the caller,
|
||||
// and must remain in scope throughout the scope of this session.
|
||||
virtual CdmResponseType Init(CdmClientPropertySet* cdm_client_property_set);
|
||||
void Close() { closed_ = true; }
|
||||
bool IsClosed() { return closed_; }
|
||||
|
||||
// Initializes this instance of CdmSession with the given parmeters.
|
||||
// All parameters are owned by the caller.
|
||||
// |cdm_client_property_set| is caller owned, may be null, but must be
|
||||
// in scope as long as the session is in scope.
|
||||
// |forced_session_id| is caller owned and may be null.
|
||||
// |event_listener| is caller owned, may be null, but must be in scope
|
||||
// as long as the session is in scope.
|
||||
virtual CdmResponseType Init(CdmClientPropertySet* cdm_client_property_set);
|
||||
virtual CdmResponseType Init(ServiceCertificate* service_certificate,
|
||||
CdmClientPropertySet* cdm_client_property_set,
|
||||
const CdmSessionId* forced_session_id,
|
||||
@@ -54,7 +42,7 @@ class CdmSession {
|
||||
virtual CdmResponseType RestoreOfflineSession(
|
||||
const CdmKeySetId& key_set_id, const CdmLicenseType license_type);
|
||||
virtual CdmResponseType RestoreUsageSession(
|
||||
const DeviceFiles::CdmUsageData& usage_data);
|
||||
const CdmKeyMessage& key_request, const CdmKeyResponse& key_response);
|
||||
|
||||
virtual const CdmSessionId& session_id() { return session_id_; }
|
||||
virtual const CdmKeySetId& key_set_id() { return key_set_id_; }
|
||||
@@ -98,8 +86,6 @@ class CdmSession {
|
||||
// ReleaseKey() - Accept response and release key.
|
||||
virtual CdmResponseType ReleaseKey(const CdmKeyResponse& key_response);
|
||||
|
||||
virtual CdmResponseType DeleteUsageEntry(uint32_t usage_entry_number);
|
||||
|
||||
virtual bool IsKeyLoaded(const KeyId& key_id);
|
||||
virtual int64_t GetDurationRemaining();
|
||||
|
||||
@@ -118,8 +104,7 @@ class CdmSession {
|
||||
// Delete usage information for the list of tokens, |provider_session_tokens|.
|
||||
virtual CdmResponseType DeleteMultipleUsageInformation(
|
||||
const std::vector<std::string>& provider_session_tokens);
|
||||
virtual CdmResponseType UpdateUsageTableInformation();
|
||||
virtual CdmResponseType UpdateUsageEntryInformation();
|
||||
virtual CdmResponseType UpdateUsageInformation();
|
||||
|
||||
virtual bool is_initial_usage_update() { return is_initial_usage_update_; }
|
||||
virtual bool is_usage_update_needed() { return is_usage_update_needed_; }
|
||||
@@ -132,13 +117,6 @@ class CdmSession {
|
||||
virtual bool is_offline() { return is_offline_; }
|
||||
virtual bool is_temporary() { return is_temporary_; }
|
||||
virtual bool license_received() { return license_received_; }
|
||||
virtual bool has_provider_session_token() {
|
||||
return (license_parser_.get() != NULL &&
|
||||
license_parser_->provider_session_token().size() > 0);
|
||||
}
|
||||
|
||||
virtual CdmUsageSupportType get_usage_support_type()
|
||||
{ return usage_support_type_; }
|
||||
|
||||
// ReleaseCrypto() - Closes the underlying crypto session but leaves this
|
||||
// object alive. It is invalid to call any method that requires a crypto
|
||||
@@ -182,7 +160,7 @@ class CdmSession {
|
||||
CdmSigningAlgorithm algorithm,
|
||||
const std::string& signature);
|
||||
|
||||
virtual metrics::SessionMetrics* GetMetrics() { return metrics_; }
|
||||
virtual metrics::MetricsGroup* GetMetrics() { return &metrics_; }
|
||||
|
||||
private:
|
||||
friend class CdmSessionTest;
|
||||
@@ -192,8 +170,6 @@ class CdmSession {
|
||||
CdmResponseType StoreLicense();
|
||||
bool StoreLicense(DeviceFiles::LicenseState state);
|
||||
|
||||
bool UpdateUsageInfo();
|
||||
|
||||
// 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);
|
||||
@@ -201,13 +177,20 @@ class CdmSession {
|
||||
void set_file_handle(DeviceFiles* file_handle);
|
||||
|
||||
// instance variables
|
||||
metrics::SessionMetrics* metrics_;
|
||||
metrics::CryptoMetrics* crypto_metrics_;
|
||||
|
||||
/*
|
||||
* The metrics group must be the first variable declared to ensure
|
||||
* that it is the last member destroyed so that no child members
|
||||
* try to use a reference to it after it is destroyed. This will
|
||||
* ensure that all data has been properly recorded in the group before
|
||||
* it is published.
|
||||
*/
|
||||
metrics::MetricsGroup metrics_;
|
||||
metrics::TimerMetric life_span_;
|
||||
|
||||
bool initialized_;
|
||||
bool closed_; // Session closed, but final shared_ptr has not been released.
|
||||
CdmSessionId session_id_;
|
||||
FileSystem* file_system_;
|
||||
scoped_ptr<CdmLicense> license_parser_;
|
||||
scoped_ptr<CryptoSession> crypto_session_;
|
||||
scoped_ptr<PolicyEngine> policy_engine_;
|
||||
@@ -220,18 +203,11 @@ class CdmSession {
|
||||
SecurityLevel requested_security_level_;
|
||||
CdmAppParameterMap app_parameters_;
|
||||
|
||||
// decryption flags
|
||||
// decryption and usage flags
|
||||
bool is_initial_decryption_;
|
||||
bool has_decrypted_since_last_report_; // ... last report to policy engine.
|
||||
|
||||
// Usage related flags and data
|
||||
bool is_initial_usage_update_;
|
||||
bool is_usage_update_needed_;
|
||||
CdmUsageSupportType usage_support_type_;
|
||||
UsageTableHeader* usage_table_header_;
|
||||
uint32_t usage_entry_number_;
|
||||
CdmUsageEntry usage_entry_;
|
||||
std::string usage_provider_session_token_;
|
||||
|
||||
// information useful for offline and usage scenarios
|
||||
CdmKeyMessage key_request_;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <string>
|
||||
|
||||
#include "crypto_session.h"
|
||||
#include "metrics_collections.h"
|
||||
#include "license_protocol.pb.h"
|
||||
#include "metrics_group.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "scoped_ptr.h"
|
||||
#include "wv_cdm_types.h"
|
||||
@@ -21,8 +21,8 @@ class ServiceCertificate;
|
||||
|
||||
class CertificateProvisioning {
|
||||
public:
|
||||
explicit CertificateProvisioning(metrics::CryptoMetrics* metrics,
|
||||
ServiceCertificate* service_certificate) :
|
||||
CertificateProvisioning(metrics::MetricsGroup* metrics,
|
||||
ServiceCertificate* service_certificate) :
|
||||
crypto_session_(metrics),
|
||||
cert_type_(kCertificateWidevine),
|
||||
service_certificate_(service_certificate) {}
|
||||
@@ -39,10 +39,8 @@ class CertificateProvisioning {
|
||||
|
||||
// Process the provisioning response.
|
||||
CdmResponseType HandleProvisioningResponse(
|
||||
FileSystem* file_system,
|
||||
const CdmProvisioningResponse& response,
|
||||
std::string* cert,
|
||||
std::string* wrapped_key);
|
||||
FileSystem* file_system, const CdmProvisioningResponse& response,
|
||||
std::string* cert, std::string* wrapped_key);
|
||||
|
||||
private:
|
||||
bool GetProvisioningTokenType(
|
||||
@@ -54,12 +52,6 @@ class CertificateProvisioning {
|
||||
video_widevine::SignedProvisioningMessage::ProtocolVersion
|
||||
GetProtocolVersion();
|
||||
|
||||
void ComposeJsonRequestAsQueryString(const std::string& message,
|
||||
CdmProvisioningRequest* request);
|
||||
bool ParseJsonResponse(const CdmProvisioningResponse& json_str,
|
||||
const std::string& start_substr,
|
||||
const std::string& end_substr, std::string* result);
|
||||
|
||||
CryptoSession crypto_session_;
|
||||
CdmCertificateType cert_type_;
|
||||
ServiceCertificate* service_certificate_;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "lock.h"
|
||||
#include "metrics_collections.h"
|
||||
#include "metrics_group.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "timer_metric.h"
|
||||
#include "wv_cdm_types.h"
|
||||
@@ -17,8 +17,6 @@
|
||||
namespace wvcdm {
|
||||
|
||||
class CryptoKey;
|
||||
class UsageTableHeader;
|
||||
|
||||
typedef std::map<CryptoKeyId, CryptoKey*> CryptoKeyMap;
|
||||
|
||||
class CryptoSession {
|
||||
@@ -36,10 +34,7 @@ class CryptoSession {
|
||||
bool rsa_cast;
|
||||
};
|
||||
|
||||
// Creates an instance of CryptoSession with the given |crypto_metrics|.
|
||||
// |crypto_metrics| is owned by the caller, must NOT be null, and must
|
||||
// exist as long as the new CryptoSession exists.
|
||||
CryptoSession(metrics::CryptoMetrics* crypto_metrics);
|
||||
CryptoSession(metrics::MetricsGroup* metrics);
|
||||
virtual ~CryptoSession();
|
||||
|
||||
virtual bool GetClientToken(std::string* client_token);
|
||||
@@ -83,6 +78,8 @@ class CryptoSession {
|
||||
virtual bool GenerateDerivedKeys(const std::string& message);
|
||||
virtual bool GenerateDerivedKeys(const std::string& message,
|
||||
const std::string& session_key);
|
||||
|
||||
|
||||
virtual bool RewrapCertificate(const std::string& signed_message,
|
||||
const std::string& signature,
|
||||
const std::string& nonce,
|
||||
@@ -96,7 +93,7 @@ class CryptoSession {
|
||||
|
||||
// Usage related methods
|
||||
virtual bool UsageInformationSupport(bool* has_support);
|
||||
virtual CdmResponseType UpdateUsageInformation(); // only for OEMCrypto v9-12
|
||||
virtual CdmResponseType UpdateUsageInformation();
|
||||
virtual CdmResponseType DeactivateUsageInformation(
|
||||
const std::string& provider_session_token);
|
||||
virtual CdmResponseType GenerateUsageReport(
|
||||
@@ -148,9 +145,6 @@ class CryptoSession {
|
||||
const std::string& signature);
|
||||
|
||||
// Usage table header and usage entry related methods
|
||||
virtual UsageTableHeader* GetUsageTableHeader() {
|
||||
return usage_table_header_;
|
||||
}
|
||||
virtual CdmResponseType GetUsageSupportType(CdmUsageSupportType* type);
|
||||
virtual CdmResponseType CreateUsageTableHeader(
|
||||
CdmUsageTableHeader* usage_table_header);
|
||||
@@ -165,28 +159,15 @@ class CryptoSession {
|
||||
virtual CdmResponseType ShrinkUsageTableHeader(
|
||||
uint32_t new_entry_count, CdmUsageTableHeader* usage_table_header);
|
||||
virtual CdmResponseType MoveUsageEntry(uint32_t new_entry_number);
|
||||
virtual bool CreateOldUsageEntry(
|
||||
uint64_t time_since_license_received,
|
||||
uint64_t time_since_first_decrypt,
|
||||
uint64_t time_since_last_decrypt,
|
||||
UsageDurationStatus status,
|
||||
const std::string& server_mac_key,
|
||||
const std::string& client_mac_key,
|
||||
const std::string& provider_session_token);
|
||||
virtual CdmResponseType CopyOldUsageEntry(
|
||||
const std::string& provider_session_token);
|
||||
virtual metrics::CryptoMetrics* GetCryptoMetrics() { return metrics_; }
|
||||
|
||||
private:
|
||||
friend class CryptoSessionForTest;
|
||||
|
||||
bool GetProvisioningMethod(CdmClientTokenType* token_type);
|
||||
void Init();
|
||||
void Terminate();
|
||||
bool GetTokenFromKeybox(std::string* token);
|
||||
bool GetTokenFromOemCert(std::string* token);
|
||||
static bool ExtractSystemIdFromOemCert(const std::string& oem_cert,
|
||||
uint32_t* system_id);
|
||||
void GenerateMacContext(const std::string& input_context,
|
||||
std::string* deriv_context);
|
||||
void GenerateEncryptContext(const std::string& input_context,
|
||||
@@ -234,12 +215,12 @@ class CryptoSession {
|
||||
static bool initialized_;
|
||||
static int session_count_;
|
||||
|
||||
metrics::CryptoMetrics* metrics_;
|
||||
metrics::MetricsGroup* metrics_;
|
||||
metrics::TimerMetric life_span_;
|
||||
|
||||
bool open_;
|
||||
CdmClientTokenType pre_provision_token_type_;
|
||||
std::string oem_token_; // Cached OEMCrypto Public Key
|
||||
std::string oem_token_; // Cached OEMCrypto Public Key
|
||||
bool update_usage_table_after_close_session_;
|
||||
CryptoSessionId oec_session_id_;
|
||||
|
||||
@@ -249,11 +230,7 @@ class CryptoSession {
|
||||
|
||||
KeyId cached_key_id_;
|
||||
|
||||
bool is_usage_support_type_valid_;
|
||||
CdmUsageSupportType usage_support_type_;
|
||||
UsageTableHeader* usage_table_header_;
|
||||
static UsageTableHeader* usage_table_header_l1_;
|
||||
static UsageTableHeader* usage_table_header_l3_;
|
||||
|
||||
uint64_t request_id_base_;
|
||||
static uint64_t request_id_index_;
|
||||
|
||||
@@ -29,13 +29,17 @@ class DeviceFiles {
|
||||
kLicenseStateUnknown,
|
||||
} LicenseState;
|
||||
|
||||
struct CdmUsageData {
|
||||
std::string provider_session_token;
|
||||
CdmKeyMessage license_request;
|
||||
CdmKeyResponse license;
|
||||
std::string key_set_id;
|
||||
CdmUsageEntry usage_entry;
|
||||
uint32_t usage_entry_number;
|
||||
typedef enum {
|
||||
kStorageLicense, // persistent license
|
||||
kStorageUsageInfo, // secure stop
|
||||
} UsageEntryStorage;
|
||||
|
||||
struct UsageEntryInfo {
|
||||
UsageEntryStorage storage_type;
|
||||
std::string key_set_id; // used when storage_type is kStorageLicense
|
||||
std::string
|
||||
provider_session_token; // used when storage_type is kStorageUsageInfo
|
||||
std::string app_id; // used when storage_type is kStorageUsageInfo
|
||||
};
|
||||
|
||||
DeviceFiles(FileSystem*);
|
||||
@@ -65,8 +69,7 @@ class DeviceFiles {
|
||||
int64_t last_playback_time,
|
||||
int64_t grace_period_end_time,
|
||||
const CdmAppParameterMap& app_parameters,
|
||||
const CdmUsageEntry& usage_entry,
|
||||
uint32_t usage_entry_number);
|
||||
const CdmUsageEntry& usage_entry);
|
||||
virtual bool RetrieveLicense(
|
||||
const std::string& key_set_id, LicenseState* state,
|
||||
CdmInitData* pssh_data, CdmKeyMessage* key_request,
|
||||
@@ -74,7 +77,7 @@ class DeviceFiles {
|
||||
CdmKeyResponse* key_renewal_response, std::string* release_server_url,
|
||||
int64_t* playback_start_time, int64_t* last_playback_time,
|
||||
int64_t* grace_period_end_time, CdmAppParameterMap* app_parameters,
|
||||
CdmUsageEntry* usage_entry, uint32_t* usage_entry_number);
|
||||
CdmUsageEntry* usage_entry);
|
||||
virtual bool DeleteLicense(const std::string& key_set_id);
|
||||
virtual bool ListLicenses(std::vector<std::string>* key_set_ids);
|
||||
virtual bool DeleteAllFiles();
|
||||
@@ -83,71 +86,54 @@ class DeviceFiles {
|
||||
virtual bool ReserveLicenseId(const std::string& key_set_id);
|
||||
virtual bool UnreserveLicenseId(const std::string& key_set_id);
|
||||
|
||||
// Use this method to create a |usage_info_file_name| from an |app_id|
|
||||
static std::string GetUsageInfoFileName(const std::string& app_id);
|
||||
|
||||
// The UsageInfo methods have been revised to use |usage_info_file_name|
|
||||
// rather than |app_id| as a parameter. Use the helper method above to
|
||||
// translate.
|
||||
// OEMCrypto API 13 introduced big usage tables which required
|
||||
// migration from usage tables stored by the TEE to usage table
|
||||
// header+usage entries stored in unsecured persistent storage. The upgrade
|
||||
// required creation of reverse lookup tables (CdmUsageEntryInfo).
|
||||
// |app_id| however was hashed and unextractable, and necessitated the
|
||||
// switch to |usage_info_file_name|
|
||||
// Store a usage record to the set of usage information on the file system.
|
||||
virtual bool StoreUsageInfo(const std::string& provider_session_token,
|
||||
const CdmKeyMessage& key_request,
|
||||
const CdmKeyResponse& key_response,
|
||||
const std::string& usage_info_file_name,
|
||||
const std::string& app_id,
|
||||
const std::string& key_set_id,
|
||||
const CdmUsageEntry& usage_entry,
|
||||
uint32_t usage_entry_number);
|
||||
virtual bool DeleteUsageInfo(const std::string& usage_info_file_name,
|
||||
const CdmUsageEntry& usage_entry);
|
||||
|
||||
// Extract KSIDs from usage information on the file system.
|
||||
virtual bool ListUsageRecords(const std::string& app_id,
|
||||
std::vector<std::string>* ksids);
|
||||
|
||||
// Get the provider session token for the given key_set_id.
|
||||
virtual bool GetProviderSessionToken(const std::string& app_id,
|
||||
const std::string& key_set_id,
|
||||
std::string* provider_session_token);
|
||||
|
||||
// Delete the usage record for the given PST.
|
||||
virtual bool DeleteUsageInfo(const std::string& app_id,
|
||||
const std::string& provider_session_token);
|
||||
|
||||
// Delete usage information from the file system. Puts a list of all the
|
||||
// psts that were deleted from the file into |provider_session_tokens|.
|
||||
virtual bool DeleteAllUsageInfoForApp(
|
||||
const std::string& usage_info_file_name,
|
||||
const std::string& app_id,
|
||||
std::vector<std::string>* provider_session_tokens);
|
||||
|
||||
// Retrieve one usage info from the file. Subsequent calls will retrieve
|
||||
// subsequent entries in the table for this app_id.
|
||||
virtual bool RetrieveUsageInfo(
|
||||
const std::string& usage_info_file_name,
|
||||
const std::string& app_id,
|
||||
std::vector<std::pair<CdmKeyMessage, CdmKeyResponse> >* usage_info);
|
||||
|
||||
// Retrieve the usage info entry specified by |provider_session_token|.
|
||||
// Returns false if the entry could not be found.
|
||||
virtual bool RetrieveUsageInfo(const std::string& usage_info_file_name,
|
||||
virtual bool RetrieveUsageInfo(const std::string& app_id,
|
||||
const std::string& provider_session_token,
|
||||
CdmKeyMessage* license_request,
|
||||
CdmKeyResponse* license_response,
|
||||
CdmUsageEntry* usage_entry,
|
||||
uint32_t* usage_entry_number);
|
||||
CdmUsageEntry* usage_entry);
|
||||
|
||||
// Retrieve the usage info entry specified by |key_set_id|.
|
||||
// Returns false if the entry could not be found.
|
||||
virtual bool RetrieveUsageInfoByKeySetId(
|
||||
const std::string& usage_info_file_name,
|
||||
const std::string& key_set_id,
|
||||
std::string* provider_session_token,
|
||||
CdmKeyMessage* license_request,
|
||||
CdmKeyResponse* license_response,
|
||||
CdmUsageEntry* usage_entry,
|
||||
uint32_t* usage_entry_number);
|
||||
|
||||
// These APIs support upgrading from usage tables to usage tabler header +
|
||||
// entries introduced in OEMCrypto V13.
|
||||
|
||||
virtual bool ListUsageInfoFiles(std::vector<std::string>* usage_file_names);
|
||||
virtual bool RetrieveUsageInfo(const std::string& usage_info_file_name,
|
||||
std::vector<CdmUsageData>* usage_data);
|
||||
virtual bool RetrieveUsageInfo(const std::string& usage_info_file_name,
|
||||
const std::string& provider_session_token,
|
||||
CdmUsageData* usage_data);
|
||||
// This method overwrites rather than appends data to the usage file
|
||||
virtual bool StoreUsageInfo(const std::string& usage_info_file_name,
|
||||
const std::vector<CdmUsageData>& usage_data);
|
||||
virtual bool UpdateUsageInfo(const std::string& usage_info_file_name,
|
||||
const std::string& provider_session_token,
|
||||
const CdmUsageData& usage_data);
|
||||
virtual bool RetrieveUsageInfoByKeySetId(const std::string& app_id,
|
||||
const std::string& key_set_id,
|
||||
CdmKeyMessage* license_request,
|
||||
CdmKeyResponse* license_response,
|
||||
CdmUsageEntry* usage_entry);
|
||||
|
||||
virtual bool StoreHlsAttributes(const std::string& key_set_id,
|
||||
const CdmHlsMethod method,
|
||||
@@ -159,11 +145,11 @@ class DeviceFiles {
|
||||
|
||||
virtual bool StoreUsageTableInfo(
|
||||
const CdmUsageTableHeader& usage_table_header,
|
||||
const std::vector<CdmUsageEntryInfo>& usage_entry_info);
|
||||
const std::vector<UsageEntryInfo>& usage_entry_info);
|
||||
|
||||
virtual bool RetrieveUsageTableInfo(
|
||||
CdmUsageTableHeader* usage_table_header,
|
||||
std::vector<CdmUsageEntryInfo>* usage_entry_info);
|
||||
std::vector<UsageEntryInfo>* usage_entry_info);
|
||||
|
||||
private:
|
||||
// Helpers that wrap the File interface and automatically handle hashing, as
|
||||
@@ -182,6 +168,7 @@ class DeviceFiles {
|
||||
static std::string GetCertificateFileName();
|
||||
static std::string GetHlsAttributesFileNameExtension();
|
||||
static std::string GetLicenseFileNameExtension();
|
||||
static std::string GetUsageInfoFileName(const std::string& app_id);
|
||||
static std::string GetUsageTableFileName();
|
||||
static std::string GetFileNameSafeHash(const std::string& input);
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace wvcdm {
|
||||
class Clock;
|
||||
class CryptoSession;
|
||||
class PolicyEngine;
|
||||
class CdmSession;
|
||||
class ServiceCertificate;
|
||||
|
||||
class CdmLicense {
|
||||
@@ -39,8 +38,7 @@ class CdmLicense {
|
||||
std::string* server_url);
|
||||
virtual CdmResponseType PrepareKeyUpdateRequest(
|
||||
bool is_renewal, const CdmAppParameterMap& app_parameters,
|
||||
CdmSession* cdm_session, CdmKeyMessage* signed_request,
|
||||
std::string* server_url);
|
||||
CdmKeyMessage* signed_request, std::string* server_url);
|
||||
virtual CdmResponseType HandleKeyResponse(
|
||||
const CdmKeyResponse& license_response);
|
||||
virtual CdmResponseType HandleKeyUpdateResponse(
|
||||
@@ -51,7 +49,7 @@ class CdmLicense {
|
||||
const CdmKeyResponse& license_response,
|
||||
const CdmKeyResponse& license_renewal_response,
|
||||
int64_t playback_start_time, int64_t last_playback_time,
|
||||
int64_t grace_period_end_time, CdmSession* cdm_session);
|
||||
int64_t grace_period_end_time);
|
||||
virtual bool RestoreLicenseForRelease(const CdmKeyMessage& license_request,
|
||||
const CdmKeyResponse& license_response);
|
||||
virtual bool HasInitData() { return stored_init_data_.get(); }
|
||||
@@ -65,10 +63,6 @@ class CdmLicense {
|
||||
return is_offline_;
|
||||
}
|
||||
|
||||
static bool ExtractProviderSessionToken(
|
||||
const CdmKeyResponse& license_response,
|
||||
std::string* provider_session_token);
|
||||
|
||||
private:
|
||||
|
||||
CdmResponseType HandleKeyErrorResponse(
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
namespace wvcdm {
|
||||
|
||||
static const uint32_t kNoResolution = 0;
|
||||
|
||||
class LicenseKeyStatus;
|
||||
|
||||
// Holds all content and operator session keys for a session.
|
||||
@@ -33,17 +31,11 @@ class LicenseKeys {
|
||||
virtual bool GetAllowedUsage(const KeyId& key_id,
|
||||
CdmKeyAllowedUsage* allowed_usage);
|
||||
|
||||
// Applies a new status, resolution, and/or HDCP level to each content key,
|
||||
// updating their usability under their constraints. Returns true if any keys
|
||||
// have changed usability, and sets new_usable_keys to true if the status
|
||||
// changes resulted in at least one key becoming usable.
|
||||
//
|
||||
// Pass in NULL for any of the const-pointer arguments to leave that state
|
||||
// unchanged.
|
||||
virtual bool ApplyStatusChange(
|
||||
const CdmKeyStatus* new_status, const uint32_t* new_resolution,
|
||||
const CryptoSession::HdcpCapability* new_hdcp_level,
|
||||
bool* new_usable_keys);
|
||||
// Applies a new status to each content key.
|
||||
// Returns true if any statuses changed, and sets new_usable_keys to
|
||||
// true if the status changes resulted in keys becoming usable.
|
||||
virtual bool ApplyStatusChange(CdmKeyStatus new_status,
|
||||
bool* new_usable_keys);
|
||||
|
||||
// Populates the CdmKeyStatusMap with the current content keys.
|
||||
virtual void ExtractKeyStatuses(CdmKeyStatusMap* content_keys);
|
||||
@@ -53,6 +45,11 @@ class LicenseKeys {
|
||||
// to the key, returns true.
|
||||
virtual bool MeetsConstraints(const KeyId& key_id);
|
||||
|
||||
// Applies a resolution and/or hdcp change to each key, updating their
|
||||
// useability under their constraints.
|
||||
virtual void ApplyConstraints(uint32_t new_resolution,
|
||||
CryptoSession::HdcpCapability new_hdcp_level);
|
||||
|
||||
// Extracts the keys from a license and makes them available for
|
||||
// querying usage and constraint settings.
|
||||
virtual void SetFromLicense(
|
||||
@@ -88,24 +85,21 @@ class LicenseKeyStatus {
|
||||
// Returns the current status of the key.
|
||||
virtual CdmKeyStatus GetKeyStatus() const { return key_status_; }
|
||||
|
||||
// Applies a new status, resolution, and/or HDCP level, updating the key's
|
||||
// usability under its constraints. Returns true if this results in a change
|
||||
// to the key's usability, and sets newly_usable to true if the status
|
||||
// changes resulted in the key becoming usable.
|
||||
//
|
||||
// Pass in NULL for any of the const-pointer arguments to leave that state
|
||||
// unchanged.
|
||||
virtual bool ApplyStatusChange(
|
||||
const CdmKeyStatus* maybe_new_status,
|
||||
const uint32_t* maybe_new_resolution,
|
||||
const CryptoSession::HdcpCapability* maybe_new_hdcp_level,
|
||||
bool* newly_usable);
|
||||
// Applies a new status to this key.
|
||||
// Returns true if the status changed, and sets new_usable_keys to
|
||||
// true if the status changes resulted in the key becoming usable.
|
||||
virtual bool ApplyStatusChange(CdmKeyStatus new_status,
|
||||
bool* new_usable_keys);
|
||||
|
||||
// Returns the current constraint status of this key. The result
|
||||
// may change due to calls to ApplyConstraints().
|
||||
// Note: this will return true until the first call to ApplyConstraints().
|
||||
virtual bool MeetsConstraints() const { return meets_constraints_; }
|
||||
|
||||
// Applies the given changes in resolution or HDCP settings.
|
||||
virtual void ApplyConstraints(
|
||||
uint32_t new_resolution, CryptoSession::HdcpCapability new_hdcp_level);
|
||||
|
||||
protected:
|
||||
typedef ::video_widevine::License::KeyContainer KeyContainer;
|
||||
typedef KeyContainer::OperatorSessionKeyPermissions
|
||||
@@ -127,14 +121,11 @@ class LicenseKeyStatus {
|
||||
bool HasConstraints() {
|
||||
return is_content_key_ && constraints_.size() != 0;
|
||||
}
|
||||
|
||||
void SetConstraints(const ConstraintList& constraints);
|
||||
void ApplyConstraints();
|
||||
|
||||
bool is_content_key_;
|
||||
CdmKeyStatus key_status_;
|
||||
uint32_t resolution_;
|
||||
CryptoSession::HdcpCapability hdcp_level_;
|
||||
bool can_check_constraints_;
|
||||
bool meets_constraints_;
|
||||
CdmKeyAllowedUsage allowed_usage_;
|
||||
CryptoSession::HdcpCapability default_hdcp_level_;
|
||||
|
||||
@@ -108,15 +108,9 @@ class PolicyEngine {
|
||||
friend class PolicyEngineConstraintsTest;
|
||||
|
||||
void InitDevice(CryptoSession* crypto_session);
|
||||
// Checks the keys against the current state of the hardware in case the HDCP
|
||||
// level no longer meets their requirements. Will only check once every
|
||||
// |kHdcpCheckInterval| seconds. Calls NotifyIfKeysChanged() to propagate any
|
||||
// resultant changes to the OnKeysChange event.
|
||||
void CheckDevice(int64_t current_time);
|
||||
|
||||
void SetDeviceResolution(uint32_t width, uint32_t height) {
|
||||
current_resolution_ = width * height;
|
||||
}
|
||||
void SetDeviceResolution(uint32_t width, uint32_t height);
|
||||
void CheckDeviceHdcpStatusOnTimer(int64_t current_time);
|
||||
void CheckDeviceHdcpStatus();
|
||||
|
||||
typedef enum {
|
||||
kLicenseStateInitial,
|
||||
@@ -147,22 +141,14 @@ class PolicyEngine {
|
||||
|
||||
void UpdateRenewalRequest(int64_t current_time);
|
||||
|
||||
|
||||
// Updates the keys' status to |new_status|. Calls NotifyIfKeysChanged() to
|
||||
// propagate any resultant changes to the OnKeysChange event.
|
||||
void UpdateKeyStatus(CdmKeyStatus new_status);
|
||||
|
||||
// Helper method that correctly fires the OnKeysChange event - if needed -
|
||||
// depending on the parameters it is given.
|
||||
void NotifyIfKeysChanged(bool keys_changed, bool new_usable_keys);
|
||||
// Notifies updates in keys information and fire OnKeysChange event if
|
||||
// key changes.
|
||||
void NotifyKeysChange(CdmKeyStatus new_status);
|
||||
|
||||
// Notifies updates in expiry time and fire OnExpirationUpdate event if
|
||||
// expiry time changes.
|
||||
void NotifyExpirationUpdate(int64_t current_time);
|
||||
|
||||
// Guard against clock rollbacks
|
||||
int64_t GetCurrentTime();
|
||||
|
||||
// set_clock() is for testing only. It alters ownership of the
|
||||
// passed-in pointer.
|
||||
void set_clock(Clock* clock);
|
||||
@@ -194,9 +180,6 @@ class PolicyEngine {
|
||||
// calculate the time where renewal retries should occur.
|
||||
int64_t next_renewal_time_;
|
||||
|
||||
// to assist in clock rollback checks
|
||||
int64_t last_recorded_current_time_;
|
||||
|
||||
// Used to dispatch CDM events.
|
||||
CdmSessionId session_id_;
|
||||
WvCdmEventListener* event_listener_;
|
||||
|
||||
@@ -43,6 +43,10 @@ class ServiceCertificate {
|
||||
virtual bool HasProviderId() { return !provider_id_.empty(); }
|
||||
virtual const std::string& provider_id() { return provider_id_; }
|
||||
|
||||
// Verify the signature for a message.
|
||||
virtual CdmResponseType VerifySignedMessage(const std::string& message,
|
||||
const std::string& signature);
|
||||
|
||||
// Encrypt the ClientIdentification message for a provisioning or
|
||||
// licensing request. Encryption is performed using the current
|
||||
// service certificate. Return a failure if the service certificate is
|
||||
|
||||
@@ -64,10 +64,6 @@ static const std::string QUERY_KEY_MAX_NUMBER_OF_SESSIONS =
|
||||
"MaxNumberOfSessions";
|
||||
static const std::string QUERY_KEY_OEMCRYPTO_API_VERSION =
|
||||
"OemCryptoApiVersion";
|
||||
static const std::string QUERY_KEY_CURRENT_SRM_VERSION = "CurrentSRMVersion";
|
||||
static const std::string QUERY_KEY_SRM_UPDATE_SUPPORT = "SRMUpdateSupport";
|
||||
// whether OEM supports SRM update
|
||||
static const std::string QUERY_KEY_WVCDM_VERSION = "WidevineCdmVersion";
|
||||
|
||||
static const std::string QUERY_VALUE_TRUE = "True";
|
||||
static const std::string QUERY_VALUE_FALSE = "False";
|
||||
@@ -77,7 +73,6 @@ static const std::string QUERY_VALUE_SECURITY_LEVEL_L1 = "L1";
|
||||
static const std::string QUERY_VALUE_SECURITY_LEVEL_L2 = "L2";
|
||||
static const std::string QUERY_VALUE_SECURITY_LEVEL_L3 = "L3";
|
||||
static const std::string QUERY_VALUE_SECURITY_LEVEL_UNKNOWN = "Unknown";
|
||||
static const std::string QUERY_VALUE_SECURITY_LEVEL_DEFAULT = "Default";
|
||||
static const std::string QUERY_VALUE_DISCONNECTED = "Disconnected";
|
||||
static const std::string QUERY_VALUE_UNPROTECTED = "Unprotected";
|
||||
static const std::string QUERY_VALUE_HDCP_V1 = "HDCP-1.x";
|
||||
@@ -105,7 +100,10 @@ static const std::string HLS_URI_ATTRIBUTE = "URI";
|
||||
|
||||
static const char EMPTY_ORIGIN[] = "";
|
||||
static const char EMPTY_SPOID[] = "";
|
||||
static const char EMPTY_APP_PACKAGE_NAME[] = "";
|
||||
|
||||
//Policy engine HDCP enforcement
|
||||
static const uint32_t HDCP_UNSPECIFIED_VIDEO_RESOLUTION = 0;
|
||||
static const int64_t HDCP_DEVICE_CHECK_INTERVAL = 10;
|
||||
} // namespace wvcdm
|
||||
|
||||
#endif // WVCDM_CORE_WV_CDM_CONSTANTS_H_
|
||||
|
||||
@@ -274,8 +274,8 @@ enum CdmResponseType {
|
||||
MOVE_USAGE_ENTRY_UNKNOWN_ERROR,
|
||||
COPY_OLD_USAGE_ENTRY_UNKNOWN_ERROR,
|
||||
INVALID_PARAMETERS_ENG_22,
|
||||
STORE_LICENSE_ERROR_4,
|
||||
LIST_LICENSES_ERROR, /* 235 */
|
||||
LIST_LICENSE_ERROR_1,
|
||||
LIST_LICENSE_ERROR_2, /* 235 */
|
||||
INVALID_PARAMETERS_ENG_23,
|
||||
USAGE_INFORMATION_SUPPORT_FAILED,
|
||||
USAGE_SUPPORT_GET_API_FAILED,
|
||||
@@ -290,8 +290,8 @@ enum CdmResponseType {
|
||||
USAGE_STORE_LICENSE_FAILED,
|
||||
USAGE_STORE_USAGE_INFO_FAILED,
|
||||
USAGE_INVALID_LOAD_ENTRY,
|
||||
RELEASE_ALL_USAGE_INFO_ERROR_4, /* 250 */
|
||||
RELEASE_ALL_USAGE_INFO_ERROR_5,
|
||||
RELEASE_ALL_USAGE_INFO_ERROR_3, /* 250 */
|
||||
RELEASE_ALL_USAGE_INFO_ERROR_4,
|
||||
RELEASE_USAGE_INFO_FAILED,
|
||||
INCORRECT_USAGE_SUPPORT_TYPE_1,
|
||||
INCORRECT_USAGE_SUPPORT_TYPE_2,
|
||||
@@ -303,16 +303,6 @@ enum CdmResponseType {
|
||||
DELETE_USAGE_ERROR_1, /* 260 */
|
||||
DELETE_USAGE_ERROR_2,
|
||||
DELETE_USAGE_ERROR_3,
|
||||
PRIVACY_MODE_ERROR_1,
|
||||
PRIVACY_MODE_ERROR_2,
|
||||
PRIVACY_MODE_ERROR_3, /* 265 */
|
||||
EMPTY_RESPONSE_ERROR_1,
|
||||
INVALID_PARAMETERS_ENG_24,
|
||||
PARSE_RESPONSE_ERROR_1,
|
||||
PARSE_RESPONSE_ERROR_2,
|
||||
PARSE_RESPONSE_ERROR_3, /* 270 */
|
||||
PARSE_RESPONSE_ERROR_4,
|
||||
RELEASE_ALL_USAGE_INFO_ERROR_6,
|
||||
};
|
||||
|
||||
enum CdmKeyStatus {
|
||||
@@ -392,28 +382,12 @@ enum CdmClientTokenType {
|
||||
// kUsageEntrySupport - usage information (table headers and entries) are
|
||||
// persisted in non-secure storage but are loaded and unloaded from
|
||||
// the TEE during use (OEMCrypto v13+)
|
||||
// kUnknownUsageSupport - usage support type is uninitialized or unavailable
|
||||
enum CdmUsageSupportType {
|
||||
kNonSecureUsageSupport,
|
||||
kUsageTableSupport,
|
||||
kUsageEntrySupport,
|
||||
};
|
||||
|
||||
enum CdmUsageEntryStorageType {
|
||||
kStorageLicense,
|
||||
kStorageUsageInfo,
|
||||
kStorageUnknown,
|
||||
};
|
||||
|
||||
struct CdmUsageEntryInfo {
|
||||
CdmUsageEntryStorageType storage_type;
|
||||
CdmKeySetId key_set_id;
|
||||
std::string usage_info_file_name;
|
||||
bool operator==(const CdmUsageEntryInfo& other) const {
|
||||
return storage_type == other.storage_type &&
|
||||
key_set_id == other.key_set_id &&
|
||||
(storage_type != kStorageUsageInfo ||
|
||||
usage_info_file_name == other.usage_info_file_name);
|
||||
}
|
||||
kUnknownUsageSupport,
|
||||
};
|
||||
|
||||
class CdmKeyAllowedUsage {
|
||||
|
||||
Reference in New Issue
Block a user