Avoid multiple loads of Device RSA private key
Molly reports OEMCrypto errors when Device RSA private key is loaded a second time in the same session. This occurs in privacy mode when a service certificate is request and later a key request is generated. bug: 10815492 Merge of https://widevine-internal-review.googlesource.com/#/c/7823/ from Widevine cdm repo Change-Id: I98999fb0e77597109b68c379eaaa4838d3f6dde4
This commit is contained in:
@@ -120,6 +120,7 @@ class CdmSession {
|
|||||||
|
|
||||||
// Used for certificate based licensing
|
// Used for certificate based licensing
|
||||||
std::string wrapped_key_;
|
std::string wrapped_key_;
|
||||||
|
bool is_certificate_loaded_;
|
||||||
|
|
||||||
std::set<WvCdmEventListener*> listeners_;
|
std::set<WvCdmEventListener*> listeners_;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ CdmSession::CdmSession(const CdmClientPropertySet* cdm_client_property_set)
|
|||||||
crypto_session_(NULL),
|
crypto_session_(NULL),
|
||||||
license_received_(false),
|
license_received_(false),
|
||||||
reinitialize_session_(false),
|
reinitialize_session_(false),
|
||||||
license_type_(kLicenseTypeStreaming) {
|
license_type_(kLicenseTypeStreaming),
|
||||||
|
is_certificate_loaded_(false) {
|
||||||
if (cdm_client_property_set) {
|
if (cdm_client_property_set) {
|
||||||
Properties::AddSessionPropertySet(session_id_, cdm_client_property_set);
|
Properties::AddSessionPropertySet(session_id_, cdm_client_property_set);
|
||||||
}
|
}
|
||||||
@@ -161,7 +162,11 @@ CdmResponseType CdmSession::GenerateKeyRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Properties::use_certificates_as_identification()) {
|
if (Properties::use_certificates_as_identification()) {
|
||||||
if (!crypto_session_->LoadCertificatePrivateKey(wrapped_key_)) {
|
if (is_certificate_loaded_ ||
|
||||||
|
crypto_session_->LoadCertificatePrivateKey(wrapped_key_)) {
|
||||||
|
is_certificate_loaded_ = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
reinitialize_session_ = true;
|
reinitialize_session_ = true;
|
||||||
return NEED_PROVISIONING;
|
return NEED_PROVISIONING;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user