Source release 14.0.0

This commit is contained in:
John W. Bruce
2018-05-16 17:35:40 -07:00
parent 31381a1311
commit 3ab70cec4e
2053 changed files with 1585838 additions and 4614 deletions

View File

@@ -39,15 +39,14 @@ class CdmEngine {
CdmEngine(FileSystem* file_system, const std::string& spoid = EMPTY_SPOID);
virtual ~CdmEngine();
// Set service certificate for all sessions under this CDM/CdmEngine.
// Setting to the empty string is OK. If the License Service certificate is
// empty and privacy mode is true, the certificate will be fetched from
// the server before the first license request.
virtual CdmResponseType SetServiceCertificate(
// Set service certificate used when provisioning under this CDM/CdmEngine.
// If no valid service certificate is set, a default one associated with
// the WV production provisioning server will be used.
virtual CdmResponseType SetProvisioningServiceCertificate(
const std::string& certificate);
// Report whether the service certificate has been set.
virtual bool HasServiceCertificate();
virtual bool HasProvisioningServiceCertificate();
// Session related methods
virtual CdmResponseType OpenSession(
@@ -213,13 +212,13 @@ class CdmEngine {
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);
// Remove all usage records for the current origin.
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id,
CdmSecurityLevel security_level);
// Release all usage records for the current origin. Span all
// Remove all usage records for the current origin. Span all
// security levels.
virtual CdmResponseType ReleaseAllUsageInfo(const std::string& app_id);
virtual CdmResponseType RemoveAllUsageInfo(const std::string& app_id);
virtual CdmResponseType ReleaseUsageInfo(
const CdmUsageInfoReleaseMessage& message);
@@ -323,11 +322,8 @@ class CdmEngine {
static bool seeded_;
// Service certificate for license server and provisioning server.
// It is initially empty. If left empty, the operations that
// require them (getting provider_id, encrypting ClientIdentification)
// are not performed.
ServiceCertificate service_certificate_;
// Service certificate for the provisioning server.
ServiceCertificate provisioning_service_certificate_;
// usage related variables
scoped_ptr<CdmSession> usage_session_;

View File

@@ -10,6 +10,7 @@
#include "metrics_collections.h"
#include "oemcrypto_adapter.h"
#include "scoped_ptr.h"
#include "service_certificate.h"
#include "wv_cdm_types.h"
namespace wvcdm {
@@ -21,13 +22,13 @@ class ServiceCertificate;
class CertificateProvisioning {
public:
CertificateProvisioning(metrics::CryptoMetrics* metrics,
ServiceCertificate* service_certificate) :
CertificateProvisioning(metrics::CryptoMetrics* metrics) :
crypto_session_(metrics),
cert_type_(kCertificateWidevine),
service_certificate_(service_certificate) {}
service_certificate_(new ServiceCertificate()) {}
~CertificateProvisioning() {}
~CertificateProvisioning() {};
CdmResponseType Init(const std::string& service_certificate);
// Construct a valid provisioning request.
// The request will be sent to the provisioning server.
@@ -43,6 +44,7 @@ class CertificateProvisioning {
std::string* cert, std::string* wrapped_key);
private:
// TODO(b/36897239): Remove this once it is no longer needed.
bool GetProvisioningTokenType(
video_widevine::ClientIdentification::TokenType* token_type);
@@ -54,7 +56,7 @@ class CertificateProvisioning {
CryptoSession crypto_session_;
CdmCertificateType cert_type_;
ServiceCertificate* service_certificate_;
scoped_ptr<ServiceCertificate> service_certificate_;
CORE_DISALLOW_COPY_AND_ASSIGN(CertificateProvisioning);
};

View File

@@ -0,0 +1,57 @@
// Copyright 2017 Google Inc. All Rights Reserved.
#ifndef WVCDM_CORE_CLIENT_IDENTIFICATION_H_
#define WVCDM_CORE_CLIENT_IDENTIFICATION_H_
// ClientIdentification fills in the ClientIdentification portion
// of the License or Provisioning request messages.
#include "license_protocol.pb.h"
#include "wv_cdm_types.h"
namespace wvcdm {
class CryptoSession;
class ClientIdentification {
public:
ClientIdentification() : is_license_request_(true) {}
virtual ~ClientIdentification() {}
// Call this method when used with provisioning requests
CdmResponseType Init(CryptoSession* crypto_session);
// Use in conjunction with license requests
// |client_token| must be provided
// |device_id| optional
// |crypto_session| input parameter, mandatory
CdmResponseType Init(const std::string& client_token,
const std::string& device_id,
CryptoSession* crypto_session);
// Fill the ClientIdentification portion of the license or provisioning
// request
// |app_parameters| parameters provided by client/app to be included in
// provisioning/license request. optional, only used
// if |is_license_request| is true
// |client_id| Portion of license/provisioning request that needs to be
// populated.
virtual CdmResponseType Prepare(
const CdmAppParameterMap& app_parameters,
video_widevine::ClientIdentification* client_id);
private:
bool GetProvisioningTokenType(
video_widevine::ClientIdentification::TokenType* token_type);
bool is_license_request_;
std::string client_token_;
std::string device_id_;
CryptoSession* crypto_session_;
CORE_DISALLOW_COPY_AND_ASSIGN(ClientIdentification);
};
} // namespace wvcdm
#endif // WVCDM_CORE_CLIENT_IDENTIFICATION_H_

View File

@@ -0,0 +1,66 @@
#ifndef WVCDM_CORE_CONTENT_KEY_SESSSION_H_
#define WVCDM_CORE_CONTENT_KEY_SESSSION_H_
#include "key_session.h"
#include "timer_metric.h"
namespace wvcdm {
class ContentKeySession : public KeySession {
public:
ContentKeySession(CryptoSessionId oec_session_id,
metrics::CryptoMetrics* metrics)
: KeySession(metrics),
oec_session_id_(oec_session_id),
cipher_mode_(kCipherModeCtr) {}
virtual ~ContentKeySession() {}
KeySessionType Type() { return kDefault; }
// Generate Derived Keys for ContentKeySession
bool GenerateDerivedKeys(const std::string& message);
// Generate Derived Keys (from session key) for ContentKeySession
bool GenerateDerivedKeys(const std::string& message,
const std::string& session_key);
// Load Keys for ContentKeySession
OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement);
OEMCryptoResult LoadEntitledContentKeys(const std::vector<CryptoKey>&) {
return OEMCrypto_ERROR_INVALID_CONTEXT;
}
// Select Key for ContentKeySession
OEMCryptoResult SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode);
// Decrypt for ContentKeySession
OEMCryptoResult Decrypt(const CdmDecryptionParameters& params,
OEMCrypto_DestBufferDesc& buffer_descriptor,
OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor);
protected:
OEMCryptoResult LoadKeys(
const std::string& message, const std::string& signature,
const std::string& mac_key_iv, const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token, CdmCipherMode* cipher_mode,
const std::string& srm_requirement, OEMCrypto_LicenseType license_type);
CryptoSessionId oec_session_id_;
private:
KeyId cached_key_id_;
CdmCipherMode cipher_mode_;
};
} // namespace wvcdm
#endif // WVCDM_CORE_CONTENT_KEY_SESSSION_H_

View File

@@ -19,6 +19,7 @@ class CryptoKey {
const std::string& key_control_iv() const { return key_control_iv_; }
const std::string& sub_session_key_id() const {return sub_session_key_id_;}
const std::string& sub_session_key() const {return sub_session_key_;}
const std::string& entitlement_key_id() const {return entitlement_key_id_;}
const std::string& track_label() const { return track_label_; }
CdmCipherMode cipher_mode() const { return cipher_mode_; }
void set_key_id(const std::string& key_id) { key_id_ = key_id; }
@@ -40,6 +41,9 @@ class CryptoKey {
void set_track_label(const std::string& track_label) {
track_label_ = track_label;
}
void set_entitlement_key_id(const std::string& entitlement_key_id) {
entitlement_key_id_ = entitlement_key_id;
}
bool HasKeyControl() const { return key_control_.size() >= 16; }
@@ -52,6 +56,7 @@ class CryptoKey {
std::string sub_session_key_id_;
std::string track_label_;
std::string sub_session_key_;
std::string entitlement_key_id_;
CdmCipherMode cipher_mode_;
};

View File

@@ -8,10 +8,10 @@
#include <vector>
#include "OEMCryptoCENC.h"
#include "key_session.h"
#include "lock.h"
#include "metrics_collections.h"
#include "oemcrypto_adapter.h"
#include "OEMCryptoCENC.h"
#include "scoped_ptr.h"
#include "timer_metric.h"
#include "wv_cdm_types.h"
@@ -22,36 +22,14 @@ class CryptoKey;
class UsageTableHeader;
typedef std::map<std::string, CryptoKey*> CryptoKeyMap;
typedef std::map<std::string, CryptoSessionId> SubLicenseSessionMap;
class KeySession {
protected:
KeySession(metrics::CryptoMetrics* metrics) : metrics_(metrics) {}
public:
typedef enum { kDefault, kSubLicense } KeySessionType;
virtual ~KeySession() {}
virtual KeySessionType Type() = 0;
virtual bool GenerateDerivedKeys(const std::string& message) = 0;
virtual bool GenerateDerivedKeys(const std::string& message,
const std::string& session_key) = 0;
virtual OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement) = 0;
virtual OEMCryptoResult SelectKey(const std::string& key_id) = 0;
virtual OEMCryptoResult Decrypt(
const CdmDecryptionParameters& params,
OEMCrypto_DestBufferDesc& buffer_descriptor,
OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor) = 0;
protected:
metrics::CryptoMetrics* metrics_;
};
// Crypto session utility functions used by KeySession implementations.
void GenerateMacContext(const std::string& input_context,
std::string* deriv_context);
void GenerateEncryptContext(const std::string& input_context,
std::string* deriv_context);
size_t GetOffset(std::string message, std::string field);
OEMCryptoCipherMode ToOEMCryptoCipherMode(CdmCipherMode cipher_mode);
class CryptoSession {
public:
@@ -74,7 +52,6 @@ class CryptoSession {
explicit CryptoSession(metrics::CryptoMetrics* crypto_metrics);
virtual ~CryptoSession();
virtual bool GetClientToken(std::string* client_token);
virtual bool GetProvisioningToken(std::string* client_token);
virtual CdmClientTokenType GetPreProvisionTokenType() {
return pre_provision_token_type_;
@@ -100,13 +77,15 @@ class CryptoSession {
bool is_provisioning, std::string* signature);
virtual bool PrepareRenewalRequest(const std::string& message,
std::string* signature);
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);
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);
virtual CdmResponseType LoadEntitledContentKeys(
const std::vector<CryptoKey>& key_array);
virtual bool LoadCertificatePrivateKey(std::string& wrapped_key);
virtual bool RefreshKeys(const std::string& message,
const std::string& signature, int num_keys,
@@ -192,21 +171,22 @@ class CryptoSession {
virtual CdmResponseType LoadUsageEntry(uint32_t entry_number,
const CdmUsageEntry& usage_entry);
virtual CdmResponseType UpdateUsageEntry(
CdmUsageTableHeader* usage_table_header,
CdmUsageEntry* usage_entry);
CdmUsageTableHeader* usage_table_header, CdmUsageEntry* usage_entry);
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 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 bool GetAnalogOutputCapabilities(bool* can_support_output,
bool* can_disable_output,
bool* can_support_cgms_a);
virtual metrics::CryptoMetrics* GetCryptoMetrics() { return metrics_; }
virtual CdmResponseType AddSubSession(const std::string& sub_session_key_id,
@@ -217,27 +197,37 @@ class CryptoSession {
bool* exists, uint32_t* nonce);
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);
bool GetSystemIdInternal(uint32_t* system_id);
bool GenerateSignature(const std::string& message, std::string* signature);
bool GenerateRsaSignature(const std::string& message, std::string* signature);
bool SetDestinationBufferType();
bool RewrapDeviceRSAKey(
const std::string& message, const std::string& signature,
const std::string& nonce, const std::string& enc_rsa_key,
const std::string& rsa_key_iv, std::string* wrapped_rsa_key);
bool RewrapDeviceRSAKey(const std::string& message,
const std::string& signature,
const std::string& nonce,
const std::string& enc_rsa_key,
const std::string& rsa_key_iv,
std::string* wrapped_rsa_key);
bool RewrapDeviceRSAKey30(
const std::string& message, const std::string& nonce,
const std::string& private_key, const std::string& iv,
const std::string& wrapping_key, std::string* wrapped_private_key);
bool RewrapDeviceRSAKey30(const std::string& message,
const std::string& nonce,
const std::string& private_key,
const std::string& iv,
const std::string& wrapping_key,
std::string* wrapped_private_key);
CdmResponseType SelectKey(const std::string& key_id);
CdmResponseType SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode);
static const OEMCrypto_Algorithm kInvalidAlgorithm =
static_cast<OEMCrypto_Algorithm>(-1);
@@ -267,6 +257,7 @@ class CryptoSession {
metrics::CryptoMetrics* metrics_;
metrics::TimerMetric life_span_;
uint32_t system_id_;
bool open_;
CdmClientTokenType pre_provision_token_type_;
@@ -282,8 +273,6 @@ class CryptoSession {
bool is_destination_buffer_type_valid_;
SecurityLevel requested_security_level_;
KeyId cached_key_id_;
bool is_usage_support_type_valid_;
CdmUsageSupportType usage_support_type_;
UsageTableHeader* usage_table_header_;
@@ -294,6 +283,7 @@ class CryptoSession {
static uint64_t request_id_index_;
CdmCipherMode cipher_mode_;
uint32_t api_version_;
CORE_DISALLOW_COPY_AND_ASSIGN(CryptoSession);
};

View File

@@ -0,0 +1,34 @@
#ifndef WVCDM_CORE_ENTITLEMENT_KEY_SESSSION_H_
#define WVCDM_CORE_ENTITLEMENT_KEY_SESSSION_H_
#include "content_key_session.h"
#include "key_session.h"
namespace wvcdm {
class EntitlementKeySession : public ContentKeySession {
public:
EntitlementKeySession(CryptoSessionId oec_session_id,
metrics::CryptoMetrics* metrics);
virtual ~EntitlementKeySession() {}
KeySessionType Type() { return kEntitlement; }
// Load Keys for ContentKeySession
OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement);
OEMCryptoResult LoadEntitledContentKeys(const std::vector<CryptoKey>& keys);
private:
std::vector<CryptoKey> keys_;
};
} // namespace wvcdm
#endif // WVCDM_CORE_ENTITLEMENT_KEY_SESSSION_H_

View File

@@ -15,7 +15,8 @@ class WvCdmEngineTest;
class InitializationData {
public:
InitializationData(const std::string& type = std::string(),
const CdmInitData& data = CdmInitData());
const CdmInitData& data = CdmInitData(),
const std::string& oec_version = std::string());
bool is_supported() const { return is_cenc_ || is_webm_ || is_hls_; }
bool is_cenc() const { return is_cenc_; }
@@ -28,13 +29,22 @@ class InitializationData {
const CdmInitData& data() const { return data_; }
std::vector<uint8_t> hls_iv() const { return hls_iv_; }
CdmHlsMethod hls_method() const { return hls_method_; }
std::vector<video_widevine::SubLicense> ExtractEmbeddedKeys() const;
const std::string ExtractGroupMasterKeyId() const;
// TODO(jfore): Perhaps this should be a generic structure with the ids for
// any type of licensing?
std::vector<video_widevine::SubLicense> ExtractSublicenseKeys() const;
std::vector<video_widevine::WidevinePsshData_EntitledKey> ExtractWrappedKeys()
const;
private:
// Parse a blob of multiple concatenated PSSH atoms to extract the first
// Widevine PSSH.
bool ExtractWidevinePssh(const CdmInitData& init_data, CdmInitData* output);
bool SelectWidevinePssh(const CdmInitData& init_data,
bool prefer_entitlements,
CdmInitData* output);
// Helpers used by SelectWidevinePssh().
bool ExtractWidevinePsshs(const CdmInitData& init_data,
std::vector<CdmInitData>* psshs);
bool ExtractWidevinePsshData(const uint8_t* data,
size_t length,
CdmInitData* output);
bool ExtractHlsAttributes(const std::string& attribute_list,
CdmHlsMethod* method, std::vector<uint8_t>* iv,
@@ -54,6 +64,9 @@ class InitializationData {
static std::vector<std::string> ExtractKeyFormatVersions(
const std::string& key_format_versions);
static bool DetectEntitlementPreference(
const std::string& oec_version_string);
// For testing only:
#if defined(UNIT_TEST)
FRIEND_TEST(HlsAttributeExtractionTest, ExtractAttribute);

View File

@@ -0,0 +1,46 @@
#ifndef WVCDM_CORE_KEY_SESSSION_H_
#define WVCDM_CORE_KEY_SESSSION_H_
#include "metrics_collections.h"
namespace wvcdm {
class CryptoKey;
class KeySession {
protected:
KeySession(metrics::CryptoMetrics* metrics) : metrics_(metrics) {}
public:
typedef enum { kDefault, kSubLicense, kEntitlement } KeySessionType;
virtual ~KeySession() {}
virtual KeySessionType Type() = 0;
virtual bool GenerateDerivedKeys(const std::string& message) = 0;
virtual bool GenerateDerivedKeys(const std::string& message,
const std::string& session_key) = 0;
virtual OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement) = 0;
virtual OEMCryptoResult LoadEntitledContentKeys(
const std::vector<CryptoKey>& keys) = 0;
virtual OEMCryptoResult SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode) = 0;
virtual OEMCryptoResult Decrypt(
const CdmDecryptionParameters& params,
OEMCrypto_DestBufferDesc& buffer_descriptor,
OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor) = 0;
protected:
metrics::CryptoMetrics* metrics_;
};
typedef std::map<std::string, CryptoSessionId> SubLicenseSessionMap;
} // namespace wvcdm
#endif // WVCDM_CORE_KEY_SESSSION_H_

View File

@@ -24,16 +24,20 @@ class PolicyEngine;
class CdmSession;
class CryptoKey;
using ::google::protobuf::RepeatedPtrField;
using video_widevine::License_KeyContainer;
using video_widevine::WidevinePsshData_EntitledKey;
class CdmLicense {
public:
CdmLicense(const CdmSessionId& session_id);
virtual ~CdmLicense();
virtual bool Init(
const std::string& client_token, CdmClientTokenType client_token_type,
const std::string& device_id, bool use_privacy_mode,
const std::string& signed_service_certificate, CryptoSession* session,
PolicyEngine* policy_engine);
virtual bool Init(const std::string& client_token,
CdmClientTokenType client_token_type,
const std::string& device_id, bool use_privacy_mode,
const std::string& signed_service_certificate,
CryptoSession* session, PolicyEngine* policy_engine);
virtual CdmResponseType PrepareKeyRequest(
const InitializationData& init_data, CdmLicenseType license_type,
@@ -47,7 +51,8 @@ class CdmLicense {
const CdmKeyResponse& license_response);
virtual CdmResponseType HandleKeyUpdateResponse(
bool is_renewal, const CdmKeyResponse& license_response);
virtual CdmResponseType HandleSubLicense(const InitializationData& init_data);
virtual CdmResponseType HandleEmbeddedKeyData(
const InitializationData& init_data);
virtual bool RestoreOfflineLicense(
const CdmKeyMessage& license_request,
@@ -64,22 +69,16 @@ class CdmLicense {
return provider_session_token_;
}
virtual bool is_offline() {
return is_offline_;
}
virtual bool is_offline() { return is_offline_; }
static bool ExtractProviderSessionToken(
const CdmKeyResponse& license_response,
std::string* provider_session_token);
private:
CdmResponseType HandleKeyErrorResponse(
const video_widevine::SignedMessage& signed_message);
bool GetClientTokenType(
video_widevine::ClientIdentification::TokenType* token_type);
CdmResponseType PrepareClientId(
const CdmAppParameterMap& app_parameters,
video_widevine::LicenseRequest* license_request);
@@ -89,9 +88,28 @@ class CdmLicense {
const std::string& request_id,
video_widevine::LicenseRequest* license_request);
CdmResponseType HandleContentKeyResponse(
const std::string& msg, const std::string& signature,
const std::string& mac_key_iv, const std::string& mac_key,
const std::vector<CryptoKey>& key_array,
const video_widevine::License& license);
// HandleEntitlementKeyResponse loads the entitlement keys in |key_array| into
// the crypto session. In addition, it also extracts content keys from
// |wrapped_keys_| and loads them for use.
CdmResponseType HandleEntitlementKeyResponse(
const std::string& msg, const std::string& signature,
const std::string& mac_key_iv, const std::string& mac_key,
const std::vector<CryptoKey>& key_array,
const video_widevine::License& license);
CdmResponseType HandleNewEntitledKeys(
const std::vector<WidevinePsshData_EntitledKey>& wrapped_keys);
CdmResponseType HandleSubLicense(const InitializationData& init_data);
template <typename T>
bool SetTypeAndId(CdmLicenseType license_type,
const std::string& request_id, T* content_id);
bool SetTypeAndId(CdmLicenseType license_type, const std::string& request_id,
T* content_id);
CryptoSession* crypto_session_;
PolicyEngine* policy_engine_;
@@ -120,10 +138,19 @@ class CdmLicense {
// CdmLicense takes ownership of the clock.
CdmLicense(const CdmSessionId& session_id, Clock* clock);
// For sublicense key embedding. This key array will be initilized with any
// For entitlement key licensing. This holds the keys from the init_data.
// These keys are extracted from the pssh when we generate a license request.
// It is used to load content keys after we have received a license and
// entitelement keys. It is also used in updating the key status info.
std::vector<WidevinePsshData_EntitledKey> wrapped_keys_;
// For sublicense key embedding. This key array will be initialized with any
// sub session keys we may have received in a license response. These keys
// may be used to support key rotation.
std::vector<CryptoKey> sub_session_key_array_;
std::vector<CryptoKey> entitlement_key_array_;
CdmLicenseKeyType license_key_type_;
RepeatedPtrField<License_KeyContainer> entitlement_keys_;
#if defined(UNIT_TEST)
friend class CdmLicenseTest;
#endif

View File

@@ -13,6 +13,8 @@ namespace wvcdm {
class LicenseKeyStatus;
using video_widevine::WidevinePsshData_EntitledKey;
// Holds all content and operator session keys for a session.
class LicenseKeys {
public:
@@ -56,8 +58,11 @@ class LicenseKeys {
// Extracts the keys from a license and makes them available for
// querying usage and constraint settings.
virtual void SetFromLicense(
const video_widevine::License& license);
virtual void SetFromLicense(const video_widevine::License& license);
// Sets the keys from the input entitled key data.
virtual void SetEntitledKeys(
const std::vector<WidevinePsshData_EntitledKey>& keys);
private:
typedef ::video_widevine::License::KeyContainer KeyContainer;
@@ -67,7 +72,12 @@ class LicenseKeys {
void Clear();
bool is_initialized_;
// |keys_| can hold either content key statuses, or entitlement key statuses.
std::map<KeyId, LicenseKeyStatus*> keys_;
// |content_keyid_to_entitlement_key_id_| maps a content key id to an
// entitlement_key_id. The resulting key id can be used to obtain the current
// key status from |keys_| when using entitlement key licensing.
std::map<KeyId, KeyId> content_keyid_to_entitlement_key_id_;
CORE_DISALLOW_COPY_AND_ASSIGN(LicenseKeys);
};
@@ -101,8 +111,8 @@ class LicenseKeyStatus {
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);
virtual void ApplyConstraints(uint32_t new_resolution,
CryptoSession::HdcpCapability new_hdcp_level);
protected:
typedef ::video_widevine::License::KeyContainer KeyContainer;
@@ -118,13 +128,10 @@ class LicenseKeyStatus {
virtual ~LicenseKeyStatus() {}
private:
void ParseContentKey(const KeyContainer& key);
void ParseOperatorSessionKey(const KeyContainer& key);
bool HasConstraints() {
return is_content_key_ && constraints_.size() != 0;
}
bool HasConstraints() { return is_content_key_ && constraints_.size() != 0; }
void SetConstraints(const ConstraintList& constraints);

View File

@@ -29,6 +29,7 @@ void Log(const char* file, const char* function, int line, LogPriority level,
const char* fmt, ...);
// Log APIs
#ifndef LOGE
#define LOGE(...) Log(__FILE__, __func__, __LINE__, \
wvcdm::LOG_ERROR, __VA_ARGS__)
#define LOGW(...) Log(__FILE__, __func__, __LINE__, \
@@ -39,6 +40,7 @@ void Log(const char* file, const char* function, int line, LogPriority level,
wvcdm::LOG_DEBUG, __VA_ARGS__)
#define LOGV(...) Log(__FILE__, __func__, __LINE__, \
wvcdm::LOG_VERBOSE, __VA_ARGS__)
#endif
} // namespace wvcdm
#endif // WVCDM_CORE_LOG_H_

View File

@@ -53,7 +53,7 @@ OEMCryptoResult OEMCrypto_CreateOldUsageEntry(SecurityLevel level,
uint64_t time_since_last_decrypt, OEMCrypto_Usage_Entry_Status status,
uint8_t* server_mac_key, uint8_t* client_mac_key, const uint8_t* pst,
size_t pst_length);
uint32_t OEMCrypto_GetAnalogOutputFlags(SecurityLevel level);
} // namespace wvcdm
/* The following functions are deprecated in OEMCrypto v13. They are defined
@@ -62,12 +62,25 @@ OEMCryptoResult OEMCrypto_CreateOldUsageEntry(SecurityLevel level,
*/
extern "C" {
OEMCryptoResult OEMCrypto_LoadKeys_V11_or_V12(
struct OEMCrypto_KeyObject_V13 { // Used for backwards compatibility.
const uint8_t* key_id;
size_t key_id_length;
const uint8_t* key_data_iv;
const uint8_t* key_data;
size_t key_data_length;
const uint8_t* key_control_iv;
const uint8_t* key_control;
OEMCryptoCipherMode cipher_mode;
};
// Backwards compitiblity between v14 and v13.
OEMCryptoResult OEMCrypto_LoadKeys_Back_Compat(
OEMCrypto_SESSION session, const uint8_t* message, size_t message_length,
const uint8_t* signature, size_t signature_length,
const uint8_t* enc_mac_keys_iv, const uint8_t* enc_mac_keys,
size_t num_keys, const OEMCrypto_KeyObject* key_array, const uint8_t* pst,
size_t pst_length);
size_t num_keys, const OEMCrypto_KeyObject_V13* key_array,
const uint8_t* pst, size_t pst_length, const uint8_t* srm_requirement,
OEMCrypto_LicenseType license_type);
OEMCryptoResult OEMCrypto_UpdateUsageTable();

View File

@@ -14,6 +14,7 @@
namespace wvcdm {
using video_widevine::LicenseIdentification;
using video_widevine::WidevinePsshData_EntitledKey;
class Clock;
class CryptoSession;
@@ -39,6 +40,10 @@ class PolicyEngine {
// out why a key is not usable.
virtual CdmKeyStatus GetKeyStatus(const KeyId& key_id);
// Verifies whether the policy allows use of the specified key of
// a given security level for content decryption.
virtual bool CanUseKey(const KeyId& key_id, CdmSecurityLevel security_level);
// OnTimerEvent is called when a timer fires. It notifies the Policy Engine
// that the timer has fired and dispatches the relevant events through
// |event_listener_|.
@@ -50,12 +55,18 @@ class PolicyEngine {
// permits playback.
virtual void SetLicense(const video_widevine::License& license);
// TODO(jfore): Sublicense uses this to update the keys when they are
// changed during key rotation. Drop this method and use SetLicenseKeys
// instead.
virtual void UpdateLicenseKeys(const video_widevine::License& license);
// Used to update the currently loaded entitled content keys.
virtual void SetEntitledLicenseKeys(
const std::vector<WidevinePsshData_EntitledKey>& entitled_keys);
// 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);
virtual void SetLicenseForRelease(const video_widevine::License& license);
// Call this on first decrypt to set the start of playback.
virtual void BeginDecryption(void);
@@ -66,8 +77,7 @@ class PolicyEngine {
// case an exact copy is not what we want to happen. We also will receive an
// updated license_start_time from the server. The license will transition to
// kLicenseStateCanPlay if the license permits playback.
virtual void UpdateLicense(
const video_widevine::License& license);
virtual void UpdateLicense(const video_widevine::License& license);
// Used for notifying the Policy Engine of resolution changes
virtual void NotifyResolution(uint32_t width, uint32_t height);
@@ -94,8 +104,7 @@ class PolicyEngine {
bool IsLicenseForFuture() { return license_state_ == kLicenseStatePending; }
bool HasPlaybackStarted(int64_t current_time) {
if (playback_start_time_ == 0)
return false;
if (playback_start_time_ == 0) return false;
const int64_t playback_time = current_time - playback_start_time_;
return playback_time >= policy_.play_start_grace_period_seconds();
@@ -211,6 +220,6 @@ class PolicyEngine {
CORE_DISALLOW_COPY_AND_ASSIGN(PolicyEngine);
};
} // wvcdm
} // namespace wvcdm
#endif // WVCDM_CORE_POLICY_ENGINE_H_

View File

@@ -46,9 +46,6 @@ class Properties {
static void set_provisioning_messages_are_binary(bool flag) {
provisioning_messages_are_binary_ = flag;
}
static inline bool security_level_path_backward_compatibility_support() {
return security_level_path_backward_compatibility_support_;
}
static bool GetCompanyName(std::string* company_name);
static bool GetModelName(std::string* model_name);
static bool GetArchitectureName(std::string* arch_name);
@@ -96,10 +93,6 @@ class Properties {
static void set_use_certificates_as_identification(bool flag) {
use_certificates_as_identification_ = flag;
}
static void set_security_level_path_backward_compatibility_support(
bool flag) {
security_level_path_backward_compatibility_support_ = flag;
}
#if defined(UNIT_TEST)
FRIEND_TEST(CdmSessionTest, InitWithBuiltInCertificate);
@@ -117,7 +110,6 @@ class Properties {
static bool oem_crypto_use_fifo_;
static bool oem_crypto_use_userspace_buffers_;
static bool use_certificates_as_identification_;
static bool security_level_path_backward_compatibility_support_;
static bool provisioning_messages_are_binary_;
static bool allow_service_certificate_requests_;
static scoped_ptr<CdmClientPropertySetMap> session_property_set_;

146
core/include/pst_report.h Normal file
View File

@@ -0,0 +1,146 @@
// Copyright 2017 Google Inc. All Rights Reserved.
/*********************************************************************
* pst_report.h
*
* Reference APIs needed to support Widevine's crypto algorithms.
*********************************************************************/
#ifndef PST_REPORT_H_
#define PST_REPORT_H_
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "OEMCryptoCENC.h"
#include "string_conversions.h" // needed for htonll64.
namespace wvcdm {
class Unpacked_PST_Report {
public:
// This object does not own the buffer, and does not check that buffer
// is not null.
Unpacked_PST_Report(uint8_t *buffer) : buffer_(buffer) {}
// Copy and move semantics of this class is like that of a pointer.
Unpacked_PST_Report(const Unpacked_PST_Report& other) :
buffer_(other.buffer_) {}
Unpacked_PST_Report& operator=(const Unpacked_PST_Report& other) {
buffer_ = other.buffer_;
return *this;
}
size_t report_size() const {
return pst_length() + kraw_pst_report_size;
}
static size_t report_size(size_t pst_length) {
return pst_length + kraw_pst_report_size;
}
uint8_t status() const {
return static_cast<uint8_t>(* (buffer_ + kstatus_offset));
}
void set_status(uint8_t value) {
buffer_[kstatus_offset] = value;
}
uint8_t* signature() {
return buffer_ + ksignature_offset;
}
uint8_t clock_security_level() const {
return static_cast<uint8_t>(* (buffer_ + kclock_security_level_offset));
}
void set_clock_security_level(uint8_t value) {
buffer_[kclock_security_level_offset] = value;
}
uint8_t pst_length() const {
return static_cast<uint8_t>(* (buffer_ + kpst_length_offset));
}
void set_pst_length(uint8_t value) {
buffer_[kpst_length_offset] = value;
}
uint8_t padding() const {
return static_cast<uint8_t>(* (buffer_ + kpadding_offset));
}
void set_padding(uint8_t value) {
buffer_[kpadding_offset] = value;
}
// In host byte order.
int64_t seconds_since_license_received() const {
int64_t time;
memcpy(&time, buffer_ + kseconds_since_license_received_offset,
sizeof(int64_t));
return ntohll64(time);
}
// Parameter time is in host byte order.
void set_seconds_since_license_received(int64_t time) const {
time = ntohll64(time);
memcpy(buffer_ + kseconds_since_license_received_offset, &time,
sizeof(int64_t));
}
// In host byte order.
int64_t seconds_since_first_decrypt() const {
int64_t time;
memcpy(&time, buffer_ + kseconds_since_first_decrypt_offset,
sizeof(int64_t));
return ntohll64(time);
}
// Parameter time is in host byte order.
void set_seconds_since_first_decrypt(int64_t time) const {
time = ntohll64(time);
memcpy(buffer_ + kseconds_since_first_decrypt_offset, &time,
sizeof(int64_t));
}
// In host byte order.
int64_t seconds_since_last_decrypt() const {
int64_t time;
memcpy(&time, buffer_ + kseconds_since_last_decrypt_offset,
sizeof(int64_t));
return ntohll64(time);
}
// Parameter time is in host byte order.
void set_seconds_since_last_decrypt(int64_t time) const {
time = ntohll64(time);
memcpy(buffer_ + kseconds_since_last_decrypt_offset, &time,
sizeof(int64_t));
}
uint8_t* pst() {
return (buffer_ + kpst_offset);
}
private:
uint8_t *buffer_;
// Size of the PST_Report without the pst string.
static const size_t kraw_pst_report_size = 48;
static const size_t ksignature_offset = 0;
static const size_t kstatus_offset = 20;
static const size_t kclock_security_level_offset = 21;
static const size_t kpst_length_offset = 22;
static const size_t kpadding_offset = 23;
static const size_t kseconds_since_license_received_offset = 24;
static const size_t kseconds_since_first_decrypt_offset = 32;
static const size_t kseconds_since_last_decrypt_offset = 40;
static const size_t kpst_offset = 48;
};
} // namespace wvcdm
#endif // PST_REPORT_H_

View File

@@ -0,0 +1,95 @@
#ifndef WVCDM_CORE_SUBLICENSE_KEY_SESSSION_H_
#define WVCDM_CORE_SUBLICENSE_KEY_SESSSION_H_
#include "crypto_key.h"
#include "key_session.h"
namespace wvcdm {
class SubLicenseKeySession : public KeySession {
typedef enum {
kInitializing,
kInitialLicenseLoaded,
kInitialLicenseFailed,
} SubLicenseState;
public:
SubLicenseKeySession(SubLicenseSessionMap& sub_license_oec_sessions,
metrics::CryptoMetrics* metrics,
const std::string& wrapped_private_device_key,
SecurityLevel requested_security_level,
const std::string& group_id);
virtual ~SubLicenseKeySession();
KeySessionType Type() { return kSubLicense; }
// This version of GenerateDerivedKeys is for devices using keyboxes. It is
// not supported using sub licenses.
bool GenerateDerivedKeys(const std::string&) { return false; }
// GenerateDerivedKeys is called for each open oemcrypto session and is only
// called once.
bool GenerateDerivedKeys(const std::string& message,
const std::string& session_key);
// Load the keys in |keys|. The initial keys are saved for key rotation.
OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement);
OEMCryptoResult LoadEntitledContentKeys(const std::vector<CryptoKey>& /*keys*/) {
return OEMCrypto_ERROR_INVALID_CONTEXT;
}
// Each oemcrypto session contains a single key. Find the right sub session
// and save it's id as the selected oemcrypto session.
OEMCryptoResult SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode);
// Decrypt performs the decryption using the selected oemcrypto session.
// TODO(jfore): Support DecryptInChunks.
OEMCryptoResult Decrypt(const CdmDecryptionParameters& params,
OEMCrypto_DestBufferDesc& buffer_descriptor,
OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor);
private:
// Destroy each open oemcrypto session and relace them with new ones.
OEMCryptoResult ResetCryptoSessions();
// DoLoadKeys loads a single key into each oemcrypto session.
OEMCryptoResult DoLoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement);
// DoLoadKeys loads a single key into each oemcrypto session.
OEMCryptoResult DoSubLicenseLoadKeys(
const std::string& message, const std::string& signature,
const std::string& mac_key_iv, const std::string& mac_key,
const CryptoKey& key, const std::string& provider_session_token,
CdmCipherMode*, const std::string& srm_requirement);
SubLicenseState state_;
std::string cached_sub_session_key_id_;
std::string wrapped_private_device_key_;
std::string message_;
std::string session_key_;
std::vector<CryptoKey> keys_;
SubLicenseSessionMap& sub_license_oec_sessions_;
SecurityLevel requested_security_level_;
KeyId group_id_;
};
} // namespace wvcdm
#endif // WVCDM_CORE_SUBLICENSE_KEY_SESSSION_H_

View File

@@ -78,12 +78,13 @@ 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_NO_DIGITAL_OUTPUT = "Disconnected";
static const std::string QUERY_VALUE_HDCP_NONE = "Unprotected";
static const std::string QUERY_VALUE_HDCP_V1 = "HDCP-1.x";
static const std::string QUERY_VALUE_HDCP_V2_0 = "HDCP-2.0";
static const std::string QUERY_VALUE_HDCP_V2_1 = "HDCP-2.1";
static const std::string QUERY_VALUE_HDCP_V2_2 = "HDCP-2.2";
static const std::string QUERY_VALUE_HDCP_LEVEL_UNKNOWN = "HDCP-LevelUnknown";
static const std::string ISO_BMFF_VIDEO_MIME_TYPE = "video/mp4";
static const std::string ISO_BMFF_AUDIO_MIME_TYPE = "audio/mp4";

View File

@@ -38,286 +38,296 @@ enum CdmKeyRequestType {
};
enum CdmResponseType {
NO_ERROR, /* 0 */
UNKNOWN_ERROR,
KEY_ADDED,
KEY_ERROR,
KEY_MESSAGE,
NEED_KEY, /* 5 */
KEY_CANCELED,
NEED_PROVISIONING,
DEVICE_REVOKED,
INSUFFICIENT_CRYPTO_RESOURCES,
ADD_KEY_ERROR, /* 10 */
CERT_PROVISIONING_GET_KEYBOX_ERROR_1,
CERT_PROVISIONING_GET_KEYBOX_ERROR_2,
CERT_PROVISIONING_INVALID_CERT_TYPE,
CERT_PROVISIONING_REQUEST_ERROR_1,
CERT_PROVISIONING_NONCE_GENERATION_ERROR, /* 15 */
CERT_PROVISIONING_REQUEST_ERROR_3,
CERT_PROVISIONING_REQUEST_ERROR_4,
CERT_PROVISIONING_RESPONSE_ERROR_1,
CERT_PROVISIONING_RESPONSE_ERROR_2,
CERT_PROVISIONING_RESPONSE_ERROR_3, /* 20 */
CERT_PROVISIONING_RESPONSE_ERROR_4,
CERT_PROVISIONING_RESPONSE_ERROR_5,
CERT_PROVISIONING_RESPONSE_ERROR_6,
CERT_PROVISIONING_RESPONSE_ERROR_7,
CERT_PROVISIONING_RESPONSE_ERROR_8, /* 25 */
CRYPTO_SESSION_OPEN_ERROR_1,
CRYPTO_SESSION_OPEN_ERROR_2,
CRYPTO_SESSION_OPEN_ERROR_3,
CRYPTO_SESSION_OPEN_ERROR_4,
CRYPTO_SESSION_OPEN_ERROR_5, /* 30 */
DECRYPT_NOT_READY,
DEVICE_CERTIFICATE_ERROR_1,
DEVICE_CERTIFICATE_ERROR_2,
DEVICE_CERTIFICATE_ERROR_3,
DEVICE_CERTIFICATE_ERROR_4, /* 35 */
EMPTY_KEY_DATA_1,
EMPTY_KEY_DATA_2,
EMPTY_KEYSET_ID,
EMPTY_KEYSET_ID_ENG_1,
EMPTY_KEYSET_ID_ENG_2, /* 40 */
EMPTY_KEYSET_ID_ENG_3,
EMPTY_KEYSET_ID_ENG_4,
EMPTY_LICENSE_RENEWAL,
EMPTY_LICENSE_RESPONSE_1,
EMPTY_LICENSE_RESPONSE_2, /* 45 */
EMPTY_PROVISIONING_CERTIFICATE_1,
EMPTY_PROVISIONING_RESPONSE,
EMPTY_SESSION_ID,
GENERATE_DERIVED_KEYS_ERROR,
LICENSE_RENEWAL_NONCE_GENERATION_ERROR, /* 50 */
GENERATE_USAGE_REPORT_ERROR,
GET_LICENSE_ERROR,
GET_RELEASED_LICENSE_ERROR,
GET_USAGE_INFO_ERROR_1,
GET_USAGE_INFO_ERROR_2, /* 55 */
GET_USAGE_INFO_ERROR_3,
GET_USAGE_INFO_ERROR_4,
INIT_DATA_NOT_FOUND,
INVALID_CRYPTO_SESSION_1,
INVALID_CRYPTO_SESSION_2, /* 60 */
INVALID_CRYPTO_SESSION_3,
INVALID_CRYPTO_SESSION_4,
INVALID_CRYPTO_SESSION_5,
INVALID_DECRYPT_PARAMETERS_ENG_1,
INVALID_DECRYPT_PARAMETERS_ENG_2, /* 65 */
INVALID_DECRYPT_PARAMETERS_ENG_3,
INVALID_DECRYPT_PARAMETERS_ENG_4,
INVALID_DEVICE_CERTIFICATE_TYPE,
INVALID_KEY_SYSTEM,
INVALID_LICENSE_RESPONSE, /* 70 */
INVALID_LICENSE_TYPE,
INVALID_PARAMETERS_ENG_1,
INVALID_PARAMETERS_ENG_2,
INVALID_PARAMETERS_ENG_3,
INVALID_PARAMETERS_ENG_4, /* 75 */
INVALID_PARAMETERS_LIC_1,
INVALID_PARAMETERS_LIC_2,
INVALID_PROVISIONING_PARAMETERS_1,
INVALID_PROVISIONING_PARAMETERS_2,
INVALID_PROVISIONING_REQUEST_PARAM_1, /* 80 */
INVALID_PROVISIONING_REQUEST_PARAM_2,
INVALID_QUERY_KEY,
INVALID_SESSION_ID,
KEY_REQUEST_ERROR_1,
UNUSED_1, /* previously KEY_REQUEST_ERROR_2 */ /* 85 */
KEY_SIZE_ERROR,
KEYSET_ID_NOT_FOUND_1,
KEYSET_ID_NOT_FOUND_2,
KEYSET_ID_NOT_FOUND_3,
LICENSE_ID_NOT_FOUND, /* 90 */
LICENSE_PARSER_INIT_ERROR,
LICENSE_PARSER_NOT_INITIALIZED_1,
LICENSE_PARSER_NOT_INITIALIZED_2,
LICENSE_PARSER_NOT_INITIALIZED_3,
LICENSE_RESPONSE_NOT_SIGNED, /* 95 */
LICENSE_RESPONSE_PARSE_ERROR_1,
LICENSE_RESPONSE_PARSE_ERROR_2,
LICENSE_RESPONSE_PARSE_ERROR_3,
LOAD_KEY_ERROR,
NO_CONTENT_KEY, /* 100 */
REFRESH_KEYS_ERROR,
RELEASE_ALL_USAGE_INFO_ERROR_1,
RELEASE_ALL_USAGE_INFO_ERROR_2,
RELEASE_KEY_ERROR,
RELEASE_KEY_REQUEST_ERROR, /* 105 */
RELEASE_LICENSE_ERROR_1,
RELEASE_LICENSE_ERROR_2,
RELEASE_USAGE_INFO_ERROR,
RENEW_KEY_ERROR_1,
RENEW_KEY_ERROR_2, /* 110 */
LICENSE_RENEWAL_SIGNING_ERROR,
UNUSED_4, /* previously RESTORE_OFFLINE_LICENSE_ERROR_1 */
RESTORE_OFFLINE_LICENSE_ERROR_2,
SESSION_INIT_ERROR_1,
SESSION_INIT_ERROR_2, /* 115 */
UNUSED_5, /* previously SESSION_INIT_GET_KEYBOX_ERROR */
SESSION_NOT_FOUND_1,
SESSION_NOT_FOUND_2,
SESSION_NOT_FOUND_3,
SESSION_NOT_FOUND_4, /* 120 */
SESSION_NOT_FOUND_5,
SESSION_NOT_FOUND_6,
SESSION_NOT_FOUND_7,
SESSION_NOT_FOUND_8,
SESSION_NOT_FOUND_9, /* 125 */
SESSION_NOT_FOUND_10,
SESSION_NOT_FOUND_FOR_DECRYPT,
SESSION_KEYS_NOT_FOUND,
SIGNATURE_NOT_FOUND,
STORE_LICENSE_ERROR_1, /* 130 */
STORE_LICENSE_ERROR_2,
UNUSED_6, /* previously STORE_LICENSE_ERROR_3 */
STORE_USAGE_INFO_ERROR,
UNPROVISION_ERROR_1,
UNPROVISION_ERROR_2, /* 135 */
UNPROVISION_ERROR_3,
UNPROVISION_ERROR_4,
UNSUPPORTED_INIT_DATA,
USAGE_INFO_NOT_FOUND,
UNUSED_8, /* 140 */
/* UNUSED_8 previously LICENSE_RENEWAL_SERVICE_CERTIFICATE_GENERATION_ERROR */
PARSE_SERVICE_CERTIFICATE_ERROR,
UNUSED_10, /* previously SERVICE_CERTIFICATE_TYPE_ERROR */
CLIENT_ID_GENERATE_RANDOM_ERROR,
CLIENT_ID_AES_INIT_ERROR,
CLIENT_ID_AES_ENCRYPT_ERROR, /* 145 */
CLIENT_ID_RSA_INIT_ERROR,
CLIENT_ID_RSA_ENCRYPT_ERROR,
INVALID_QUERY_STATUS,
UNUSED_3, /* previously EMPTY_PROVISIONING_CERTIFICATE_2 on mnc-dev, */
/* DUPLICATE_SESSION_ID_SPECIFIED on master */
LICENSE_PARSER_NOT_INITIALIZED_4, /* 150 */
INVALID_PARAMETERS_LIC_3,
INVALID_PARAMETERS_LIC_4,
UNUSED_2, /* previously INVALID_PARAMETERS_LIC_5 */
INVALID_PARAMETERS_LIC_6,
INVALID_PARAMETERS_LIC_7, /* 155 */
LICENSE_REQUEST_SERVICE_CERTIFICATE_GENERATION_ERROR,
CENC_INIT_DATA_UNAVAILABLE,
PREPARE_CENC_CONTENT_ID_FAILED,
WEBM_INIT_DATA_UNAVAILABLE,
PREPARE_WEBM_CONTENT_ID_FAILED, /* 160 */
UNSUPPORTED_INIT_DATA_FORMAT,
LICENSE_REQUEST_NONCE_GENERATION_ERROR,
LICENSE_REQUEST_SIGNING_ERROR,
EMPTY_LICENSE_REQUEST,
SECURE_BUFFER_REQUIRED, /* 165 */
DUPLICATE_SESSION_ID_SPECIFIED,
LICENSE_RENEWAL_PROHIBITED,
EMPTY_PROVISIONING_CERTIFICATE_2,
OFFLINE_LICENSE_PROHIBITED,
STORAGE_PROHIBITED, /* 170 */
EMPTY_KEYSET_ID_ENG_5,
SESSION_NOT_FOUND_11,
LOAD_USAGE_INFO_FILE_ERROR,
LOAD_USAGE_INFO_MISSING,
SESSION_FILE_HANDLE_INIT_ERROR, /* 175 */
INCORRECT_CRYPTO_MODE,
INVALID_PARAMETERS_ENG_5,
DECRYPT_ERROR,
INSUFFICIENT_OUTPUT_PROTECTION,
SESSION_NOT_FOUND_12, /* 180 */
KEY_NOT_FOUND_1,
KEY_NOT_FOUND_2,
KEY_CONFLICT_1,
INVALID_PARAMETERS_ENG_6,
INVALID_PARAMETERS_ENG_7, /* 185 */
INVALID_PARAMETERS_ENG_8,
INVALID_PARAMETERS_ENG_9,
INVALID_PARAMETERS_ENG_10,
INVALID_PARAMETERS_ENG_11,
INVALID_PARAMETERS_ENG_12, /* 190 */
SESSION_NOT_FOUND_13,
SESSION_NOT_FOUND_14,
SESSION_NOT_FOUND_15,
SESSION_NOT_FOUND_16,
KEY_NOT_FOUND_3, /* 195 */
KEY_NOT_FOUND_4,
KEY_NOT_FOUND_5,
KEY_NOT_FOUND_6,
INVALID_SESSION_1,
NO_DEVICE_KEY_1, /* 200 */
NO_CONTENT_KEY_2,
INSUFFICIENT_CRYPTO_RESOURCES_2,
INVALID_PARAMETERS_ENG_13,
INVALID_PARAMETERS_ENG_14,
INVALID_PARAMETERS_ENG_15, /* 205 */
INVALID_PARAMETERS_ENG_16,
UNUSED_7, /* previously DEVICE_CERTIFICATE_ERROR_5 */
CERT_PROVISIONING_CLIENT_TOKEN_ERROR_1,
CERT_PROVISIONING_CLIENT_TOKEN_ERROR_2,
LICENSING_CLIENT_TOKEN_ERROR_1, /* 210 */
ANALOG_OUTPUT_ERROR,
UNKNOWN_SELECT_KEY_ERROR_1,
UNKNOWN_SELECT_KEY_ERROR_2,
CREATE_USAGE_TABLE_ERROR,
LOAD_USAGE_HEADER_GENERATION_SKEW, /* 215 */
LOAD_USAGE_HEADER_SIGNATURE_FAILURE,
LOAD_USAGE_HEADER_BAD_MAGIC,
LOAD_USAGE_HEADER_UNKNOWN_ERROR,
INVALID_PARAMETERS_ENG_17,
INVALID_PARAMETERS_ENG_18, /* 220 */
INSUFFICIENT_CRYPTO_RESOURCES_3,
CREATE_USAGE_ENTRY_UNKNOWN_ERROR,
LOAD_USAGE_ENTRY_GENERATION_SKEW,
LOAD_USAGE_ENTRY_SIGNATURE_FAILURE,
LOAD_USAGE_ENTRY_UNKNOWN_ERROR, /* 225 */
INVALID_PARAMETERS_ENG_19,
INVALID_PARAMETERS_ENG_20,
UPDATE_USAGE_ENTRY_UNKNOWN_ERROR,
INVALID_PARAMETERS_ENG_21,
SHRINK_USAGE_TABLER_HEADER_UNKNOWN_ERROR, /* 230 */
MOVE_USAGE_ENTRY_UNKNOWN_ERROR,
COPY_OLD_USAGE_ENTRY_UNKNOWN_ERROR,
INVALID_PARAMETERS_ENG_22,
LIST_LICENSE_ERROR_1,
LIST_LICENSE_ERROR_2, /* 235 */
INVALID_PARAMETERS_ENG_23,
USAGE_INFORMATION_SUPPORT_FAILED,
USAGE_SUPPORT_GET_API_FAILED,
UNEXPECTED_EMPTY_USAGE_ENTRY,
INVALID_USAGE_ENTRY_NUMBER_MODIFICATION, /* 240 */
USAGE_INVALID_NEW_ENTRY,
USAGE_INVALID_PARAMETERS_1,
USAGE_GET_ENTRY_RETRIEVE_LICENSE_FAILED,
USAGE_GET_ENTRY_RETRIEVE_USAGE_INFO_FAILED,
USAGE_GET_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE, /* 245 */
USAGE_ENTRY_NUMBER_MISMATCH,
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_USAGE_INFO_FAILED,
INCORRECT_USAGE_SUPPORT_TYPE_1,
INCORRECT_USAGE_SUPPORT_TYPE_2,
KEY_PROHIBITED_FOR_SECURITY_LEVEL, /* 255 */
KEY_NOT_FOUND_IN_SESSION,
NO_USAGE_ENTRIES,
LIST_USAGE_ERROR_1,
LIST_USAGE_ERROR_2,
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,
USAGE_STORE_ENTRY_RETRIEVE_LICENSE_FAILED,
USAGE_STORE_ENTRY_RETRIEVE_USAGE_INFO_FAILED,
USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE,
RELEASE_ALL_USAGE_INFO_ERROR_6, /* 275 */
RELEASE_ALL_USAGE_INFO_ERROR_7,
LICENSE_REQUEST_INVALID_SUBLICENSE,
NO_ERROR = 0,
UNKNOWN_ERROR = 1,
KEY_ADDED = 2,
KEY_ERROR = 3,
KEY_MESSAGE = 4,
NEED_KEY = 5,
KEY_CANCELED = 6,
NEED_PROVISIONING = 7,
DEVICE_REVOKED = 8,
INSUFFICIENT_CRYPTO_RESOURCES = 9,
ADD_KEY_ERROR = 10,
CERT_PROVISIONING_GET_KEYBOX_ERROR_1 = 11,
CERT_PROVISIONING_GET_KEYBOX_ERROR_2 = 12,
CERT_PROVISIONING_INVALID_CERT_TYPE = 13,
CERT_PROVISIONING_REQUEST_ERROR_1 = 14,
CERT_PROVISIONING_NONCE_GENERATION_ERROR = 15,
CERT_PROVISIONING_REQUEST_ERROR_3 = 16,
CERT_PROVISIONING_REQUEST_ERROR_4 = 17,
CERT_PROVISIONING_RESPONSE_ERROR_1 = 18,
CERT_PROVISIONING_RESPONSE_ERROR_2 = 19,
CERT_PROVISIONING_RESPONSE_ERROR_3 = 20,
CERT_PROVISIONING_RESPONSE_ERROR_4 = 21,
CERT_PROVISIONING_RESPONSE_ERROR_5 = 22,
CERT_PROVISIONING_RESPONSE_ERROR_6 = 23,
CERT_PROVISIONING_RESPONSE_ERROR_7 = 24,
CERT_PROVISIONING_RESPONSE_ERROR_8 = 25,
/* previously CRYPTO_SESSION_OPEN_ERROR_1 = 26 */
/* previously CRYPTO_SESSION_OPEN_ERROR_2 = 27 */
/* previously CRYPTO_SESSION_OPEN_ERROR_3 = 28 */
/* previously CRYPTO_SESSION_OPEN_ERROR_4 = 29 */
/* previously CRYPTO_SESSION_OPEN_ERROR_5 = 30 */
DECRYPT_NOT_READY = 31,
DEVICE_CERTIFICATE_ERROR_1 = 32,
DEVICE_CERTIFICATE_ERROR_2 = 33,
DEVICE_CERTIFICATE_ERROR_3 = 34,
DEVICE_CERTIFICATE_ERROR_4 = 35,
EMPTY_KEY_DATA_1 = 36,
EMPTY_KEY_DATA_2 = 37,
EMPTY_KEYSET_ID = 38,
EMPTY_KEYSET_ID_ENG_1 = 39,
EMPTY_KEYSET_ID_ENG_2 = 40,
EMPTY_KEYSET_ID_ENG_3 = 41,
EMPTY_KEYSET_ID_ENG_4 = 42,
EMPTY_LICENSE_RENEWAL = 43,
EMPTY_LICENSE_RESPONSE_1 = 44,
EMPTY_LICENSE_RESPONSE_2 = 45,
EMPTY_PROVISIONING_CERTIFICATE_1 = 46,
EMPTY_PROVISIONING_RESPONSE = 47,
EMPTY_SESSION_ID = 48,
GENERATE_DERIVED_KEYS_ERROR = 49,
LICENSE_RENEWAL_NONCE_GENERATION_ERROR = 50,
GENERATE_USAGE_REPORT_ERROR = 51,
GET_LICENSE_ERROR = 52,
GET_RELEASED_LICENSE_ERROR = 53,
GET_USAGE_INFO_ERROR_1 = 54,
GET_USAGE_INFO_ERROR_2 = 55,
GET_USAGE_INFO_ERROR_3 = 56,
GET_USAGE_INFO_ERROR_4 = 57,
INIT_DATA_NOT_FOUND = 58,
/* previously INVALID_CRYPTO_SESSION_1 = 59 */
/* previously INVALID_CRYPTO_SESSION_2 = 60 */
/* previously INVALID_CRYPTO_SESSION_3 = 61 */
/* previously INVALID_CRYPTO_SESSION_4 = 62 */
/* previously INVALID_CRYPTO_SESSION_5 = 63 */
INVALID_DECRYPT_PARAMETERS_ENG_1 = 64,
INVALID_DECRYPT_PARAMETERS_ENG_2 = 65,
INVALID_DECRYPT_PARAMETERS_ENG_3 = 66,
INVALID_DECRYPT_PARAMETERS_ENG_4 = 67,
INVALID_DEVICE_CERTIFICATE_TYPE = 68,
INVALID_KEY_SYSTEM = 69,
INVALID_LICENSE_RESPONSE = 70,
INVALID_LICENSE_TYPE = 71,
PARAMETER_NULL = 72, /* prior to pi, INVALID_PARAMETERS_ENG_1 = 72 */
/* previously INVALID_PARAMETERS_ENG_2 = 73 */
/* previously INVALID_PARAMETERS_ENG_3 = 74 */
/* previously INVALID_PARAMETERS_ENG_4 = 75 */
INVALID_PARAMETERS_LIC_1 = 76,
INVALID_PARAMETERS_LIC_2 = 77,
INVALID_PROVISIONING_PARAMETERS_1 = 78,
INVALID_PROVISIONING_PARAMETERS_2 = 79,
INVALID_PROVISIONING_REQUEST_PARAM_1 = 80,
INVALID_PROVISIONING_REQUEST_PARAM_2 = 81,
INVALID_QUERY_KEY = 82,
INVALID_SESSION_ID = 83,
KEY_REQUEST_ERROR_1 = 84,
/* previously KEY_REQUEST_ERROR_2 = 85 */
KEY_SIZE_ERROR = 86,
KEYSET_ID_NOT_FOUND_1 = 87,
KEYSET_ID_NOT_FOUND_2 = 88,
KEYSET_ID_NOT_FOUND_3 = 89,
LICENSE_ID_NOT_FOUND = 90,
LICENSE_PARSER_INIT_ERROR = 91,
LICENSE_PARSER_NOT_INITIALIZED_1 = 92,
LICENSE_PARSER_NOT_INITIALIZED_2 = 93,
LICENSE_PARSER_NOT_INITIALIZED_3 = 94,
LICENSE_RESPONSE_NOT_SIGNED = 95,
LICENSE_RESPONSE_PARSE_ERROR_1 = 96,
LICENSE_RESPONSE_PARSE_ERROR_2 = 97,
LICENSE_RESPONSE_PARSE_ERROR_3 = 98,
LOAD_KEY_ERROR = 99,
NO_CONTENT_KEY = 100,
REFRESH_KEYS_ERROR = 101,
REMOVE_ALL_USAGE_INFO_ERROR_1 = 102,
REMOVE_ALL_USAGE_INFO_ERROR_2 = 103,
RELEASE_KEY_ERROR = 104,
RELEASE_KEY_REQUEST_ERROR = 105,
RELEASE_LICENSE_ERROR_1 = 106,
RELEASE_LICENSE_ERROR_2 = 107,
RELEASE_USAGE_INFO_ERROR = 108,
RENEW_KEY_ERROR_1 = 109,
RENEW_KEY_ERROR_2 = 110,
LICENSE_RENEWAL_SIGNING_ERROR = 111,
/* previously RESTORE_OFFLINE_LICENSE_ERROR_1 = 112 */
RESTORE_OFFLINE_LICENSE_ERROR_2 = 113,
NOT_INITIALIZED_ERROR = 114, /* prior to pi, SESSION_INIT_ERROR_1 = 114 */
REINIT_ERROR = 115, /* prior to pi, SESSION_INIT_ERROR_2 = 115 */
/* previously SESSION_INIT_GET_KEYBOX_ERROR = 116 */
SESSION_NOT_FOUND_1 = 117,
SESSION_NOT_FOUND_2 = 118,
SESSION_NOT_FOUND_3 = 119,
SESSION_NOT_FOUND_4 = 120,
SESSION_NOT_FOUND_5 = 121,
SESSION_NOT_FOUND_6 = 122,
SESSION_NOT_FOUND_7 = 123,
SESSION_NOT_FOUND_8 = 124,
SESSION_NOT_FOUND_9 = 125,
SESSION_NOT_FOUND_10 = 126,
SESSION_NOT_FOUND_FOR_DECRYPT = 127,
SESSION_KEYS_NOT_FOUND = 128,
SIGNATURE_NOT_FOUND = 129,
STORE_LICENSE_ERROR_1 = 130,
STORE_LICENSE_ERROR_2 = 131,
/* previously STORE_LICENSE_ERROR_3 = 132 */
STORE_USAGE_INFO_ERROR = 133,
UNPROVISION_ERROR_1 = 134,
UNPROVISION_ERROR_2 = 135,
UNPROVISION_ERROR_3 = 136,
UNPROVISION_ERROR_4 = 137,
UNSUPPORTED_INIT_DATA = 138,
USAGE_INFO_NOT_FOUND = 139,
/* previously LICENSE_RENEWAL_SERVICE_CERTIFICATE_GENERATION_ERROR = 140 */
PARSE_SERVICE_CERTIFICATE_ERROR = 141,
/* previously SERVICE_CERTIFICATE_TYPE_ERROR = 142 */
CLIENT_ID_GENERATE_RANDOM_ERROR = 143,
CLIENT_ID_AES_INIT_ERROR = 144,
CLIENT_ID_AES_ENCRYPT_ERROR = 145,
CLIENT_ID_RSA_INIT_ERROR = 146,
CLIENT_ID_RSA_ENCRYPT_ERROR = 147,
/* previously INVALID_QUERY_STATUS = 148 */
/* previously EMPTY_PROVISIONING_CERTIFICATE_2 = 149 on mnc-dev, */
/* and DUPLICATE_SESSION_ID_SPECIFIED = 149 on master */
LICENSE_PARSER_NOT_INITIALIZED_4 = 150,
INVALID_PARAMETERS_LIC_3 = 151,
INVALID_PARAMETERS_LIC_4 = 152,
/* previously INVALID_PARAMETERS_LIC_5 = 153 */
INVALID_PARAMETERS_LIC_6 = 154,
INVALID_PARAMETERS_LIC_7 = 155,
LICENSE_REQUEST_SERVICE_CERTIFICATE_GENERATION_ERROR = 156,
CENC_INIT_DATA_UNAVAILABLE = 157,
PREPARE_CENC_CONTENT_ID_FAILED = 158,
WEBM_INIT_DATA_UNAVAILABLE = 159,
PREPARE_WEBM_CONTENT_ID_FAILED = 160,
UNSUPPORTED_INIT_DATA_FORMAT = 161,
LICENSE_REQUEST_NONCE_GENERATION_ERROR = 162,
LICENSE_REQUEST_SIGNING_ERROR = 163,
EMPTY_LICENSE_REQUEST = 164,
SECURE_BUFFER_REQUIRED = 165,
DUPLICATE_SESSION_ID_SPECIFIED = 166,
LICENSE_RENEWAL_PROHIBITED = 167,
EMPTY_PROVISIONING_CERTIFICATE_2 = 168,
OFFLINE_LICENSE_PROHIBITED = 169,
STORAGE_PROHIBITED = 170,
EMPTY_KEYSET_ID_ENG_5 = 171,
SESSION_NOT_FOUND_11 = 172,
LOAD_USAGE_INFO_FILE_ERROR = 173,
LOAD_USAGE_INFO_MISSING = 174,
SESSION_FILE_HANDLE_INIT_ERROR = 175,
INCORRECT_CRYPTO_MODE = 176,
INVALID_PARAMETERS_ENG_5 = 177,
DECRYPT_ERROR = 178,
INSUFFICIENT_OUTPUT_PROTECTION = 179,
SESSION_NOT_FOUND_12 = 180,
KEY_NOT_FOUND_1 = 181,
KEY_NOT_FOUND_2 = 182,
KEY_CONFLICT_1 = 183,
/* previously INVALID_PARAMETERS_ENG_6 = 184 */
/* previously INVALID_PARAMETERS_ENG_7 = 185 */
/* previously INVALID_PARAMETERS_ENG_8 = 186 */
/* previously INVALID_PARAMETERS_ENG_9 = 187 */
/* previously INVALID_PARAMETERS_ENG_10 = 188 */
/* previously INVALID_PARAMETERS_ENG_11 = 189 */
/* previously INVALID_PARAMETERS_ENG_12 = 190 */
SESSION_NOT_FOUND_13 = 191,
SESSION_NOT_FOUND_14 = 192,
SESSION_NOT_FOUND_15 = 193,
SESSION_NOT_FOUND_16 = 194,
KEY_NOT_FOUND_3 = 195,
KEY_NOT_FOUND_4 = 196,
KEY_NOT_FOUND_5 = 197,
KEY_NOT_FOUND_6 = 198,
INVALID_SESSION_1 = 199,
NO_DEVICE_KEY_1 = 200,
NO_CONTENT_KEY_2 = 201,
INSUFFICIENT_CRYPTO_RESOURCES_2 = 202,
INVALID_PARAMETERS_ENG_13 = 203,
INVALID_PARAMETERS_ENG_14 = 204,
INVALID_PARAMETERS_ENG_15 = 205,
INVALID_PARAMETERS_ENG_16 = 206,
/* previously DEVICE_CERTIFICATE_ERROR_5 = 207 */
CLIENT_IDENTIFICATION_TOKEN_ERROR_1 = 208,
CLIENT_IDENTIFICATION_TOKEN_ERROR_2 = 209,
/* previously LICENSING_CLIENT_TOKEN_ERROR_1 = 210 */
ANALOG_OUTPUT_ERROR = 211,
UNKNOWN_SELECT_KEY_ERROR_1 = 212,
UNKNOWN_SELECT_KEY_ERROR_2 = 213,
CREATE_USAGE_TABLE_ERROR = 214,
LOAD_USAGE_HEADER_GENERATION_SKEW = 215,
LOAD_USAGE_HEADER_SIGNATURE_FAILURE = 216,
LOAD_USAGE_HEADER_BAD_MAGIC = 217,
LOAD_USAGE_HEADER_UNKNOWN_ERROR = 218,
INVALID_PARAMETERS_ENG_17 = 219,
INVALID_PARAMETERS_ENG_18 = 220,
INSUFFICIENT_CRYPTO_RESOURCES_3 = 221,
CREATE_USAGE_ENTRY_UNKNOWN_ERROR = 222,
LOAD_USAGE_ENTRY_GENERATION_SKEW = 223,
LOAD_USAGE_ENTRY_SIGNATURE_FAILURE = 224,
LOAD_USAGE_ENTRY_UNKNOWN_ERROR = 225,
INVALID_PARAMETERS_ENG_19 = 226,
INVALID_PARAMETERS_ENG_20 = 227,
UPDATE_USAGE_ENTRY_UNKNOWN_ERROR = 228,
INVALID_PARAMETERS_ENG_21 = 229,
SHRINK_USAGE_TABLER_HEADER_UNKNOWN_ERROR = 230,
MOVE_USAGE_ENTRY_UNKNOWN_ERROR = 231,
COPY_OLD_USAGE_ENTRY_UNKNOWN_ERROR = 232,
INVALID_PARAMETERS_ENG_22 = 233,
LIST_LICENSE_ERROR_1 = 234,
LIST_LICENSE_ERROR_2 = 235,
INVALID_PARAMETERS_ENG_23 = 236,
USAGE_INFORMATION_SUPPORT_FAILED = 237,
USAGE_SUPPORT_GET_API_FAILED = 238,
UNEXPECTED_EMPTY_USAGE_ENTRY = 239,
INVALID_USAGE_ENTRY_NUMBER_MODIFICATION = 240,
USAGE_INVALID_NEW_ENTRY = 241,
USAGE_INVALID_PARAMETERS_1 = 242,
USAGE_GET_ENTRY_RETRIEVE_LICENSE_FAILED = 243,
USAGE_GET_ENTRY_RETRIEVE_USAGE_INFO_FAILED = 244,
USAGE_GET_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE = 245,
USAGE_ENTRY_NUMBER_MISMATCH = 246,
USAGE_STORE_LICENSE_FAILED = 247,
USAGE_STORE_USAGE_INFO_FAILED = 248,
USAGE_INVALID_LOAD_ENTRY = 249,
REMOVE_ALL_USAGE_INFO_ERROR_4 = 250,
REMOVE_ALL_USAGE_INFO_ERROR_5 = 251,
RELEASE_USAGE_INFO_FAILED = 252,
INCORRECT_USAGE_SUPPORT_TYPE_1 = 253,
INCORRECT_USAGE_SUPPORT_TYPE_2 = 254,
KEY_PROHIBITED_FOR_SECURITY_LEVEL = 255,
KEY_NOT_FOUND_IN_SESSION = 256,
NO_USAGE_ENTRIES = 257,
LIST_USAGE_ERROR_1 = 258,
LIST_USAGE_ERROR_2 = 259,
DELETE_USAGE_ERROR_1 = 260,
DELETE_USAGE_ERROR_2 = 261,
DELETE_USAGE_ERROR_3 = 262,
PRIVACY_MODE_ERROR_1 = 263,
PRIVACY_MODE_ERROR_2 = 264,
PRIVACY_MODE_ERROR_3 = 265,
EMPTY_RESPONSE_ERROR_1 = 266,
INVALID_PARAMETERS_ENG_24 = 267,
PARSE_RESPONSE_ERROR_1 = 268,
PARSE_RESPONSE_ERROR_2 = 269,
PARSE_RESPONSE_ERROR_3 = 270,
PARSE_RESPONSE_ERROR_4 = 271,
USAGE_STORE_ENTRY_RETRIEVE_LICENSE_FAILED = 272,
USAGE_STORE_ENTRY_RETRIEVE_USAGE_INFO_FAILED = 273,
USAGE_STORE_ENTRY_RETRIEVE_INVALID_STORAGE_TYPE = 274,
REMOVE_ALL_USAGE_INFO_ERROR_6 = 275,
REMOVE_ALL_USAGE_INFO_ERROR_7 = 276,
LICENSE_REQUEST_INVALID_SUBLICENSE = 277,
CERT_PROVISIONING_EMPTY_SERVICE_CERTIFICATE = 278,
LOAD_SYSTEM_ID_ERROR = 279,
INSUFFICIENT_CRYPTO_RESOURCES_4 = 280,
INSUFFICIENT_CRYPTO_RESOURCES_5 = 281,
REMOVE_USAGE_INFO_ERROR_1 = 282,
REMOVE_USAGE_INFO_ERROR_2 = 283,
REMOVE_USAGE_INFO_ERROR_3 = 284,
INSUFFICIENT_CRYPTO_RESOURCES_6 = 285,
NOT_AN_ENTITLEMENT_SESSION = 286,
NO_MATCHING_ENTITLEMENT_KEY = 287,
LOAD_ENTITLED_CONTENT_KEYS_ERROR = 288,
};
enum CdmKeyStatus {
@@ -341,13 +351,19 @@ enum CdmLicenseType {
// Like Streaming, but stricter. Does not permit storage of any kind.
// Named after the 'temporary' session type in EME, which has this behavior.
kLicenseTypeTemporary,
kLicenseTypeSubSession
// TODO(jfore): The kLicenseTypeEmbeddedKeyData currently is to differentiate
// between call types made to GenerateKeyRequest. This type is used to
// differentiate between calls to generate a license renewal and a new pssh
// with embedded keys. Please refer to CdmSession::GenerateKeyRequest. Based
// on code review comments from go/wvgerrit/41860 this license type should not
// be added. This type can be removed once it is no longer needed by
// GenerateKeyRequest.
kLicenseTypeEmbeddedKeyData
};
enum SecurityLevel {
kLevelDefault,
kLevel3
};
enum CdmLicenseKeyType { kLicenseKeyTypeContent, kLicenseKeyTypeEntitlement };
enum SecurityLevel { kLevelDefault, kLevel3 };
enum CdmSecurityLevel {
kSecurityLevelUninitialized,
@@ -415,18 +431,26 @@ struct CdmUsageEntryInfo {
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);
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);
}
};
enum CdmKeySecurityLevel {
kKeySecurityLevelUnset,
kSoftwareSecureCrypto,
kSoftwareSecureDecode,
kHardwareSecureCrypto,
kHardwareSecureDecode,
kHardwareSecureAll,
kKeySecurityLevelUnknown,
};
class CdmKeyAllowedUsage {
public:
CdmKeyAllowedUsage() {
Clear();
}
CdmKeyAllowedUsage() { Clear(); }
bool Valid() const { return valid_; }
void SetValid() { valid_ = true; }
@@ -438,6 +462,7 @@ class CdmKeyAllowedUsage {
generic_decrypt = false;
generic_sign = false;
generic_verify = false;
key_security_level_ = kKeySecurityLevelUnset;
valid_ = false;
}
@@ -448,7 +473,8 @@ class CdmKeyAllowedUsage {
generic_encrypt != other.generic_encrypt ||
generic_decrypt != other.generic_decrypt ||
generic_sign != other.generic_sign ||
generic_verify != other.generic_verify) {
generic_verify != other.generic_verify ||
key_security_level_ != other.key_security_level_) {
return false;
}
return true;
@@ -460,6 +486,7 @@ class CdmKeyAllowedUsage {
bool generic_decrypt;
bool generic_sign;
bool generic_verify;
CdmKeySecurityLevel key_security_level_;
private:
bool valid_;
@@ -473,9 +500,7 @@ class CdmKeyAllowedUsage {
struct CdmCencPatternEncryptionDescriptor {
size_t encrypt_blocks; // number of 16 byte blocks to decrypt
size_t skip_blocks; // number of 16 byte blocks to leave in clear
CdmCencPatternEncryptionDescriptor()
: encrypt_blocks(0),
skip_blocks(0) {}
CdmCencPatternEncryptionDescriptor() : encrypt_blocks(0), skip_blocks(0) {}
};
struct CdmDecryptionParameters {