Merges to android Pi release (part: 1)

Below are a set of CLs being merged from the wv cdm repo to the android repo.

* Fix handling of OEM Cert public key.

  Author: Srujan Gaddam <srujzs@google.com>

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

  This is a potential fix for b/36656190. Set aside public
  key on first call to get the public key, and use it afterwards.
  This gets rid of extra calls to OEMCrypto_GetOEMPublicCertificate(),
  which has side-effect of staging the OEM private key.

  This also fixes a problem where the public cert string was
  not being trimmed to match the size returned by
  OEMCrypto_GetOEMPublicCertificate().

* Complete provisioning request/response for Provisioning 3.0

  Author: Gene Morgan <gmorgan@google.com>

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

  Fix bug on provisioning request path where GenerateDerivedKeys()
  was being called when preparing to generate the signature.

  Add message signature verification, and call correct OEMCrypto
  routine to rewrap the private key (OEMCrypto_RewrapDeviceRSAKey30).

* Implement Cdm::deleteAllUsageRecords()

  Author: Gene Morgan <gmorgan@google.com>

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

  Delete all usage records for current origin.  Removes usage
  records from file system and retains the PSTs.  The deletes
  any usage entries matching those PSTs held by OEMCrypto.

  BUG: 35319024

* Remove stringencoders library from third_party.

  Author: Jacob Trimble <modmaker@google.com>

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

  We have a fork of the stringencoders library that we use for base64
  encoding.  This reimplements base64 encoding to remove the extra
  dependency and to reduce the amount of code.

* Add Cdm::deleteUsageRecord() based on key_set_id.

  Author: Gene Morgan <gmorgan@google.com>

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

  Delete specified usage record from file system usage info and
  from OEMCrypto.

  BUG: 35319024

* Modifiable OEMCrypto

  Author: Fred Gylys-Colwell <fredgc@google.com>

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

  This CL adds a new variant of the OEMCrypto mock code that adjusts its
  behavior based on a configuration file.  This is intended for
  testing.

  For example, a tester can set current_hdcp to 2 in the options.txt
  file, push it to the device, and verify that a license is granted for
  HDCP 2.0.  Then the tester can edit the value of current_hdcp to 1 and
  push the file to the device.  Playback should stop because the license
  is no longer valid.

  This variant uses a real level 1 liboemcrypto.so to push data to a
  secure buffer.  That means we can test playback for a license that
  requires secure buffers on an Android device with real secure buffers.

  BUG: 35141278
  BUG: 37353534

BUG: 71650075
Test: Not currently passing. Will be addressed in a subsequent
      commit in the chain.

Change-Id: I58443c510919e992bb455192e70373490a00e2b6
This commit is contained in:
Rahul Frias
2018-01-05 17:05:18 -08:00
parent e34f83cdce
commit 0419b55222
120 changed files with 5402 additions and 6827 deletions

View File

@@ -411,6 +411,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kInvalidParametersEng16;
case wvcdm::INVALID_PARAMETERS_ENG_17:
return kInvalidParametersEng17;
case wvcdm::INVALID_PARAMETERS_ENG_18:
return kInvalidParametersEng18;
case wvcdm::CERT_PROVISIONING_CLIENT_TOKEN_ERROR_1:
return kCertProvisioningClientTokenError1;
case wvcdm::CERT_PROVISIONING_CLIENT_TOKEN_ERROR_2:
@@ -431,8 +433,6 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kLoadUsageHeaderBadMagic;
case wvcdm::LOAD_USAGE_HEADER_UNKNOWN_ERROR:
return kLoadUsageHeaderUnknownError;
case wvcdm::INVALID_PARAMETERS_ENG_18:
return kInvalidParametersEng18;
case wvcdm::INSUFFICIENT_CRYPTO_RESOURCES_3:
return kInsufficientCryptoResources3;
case wvcdm::CREATE_USAGE_ENTRY_UNKNOWN_ERROR:
@@ -459,14 +459,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kMoveUsageEntryUnknownError;
case wvcdm::COPY_OLD_USAGE_ENTRY_UNKNOWN_ERROR:
return kCopyOldUsageEntryUnknownError;
case wvcdm::STORE_LICENSE_ERROR_4:
return kStoreLicenseError4;
case wvcdm::LIST_LICENSES_ERROR:
return kListLicensesError;
case wvcdm::INVALID_PARAMETERS_ENG_23:
return kInvalidParametersEng23;
case wvcdm::INVALID_PARAMETERS_ENG_24:
return kInvalidParametersEng24;
case wvcdm::USAGE_INFORMATION_SUPPORT_FAILED:
return kUsageInformationSupportFailed;
case wvcdm::USAGE_SUPPORT_GET_API_FAILED:
@@ -493,20 +487,22 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kUsageStoreUsageInfoFailed;
case wvcdm::USAGE_INVALID_LOAD_ENTRY:
return kUsageInvalidLoadEntry;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_4:
return kReleaseAllUsageInfoError4;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_5:
return kReleaseAllUsageInfoError5;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_6:
return kReleaseAllUsageInfoError6;
case wvcdm::RELEASE_USAGE_INFO_FAILED:
return android::ERROR_DRM_TAMPER_DETECTED;
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_1:
return kIncorrectUsageSupportType1;
case wvcdm::INCORRECT_USAGE_SUPPORT_TYPE_2:
return kIncorrectUsageSupportType2;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_3:
return kReleaseAllUsageInfoError3;
case wvcdm::RELEASE_ALL_USAGE_INFO_ERROR_4:
return kReleaseAllUsageInfoError4;
case wvcdm::NO_USAGE_ENTRIES:
return kNoUsageEntries;
case wvcdm::LIST_LICENSE_ERROR_1:
return kListLicenseError1;
case wvcdm::LIST_LICENSE_ERROR_2:
return kListLicenseError2;
case wvcdm::LIST_USAGE_ERROR_1:
return kListUsageError1;
case wvcdm::LIST_USAGE_ERROR_2:
@@ -517,22 +513,6 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kDeleteUsageError2;
case wvcdm::DELETE_USAGE_ERROR_3:
return kDeleteUsageError3;
case wvcdm::PRIVACY_MODE_ERROR_1:
return kPrivacyModeError1;
case wvcdm::PRIVACY_MODE_ERROR_2:
return kPrivacyModeError2;
case wvcdm::PRIVACY_MODE_ERROR_3:
return kPrivacyModeError3;
case wvcdm::EMPTY_RESPONSE_ERROR_1:
return kEmptyResponseError1;
case wvcdm::PARSE_RESPONSE_ERROR_1:
return kParseResponseError1;
case wvcdm::PARSE_RESPONSE_ERROR_2:
return kParseResponseError2;
case wvcdm::PARSE_RESPONSE_ERROR_3:
return kParseResponseError3;
case wvcdm::PARSE_RESPONSE_ERROR_4:
return kParseResponseError4;
case wvcdm::UNUSED_1:
case wvcdm::UNUSED_2: