Report 3072-bit Certificate Capability
(This is a merge of go/wvgerrit/23154) This patch updates the ClientCapabilities protobuf to match the latest on the server side and adds plumbing to the provisioning request process so that devices can report whether they like big certs. Their capacity to lie remains untested. Bug: 34076937 Test: license_unittest Change-Id: I3bcc9f1741146953d8bc0ff3d7d2305e7ac2c118
This commit is contained in:
@@ -83,6 +83,7 @@ class MockCryptoSession : public CryptoSession {
|
||||
MOCK_METHOD1(GenerateRequestId, bool(std::string*));
|
||||
MOCK_METHOD1(UsageInformationSupport, bool(bool*));
|
||||
MOCK_METHOD2(GetHdcpCapabilities, bool(HdcpCapability*, HdcpCapability*));
|
||||
MOCK_METHOD1(GetSupportedCertificateTypes, bool(SupportedCertificateTypes*));
|
||||
MOCK_METHOD1(GetApiVersion, bool(uint32_t*));
|
||||
MOCK_METHOD1(GenerateNonce, bool(uint32_t*));
|
||||
MOCK_METHOD3(PrepareRequest, bool(const std::string&, bool, std::string*));
|
||||
@@ -121,6 +122,7 @@ using ::testing::Eq;
|
||||
using ::testing::NotNull;
|
||||
using ::testing::Return;
|
||||
using ::testing::SetArgPointee;
|
||||
using ::testing::UnorderedElementsAre;
|
||||
|
||||
class CdmLicenseTest : public ::testing::Test {
|
||||
protected:
|
||||
@@ -184,6 +186,11 @@ TEST_F(CdmLicenseTest, PrepareKeyRequestValidation) {
|
||||
bool usage_information_support = true;
|
||||
CryptoSession::HdcpCapability current_hdcp_version = HDCP_NO_DIGITAL_OUTPUT;
|
||||
CryptoSession::HdcpCapability max_hdcp_version = HDCP_V2_1;
|
||||
CryptoSession::SupportedCertificateTypes device_supported_certs = {
|
||||
true,
|
||||
true,
|
||||
true
|
||||
};
|
||||
uint32_t crypto_session_api_version = 9;
|
||||
|
||||
EXPECT_CALL(*crypto_session_, IsOpen())
|
||||
@@ -196,6 +203,8 @@ TEST_F(CdmLicenseTest, PrepareKeyRequestValidation) {
|
||||
EXPECT_CALL(*crypto_session_, GetHdcpCapabilities(NotNull(), NotNull()))
|
||||
.WillOnce(DoAll(SetArgPointee<0>(current_hdcp_version),
|
||||
SetArgPointee<1>(max_hdcp_version), Return(true)));
|
||||
EXPECT_CALL(*crypto_session_, GetSupportedCertificateTypes(NotNull()))
|
||||
.WillOnce(DoAll(SetArgPointee<0>(device_supported_certs), Return(true)));
|
||||
EXPECT_CALL(*crypto_session_, GetApiVersion(NotNull()))
|
||||
.WillOnce(
|
||||
DoAll(SetArgPointee<0>(crypto_session_api_version), Return(true)));
|
||||
@@ -264,6 +273,14 @@ TEST_F(CdmLicenseTest, PrepareKeyRequestValidation) {
|
||||
EXPECT_EQ(crypto_session_api_version,
|
||||
client_capabilities.oem_crypto_api_version());
|
||||
|
||||
EXPECT_THAT(
|
||||
client_capabilities.supported_certificate_key_type(),
|
||||
UnorderedElementsAre(
|
||||
video_widevine::
|
||||
ClientIdentification_ClientCapabilities_CertificateKeyType_RSA_2048,
|
||||
video_widevine::
|
||||
ClientIdentification_ClientCapabilities_CertificateKeyType_RSA_3072));
|
||||
|
||||
// Verify Content Identification
|
||||
const LicenseRequest_ContentIdentification& content_id =
|
||||
license_request.content_id();
|
||||
|
||||
Reference in New Issue
Block a user