Separate key session SelectKey methods
Test: CE CDM tests, Android unit/integration tests Bug: b/124773017 Merge of http://go/wvgerrit/73144 Since OEMCrypto supports one content key per entitlement key, LoadEntitledContentKeys must be called every time we want to select a key. EntitlementKeySession::SelectKey calls ContentKeySession::SelectKey after loading the keys, which caches the key id from the previous call, and if the key id hasn't changed, doesn't call SelectKey. This caching is fine for content keys since we don't call LoadKeys every time, but not fine for entitled keys since we do call LoadEntitledContentKeys every time. So, we instead cache the current content key id per entitlement key and only call LoadEntitledContentKeys and SelectKey if the entitled content key id changes. Furthermore, the test HandlesKeyRotationWithOnlyOneLicenseRequest is modified to complete multiple decrypts per key to test this behavior. Change-Id: I9d0d94e49da0fe1965beadbddec99d8dff744d73
This commit is contained in:
@@ -44,7 +44,10 @@ class EntitlementKeySession : public ContentKeySession {
|
||||
OEMCrypto_EntitledContentKeyObject MakeOecEntitledKey(
|
||||
const CryptoKey& input_key, std::string& message);
|
||||
|
||||
std::map<std::string, CryptoKey> entitled_keys_;
|
||||
// Find the CryptoKey for the given entitled content key id.
|
||||
std::map<KeyId, CryptoKey> entitled_keys_;
|
||||
// Find the current entitled content key id for the given entitlement key id.
|
||||
std::map<KeyId, KeyId> current_loaded_content_keys_;
|
||||
};
|
||||
|
||||
} // namespace wvcdm
|
||||
|
||||
Reference in New Issue
Block a user