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

@@ -19,12 +19,10 @@ fi
adb_shell_run() {
local test_file=$1
shift
if adb shell ls /data/bin/$test_file &> /dev/null; then
test_file=/data/bin/$test_file
if adb shell ls /data/widevine_tests/$test_file &> /dev/null; then
test_file=/data/widevine_tests/$test_file
else
echo "Please install the test on the device in /data/bin, "
echo "or begin execution by running ./build_and_run_all_unit_tests.sh"
exit 1
test_file=/vendor/bin/$test_file
fi
echo $test_file
local tmp_log="$OUT/mediadrmtest.log"
@@ -51,7 +49,7 @@ if [ -z "$ANDROID_BUILD_TOP" ]; then
fi
echo "waiting for device"
ADB_OUTPUT=`adb root && echo ". " && adb wait-for-device remount`
ADB_OUTPUT=`adb root && adb wait-for-device remount`
echo $ADB_OUTPUT
if echo $ADB_OUTPUT | grep -qi "verity"; then
echo
@@ -64,47 +62,31 @@ fi
# Disable DroidGuard to prevent provisioning collisions
set_droidguard disable
# Run oemcrypto tests first due to historical test order issues
adb_shell_run oemcrypto_test \
GTEST_FILTER="$GTEST_FILTER:*Level1Required" FORCE_LEVEL3_OEMCRYPTO=yes
adb_shell_run oemcrypto_test
# Run request_license_test next to ensure device is provisioned
adb_shell_run request_license_test
# cdm_extended_duration_test takes >30 minutes to run.
# adb_shell_run cdm_extended_duration_test
# cdm_feature_test to be run with modified/mock oemcrypto
# adb_shell_run cdm_feature_test
# Additional tests
adb_shell_run base64_test
adb_shell_run buffer_reader_test
adb_shell_run policy_engine_unittest
adb_shell_run policy_engine_constraints_unittest
adb_shell_run libwvdrmmediacrypto_test
adb_shell_run libwvdrmmediacrypto_hidl_test
adb_shell_run libwvdrmdrmplugin_test
adb_shell_run libwvdrmdrmplugin_hidl_test
adb_shell_run cdm_engine_test
adb_shell_run cdm_session_unittest
adb_shell_run counter_metric_unittest
adb_shell_run crypto_session_unittest
adb_shell_run device_files_unittest
adb_shell_run distribution_unittest
adb_shell_run event_metric_unittest
adb_shell_run file_store_unittest
adb_shell_run file_utils_unittest
adb_shell_run http_socket_test
adb_shell_run initialization_data_unittest
adb_shell_run libwvdrmdrmplugin_hidl_test
adb_shell_run libwvdrmdrmplugin_test
adb_shell_run libwvdrmmediacrypto_hidl_test
adb_shell_run libwvdrmmediacrypto_test
adb_shell_run license_keys_unittest
adb_shell_run license_unittest
adb_shell_run policy_engine_constraints_unittest
adb_shell_run policy_engine_unittest
adb_shell_run license_keys_unittest
adb_shell_run initialization_data_unittest
adb_shell_run device_files_unittest
adb_shell_run service_certificate_unittest
adb_shell_run timer_unittest
adb_shell_run usage_table_header_unittest
adb_shell_run value_metric_unittest
adb_shell_run wv_cdm_metrics_test
adb_shell_run buffer_reader_test
adb_shell_run distribution_test
adb_shell_run event_metric_test
# Run the non-Treble test on non-Treble devices
if adb shell ls /vendor/lib/mediadrm/libwvdrmengine.so &> /dev/null ||