Merge from Widevine repo of http://go/wvgerrit/41834 Key rotation is not yet supported. The key statuses are updated from a license. The mechanism expects content keys tro come in a license. For entitlement licenses, the content keys come in the init_data. This code does not yet support the key rotation event. (A new pssh with wrapped keys is a passed to the cdm) The policy engine/key status mechanism needs to be updated to handle updated from the init_data. For now, the cdm builds a license with a key container with the content keys and used that to call PolicyEngine::SetLicense to setup the policy engine and key statuses. Bug: 64003606 Bug: 70334840 Test: In child CL Change-Id: Ibf46a18f5321cab4ff6f1778ba30527942c8021f
46 lines
1.7 KiB
C++
46 lines
1.7 KiB
C++
#ifndef WVCDM_CORE_KEY_SESSSION_H_
|
|
#define WVCDM_CORE_KEY_SESSSION_H_
|
|
|
|
#include "metrics_collections.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
class CryptoKey;
|
|
|
|
class KeySession {
|
|
protected:
|
|
KeySession(metrics::CryptoMetrics* metrics) : metrics_(metrics) {}
|
|
|
|
public:
|
|
typedef enum { kDefault, kSubLicense, kEntitlement } KeySessionType;
|
|
virtual ~KeySession() {}
|
|
virtual KeySessionType Type() = 0;
|
|
virtual bool GenerateDerivedKeys(const std::string& message) = 0;
|
|
virtual bool GenerateDerivedKeys(const std::string& message,
|
|
const std::string& session_key) = 0;
|
|
virtual OEMCryptoResult LoadKeys(const std::string& message,
|
|
const std::string& signature,
|
|
const std::string& mac_key_iv,
|
|
const std::string& mac_key,
|
|
const std::vector<CryptoKey>& keys,
|
|
const std::string& provider_session_token,
|
|
CdmCipherMode* cipher_mode,
|
|
const std::string& srm_requirement) = 0;
|
|
virtual OEMCryptoResult LoadEntitledContentKeys(
|
|
const std::vector<CryptoKey>& keys) = 0;
|
|
virtual OEMCryptoResult SelectKey(const std::string& key_id,
|
|
CdmCipherMode cipher_mode) = 0;
|
|
virtual OEMCryptoResult Decrypt(
|
|
const CdmDecryptionParameters& params,
|
|
OEMCrypto_DestBufferDesc& buffer_descriptor,
|
|
OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor) = 0;
|
|
|
|
protected:
|
|
metrics::CryptoMetrics* metrics_;
|
|
};
|
|
|
|
typedef std::map<std::string, CryptoSessionId> SubLicenseSessionMap;
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // WVCDM_CORE_KEY_SESSSION_H_
|