CDM Core: Removed support for v15 licenses.

[ Merge of http://go/wvgerrit/160000 ]

OEMCrypto v15 licenses made use of several now-obsolete API functions
of OEMCrypto (mainly LoadKeys and RefreshKeys).  All license handled
by the CDM must be v16 or newer.  The CDM can now rely on all license
requests/responses containing a core message, using v16 policy timers,
and requires loading using LoadLicense() / LoadRenewal().

Bug: 252670759
Test: run_x86_64_tests and policy_engine_unittest
Change-Id: I3f65a6ec0326b4c89d1919b8911e065079cb90d2
This commit is contained in:
Alex Dale
2022-10-27 17:05:20 -07:00
parent 4a4ee80cad
commit b26126d3aa
8 changed files with 200 additions and 2301 deletions

View File

@@ -72,6 +72,7 @@ class HdcpOnlyMockCryptoSession : public TestCryptoSession {
MOCK_METHOD(CdmResponseType, GetHdcpCapabilities,
(HdcpCapability*, HdcpCapability*), (override));
CdmSecurityLevel GetSecurityLevel() override { return kSecurityLevelL1; }
};
class MockCdmEventListener : public WvCdmEventListener {
@@ -241,7 +242,7 @@ TEST_F(PolicyEngineConstraintsTest, IsPermissiveWithoutAResolution) {
.WillRepeatedly(DoAll(SetArgPointee<0>(HDCP_NO_DIGITAL_OUTPUT),
Return(GET_HDCP_CAPABILITY_FAILED)));
policy_engine_->SetLicense(license_, false, false);
policy_engine_->SetLicense(license_, false);
policy_engine_->OnTimerEvent();
EXPECT_TRUE(policy_engine_->CanDecryptContent(kKeyId1));
@@ -273,7 +274,7 @@ TEST_F(PolicyEngineConstraintsTest, HandlesResolutionsBasedOnConstraints) {
.WillRepeatedly(
DoAll(SetArgPointee<0>(HDCP_NO_DIGITAL_OUTPUT), Return(NO_ERROR)));
policy_engine_->SetLicense(license_, false, false);
policy_engine_->SetLicense(license_, false);
policy_engine_->NotifyResolution(1, kTargetRes1);
policy_engine_->OnTimerEvent();
EXPECT_TRUE(policy_engine_->CanDecryptContent(kKeyId1));
@@ -337,7 +338,7 @@ TEST_F(PolicyEngineConstraintsTest,
}
policy_engine_->NotifyResolution(1, kTargetRes1);
policy_engine_->SetLicense(license_, false, false);
policy_engine_->SetLicense(license_, false);
policy_engine_->OnTimerEvent();
policy_engine_->OnTimerEvent();
policy_engine_->OnTimerEvent();
@@ -370,7 +371,7 @@ TEST_F(PolicyEngineConstraintsTest, HandlesConstraintOverridingHdcp) {
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
.WillRepeatedly(DoAll(SetArgPointee<0>(HDCP_V2), Return(NO_ERROR)));
policy_engine_->SetLicense(license_, false, false);
policy_engine_->SetLicense(license_, false);
policy_engine_->NotifyResolution(1, kTargetRes1);
policy_engine_->OnTimerEvent();
EXPECT_TRUE(policy_engine_->CanDecryptContent(kKeyId1));
@@ -412,7 +413,7 @@ TEST_F(PolicyEngineConstraintsTest, HandlesNoHdcp) {
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
.WillRepeatedly(DoAll(SetArgPointee<0>(HDCP_NONE), Return(NO_ERROR)));
policy_engine_->SetLicense(license_, false, false);
policy_engine_->SetLicense(license_, false);
policy_engine_->NotifyResolution(1, kTargetRes1);
policy_engine_->OnTimerEvent();
@@ -456,7 +457,7 @@ TEST_F(PolicyEngineConstraintsTest, UsesDefaultHdcpWhenResolutionNotSet) {
.WillRepeatedly(DoAll(SetArgPointee<0>(HDCP_NO_DIGITAL_OUTPUT),
Return(GET_HDCP_CAPABILITY_FAILED)));
policy_engine_->SetLicense(license_, false, false);
policy_engine_->SetLicense(license_, false);
policy_engine_->OnTimerEvent();
EXPECT_TRUE(policy_engine_->CanDecryptContent(kKeyId1));
EXPECT_FALSE(policy_engine_->CanDecryptContent(kKeyId2));

File diff suppressed because it is too large Load Diff