L1 System Lowered to L3 Still Requires Secure Decoders
Merge of https://widevine-internal-review.googlesource.com/#/c/8263 from the Widevine repo. Changes the behavior of requiresSecureDecoderComponent() to query the session for whether a lowered security level has been requested before querying the system to see what its default security level is. As part of this, we added a new QuerySessionStatus() method to the CDM that gets status info on a session-specific level, such as the effective security level of a session. Bug: 11428937 Change-Id: I5549a2fdd400cc87f567d27fcf74c473451093d6
This commit is contained in:
committed by
John Bruce
parent
0a9f0b1dd8
commit
fd482527e4
@@ -715,6 +715,40 @@ TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewal) {
|
||||
decryptor_.CloseSession(session_id_);
|
||||
}
|
||||
|
||||
TEST_F(WvCdmRequestLicenseTest, QuerySessionStatus) {
|
||||
// Test that the global value is returned when no properties are modifying it.
|
||||
CdmQueryMap system_query_info;
|
||||
CdmQueryMap::iterator system_itr;
|
||||
ASSERT_EQ(wvcdm::NO_ERROR, decryptor_.QueryStatus(&system_query_info));
|
||||
system_itr = system_query_info.find(wvcdm::QUERY_KEY_SECURITY_LEVEL);
|
||||
ASSERT_TRUE(system_itr != system_query_info.end());
|
||||
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
CdmQueryMap unmodified_query_info;
|
||||
CdmQueryMap::iterator unmodified_itr;
|
||||
ASSERT_EQ(wvcdm::NO_ERROR,
|
||||
decryptor_.QuerySessionStatus(session_id_, &unmodified_query_info));
|
||||
unmodified_itr = unmodified_query_info.find(wvcdm::QUERY_KEY_SECURITY_LEVEL);
|
||||
ASSERT_TRUE(unmodified_itr != unmodified_query_info.end());
|
||||
EXPECT_EQ(system_itr->second, unmodified_itr->second);
|
||||
decryptor_.CloseSession(session_id_);
|
||||
|
||||
// Test that L3 is returned when properties downgrade security.
|
||||
TestWvCdmClientPropertySet property_set_L3;
|
||||
property_set_L3.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3);
|
||||
|
||||
decryptor_.OpenSession(g_key_system, &property_set_L3, &session_id_);
|
||||
CdmQueryMap modified_query_info;
|
||||
CdmQueryMap::iterator modified_itr;
|
||||
ASSERT_EQ(wvcdm::NO_ERROR,
|
||||
decryptor_.QuerySessionStatus(session_id_, &modified_query_info));
|
||||
modified_itr = modified_query_info.find(wvcdm::QUERY_KEY_SECURITY_LEVEL);
|
||||
ASSERT_TRUE(modified_itr != modified_query_info.end());
|
||||
EXPECT_EQ(QUERY_VALUE_SECURITY_LEVEL_L3, modified_itr->second);
|
||||
decryptor_.CloseSession(session_id_);
|
||||
|
||||
}
|
||||
|
||||
TEST_F(WvCdmRequestLicenseTest, QueryKeyStatus) {
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
GenerateKeyRequest(g_key_system, g_key_id, kLicenseTypeStreaming);
|
||||
|
||||
Reference in New Issue
Block a user