Refactoring to cache service certs and initialization data

* Extend CdmLicense's stored_init_data_

  [ Merge of http://go/wvgerrit/14661 ]

  CdmLicense will store init data when a server cert must be
  provisioned.  After provisioning, the original init data can be used
  to generate the originally-intended license request.

  To do this before, the caller had to call CdmSession's
  GenerateKeyRequest with an empty InitializationData object.  However,
  the init data's type still had to be set, as did the license type.

  This CL allows the caller to use a truly empty InitializationData
  without a type.  To permit this, CdmLicense now stores a full
  InitializationData object, rather than just a copy of it's data field.

  With this CL, the caller also avoid storing the original license type.
  To accomplish this, CdmSession uses the already-set is_offline_ and
  is_release_ flags from the original call to reconstruct the intended
  license type.  The caller uses the new type kLicenseTypeDeferred.

  To facilitate storing whole InitializationData objects, they are now
  copyable.

  This ultimately simplifies server cert code for the new CE CDM.

* Store service certs in Properties

  [ Merge of http://go/wvgerrit/14664 ]

  This allows CE devices to mimic the Chrome CDM's behavior of sharing
  server certs between sessions.

  This also affects Android behavior.  Previously, provisioned service
  certificates were per-session, while explicitly-set service certs
  were per-DRM-plugin.  Now, both are per-DRM-plugin.

  A DRM plugin is associated with a mediaDrm object. Content
  providers will still be able to retrieve and use different
  certificates. The change here requires an app, that wishes to use
  different provisioned service certificates will have to use
  multiple mediaDrm objects. This is an unlikely scenario.

Change-Id: If2586932784ed046ecab72b5720ff30547e84b97
This commit is contained in:
Rahul Frias
2015-09-30 09:48:07 -07:00
parent 9dd196e0ec
commit 85da7bdb98
19 changed files with 162 additions and 104 deletions

View File

@@ -317,8 +317,6 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kInvalidParametersLic3;
case wvcdm::INVALID_PARAMETERS_LIC_4:
return kInvalidParametersLic4;
case wvcdm::INVALID_PARAMETERS_LIC_5:
return kInvalidParametersLic5;
case wvcdm::INVALID_PARAMETERS_LIC_6:
return kInvalidParametersLic6;
case wvcdm::INVALID_PARAMETERS_LIC_7:
@@ -347,10 +345,12 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kLicenseRenewalProhibited;
case wvcdm::UNKNOWN_ERROR:
return android::ERROR_DRM_UNKNOWN;
case wvcdm::UNUSED_1:
return android::UNKNOWN_ERROR;
case wvcdm::SECURE_BUFFER_REQUIRED:
return android::ERROR_DRM_CANNOT_HANDLE;
case wvcdm::UNUSED_1:
case wvcdm::UNUSED_2:
case wvcdm::UNUSED_3:
return android::UNKNOWN_ERROR;
}
// Return here instead of as a default case so that the compiler will warn