Commit Graph

2795 Commits

Author SHA1 Message Date
Srujan Gaddam
5064731d02 Remove call to DeriveKeys for release
Merge of http://go/wvgerrit/45520/

Bug: b/70650789

Test: request_license_tests and GTS tests on sailfish and taimen

This is related to b/70650789. An extra call to DeriveKeysFromSessionKey
in the case where there is a provider session token results in the
OEMCrypto mock incorrectly using the derived mac keys to sign the release
message, since a future call to LoadKeys is never called.
2018-03-29 10:37:09 -07:00
John W. Bruce
f73b67c1a8 Load Certificate to Confirm Provisioning am: db0911df54
am: c96cb92fd4

Change-Id: Iba298ae3f751cbcd2dd0321d46470df981cf22bf
2018-03-29 04:39:45 +00:00
John W. Bruce
c96cb92fd4 Load Certificate to Confirm Provisioning
am: db0911df54

Change-Id: I1f6170281f2b6ec950b80f2d1e8f368bed20773d
2018-03-29 01:58:08 +00:00
John W. Bruce
db0911df54 Load Certificate to Confirm Provisioning
(This is a merge of http://go/wvgerrit/46203)

Previously, IsProvisioned() only confirmed the existence of a
certificate file, not whether the contents of that file were actually
valid. This patch changes its behavior so that it actually validates the
loadability of the file before returning.

This is sufficient to resolve Netflix's use case in b/65835227, but it
is only part of the solution for Android's use case in b/72353451. A
second patch will be required to cover cases where the certificate can
be loaded but cannot be used with the current OEMCrypto or with the
server.

Bug: 65835227
Bug: 72353451
Test: Android and CE CDM unit tests
Change-Id: Id3987a6f3c4097d7d356dfa631b023287354439a
2018-03-28 03:33:02 -07:00
Adam Stone
316d2ad9b3 Fixes widevine metrics proto serialization am: b19f0d106f
am: 07155523d6

Change-Id: Id2a427bb3f6feaceed4565e2e07d3b52b03af384
2018-03-26 17:40:48 +00:00
Adam Stone
07155523d6 Fixes widevine metrics proto serialization
am: b19f0d106f

Change-Id: Ie8d42f96590f63bfebb3f517061d4189e30d5910
2018-03-26 17:36:42 +00:00
Adam Stone
b19f0d106f Fixes widevine metrics proto serialization
Changes to a much more efficient and more reusable protobuf format for
metrics.

Test: Widevine tests, Google Play and MediaDrm CTS test.
Bug: 73724218

Change-Id: I3299051d7a16bcd7758c8f272415ca40e10c1313
2018-03-22 16:36:18 -07:00
Rahul Frias
0fdcae660c Merge changes I04ac8224,Iee6e60b9 into pi-dev am: efc008c5a1
am: 5fffcd79b6

Change-Id: I09c240546983229de5f01b6400e5628caf3a6509
2018-03-16 23:26:28 +00:00
Rahul Frias
5fffcd79b6 Merge changes I04ac8224,Iee6e60b9 into pi-dev
am: efc008c5a1

Change-Id: Ia64a9ffd7c5ca5a1a5a5e41e13c37371ae2fe7d0
2018-03-16 23:13:40 +00:00
Rahul Frias
efc008c5a1 Merge changes I04ac8224,Iee6e60b9 into pi-dev
* changes:
  Secure stop API related changes
  Rename ReleaseAllUsageInfo to RemoveAllUsageInfo
2018-03-16 22:52:06 +00:00
John W. Bruce
bf8f938966 Merge "Sync Android CDM Version with OEMCrypto" into pi-dev am: d24ff56def
am: a5392a3986  -s ours

Change-Id: I6235109e95365a2d2e1a329a23a14e617c380686
2018-03-16 20:12:52 +00:00
John W. Bruce
a5392a3986 Merge "Sync Android CDM Version with OEMCrypto" into pi-dev
am: d24ff56def

Change-Id: I7c0011472807addc3887b2bb467da7c6cfed3696
2018-03-16 19:53:26 +00:00
Rahul Frias
29a99099a8 Disable UsageOverflowTest am: a6e8a38c20
am: 8a9db7350d

Change-Id: If0e7b2203bb8ab9cc98a382cd6158718b435c112
2018-03-16 19:52:43 +00:00
TreeHugger Robot
d24ff56def Merge "Sync Android CDM Version with OEMCrypto" into pi-dev 2018-03-16 19:37:51 +00:00
Rahul Frias
8a9db7350d Disable UsageOverflowTest
am: a6e8a38c20

Change-Id: I8fd1ee9264226b9fb819a427ff75c7c42ab387d9
2018-03-16 19:30:16 +00:00
Rahul Frias
a6e8a38c20 Disable UsageOverflowTest
[ Merge of http://go/wvgerrit/45661 ]

This test was written to verify that the last 50 entries were maintained
by the usage table (OEMCrypto v9-11). With OEMCrypto v13+, that limit has
been removed and this is no longer an appropriate test. I have
disabled the test for now and will replace/rewrite with one
appropriate for big usage tables.

Bug: 30022298
Test: Ran cdm_extended_duration_tests
Change-Id: I23d54bb57c92b391f80817945626898fd590078f
2018-03-16 00:36:37 -07:00
John W. Bruce
376b96512f Sync Android CDM Version with OEMCrypto
(This is a cherry-pick of http://go/ag/3684977 that got left behind when
pi-dev was branched.)

The various Shared Source CDM groups have agreed on a more unified
version numbering scheme. Henceforth, the pattern for the version number
will be:

<max-oemcrypto-version-supported>.<minor-version>.<patch-version>

Where "minor-version" and "patch-version" are incremented independently
at the discretion of each CDM product.

This patch updates the version number for the Android CDM to match the
new scheme and updates the relevant tests.

Bug: 73090259
Test: request_license_test --gtest_filter=VersionNumberTest.*
Merged-In: Idcead5d92565dd549aa35565da632f01abb9e513
Change-Id: Idcead5d92565dd549aa35565da632f01abb9e513
2018-03-15 13:21:13 -07:00
Rahul Frias
4ba82e4585 Secure stop API related changes
[ Merge of http://go/wvgerrit/44921 ]

* Added the ability to remove a single usage information record.
* Added a method to retrieve all secure stop Ids.

Bug: 69674645
Test: WV unit, integration tests
Change-Id: I04ac8224b4bdda69541e61ff1103af3836138228
2018-03-14 15:24:10 -07:00
Jeff Tinker
f425d23132 Remove error code INVALID_QUERY_STATUS am: 6a4abc15fe
am: db3d773db6

Change-Id: I1a7a1a52114eb43c7db5270e144ef81ff9e9ea8e
2018-03-14 19:09:37 +00:00
Jeff Tinker
db3d773db6 Remove error code INVALID_QUERY_STATUS
am: 6a4abc15fe

Change-Id: Ib7c8bcf5e60e7bfd4828dd8846ca1c72f04ccfdc
2018-03-14 18:52:33 +00:00
Rahul Frias
1d9a16c3b9 Rename ReleaseAllUsageInfo to RemoveAllUsageInfo
[ Merge of http://go/wvgerrit/44920 ]

Bug: 69674645
Test: WV unit and integration tests
Change-Id: Iee6e60b9dd20a8ed087c5e44924aa1c05f640920
2018-03-14 11:34:05 -07:00
Jeff Tinker
6a4abc15fe Remove error code INVALID_QUERY_STATUS
CdmEngine::QueryStatus was mapping all error codes
returned from crypto_session.Open to INVALID_QUERY_STATUS
which caused important failure information to be lost.
The GTS DrmSessionManagerTest test was failing as a
result, because session reclaiming no longer worked.

merge of http://go/wvgerrit/44800

bug:72705384
test:gts DrmSessionManagerTest

Change-Id: Id404a18b8f66cf6137b69f6b4e1bdd7004706a0c
(cherry picked from commit 6aad0f77cb)
2018-03-12 23:38:04 +00:00
Kyle Alexander
cb117f6d40 Add missing unit tests to device tests.zip package am: 66977c3cab
am: 4ac558aec3

Change-Id: Ic3084dcfbcba4860be58f696fca7fe2696930179
2018-03-09 23:39:34 +00:00
Kyle Alexander
4ac558aec3 Add missing unit tests to device tests.zip package
am: 66977c3cab

Change-Id: I1efff5749831a6d5395863678fa85db51e99322c
2018-03-09 21:12:05 +00:00
Kyle Alexander
66977c3cab Add missing unit tests to device tests.zip package
Need to add missing unit tests to the test package so that
they will be available to the tradefed-based ATP test platform.

Test: lunch sailfish-userdebug, make
      check out/.../tests.zip package for missing files.

Bug: 74028858
Change-Id: I009751ea8fe7aed48bcdd92ac9bcc050e48ce666
2018-03-07 15:57:08 -08:00
John Bruce
ac033b0b77 Merge "Sync Android CDM Version with OEMCrypto" 2018-03-06 23:28:51 +00:00
TreeHugger Robot
b93c900dc9 Merge "Remove error code INVALID_QUERY_STATUS" 2018-03-06 08:15:12 +00:00
Jeff Tinker
6aad0f77cb Remove error code INVALID_QUERY_STATUS
CdmEngine::QueryStatus was mapping all error codes
returned from crypto_session.Open to INVALID_QUERY_STATUS
which caused important failure information to be lost.
The GTS DrmSessionManagerTest test was failing as a
result, because session reclaiming no longer worked.

merge of http://go/wvgerrit/44800

bug:72705384
test:gts DrmSessionManagerTest

Change-Id: Id404a18b8f66cf6137b69f6b4e1bdd7004706a0c
2018-03-05 14:49:43 -08:00
John W. Bruce
9e632c3b19 Sync Android CDM Version with OEMCrypto
(This is a merge from http://go/wvgerrit/44680 in the Widevine repo.)

The various Shared Source CDM groups have agreed on a more unified
version numbering scheme. Henceforth, the pattern for the version number
will be:

<max-oemcrypto-version-supported>.<minor-version>.<patch-version>

Where "minor-version" and "patch-version" are incremented independently
at the discretion of each CDM product.

This patch updates the version number for the Android CDM to match the
new scheme and updates the relevant tests.

Bug: 73090259
Test: request_license_test --gtest_filter=VersionNumberTest.*
Change-Id: Idcead5d92565dd549aa35565da632f01abb9e513
2018-03-02 17:35:15 -08:00
Fred Gylys-Colwell
5bd4dbb502 Use license.widevine.com cert for provisioning server
Merge from Widevine repo of http://go/wvgerrit/44505

This CL changes the certificate provisioning code to verify the
provisioning message using a cert from license.widevine.com instead of
the staging certificate.

It also adjusts the certificates in config_test_env.cpp because the
license and provisioning servers are different and may probably have
different certs.

bug: 73031756
test: unit tests with mock oemcrypto, and read oemcrypto on sailfish
Change-Id: I4b457a369a49ef07bda9e5632ab59e5f621ec966
2018-03-02 14:36:42 -08:00
Srujan Gaddam
9acc38df40 Turn off erroneous tool for L3 obfuscation
Merge of http://go/wvgerrit/44508

b/73893009

Test: Unit/integration tests

One of the tools in Caligo (fix_constants) led to segfaults in the x86
build when creating usage table headers and in OEMCrypto_Terminate.
This file removes that level of obfuscation temporarily until the
problem is fixed.
2018-03-01 13:43:48 -08:00
TreeHugger Robot
1ca7b6aeef Merge "Disable v14 unit test for Pi" 2018-03-01 01:04:16 +00:00
Fred Gylys-Colwell
f1f88f529e Disable v14 unit test for Pi
Merge from Widevine repo of http://go/wvgerrit/44502

OEMCrypto v14 is no longer required for Pi, so this CL disables the
unit test verifying that version.  The test will be re-enabled for
MR1.

test: unit tests
bug: 74003607
Change-Id: I76f9b66e1652ffb1f8a5bfc7be572e3c7a4cff83
2018-02-28 15:27:14 -08:00
Edwin Wong
328cdd0e3a Merge "Do not install move_widevine_data.sh in new devices." 2018-02-28 00:01:32 +00:00
Anton Hansson
fe7ca1ad87 vendor/widevine: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I1c0366e78fb44f06bc07329866440097275f5b51
2018-02-27 18:58:17 +00:00
Edwin Wong
0fa3ae72be Do not install move_widevine_data.sh in new devices.
Merged from http://go/wvgerrit/44312

The move script is only needed for existing devices that
are running Widevine DRM and are upgrading to Pi or later
Android releases. New devices release with Pi and future
Android releases do not need to run this script.

To run this script, vendor must add the dependency to the
corresponding device makefile and build from ANDROID_ROOT.

For example:
  PRODUCT_PACKAGES += \
      android.hardware.drm@1.0-impl \
      android.hardware.drm@1.0-service \
      android.hardware.drm@1.0-service.widevine \
      move_widevine_data.sh

In addition, vendor needs to update device SELinux policy.

Test: Upgrade from O-MR1 to Pi, Netflix & Play Movies
  can play back offline content downloaded in O-MR1

Test: adb shell to verify script is in /system/bin

Test: adb shell to verify widevine data is moved to
/data/vendor/mediadrm

Test: use audit2allow to verify no avc:denied for widevine drm service

bug: 73656300
Change-Id: I7ad0dfcc0e490f4c018b6a17df6313fade89937f
2018-02-27 08:57:53 -08:00
TreeHugger Robot
b6729a0b14 Merge "Adjust nonce flood rate in mock oemcrypto" 2018-02-26 23:08:09 +00:00
TreeHugger Robot
a617065987 Merge "Adjust cdm engine test response to nonce flood" 2018-02-26 23:06:18 +00:00
Paul Duffin
00f28599b9 Add uses-library for org.apache.http.legacy
The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* libwvdrmengine/test/castv2/AndroidManifest.xml
    Add uses-library for org.apache.http.legacy because CastSignAPITest
    depends on org.apache.http.legacy library at build time so
    presumably needs it to be provided at runtime. Unfortunately,
    CastSignAPITest targets P and from P onwards the
    org.apache.http.legacy library is only provided when explicitly
    requested through the manifest.

* libwvdrmengine/test/java/AndroidManifest.xml
    Add uses-library for org.apache.http.legacy because MediaDrmAPITest
    depends on org.apache.http.legacy library at build time so
    presumably needs it to be provided at runtime. Unfortunately,
    MediaDrmAPITest targets P and from P onwards the
    org.apache.http.legacy library is only provided when explicitly
    requested through the manifest.

Bug: 72375096
Bug: 18027885
Test:  make checkbuild
Change-Id: I3a761a693918fd506ace26fd7c3502a2a42c031d
2018-02-23 14:55:50 +00:00
Fred Gylys-Colwell
d2c384f619 Adjust cdm engine test response to nonce flood
Merge from Widevine repo of http://go/wvgerrit/43720

This CL changes the cdm engine test's Provision method so that it
keeps OEMCrypto alive during the provisioning.  This is only needed
when testing with the oemcrypto mock and the nonce flood rate has been
throttled to 1.  In that case, if OEMCrypto is allowed to terminate
between each request, all nonce requests will be an error.

Keeping OEMCrypto alive does not modify the desired test results when
oemcrypto is not throttled.

This CL changes test code only.

bug: 73607610
test: unit tests
Change-Id: I71b27b1bb8200188a0a821afc977d7a9cc7fd968
2018-02-21 13:35:57 -08:00
Fred Gylys-Colwell
9729663671 Adjust nonce flood rate in mock oemcrypto
Merge from Widevine repo of http://go/wvgerrit/43721

This CL allows the tester to change the nonce flood rate from the
default of 20.  A tester would want this value to be larger to make
tests run more quickly.

Setting the rate to 1 makes every other nonce request a flood error.
A tester wants to do this in order to verify cdm code responds to
nonce flood correctly.  Several failing oemcrypto tests have also been
corrected.

This CL changes test code only.

bug: 73607610
test: unit tests
Change-Id: I3f52ff7ea9bcc1db7bc0e010da0b64a12d3b4dd3
2018-02-21 13:34:09 -08:00
Rahul Frias
aef1f6f48e Merge "Correct format specifier" 2018-02-17 00:55:30 +00:00
Rahul Frias
3480900b1a Correct format specifier
[ Merged from http://go/wvgerrit/43640 ]

Bug: 62266605
Test: WV unit/integration test
Change-Id: I9944805f0dd7f5b33e3a0b2eb40f2a3a6e26489e
2018-02-16 15:07:14 -08:00
Srujan Gaddam
68e22bc2cd Fix test sample for cbcs decryption
Merge of http://go/wvgerrit/43541

Test: Unit/Integration tests

b/73500155

This change uses the same clear data as the kCenc30Cbc1Key33Sample to
verify decryption, since it shares the same key as opposed to the
32Sample.
2018-02-16 14:20:53 -08:00
Fred Gylys-Colwell
a0040ec5bf Halt tests after multiple failures
Merge from Widevine repo of http://go/wvgerrit/43440

This CL changes several tests so that they abort after multiple
failures.  This prevents a network error from putting one of the usage
table tests into an infinite loop.

bug: 73397596
test: unit tests
Change-Id: Iaaec9eb2b39a6a2b2cfc90ee1c28bae0486aa851
2018-02-16 02:16:06 +00:00
Fred Gylys-Colwell
10275f508a Merge "Fix compiler warnings" 2018-02-16 02:15:09 +00:00
Fred Gylys-Colwell
ef0ec145d3 Fix compiler warnings
Merge from Widevine repo of http://go/wvgerrit/43420

Remove or mark unused variables.  Fix unsigned/signed comparisons.

bug: 73390805
test: unit tests
Change-Id: Ic523400a5decf82fae733042b260e0c39a087cd3
2018-02-15 11:18:54 -08:00
Fred Gylys-Colwell
46b7e5a53c Merge "Mark unused typedef as unused" 2018-02-15 16:50:35 +00:00
Fred Gylys-Colwell
901e673085 Mark unused typedef as unused
Merge from Widevine repo of http://go/wvgerrit/43401

This turns off a bunch of unused typedef warning messages

test: unit tests
bug: 70894426
Change-Id: I8c0f02b98a2e89c4623c942a0981f01f3fe47da6
2018-02-14 16:40:38 -08:00
Rahul Frias
fe2c777a8e Disambiguate INSUFFICIENT_CRYPTO_RESOURCES errors
[ Merge of http://go/wvgerrit/43281 ]

Bug: 73164325
Test: WV unit/integration test, playback tests using Netflix and
      Play Movies.

Change-Id: Ifc3dd8863da1616eb4a7df35ad010f53b6d5e3d2
2018-02-14 15:45:27 -08:00