From fce75c295b6243d2d753e290475173a1cc730f9c Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Mon, 29 Apr 2019 14:04:53 -0700 Subject: [PATCH] Call SelectKey regardless of entitled key mapping Bug: b/129426820 Test: CE CDM, Android unit/integration, Linux, ExoPlayer key rotation playback with modmock and L3 Merge of http://go/wvgerrit/77608 http://go/ag/6543431 modified the entitlement key session to select the entitled content key if it had just been loaded in so that there's a valid current content key loaded in OEMCrypto. However, this did not account for the case where you have two entitlement to entitled key pairs. If OEMCrypto does not select the key when you switch from the first pair to the second pair back to the first pair, OEMCrypto will still be using the key from the second pair during decrypt. This CL changes it so we SelectKey each time to make sure that we update the current content key. Change-Id: I764ec13deb87e14188707b811a44eff132eeb5a1 --- libwvdrmengine/cdm/core/src/entitlement_key_session.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libwvdrmengine/cdm/core/src/entitlement_key_session.cpp b/libwvdrmengine/cdm/core/src/entitlement_key_session.cpp index 504a6b05..a671d397 100644 --- a/libwvdrmengine/cdm/core/src/entitlement_key_session.cpp +++ b/libwvdrmengine/cdm/core/src/entitlement_key_session.cpp @@ -75,11 +75,8 @@ OEMCryptoResult EntitlementKeySession::SelectKey(const std::string& key_id, current_loaded_content_keys_[entitled_content_key.entitlement_key_id()] = key_id; - - return ContentKeySession::SelectKey(key_id, cipher_mode); - } else { - return OEMCrypto_SUCCESS; } + return ContentKeySession::SelectKey(key_id, cipher_mode); } OEMCrypto_EntitledContentKeyObject EntitlementKeySession::MakeOecEntitledKey(