Use aidl interface for Widevine service.
The interface is defined in hardware/interfaces/drm/aidl(http://go/ag/15329852). Test: build m android.hardware.drm-service.widevine -j128 Test: build_and_run_all_unit_tests.sh for hidl tests Test: atest VtsAidlHalDrmTargetTest Bug: 200055138 Bug: 170964303 Change-Id: If2f2a129914436ba5cef1c46f6cb9415e12c3d1c
This commit is contained in:
@@ -146,7 +146,7 @@ class CdmEngine {
|
||||
const CdmSessionId& session_id, const std::string& service_certificate);
|
||||
|
||||
// Query system information
|
||||
virtual CdmResponseType QueryStatus(SecurityLevel security_level,
|
||||
virtual CdmResponseType QueryStatus(RequestedSecurityLevel security_level,
|
||||
const std::string& query_token,
|
||||
std::string* query_response);
|
||||
|
||||
@@ -184,13 +184,13 @@ class CdmEngine {
|
||||
virtual CdmResponseType GetProvisioningRequest(
|
||||
CdmCertificateType cert_type, const std::string& cert_authority,
|
||||
const std::string& service_certificate,
|
||||
SecurityLevel requested_security_level, CdmProvisioningRequest* request,
|
||||
std::string* default_url);
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
CdmProvisioningRequest* request, std::string* default_url);
|
||||
|
||||
// Verify and process a provisioning response.
|
||||
virtual CdmResponseType HandleProvisioningResponse(
|
||||
const CdmProvisioningResponse& response,
|
||||
SecurityLevel requested_security_level, std::string* cert,
|
||||
RequestedSecurityLevel requested_security_level, std::string* cert,
|
||||
std::string* wrapped_key);
|
||||
|
||||
// Return true if there is a device certificate on the current
|
||||
@@ -398,7 +398,7 @@ class CdmEngine {
|
||||
|
||||
bool ValidateKeySystem(const CdmKeySystem& key_system);
|
||||
CdmResponseType GetUsageInfo(const std::string& app_id,
|
||||
SecurityLevel requested_security_level,
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
int* error_detail, CdmUsageInfo* usage_info);
|
||||
|
||||
void OnKeyReleaseEvent(const CdmKeySetId& key_set_id);
|
||||
|
||||
@@ -153,12 +153,11 @@ class CdmEngineMetricsImpl : public T {
|
||||
return sts;
|
||||
}
|
||||
|
||||
CdmResponseType GetProvisioningRequest(CdmCertificateType cert_type,
|
||||
const std::string& cert_authority,
|
||||
const std::string& service_certificate,
|
||||
SecurityLevel requested_security_level,
|
||||
CdmProvisioningRequest* request,
|
||||
std::string* default_url) override {
|
||||
CdmResponseType GetProvisioningRequest(
|
||||
CdmCertificateType cert_type, const std::string& cert_authority,
|
||||
const std::string& service_certificate,
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
CdmProvisioningRequest* request, std::string* default_url) override {
|
||||
CdmResponseType sts;
|
||||
M_TIME(sts = T::GetProvisioningRequest(
|
||||
cert_type, cert_authority, service_certificate,
|
||||
@@ -169,7 +168,7 @@ class CdmEngineMetricsImpl : public T {
|
||||
|
||||
CdmResponseType HandleProvisioningResponse(
|
||||
const CdmProvisioningResponse& response,
|
||||
SecurityLevel requested_security_level, std::string* cert,
|
||||
RequestedSecurityLevel requested_security_level, std::string* cert,
|
||||
std::string* wrapped_key) override {
|
||||
CdmResponseType sts;
|
||||
M_TIME(sts = T::HandleProvisioningResponse(
|
||||
|
||||
@@ -141,7 +141,7 @@ class CdmSession {
|
||||
virtual void OnKeyReleaseEvent(const CdmKeySetId& key_set_id);
|
||||
|
||||
virtual void GetApplicationId(std::string* app_id);
|
||||
virtual SecurityLevel GetRequestedSecurityLevel() {
|
||||
virtual RequestedSecurityLevel GetRequestedSecurityLevel() {
|
||||
return requested_security_level_;
|
||||
}
|
||||
virtual CdmSecurityLevel GetSecurityLevel() { return security_level_; }
|
||||
@@ -283,7 +283,7 @@ class CdmSession {
|
||||
bool is_release_;
|
||||
bool is_temporary_;
|
||||
CdmSecurityLevel security_level_;
|
||||
SecurityLevel requested_security_level_;
|
||||
RequestedSecurityLevel requested_security_level_;
|
||||
// If |forced_level3_|, |security_level_| and |requested_security_level_|
|
||||
// MUST be set to kSecurityLevelL3 and kLevel3, respectively.
|
||||
bool forced_level3_ = false;
|
||||
|
||||
@@ -39,7 +39,8 @@ class CertificateProvisioning {
|
||||
// Construct a valid provisioning request.
|
||||
// The request will be sent to the provisioning server.
|
||||
CdmResponseType GetProvisioningRequest(
|
||||
wvutil::FileSystem* file_system, SecurityLevel requested_security_level,
|
||||
wvutil::FileSystem* file_system,
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
CdmCertificateType cert_type, const std::string& cert_authority,
|
||||
const std::string& origin, const std::string& spoid,
|
||||
CdmProvisioningRequest* request, std::string* default_url);
|
||||
@@ -75,7 +76,8 @@ class CertificateProvisioning {
|
||||
|
||||
private:
|
||||
CdmResponseType GetProvisioningRequestInternal(
|
||||
wvutil::FileSystem* file_system, SecurityLevel requested_security_level,
|
||||
wvutil::FileSystem* file_system,
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
CdmCertificateType cert_type, const std::string& cert_authority,
|
||||
const std::string& origin, const std::string& spoid,
|
||||
CdmProvisioningRequest* request, std::string* default_url);
|
||||
|
||||
@@ -91,10 +91,12 @@ class CryptoSession {
|
||||
// The overloaded methods with |requested_level| may be called
|
||||
// without a preceding call to Open. The other method must call Open first.
|
||||
virtual CdmSecurityLevel GetSecurityLevel();
|
||||
virtual CdmSecurityLevel GetSecurityLevel(SecurityLevel requested_level);
|
||||
virtual CdmSecurityLevel GetSecurityLevel(
|
||||
RequestedSecurityLevel requested_level);
|
||||
virtual bool GetApiVersion(uint32_t* version);
|
||||
virtual bool GetApiVersion(SecurityLevel requested_level, uint32_t* version);
|
||||
virtual bool GetApiMinorVersion(SecurityLevel requested_level,
|
||||
virtual bool GetApiVersion(RequestedSecurityLevel requested_level,
|
||||
uint32_t* version);
|
||||
virtual bool GetApiMinorVersion(RequestedSecurityLevel requested_level,
|
||||
uint32_t* minor_version);
|
||||
|
||||
// This method will return, for devices with a
|
||||
@@ -117,7 +119,7 @@ class CryptoSession {
|
||||
virtual uint8_t GetSecurityPatchLevel();
|
||||
|
||||
virtual CdmResponseType Open() { return Open(kLevelDefault); }
|
||||
virtual CdmResponseType Open(SecurityLevel requested_security_level);
|
||||
virtual CdmResponseType Open(RequestedSecurityLevel requested_security_level);
|
||||
virtual void Close();
|
||||
|
||||
virtual bool IsOpen() { return open_; }
|
||||
@@ -194,30 +196,30 @@ class CryptoSession {
|
||||
// preceding call to Open. The other methods must call Open first.
|
||||
virtual CdmResponseType GetHdcpCapabilities(HdcpCapability* current,
|
||||
HdcpCapability* max);
|
||||
virtual CdmResponseType GetHdcpCapabilities(SecurityLevel security_level,
|
||||
HdcpCapability* current,
|
||||
HdcpCapability* max);
|
||||
virtual CdmResponseType GetHdcpCapabilities(
|
||||
RequestedSecurityLevel security_level, HdcpCapability* current,
|
||||
HdcpCapability* max);
|
||||
virtual bool GetResourceRatingTier(uint32_t* tier);
|
||||
virtual bool GetResourceRatingTier(SecurityLevel security_level,
|
||||
virtual bool GetResourceRatingTier(RequestedSecurityLevel security_level,
|
||||
uint32_t* tier);
|
||||
|
||||
virtual bool GetSupportedCertificateTypes(SupportedCertificateTypes* support);
|
||||
virtual CdmResponseType GetRandom(size_t data_length, uint8_t* random_data);
|
||||
virtual CdmResponseType GetNumberOfOpenSessions(SecurityLevel security_level,
|
||||
size_t* count);
|
||||
virtual CdmResponseType GetMaxNumberOfSessions(SecurityLevel security_level,
|
||||
size_t* max);
|
||||
virtual CdmResponseType GetNumberOfOpenSessions(
|
||||
RequestedSecurityLevel security_level, size_t* count);
|
||||
virtual CdmResponseType GetMaxNumberOfSessions(
|
||||
RequestedSecurityLevel security_level, size_t* max);
|
||||
|
||||
virtual CdmResponseType GetSrmVersion(uint16_t* srm_version);
|
||||
|
||||
virtual bool GetBuildInformation(SecurityLevel security_level,
|
||||
virtual bool GetBuildInformation(RequestedSecurityLevel security_level,
|
||||
std::string* info);
|
||||
virtual bool GetBuildInformation(std::string* info);
|
||||
|
||||
virtual bool GetMaximumUsageTableEntries(SecurityLevel security_level,
|
||||
size_t* number_of_entries);
|
||||
virtual bool GetMaximumUsageTableEntries(
|
||||
RequestedSecurityLevel security_level, size_t* number_of_entries);
|
||||
|
||||
virtual bool GetDecryptHashSupport(SecurityLevel security_level,
|
||||
virtual bool GetDecryptHashSupport(RequestedSecurityLevel security_level,
|
||||
uint32_t* hash_support);
|
||||
|
||||
virtual CdmResponseType SetDecryptHash(uint32_t frame_number,
|
||||
@@ -253,7 +255,7 @@ class CryptoSession {
|
||||
// usage entries.
|
||||
// The first method will use a cached value if present.
|
||||
virtual bool HasUsageInfoSupport(bool* has_support);
|
||||
virtual bool HasUsageInfoSupport(SecurityLevel security_level,
|
||||
virtual bool HasUsageInfoSupport(RequestedSecurityLevel security_level,
|
||||
bool* has_support);
|
||||
|
||||
// Usage report.
|
||||
@@ -271,13 +273,13 @@ class CryptoSession {
|
||||
// The following crypto methods do not require an open session to
|
||||
// complete the operations.
|
||||
virtual CdmResponseType CreateUsageTableHeader(
|
||||
SecurityLevel requested_security_level,
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
CdmUsageTableHeader* usage_table_header);
|
||||
virtual CdmResponseType LoadUsageTableHeader(
|
||||
SecurityLevel requested_security_level,
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
const CdmUsageTableHeader& usage_table_header);
|
||||
virtual CdmResponseType ShrinkUsageTableHeader(
|
||||
SecurityLevel requested_security_level, uint32_t new_entry_count,
|
||||
RequestedSecurityLevel requested_security_level, uint32_t new_entry_count,
|
||||
CdmUsageTableHeader* usage_table_header);
|
||||
|
||||
// Usage entry.
|
||||
@@ -296,7 +298,8 @@ class CryptoSession {
|
||||
virtual metrics::CryptoMetrics* GetCryptoMetrics() { return metrics_; }
|
||||
|
||||
virtual CdmResponseType GetProvisioningMethod(
|
||||
SecurityLevel requested_security_level, CdmClientTokenType* token_type);
|
||||
RequestedSecurityLevel requested_security_level,
|
||||
CdmClientTokenType* token_type);
|
||||
|
||||
// OTA Provisioning
|
||||
|
||||
@@ -362,7 +365,7 @@ class CryptoSession {
|
||||
// creating a new UsageTableHeader if the global instance has not
|
||||
// been initialized.
|
||||
// Note: This function will lock the global static field lock in write mode.
|
||||
bool SetUpUsageTableHeader(SecurityLevel requested_security_level);
|
||||
bool SetUpUsageTableHeader(RequestedSecurityLevel requested_security_level);
|
||||
|
||||
CdmResponseType GetTokenFromKeybox(std::string* token);
|
||||
CdmResponseType GetTokenFromOemCert(std::string* token);
|
||||
@@ -381,8 +384,8 @@ class CryptoSession {
|
||||
// Retrieves the OEMCrypto usage info support for the specified
|
||||
// |requested_security_level|.
|
||||
// Caller should acquire the OEMCrypto read lock before calling.
|
||||
bool HasUsageInfoSupportInternal(SecurityLevel requested_security_level,
|
||||
bool* has_support);
|
||||
bool HasUsageInfoSupportInternal(
|
||||
RequestedSecurityLevel requested_security_level, bool* has_support);
|
||||
|
||||
// These methods fall back into each other in the order given, depending on
|
||||
// how much data they were given and how much data OEMCrypto can accept in one
|
||||
@@ -502,7 +505,7 @@ class CryptoSession {
|
||||
|
||||
OEMCryptoBufferType destination_buffer_type_;
|
||||
bool is_destination_buffer_type_valid_;
|
||||
SecurityLevel requested_security_level_;
|
||||
RequestedSecurityLevel requested_security_level_;
|
||||
|
||||
// Open session-cached result of OEMCrypto_SupportsUsageTable().
|
||||
CachedBooleanProperty has_usage_info_support_ = kBooleanUnset;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
#if defined(UNIT_TEST)
|
||||
# include <gtest/gtest_prod.h>
|
||||
#include <gtest/gtest_prod.h>
|
||||
#endif
|
||||
|
||||
namespace wvutil {
|
||||
@@ -321,7 +321,7 @@ class DeviceFiles {
|
||||
static std::string GetFileNameSafeHash(const std::string& input);
|
||||
|
||||
#if defined(UNIT_TEST)
|
||||
FRIEND_TEST(DeviceFilesSecurityLevelTest, SecurityLevel);
|
||||
FRIEND_TEST(DeviceFilesSecurityLevelTest, RequestedSecurityLevel);
|
||||
FRIEND_TEST(DeviceCertificateTest, ReadCertificate);
|
||||
FRIEND_TEST(DeviceFilesStoreTest, StoreLicense);
|
||||
FRIEND_TEST(DeviceFilesHlsAttributesTest, Delete);
|
||||
|
||||
@@ -27,49 +27,49 @@ OEMCryptoResult OEMCrypto_SetAllowTestKeybox(bool allow);
|
||||
// This attempts to open a session at the desired security level.
|
||||
// If one level is not available, the other will be used instead.
|
||||
OEMCryptoResult OEMCrypto_OpenSession(OEMCrypto_SESSION* session,
|
||||
SecurityLevel level);
|
||||
RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_InstallKeybox(const uint8_t* keybox,
|
||||
size_t keyBoxLength,
|
||||
SecurityLevel level);
|
||||
RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_GetDeviceID(uint8_t* deviceID, size_t* idLength,
|
||||
SecurityLevel level);
|
||||
RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_GetKeyData(uint8_t* keyData, size_t* keyDataLength,
|
||||
SecurityLevel level);
|
||||
uint32_t OEMCrypto_APIVersion(SecurityLevel level);
|
||||
uint32_t OEMCrypto_MinorAPIVersion(SecurityLevel level);
|
||||
OEMCrypto_Security_Level OEMCrypto_SecurityLevel(SecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_GetHDCPCapability(SecurityLevel level,
|
||||
RequestedSecurityLevel level);
|
||||
uint32_t OEMCrypto_APIVersion(RequestedSecurityLevel level);
|
||||
uint32_t OEMCrypto_MinorAPIVersion(RequestedSecurityLevel level);
|
||||
OEMCrypto_Security_Level OEMCrypto_SecurityLevel(RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_GetHDCPCapability(RequestedSecurityLevel level,
|
||||
OEMCrypto_HDCP_Capability* current,
|
||||
OEMCrypto_HDCP_Capability* maximum);
|
||||
bool OEMCrypto_SupportsUsageTable(SecurityLevel level);
|
||||
bool OEMCrypto_IsAntiRollbackHwPresent(SecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_GetNumberOfOpenSessions(SecurityLevel level,
|
||||
bool OEMCrypto_SupportsUsageTable(RequestedSecurityLevel level);
|
||||
bool OEMCrypto_IsAntiRollbackHwPresent(RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_GetNumberOfOpenSessions(RequestedSecurityLevel level,
|
||||
size_t* count);
|
||||
OEMCryptoResult OEMCrypto_GetMaxNumberOfSessions(SecurityLevel level,
|
||||
OEMCryptoResult OEMCrypto_GetMaxNumberOfSessions(RequestedSecurityLevel level,
|
||||
size_t* maximum);
|
||||
uint8_t OEMCrypto_Security_Patch_Level(SecurityLevel level);
|
||||
uint8_t OEMCrypto_Security_Patch_Level(RequestedSecurityLevel level);
|
||||
OEMCrypto_ProvisioningMethod OEMCrypto_GetProvisioningMethod(
|
||||
SecurityLevel level);
|
||||
uint32_t OEMCrypto_SupportedCertificates(SecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_CreateUsageTableHeader(SecurityLevel level,
|
||||
RequestedSecurityLevel level);
|
||||
uint32_t OEMCrypto_SupportedCertificates(RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_CreateUsageTableHeader(RequestedSecurityLevel level,
|
||||
uint8_t* header_buffer,
|
||||
size_t* header_buffer_length);
|
||||
OEMCryptoResult OEMCrypto_LoadUsageTableHeader(SecurityLevel level,
|
||||
OEMCryptoResult OEMCrypto_LoadUsageTableHeader(RequestedSecurityLevel level,
|
||||
const uint8_t* buffer,
|
||||
size_t buffer_length);
|
||||
OEMCryptoResult OEMCrypto_ShrinkUsageTableHeader(SecurityLevel level,
|
||||
OEMCryptoResult OEMCrypto_ShrinkUsageTableHeader(RequestedSecurityLevel level,
|
||||
uint32_t new_table_size,
|
||||
uint8_t* header_buffer,
|
||||
size_t* header_buffer_length);
|
||||
uint32_t OEMCrypto_GetAnalogOutputFlags(SecurityLevel level);
|
||||
uint32_t OEMCrypto_GetAnalogOutputFlags(RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_BuildInformation(char* buffer, size_t* buffer_length,
|
||||
SecurityLevel level);
|
||||
uint32_t OEMCrypto_ResourceRatingTier(SecurityLevel level);
|
||||
uint32_t OEMCrypto_SupportsDecryptHash(SecurityLevel level);
|
||||
size_t OEMCrypto_MaximumUsageTableHeaderSize(SecurityLevel level);
|
||||
RequestedSecurityLevel level);
|
||||
uint32_t OEMCrypto_ResourceRatingTier(RequestedSecurityLevel level);
|
||||
uint32_t OEMCrypto_SupportsDecryptHash(RequestedSecurityLevel level);
|
||||
size_t OEMCrypto_MaximumUsageTableHeaderSize(RequestedSecurityLevel level);
|
||||
OEMCryptoResult OEMCrypto_GetOEMPublicCertificate(uint8_t* public_cert,
|
||||
size_t* public_cert_length,
|
||||
SecurityLevel level);
|
||||
RequestedSecurityLevel level);
|
||||
} // namespace wvcdm
|
||||
|
||||
/* The following functions are deprecated in OEMCrypto v13. They are defined
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
#if defined(UNIT_TEST)
|
||||
# include <gtest/gtest_prod.h>
|
||||
#include <gtest/gtest_prod.h>
|
||||
#endif
|
||||
|
||||
namespace wvcdm {
|
||||
@@ -282,7 +282,7 @@ class UsageTableHeader {
|
||||
std::unique_ptr<DeviceFiles> device_files_;
|
||||
std::unique_ptr<wvutil::FileSystem> file_system_;
|
||||
CdmSecurityLevel security_level_ = kSecurityLevelUninitialized;
|
||||
SecurityLevel requested_security_level_ = kLevelDefault;
|
||||
RequestedSecurityLevel requested_security_level_ = kLevelDefault;
|
||||
|
||||
CdmUsageTableHeader usage_table_header_;
|
||||
std::vector<CdmUsageEntryInfo> usage_entry_info_;
|
||||
|
||||
@@ -480,7 +480,7 @@ enum CdmLicenseKeyType : int32_t {
|
||||
kLicenseKeyTypeEntitlement,
|
||||
};
|
||||
|
||||
enum SecurityLevel : uint32_t { kLevelDefault, kLevel3 };
|
||||
enum RequestedSecurityLevel : uint32_t { kLevelDefault, kLevel3 };
|
||||
|
||||
enum CdmSecurityLevel : int32_t {
|
||||
kSecurityLevelUninitialized,
|
||||
@@ -833,7 +833,7 @@ const char* CdmOfflineLicenseStateToString(
|
||||
CdmOfflineLicenseState license_state);
|
||||
const char* CdmSecurityLevelToString(CdmSecurityLevel security_level);
|
||||
const char* CdmUsageEntryStorageTypeToString(CdmUsageEntryStorageType type);
|
||||
const char* SecurityLevelToString(SecurityLevel security_level);
|
||||
const char* RequestedSecurityLevelToString(RequestedSecurityLevel security_level);
|
||||
// Converts a generic, unknown enum value to a string representation
|
||||
// containing its numeric value.
|
||||
// The pointer returned from this function is thread_local.
|
||||
|
||||
Reference in New Issue
Block a user