Correct CancelKeyRequest behavior

[ Merge of https://widevine-internal-review.googlesource.com/#/c/10659/
  from the widevine cdm repo. ]

CdmEngine::CancelKeyRequest would earlier release keys by closing and
reopening a crypto session. Behavior has been changed to just close
the session.

b/15984869

Change-Id: I92a1f82fd4a97b5510596d4bc69bf07406cee606
This commit is contained in:
Rahul Frias
2014-07-21 14:36:50 -07:00
parent a19a965fb7
commit e894774942
2 changed files with 9 additions and 2 deletions

View File

@@ -299,8 +299,7 @@ CdmResponseType CdmEngine::CancelKeyRequest(const CdmSessionId& session_id) {
return KEY_ERROR;
}
// Re-initialize to release crypto session/keys without closing session
iter->second->Init();
iter->second->CancelKeyRequest();
return NO_ERROR;
}

View File

@@ -986,6 +986,14 @@ TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewal) {
decryptor_.CloseSession(session_id_);
}
TEST_F(WvCdmRequestLicenseTest, RemoveKeys) {
ASSERT_EQ(NO_ERROR, decryptor_.OpenSession(g_key_system, NULL, &session_id_));
GenerateKeyRequest(g_key_id, kLicenseTypeStreaming);
VerifyKeyRequestResponse(g_license_server, g_client_auth, false);
ASSERT_EQ(NO_ERROR, decryptor_.CancelKeyRequest(session_id_));
ASSERT_EQ(NO_ERROR, decryptor_.CloseSession(session_id_));
}
class WvCdmUsageInfoTest
: public WvCdmRequestLicenseTest,
public ::testing::WithParamInterface<UsageInfoSubSampleInfo*> {};