Source release 18.1.0

This commit is contained in:
John "Juce" Bruce
2023-06-23 15:45:08 -07:00
parent 2baa7c6e2b
commit b2c35151ad
2074 changed files with 196004 additions and 427059 deletions

View File

@@ -26,7 +26,7 @@ namespace wvcdm {
class CryptoKey;
class CryptoSessionFactory;
class OtaKeyboxProvisioner;
class UsageTableHeader;
class CdmUsageTable;
namespace okp {
class SystemFallbackPolicy;
@@ -153,17 +153,9 @@ class CryptoSession {
// License request/responses
virtual CdmResponseType PrepareAndSignLicenseRequest(
const std::string& message, std::string* core_message,
std::string* signature);
std::string* signature, bool& should_specify_algorithm,
OEMCrypto_SignatureHashAlgorithm& algorithm);
virtual CdmResponseType UseSecondaryKey(bool dual_key);
// V15 licenses.
virtual CdmResponseType LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& key_array,
const std::string& provider_session_token,
const std::string& srm_requirement,
CdmLicenseKeyType key_type);
// V16 licenses.
virtual CdmResponseType LoadLicense(const std::string& signed_message,
const std::string& core_message,
@@ -174,10 +166,6 @@ class CryptoSession {
virtual CdmResponseType PrepareAndSignRenewalRequest(
const std::string& message, std::string* core_message,
std::string* signature);
// V15 licenses.
virtual CdmResponseType RefreshKeys(const std::string& message,
const std::string& signature,
const std::vector<CryptoKey>& key_array);
// V16 licenses.
virtual CdmResponseType LoadRenewal(const std::string& signed_message,
const std::string& core_message,
@@ -193,7 +181,8 @@ class CryptoSession {
const std::string& session_key);
virtual CdmResponseType PrepareAndSignProvisioningRequest(
const std::string& message, std::string* core_message,
std::string* signature);
std::string* signature, bool& should_specify_algorithm,
OEMCrypto_SignatureHashAlgorithm& algorithm);
virtual CdmResponseType LoadProvisioning(const std::string& signed_message,
const std::string& core_message,
const std::string& signature,
@@ -228,7 +217,6 @@ class CryptoSession {
uint32_t* tier);
virtual bool GetSupportedCertificateTypes(SupportedCertificateTypes* support);
virtual CdmResponseType GetRandom(size_t data_length, uint8_t* random_data);
virtual CdmResponseType GetNumberOfOpenSessions(
RequestedSecurityLevel security_level, size_t* count);
virtual CdmResponseType GetMaxNumberOfSessions(
@@ -284,13 +272,13 @@ class CryptoSession {
// Used to manipulate the CDM managed usage table header & entries,
// delegating calls to OEMCrypto.
// Determines whether the OEMCrypto library supports usage info.
// Determines whether the OEMCrypto library supports usage table.
// As of V16, the only valid type of support is usage table header +
// usage entries.
// The first method will use a cached value if present.
virtual bool HasUsageInfoSupport(bool* has_support);
virtual bool HasUsageInfoSupport(RequestedSecurityLevel security_level,
bool* has_support);
virtual bool HasUsageTableSupport(bool* has_support);
virtual bool HasUsageTableSupport(RequestedSecurityLevel security_level,
bool* has_support);
// Usage report.
virtual CdmResponseType DeactivateUsageInformation(
@@ -301,30 +289,28 @@ class CryptoSession {
int64_t* seconds_since_started, int64_t* seconds_since_last_played);
// Usage table header.
virtual UsageTableHeader* GetUsageTableHeader() {
return usage_table_header_;
}
virtual CdmUsageTable* GetUsageTable() { return usage_table_; }
// The following crypto methods do not require an open session to
// complete the operations.
virtual CdmResponseType CreateUsageTableHeader(
RequestedSecurityLevel requested_security_level,
CdmUsageTableHeader* usage_table_header);
UsageTableHeader* usage_table_header);
virtual CdmResponseType LoadUsageTableHeader(
RequestedSecurityLevel requested_security_level,
const CdmUsageTableHeader& usage_table_header);
const UsageTableHeader& usage_table_header);
virtual CdmResponseType ShrinkUsageTableHeader(
RequestedSecurityLevel requested_security_level, uint32_t new_entry_count,
CdmUsageTableHeader* usage_table_header);
UsageTableHeader* usage_table_header);
// Usage entry.
virtual CdmResponseType CreateUsageEntry(uint32_t* entry_number);
virtual CdmResponseType LoadUsageEntry(uint32_t entry_number,
const CdmUsageEntry& usage_entry);
virtual CdmResponseType UpdateUsageEntry(
CdmUsageTableHeader* usage_table_header, CdmUsageEntry* usage_entry);
virtual CdmResponseType CreateUsageEntry(UsageEntryIndex* entry_index);
virtual CdmResponseType LoadUsageEntry(UsageEntryIndex entry_index,
const UsageEntry& usage_entry);
virtual CdmResponseType UpdateUsageEntry(UsageTableHeader* usage_table_header,
UsageEntry* usage_entry);
// Adjust usage entries in usage table header.
virtual CdmResponseType MoveUsageEntry(uint32_t new_entry_number);
virtual CdmResponseType MoveUsageEntry(UsageEntryIndex new_entry_index);
virtual bool GetAnalogOutputCapabilities(bool* can_support_output,
bool* can_disable_output,
@@ -400,11 +386,11 @@ class CryptoSession {
void Init();
// Will set up the UsageTableHeader for this session. This may require
// creating a new UsageTableHeader if the global instance has not
// Will set up the CdmUsageTable for this session. This may require
// creating a new CdmUsageTable if the global instance has not
// been initialized.
// Note: This function will lock the global static field lock in write mode.
bool SetUpUsageTableHeader(RequestedSecurityLevel requested_security_level);
bool SetUpUsageTable(RequestedSecurityLevel requested_security_level);
size_t GetMaxSubsampleRegionSize();
@@ -413,10 +399,10 @@ class CryptoSession {
CdmResponseType SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode);
// Retrieves the OEMCrypto usage info support for the specified
// Retrieves the OEMCrypto usage table support for the specified
// |requested_security_level|.
// Caller should acquire the OEMCrypto read lock before calling.
bool HasUsageInfoSupportInternal(
bool HasUsageTableSupportInternal(
RequestedSecurityLevel requested_security_level, bool* has_support);
// These methods fall back into each other in the order given, depending on
@@ -540,12 +526,12 @@ class CryptoSession {
RequestedSecurityLevel requested_security_level_;
// Open session-cached result of OEMCrypto_SupportsUsageTable().
CachedBooleanProperty has_usage_info_support_ = kBooleanUnset;
UsageTableHeader* usage_table_header_ = nullptr;
CachedBooleanProperty has_usage_table_support_ = kBooleanUnset;
CdmUsageTable* usage_table_ = nullptr;
// These fields are protected by |usage_table_mutex_| and not
// |static_field_mutex_|.
static std::unique_ptr<UsageTableHeader> usage_table_header_l1_;
static std::unique_ptr<UsageTableHeader> usage_table_header_l3_;
static std::unique_ptr<CdmUsageTable> usage_table_l1_;
static std::unique_ptr<CdmUsageTable> usage_table_l3_;
std::string request_id_;
static std::atomic<uint64_t> request_id_index_source_;