Source release 18.5.0

This commit is contained in:
Matt Feddersen
2024-03-28 19:15:22 -07:00
parent b2c35151ad
commit 28ec8548c6
109 changed files with 3623 additions and 1012 deletions

View File

@@ -69,6 +69,8 @@ class CryptoSession {
static CryptoSession* MakeCryptoSession(
metrics::CryptoMetrics* crypto_metrics);
static const char* HdcpCapabilityToString(HdcpCapability hdcp_level);
virtual ~CryptoSession();
// This method will try to terminate OEMCrypto if |session_size_| is 0.
@@ -103,6 +105,9 @@ class CryptoSession {
// Only valid for OEM certificate-based based devices.
virtual CdmResponseType GetTokenFromOemCert(
RequestedSecurityLevel requested_security_level, std::string* oem_cert);
// Retrieves the embedded public certificate from OEMCrypto.
// Only valid for L3 devices with embedded (baked-in) certificates.
virtual CdmResponseType GetTokenFromEmbeddedCertificate(std::string* token);
// The overloaded methods with |requested_level| may be called
// without a preceding call to Open. The other method must call Open first.
@@ -194,6 +199,13 @@ class CryptoSession {
std::string* additional_signature);
virtual CdmResponseType GetBootCertificateChain(
std::string* bcc, std::string* additional_signature);
virtual CdmResponseType GetDeviceInformation(
RequestedSecurityLevel requested_security_level,
std::string* device_info);
virtual CdmResponseType GetDeviceSignedCsrPayload(
RequestedSecurityLevel requested_security_level,
const std::string& challenge, const std::string& device_info,
std::string* signed_csr_payload);
virtual CdmResponseType GenerateCertificateKeyPair(
std::string* public_key, std::string* public_key_signature,
std::string* wrapped_private_key, CryptoWrappedKey::Type* key_type);
@@ -411,18 +423,22 @@ class CryptoSession {
OEMCryptoResult DecryptMultipleSamples(
const std::vector<OEMCrypto_SampleDescription>& samples,
CdmCipherMode cipher_mode,
const OEMCrypto_CENCEncryptPatternDesc& pattern);
OEMCryptoResult DecryptSample(
const OEMCrypto_SampleDescription& sample, CdmCipherMode cipher_mode,
const OEMCrypto_CENCEncryptPatternDesc& pattern);
OEMCryptoResult LegacyDecrypt(
const OEMCrypto_SampleDescription& sample, CdmCipherMode cipher_mode,
const OEMCrypto_CENCEncryptPatternDesc& pattern);
const OEMCrypto_CENCEncryptPatternDesc& pattern,
bool is_any_subsample_protected);
OEMCryptoResult DecryptSample(const OEMCrypto_SampleDescription& sample,
CdmCipherMode cipher_mode,
const OEMCrypto_CENCEncryptPatternDesc& pattern,
bool is_any_subsample_protected);
OEMCryptoResult LegacyDecrypt(const OEMCrypto_SampleDescription& sample,
CdmCipherMode cipher_mode,
const OEMCrypto_CENCEncryptPatternDesc& pattern,
bool is_any_subsample_protected);
OEMCryptoResult LegacyCopyBufferInChunks(
const OEMCrypto_SampleDescription& sample, size_t max_chunk_size);
OEMCryptoResult LegacyDecryptInChunks(
const OEMCrypto_SampleDescription& sample, CdmCipherMode cipher_mode,
const OEMCrypto_CENCEncryptPatternDesc& pattern, size_t max_chunk_size);
const OEMCrypto_CENCEncryptPatternDesc& pattern, size_t max_chunk_size,
bool is_any_subsample_protected);
// These methods should be used to take the various CryptoSession mutexes in
// preference to taking the mutexes directly.
@@ -545,6 +561,9 @@ class CryptoSession {
// same error code in sequence of each other. A value of
// OEMCrypto_SUCCESS indicates that no error have yet occurred.
OEMCryptoResult last_decrypt_error_ = OEMCrypto_SUCCESS;
// Similar to |last_decrypt_error_|, but intended for calls to
// SelectKey().
OEMCryptoResult last_select_key_error_ = OEMCrypto_SUCCESS;
// In order to avoid creating a deadlock if instantiation needs to take any
// of the CryptoSession static mutexes, |factory_| is protected by its own