Merge latest oemcrypto-v17 change

No-Typo-Check: Not related to this change.

Bug: 161477208
Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
This commit is contained in:
Kyle Zhang
2022-01-21 05:58:12 +00:00
committed by Fred Gylys-Colwell
parent c924960962
commit 642965c678
176 changed files with 301013 additions and 296749 deletions

View File

@@ -20,9 +20,11 @@
# include <gtest/gtest_prod.h>
#endif
namespace wvcdm {
namespace wvutil {
class FileSystem;
}
namespace wvcdm {
class DeviceFiles {
public:
@@ -111,7 +113,7 @@ class DeviceFiles {
CryptoWrappedKey wrapped_private_key;
};
DeviceFiles(FileSystem*);
DeviceFiles(wvutil::FileSystem*);
virtual ~DeviceFiles();
virtual bool Init(CdmSecurityLevel security_level);
@@ -128,6 +130,7 @@ class DeviceFiles {
CryptoWrappedKey* private_key,
std::string* serial_number,
uint32_t* system_id);
// Returns true if a DRM certificate is available.
virtual bool HasCertificate(bool atsc_mode_enabled);
// Retrieves the legacy DRM certificate without performing expiry
// related validation. Use this only when restoring/releasing
@@ -138,6 +141,13 @@ class DeviceFiles {
uint32_t* system_id);
virtual bool RemoveCertificate();
virtual bool StoreOemCertificate(const std::string& certificate,
const CryptoWrappedKey& private_key);
virtual DeviceFiles::CertificateState RetrieveOemCertificate(
std::string* certificate, CryptoWrappedKey* wrapped_private_key);
virtual bool HasOemCertificate();
virtual bool RemoveOemCertificate();
virtual bool StoreLicense(const CdmLicenseData& license_data,
ResponseType* result);
@@ -288,7 +298,7 @@ class DeviceFiles {
bool HasCertificate(CertificateType certificate_type);
// Helpers that wrap the File interface and automatically handle hashing, as
// well as adding the device files base path to to the file name.
// well as adding the device files base path to the file name.
ResponseType StoreFileWithHash(const std::string& name,
const std::string& serialized_file);
ResponseType StoreFileRaw(const std::string& name,
@@ -302,6 +312,8 @@ class DeviceFiles {
static bool GetCertificateFileName(CertificateType certificate_type,
std::string* certificate_file_name);
static bool GetOemCertificateFileName(std::string* certificate_file_name);
static std::string GetHlsAttributesFileNameExtension();
static std::string GetLicenseFileNameExtension();
static std::string GetUsageTableFileName();
@@ -358,7 +370,7 @@ class DeviceFiles {
static std::set<std::string> reserved_license_ids_;
FileSystem* file_system_;
wvutil::FileSystem* file_system_;
CdmSecurityLevel security_level_;
bool initialized_;