diff --git a/libwvdrmengine/cdm/core/include/cdm_engine.h b/libwvdrmengine/cdm/core/include/cdm_engine.h index 633e0616..4e323e92 100644 --- a/libwvdrmengine/cdm/core/include/cdm_engine.h +++ b/libwvdrmengine/cdm/core/include/cdm_engine.h @@ -79,7 +79,26 @@ class CdmEngine { const CdmSessionId& session_id, const CdmKeySetId& key_set_id, const InitializationData& init_data, const CdmLicenseType license_type, CdmAppParameterMap& app_parameters, CdmKeyRequest* key_request); - // Accept license response and extract key info. + // This API may + // (a) accept license response, extract key info and load keys. + // (b) accept a renewal response and update license policy information. + // (c) accept a release response and release an offline license or secure + // stop. + // (d) accept a service certificate and cache that information for the + // the lifetime of the session. + // + // |session_id| identifies the session that generated the request and can + // process the response. Should be empty if a release response. + // |key_data| is the license, renewal, release response or service + // certificate response. + // |key_set_id| should be non-null and specified if license release. + // If offline license or streaming license associated with + // a secure stop, |key_set_id| should be non-null and will + // be filled in on return. Use the |key_set_id| with + // RestoreKeys (to reload offline session) or + // GenerateKeyRequest (to release offline session/secure stop). + // |key_set_id| will be cleared if release or streaming + // (not associated with a secure stop). virtual CdmResponseType AddKey(const CdmSessionId& session_id, const CdmKeyResponse& key_data, CdmKeySetId* key_set_id); diff --git a/libwvdrmengine/cdm/core/include/cdm_session.h b/libwvdrmengine/cdm/core/include/cdm_session.h index 7cd781cc..dd3d1d90 100644 --- a/libwvdrmengine/cdm/core/include/cdm_session.h +++ b/libwvdrmengine/cdm/core/include/cdm_session.h @@ -117,6 +117,10 @@ class CdmSession { virtual bool is_offline() { return is_offline_; } virtual bool is_temporary() { return is_temporary_; } virtual bool license_received() { return license_received_; } + virtual bool has_provider_session_token() { + return (license_parser_.get() != NULL && + license_parser_->provider_session_token().size() > 0); + } virtual CdmUsageSupportType get_usage_support_type() { return usage_support_type_; } diff --git a/libwvdrmengine/cdm/core/src/cdm_engine.cpp b/libwvdrmengine/cdm/core/src/cdm_engine.cpp index 19291f9b..64457a65 100644 --- a/libwvdrmengine/cdm/core/src/cdm_engine.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_engine.cpp @@ -363,7 +363,13 @@ CdmResponseType CdmEngine::AddKey(const CdmSessionId& session_id, CdmResponseType sts = iter->second->AddKey(key_data); if (key_set_id) { - *key_set_id = iter->second->key_set_id(); + if ((iter->second->is_offline() || + iter->second->has_provider_session_token()) && + !license_type_release) { + *key_set_id = iter->second->key_set_id(); + } else { + key_set_id->clear(); + } } switch (sts) { diff --git a/libwvdrmengine/cdm/core/src/cdm_session.cpp b/libwvdrmengine/cdm/core/src/cdm_session.cpp index 485cff04..d4a12313 100644 --- a/libwvdrmengine/cdm/core/src/cdm_session.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_session.cpp @@ -185,6 +185,9 @@ CdmResponseType CdmSession::Init(CdmClientPropertySet* cdm_client_property_set, CdmResponseType CdmSession::RestoreOfflineSession( const CdmKeySetId& key_set_id, const CdmLicenseType license_type) { + if (!key_set_id_.empty()) { + file_handle_->UnreserveLicenseId(key_set_id_); + } key_set_id_ = key_set_id; DeviceFiles::LicenseState license_state; @@ -456,7 +459,7 @@ CdmResponseType CdmSession::AddKey(const CdmKeyResponse& key_response) { license_received_ = true; key_response_ = key_response; - if (is_offline_ || !license_parser_->provider_session_token().empty()) { + if (is_offline_ || has_provider_session_token()) { if (usage_support_type_ == kUsageEntrySupport) usage_table_header_->UpdateEntry(crypto_session_.get(), &usage_entry_); @@ -562,8 +565,7 @@ CdmResponseType CdmSession::Decrypt(const CdmDecryptionParameters& params) { } has_decrypted_since_last_report_ = true; if (!is_usage_update_needed_) { - is_usage_update_needed_ = - !license_parser_->provider_session_token().empty(); + is_usage_update_needed_ = has_provider_session_token(); } } else { Clock clock; @@ -647,7 +649,7 @@ CdmResponseType CdmSession::ReleaseKey(const CdmKeyResponse& key_response) { license_parser_->HandleKeyUpdateResponse(false, key_response); if (sts != KEY_ADDED) return (sts == KEY_ERROR) ? RELEASE_KEY_ERROR : sts; - if (is_offline_ || !license_parser_->provider_session_token().empty()) { + if (is_offline_ || has_provider_session_token()) { DeleteLicense(); // Deletion of usage entry cannot occur while in use by a crypto session. @@ -780,7 +782,7 @@ CdmResponseType CdmSession::ReleaseCrypto() { } bool CdmSession::DeleteLicense() { - if (!is_offline_ && license_parser_->provider_session_token().empty()) + if (!is_offline_ && !has_provider_session_token()) return false; if (is_offline_) { diff --git a/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp b/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp index 29a256cd..36bf23db 100644 --- a/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp +++ b/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp @@ -160,6 +160,11 @@ CdmResponseType WvContentDecryptionModule::AddKey( CdmEngine* cdm_engine = session_id.empty() ? GetCdmForSessionId(*key_set_id) : GetCdmForSessionId(session_id); if (!cdm_engine) return SESSION_NOT_FOUND_3; + // Save key_set_id, as CDM will return an empty key_set_id on release + CdmKeySetId release_key_set_id; + if (session_id.empty() && key_set_id != NULL) { + release_key_set_id = *key_set_id; + } CdmResponseType sts; M_TIME( sts = cdm_engine->AddKey( @@ -170,8 +175,8 @@ CdmResponseType WvContentDecryptionModule::AddKey( cdm_engine_add_key_, sts); if (sts == KEY_ADDED && session_id.empty()) { // license type release - cdm_engine->CloseKeySetSession(*key_set_id); - cdm_by_session_id_.erase(*key_set_id); + cdm_engine->CloseKeySetSession(release_key_set_id); + cdm_by_session_id_.erase(release_key_set_id); } return sts; } diff --git a/libwvdrmengine/cdm/test/request_license_test.cpp b/libwvdrmengine/cdm/test/request_license_test.cpp index 756d5032..e564fc86 100644 --- a/libwvdrmengine/cdm/test/request_license_test.cpp +++ b/libwvdrmengine/cdm/test/request_license_test.cpp @@ -993,7 +993,7 @@ class TestWvCdmHlsEventListener : public WvCdmEventListener { class WvCdmRequestLicenseTest : public WvCdmTestBase { public: - WvCdmRequestLicenseTest() {} + WvCdmRequestLicenseTest() : license_type_(kLicenseTypeStreaming) {} ~WvCdmRequestLicenseTest() {} protected: @@ -1039,6 +1039,7 @@ class WvCdmRequestLicenseTest : public WvCdmTestBase { CdmClientPropertySet* property_set) { CdmKeyRequest key_request; std::string key_set_id; + license_type_ = license_type; EXPECT_EQ(expected_response, decryptor_.GenerateKeyRequest( session_id_, key_set_id, init_data_type, init_data, @@ -1082,6 +1083,7 @@ class WvCdmRequestLicenseTest : public WvCdmTestBase { void GenerateKeyRelease(CdmKeySetId key_set_id, CdmClientPropertySet* property_set, CdmKeyMessage* key_msg) { + license_type_ = kLicenseTypeRelease; CdmSessionId session_id; CdmInitData init_data; wvcdm::CdmAppParameterMap app_parameters; @@ -1175,26 +1177,34 @@ class WvCdmRequestLicenseTest : public WvCdmTestBase { } void VerifyKeyRequestResponse(const std::string& server_url, - const std::string& client_auth, - bool is_renewal) { + const std::string& client_auth) { std::string response; - VerifyKeyRequestResponse(server_url, client_auth, is_renewal, &response); + VerifyKeyRequestResponse(server_url, client_auth, false); + } + + void VerifyUsageKeyRequestResponse(const std::string& server_url, + const std::string& client_auth) { + std::string response; + VerifyKeyRequestResponse(server_url, client_auth, true); } void VerifyKeyRequestResponse(const std::string& server_url, - const std::string& client_auth, bool is_renewal, + const std::string& client_auth, + bool is_usage) { + std::string response; + VerifyKeyRequestResponse(server_url, client_auth, is_usage, &response); + } + + void VerifyKeyRequestResponse(const std::string& server_url, + const std::string& client_auth, + bool is_usage, std::string* response) { *response = GetKeyRequestResponse(server_url, client_auth); - if (is_renewal) { - // TODO application makes a license request, CDM will renew the license - // when appropriate - EXPECT_EQ(decryptor_.AddKey(session_id_, *response, &key_set_id_), - wvcdm::KEY_ADDED); - } else { - EXPECT_EQ(decryptor_.AddKey(session_id_, *response, &key_set_id_), - wvcdm::KEY_ADDED); - } + EXPECT_EQ(decryptor_.AddKey(session_id_, *response, &key_set_id_), + wvcdm::KEY_ADDED); + EXPECT_EQ(is_usage || license_type_ == kLicenseTypeOffline, + key_set_id_.size() > 0); } void Unprovision() { @@ -1302,6 +1312,7 @@ class WvCdmRequestLicenseTest : public WvCdmTestBase { CdmKeyMessage key_msg_; CdmSessionId session_id_; CdmKeySetId key_set_id_; + CdmLicenseType license_type_; }; TEST_F(WvCdmRequestLicenseTest, ProvisioningTest) { @@ -1611,7 +1622,7 @@ TEST_F(WvCdmRequestLicenseTest, ForceL3Test) { kDefaultCdmIdentifier, NULL, &session_id_)); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -1627,7 +1638,7 @@ TEST_F(WvCdmRequestLicenseTest, PrivacyModeTest) { EXPECT_EQ(decryptor_.AddKey(session_id_, resp, &key_set_id_), wvcdm::NEED_KEY); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -1639,7 +1650,7 @@ TEST_F(WvCdmRequestLicenseTest, PrivacyModeWithServiceCertificateTest) { decryptor_.OpenSession(g_key_system, &property_set, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -1684,7 +1695,7 @@ TEST_F(WvCdmRequestLicenseTest, AddStreamingKeyTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -1700,7 +1711,7 @@ TEST_F(WvCdmRequestLicenseTest, AddKeyOfflineTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); decryptor_.CloseSession(session_id_); } @@ -1716,7 +1727,7 @@ TEST_F(WvCdmRequestLicenseTest, RestoreOfflineKeyTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); @@ -1741,7 +1752,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeyTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); @@ -1758,7 +1769,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeyTest) { key_set_id_.clear(); GenerateKeyRelease(key_set_id); key_set_id_ = key_set_id; - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); } TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeySessionUsageDisabledTest) { @@ -1777,7 +1788,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeySessionUsageDisabledTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); @@ -1795,7 +1806,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeySessionUsageDisabledTest) { CdmKeyMessage key_msg; GenerateKeyRelease(key_set_id, NULL, &key_msg); key_set_id_ = key_set_id; - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); SignedMessage signed_message; EXPECT_TRUE(signed_message.ParseFromString(key_msg)); @@ -1832,7 +1843,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseRetryOfflineKeyTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); @@ -1860,7 +1871,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseRetryOfflineKeyTest) { key_set_id_.clear(); GenerateKeyRelease(key_set_id); key_set_id_ = key_set_id; - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); } TEST_F(WvCdmRequestLicenseTest, ReleaseRetryL3OfflineKeyTest) { @@ -1902,7 +1913,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseRetryL3OfflineKeyTest) { decryptor_.OpenSession(g_key_system, &property_set, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline, &property_set); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); @@ -1930,7 +1941,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseRetryL3OfflineKeyTest) { key_set_id_.clear(); GenerateKeyRelease(key_set_id, &property_set, NULL); key_set_id_ = key_set_id; - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); } TEST_F(WvCdmRequestLicenseTest, ExpiryOnReleaseOfflineKeyTest) { @@ -1945,7 +1956,7 @@ TEST_F(WvCdmRequestLicenseTest, ExpiryOnReleaseOfflineKeyTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); @@ -1978,7 +1989,7 @@ TEST_F(WvCdmRequestLicenseTest, ExpiryOnReleaseOfflineKeyTest) { AllOf(Each(Pair(_, kKeyStatusExpired)), Not(IsEmpty())), false)); GenerateKeyRelease(key_set_id); key_set_id_ = key_set_id; - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); decryptor_.CloseSession(restore_session_id); } @@ -1997,7 +2008,7 @@ TEST_F(WvCdmRequestLicenseTest, AutomatedOfflineSessionReleaseTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); @@ -2031,7 +2042,7 @@ TEST_F(WvCdmRequestLicenseTest, AutomatedOfflineSessionReleaseTest) { open_sessions, QueryStatus(kLevelDefault, wvcdm::QUERY_KEY_NUMBER_OF_OPEN_SESSIONS)); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); EXPECT_EQ( --open_sessions, @@ -2042,12 +2053,12 @@ TEST_F(WvCdmRequestLicenseTest, StreamingLicenseRenewal) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); std::string license_server; GenerateRenewalRequest(kLicenseTypeStreaming, &license_server); if (license_server.empty()) license_server = g_license_server; - VerifyKeyRequestResponse(license_server, g_client_auth, true); + VerifyKeyRequestResponse(license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -2060,7 +2071,7 @@ TEST_F(WvCdmRequestLicenseTest, StreamingLicenseRenewalProhibited) { "08011a0d7769646576696e655f746573" // pssh data "74221073747265616d696e675f636c69703131"); GenerateKeyRequest(key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); std::string init_data; wvcdm::CdmAppParameterMap app_parameters; @@ -2083,12 +2094,12 @@ TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewal) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); std::string license_server; GenerateRenewalRequest(kLicenseTypeOffline, &license_server); if (license_server.empty()) license_server = g_license_server; - VerifyKeyRequestResponse(license_server, client_auth, true); + VerifyKeyRequestResponse(license_server, client_auth); decryptor_.CloseSession(session_id_); } @@ -2097,7 +2108,7 @@ TEST_F(WvCdmRequestLicenseTest, RemoveKeys) { kDefaultCdmIdentifier, NULL, &session_id_)); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); ASSERT_EQ(NO_ERROR, decryptor_.RemoveKeys(session_id_)); ASSERT_EQ(NO_ERROR, decryptor_.CloseSession(session_id_)); } @@ -2215,7 +2226,7 @@ TEST_P(WvCdmStreamingLicenseRenewalTest, WithClientId) { 0u, license_renewal.encrypted_client_id().encrypted_client_id().size()); } - VerifyKeyRequestResponse(license_server, g_client_auth, true); + VerifyKeyRequestResponse(license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -2356,7 +2367,7 @@ TEST_P(WvCdmOfflineLicenseReleaseTest, WithClientId) { 0u, license_release.encrypted_client_id().encrypted_client_id().size()); } - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); decryptor_.CloseSession(session_id_); } @@ -2411,7 +2422,7 @@ TEST_P(WvCdmUsageTest, WithClientId) { &property_set); std::string key_response; - VerifyKeyRequestResponse(g_license_server, g_client_auth, false, + VerifyKeyRequestResponse(g_license_server, g_client_auth, true, &key_response); // Validate signed license @@ -2514,7 +2525,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageInfoRetryTest) { "747265616d696e675f636c697033"); GenerateKeyRequest(key_id, kLicenseTypeStreaming, NULL); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyUsageKeyRequestResponse(g_license_server, g_client_auth); std::vector decrypt_buffer(data->encrypt_data.size()); CdmDecryptionParameters decryption_parameters( @@ -2603,7 +2614,7 @@ TEST_P(WvCdmUsageInfoTest, UsageInfo) { key_id.append(1, ch); GenerateKeyRequest(key_id, kLicenseTypeStreaming, property_set); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyUsageKeyRequestResponse(g_license_server, g_client_auth); std::vector decrypt_buffer(data->encrypt_data.size()); CdmDecryptionParameters decryption_parameters( @@ -2679,7 +2690,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageReleaseAllTest) { key_id.append(1, ch); GenerateKeyRequest(key_id, kLicenseTypeStreaming, &property_set); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyUsageKeyRequestResponse(g_license_server, g_client_auth); std::vector decrypt_buffer(data->encrypt_data.size()); CdmDecryptionParameters decryption_parameters( @@ -2746,7 +2757,7 @@ TEST_F(WvCdmRequestLicenseTest, QueryKeyStatus) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); CdmQueryMap query_info; CdmQueryMap::iterator itr; @@ -2980,7 +2991,7 @@ TEST_F(WvCdmRequestLicenseTest, QueryOemCryptoSessionId) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); CdmQueryMap query_info; CdmQueryMap::iterator itr; @@ -3068,7 +3079,7 @@ TEST_F(WvCdmRequestLicenseTest, SecurityLevelPathBackwardCompatibility) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); decryptor_.CloseSession(session_id_); @@ -3107,7 +3118,7 @@ TEST_F(WvCdmRequestLicenseTest, SecurityLevelPathBackwardCompatibility) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); decryptor_.CloseSession(session_id_); if (security_level != kSecurityLevelL1) return; @@ -3132,7 +3143,7 @@ TEST_F(WvCdmRequestLicenseTest, SecurityLevelPathBackwardCompatibility) { kDefaultCdmIdentifier, NULL, &session_id_)); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, client_auth, false); + VerifyKeyRequestResponse(g_license_server, client_auth); decryptor_.CloseSession(session_id_); } @@ -3140,7 +3151,7 @@ TEST_F(WvCdmRequestLicenseTest, DISABLED_OfflineLicenseDecryptionTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); /* // key 1, encrypted, 256b @@ -3194,7 +3205,7 @@ TEST_F(WvCdmRequestLicenseTest, DISABLED_RestoreOfflineLicenseDecryptionTest) { decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeOffline); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); CdmKeySetId key_set_id = key_set_id_; EXPECT_FALSE(key_set_id_.empty()); decryptor_.CloseSession(session_id_); @@ -3256,7 +3267,7 @@ TEST_F(WvCdmRequestLicenseTest, DISABLED_RestoreOfflineLicenseDecryptionTest) { TEST_F(WvCdmRequestLicenseTest, KeyControlBlockDecryptionTest) { decryptor_.OpenSession(g_key_system, &session_id_); GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); DecryptionData data; @@ -3322,7 +3333,7 @@ TEST_P(WvCdmSessionSharingTest, SessionSharingTest) { NULL, &session_id_); CdmSessionId gp_session_id_1 = session_id_; GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); // TODO(rfrias): Move content information to ConfigTestEnv std::string gp_client_auth2 = @@ -3336,7 +3347,7 @@ TEST_P(WvCdmSessionSharingTest, SessionSharingTest) { NULL, &session_id_); CdmSessionId gp_session_id_2 = session_id_; GenerateKeyRequest(gp_key_id2, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, gp_client_auth2, false); + VerifyKeyRequestResponse(g_license_server, gp_client_auth2); SubSampleInfo* data = session_sharing_info->sub_sample; std::vector decrypt_buffer(data->encrypt_data.size()); @@ -3381,7 +3392,7 @@ TEST_F(WvCdmRequestLicenseTest, SessionSharingTest) { NULL, &session_id_); CdmSessionId session_id1 = session_id_; GenerateKeyRequest(init_data1, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); // TODO(rfrias): Move content information to ConfigTestEnv std::string gp_client_auth2 = @@ -3395,7 +3406,7 @@ TEST_F(WvCdmRequestLicenseTest, SessionSharingTest) { NULL, &session_id_); CdmSessionId session_id2 = session_id_; GenerateKeyRequest(init_data2, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, gp_client_auth2, false); + VerifyKeyRequestResponse(g_license_server, gp_client_auth2); SubSampleInfo* data = &single_encrypted_sub_sample_short_expiry; @@ -3417,7 +3428,7 @@ TEST_F(WvCdmRequestLicenseTest, SessionSharingTest) { NULL, &session_id_); CdmSessionId session_id3 = session_id_; GenerateKeyRequest(init_data1, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); EXPECT_EQ(NO_ERROR, decryptor_.Decrypt(session_id1, data->validate_key_id, decryption_parameters)); @@ -3442,7 +3453,7 @@ TEST_F(WvCdmRequestLicenseTest, DecryptionKeyExpiredTest) { &session_id_); if (data->retrieve_key) { GenerateKeyRequest(kCpKeyId, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); } std::vector decrypt_buffer(data->encrypt_data.size()); @@ -3483,7 +3494,7 @@ TEST_F(WvCdmRequestLicenseTest, SessionKeyChangeNotificationTest) { "0801121030313233343536373839616263646566"); // pssh data GenerateKeyRequest(kCpKeyId, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -3498,7 +3509,7 @@ TEST_P(WvCdmDecryptionTest, DecryptionTest) { &session_id_); if (data->retrieve_key) { GenerateKeyRequest(g_key_id, kLicenseTypeStreaming); - VerifyKeyRequestResponse(g_license_server, g_client_auth, false); + VerifyKeyRequestResponse(g_license_server, g_client_auth); } uint32_t decrypt_sample_buffer_size = 0; @@ -3566,7 +3577,7 @@ TEST_F(WvCdmRequestLicenseTest, AddHlsStreamingKeyTest) { kLicenseTypeStreaming, NULL); //TODO(rfrias): Remove once we switch to git-on-borg std::string license_server = "https://proxy.uat.widevine.com/proxy"; - VerifyKeyRequestResponse(license_server, g_client_auth, false); + VerifyKeyRequestResponse(license_server, g_client_auth); decryptor_.CloseSession(session_id_); } @@ -3610,7 +3621,7 @@ TEST_P(WvHlsDecryptionTest, HlsDecryptionTest) { kLicenseTypeStreaming, NULL); //TODO(rfrias): Remove once we switch to git-on-borg std::string license_server = "https://proxy.uat.widevine.com/proxy"; - VerifyKeyRequestResponse(license_server, g_client_auth, false); + VerifyKeyRequestResponse(license_server, g_client_auth); CdmKeyStatusMap key_status_map = listener.GetKeyStatusMap(); EXPECT_EQ(1u, key_status_map.size()); KeyId key_id = key_status_map.begin()->first; @@ -3664,7 +3675,7 @@ TEST_P(WvHlsFourCCBackwardCompatibilityTest, HlsDecryptionTest) { kLicenseTypeStreaming, NULL); //TODO(rfrias): Remove once we switch to git-on-borg std::string license_server = "https://proxy.uat.widevine.com/proxy"; - VerifyKeyRequestResponse(license_server, g_client_auth, false); + VerifyKeyRequestResponse(license_server, g_client_auth); CdmKeyStatusMap key_status_map = listener.GetKeyStatusMap(); EXPECT_EQ(1u, key_status_map.size()); KeyId key_id = key_status_map.begin()->first;