am c28be299: Avoid multiple loads of Device RSA private key

* commit 'c28be299dc6579f29eb6c3872699232cc14bcf8c':
  Avoid multiple loads of Device RSA private key
This commit is contained in:
Jeff Tinker
2013-09-20 11:21:51 -07:00
committed by Android Git Automerger
2 changed files with 8 additions and 2 deletions

View File

@@ -120,6 +120,7 @@ class CdmSession {
// Used for certificate based licensing
std::string wrapped_key_;
bool is_certificate_loaded_;
std::set<WvCdmEventListener*> listeners_;

View File

@@ -31,7 +31,8 @@ CdmSession::CdmSession(const CdmClientPropertySet* cdm_client_property_set)
crypto_session_(NULL),
license_received_(false),
reinitialize_session_(false),
license_type_(kLicenseTypeStreaming) {
license_type_(kLicenseTypeStreaming),
is_certificate_loaded_(false) {
if (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 (!crypto_session_->LoadCertificatePrivateKey(wrapped_key_)) {
if (is_certificate_loaded_ ||
crypto_session_->LoadCertificatePrivateKey(wrapped_key_)) {
is_certificate_loaded_ = true;
}
else {
reinitialize_session_ = true;
return NEED_PROVISIONING;
}