bug: 8601053
This import syncs to the widevine git repository change
commit 6a99ad1b59ad39495f62954b3065ddc22b78da49
It includes the following changes from the widevine git
repository, which complete the jb-mr2 features
Fix Unit Test Makefile
Adds support for device certificate provisioning.
Support application parameters
Certificate based licensing
Proto for client files
Implement Property Query API
Add Device Query For Unique ID
Implement Generic Crypto in DrmEngine
Do not validate Key IDs on clear playback
Allow OEMCrypto_DecryptCTR with clear content and no key
Add a case to the MediaDrm API test to repro b/8594163
Implement requiresSecureDecoderComponent
Implement Eventing API
Add end-to-end decryption test with vectors
Refactoring of properties class
Refactor OEMCrypto unittest.
Fix for b/8567853: License renewal doesn't renew license.
Add KEY_ERROR callback to WvContentDecryptionModule() ctor.
Merged certificate_provisioning.proto and
client_identification.proto to license_protocol.proto.
Fix nonce check failure after a malformed key in OEC Mock.
asynchronize decryption
Allow querying of control information
make debugging AddKey & Decrypt statuses easier
Revert "Revert "Send KEY_ERROR event to app on license
expiration or failure""
Revert "Send KEY_ERROR event to app on license expiration
or failure"
Send KEY_ERROR event to app on license expiration or failure
remove extra session id copy
use KeyError constants directly
replace variable-length arrays with std::vector and fixed-sized array
pass session ids as const references
refactor key extraction and update keys on renewal
Updates to enable renewals and signaling license expiration.
fix error constant in OEMCrypto_DecryptCTR
Change-Id: I5f7236c7bdff1d5ece6115fd2893f8a1e1e07c50
89 lines
3.2 KiB
C++
89 lines
3.2 KiB
C++
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
|
|
#ifndef CDM_BASE_WV_CONTENT_DECRYPTION_MODULE_H_
|
|
#define CDM_BASE_WV_CONTENT_DECRYPTION_MODULE_H_
|
|
|
|
#include "wv_cdm_types.h"
|
|
|
|
#include "utils/UniquePtr.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
class CdmEngine;
|
|
class WvCdmEventListener;
|
|
|
|
class WvContentDecryptionModule {
|
|
public:
|
|
WvContentDecryptionModule();
|
|
virtual ~WvContentDecryptionModule();
|
|
|
|
// Session related methods
|
|
virtual CdmResponseType OpenSession(const CdmKeySystem& key_system,
|
|
CdmSessionId* session_id);
|
|
virtual CdmResponseType CloseSession(const CdmSessionId& session_id);
|
|
|
|
// Construct a valid license request.
|
|
virtual CdmResponseType GenerateKeyRequest(const CdmSessionId& session_id,
|
|
const CdmInitData& init_data,
|
|
const CdmLicenseType license_type,
|
|
CdmAppParameterMap& app_parameters,
|
|
CdmKeyMessage* key_request);
|
|
|
|
// Accept license response and extract key info.
|
|
virtual CdmResponseType AddKey(const CdmSessionId& session_id,
|
|
const CdmKeyResponse& key_data);
|
|
|
|
// Cancel session
|
|
virtual CdmResponseType CancelKeyRequest(const CdmSessionId& session_id);
|
|
|
|
// Query system information
|
|
virtual CdmResponseType QueryStatus(CdmQueryMap* key_info);
|
|
|
|
// Query license information
|
|
virtual CdmResponseType QueryKeyStatus(const CdmSessionId& session_id,
|
|
CdmQueryMap* key_info);
|
|
|
|
// Query session control information
|
|
virtual CdmResponseType QueryKeyControlInfo(const CdmSessionId& session_id,
|
|
CdmQueryMap* key_info);
|
|
|
|
// Provisioning related methods
|
|
virtual CdmResponseType GetProvisioningRequest(
|
|
CdmProvisioningRequest* request,
|
|
std::string* default_url);
|
|
|
|
virtual CdmResponseType HandleProvisioningResponse(
|
|
CdmProvisioningResponse& response);
|
|
|
|
// Secure stop related methods
|
|
virtual CdmResponseType GetSecureStops(CdmSecureStops* secure_stops);
|
|
virtual CdmResponseType ReleaseSecureStops(
|
|
const CdmSecureStopReleaseMessage& message);
|
|
|
|
// Accept encrypted buffer and return decrypted data.
|
|
virtual CdmResponseType Decrypt(const CdmSessionId& session_id,
|
|
bool is_encrypted,
|
|
const KeyId& key_id,
|
|
const uint8_t* encrypt_buffer,
|
|
size_t encrypt_length,
|
|
const std::vector<uint8_t>& iv,
|
|
size_t block_offset,
|
|
void* decrypt_buffer);
|
|
|
|
// Event listener related methods
|
|
virtual bool AttachEventListener(const CdmSessionId& session_id,
|
|
WvCdmEventListener* listener);
|
|
virtual bool DetachEventListener(const CdmSessionId& session_id,
|
|
WvCdmEventListener* listener);
|
|
private:
|
|
|
|
// instance variables
|
|
UniquePtr<CdmEngine> cdm_engine_;
|
|
|
|
CORE_DISALLOW_COPY_AND_ASSIGN(WvContentDecryptionModule);
|
|
};
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // CDM_BASE_WV_CONTENT_DECRYPTION_MODULE_H_
|