Commit Graph

3096 Commits

Author SHA1 Message Date
Rahul Frias
e4d432806a Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev 2019-05-30 02:06:42 +00:00
TreeHugger Robot
f246f028b2 Merge "Change move_widevine_data.sh to move L3 files" into qt-dev 2019-05-24 20:59:31 +00:00
Srujan Gaddam
45d02c545c Reverse LD_LIBRARY_PATH order based on liboemcrypto.so
Bug: b/133427576
Test: Unit tests on Taimen and Crosshatch
Merge of http://go/wvgerrit/79804

Currently, the run_all_unit_tests.sh script fails to load in the Level 1
OEMCrypto for some devices that don't have a 64-bit liboemcrypto.so. This
is because the liboemcrypto.so tries to load in libQSEEComAPI.so, which
some devices contain both a 32-bit and 64-bit version of. Since we set
the LD_LIBRARY_PATH to use /vendor/lib64 first, and since we only have a
32-bit liboemcrypto.so, the 32-bit liboemcrypto.so will try to load in the
libQSEEComAPI.so in the lib64 path first. Since the liboemcrypto.so is
32-bit, it will fail to open the 64-bit library. The solution to this is
to conditionally set the LD_LIBRARY_PATH based on if a 64-bit
liboemcrypto.so exists or not.

Change-Id: I80a9e778f31f089f66df0544cb022d810e9d3de3
2019-05-24 10:30:10 -07:00
Rahul Frias
80b8e29c3f WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes
[ Merge of http://go/wvgerrit/79724 ]

Bug: 122982573
Test: WV unit/integration tests
Change-Id: Icb7b192311dc6bbe630d96f993ccca774160774b
2019-05-22 18:12:06 -07:00
Rahul Frias
48650f74ab Merge "Correct android version number in test" into qt-dev 2019-05-17 14:23:01 +00:00
Rahul Frias
4f273991b9 Correct android version number in test
[ Merge of http://go/wvgerrit/79144 ]

Bug: 132908020
Test: WV unit/integration tests
Change-Id: Idf5cf3e1e886af3bfed157320fa09d66dfa55c0d
2019-05-16 14:44:40 -07:00
TreeHugger Robot
3454ccf51e Merge "Disable failures for LoadKeyWithSuspiciousIV and SelectKeyNotThereAPI15" into qt-dev 2019-05-16 20:34:18 +00:00
Srujan Gaddam
189eb87977 Change move_widevine_data.sh to move L3 files
Bug: b/130252305
Test: nyc-mr2-release -> pi-dev, oc-mr1-release -> pi-dev
nyc-mr2-release -> oc-mr1-release -> pi-dev upgrades with offline
licenses
Merge of http://go/ag/7323341

In N, the L3 files were stored in /data/mediadrm/IDM[uid]/. In O, they
were moved to /data/mediadrm/IDM[uid]/L3/. In P, we moved the contents
of mediadrm to /data/vendor/mediadrm/. For an O->P upgrade, the L3 files
can be read in /data/vendor/mediadrm/IDM[uid]/L3/, but when we upgrade
N->P, the L3 files sit in /data/vendor/mediadrm/IDM[uid]/, unable to be
read. This CL addresses this issue by changing the script to move any L3
files if they exist under this directory to the L3 subdirectory after we
do the bulk move from /data/mediadrm/ to /data/vendor/mediadrm/.

Change-Id: I319c323879766df063d25478046367878023a7cf
(cherry picked from commit 1a6ca36976)
2019-05-16 20:25:54 +00:00
Robert Shih
69c8f488ca Add CdmKeyStatus kKeyStatusUsableInFuture
Bug: 116738851
Test: unit tests
Change-Id: I49728788e57905806b72e891f3654fbf0c8b1bc0
2019-05-15 15:16:05 -07:00
Fred Gylys-Colwell
29becbc2bf Disable failures for LoadKeyWithSuspiciousIV and SelectKeyNotThereAPI15
Merge from Widevine repo of http://go/wvgerrit/78949

LoadKeyWithSuspiciousIV is a new test for OEMCrypto v15.2.  It is
being disabled since we do not require 15.2 for the Q release.

SelectKeyNotThereAPI15 was failing because the error code is
delayed. This is acceptable.

Bug: 132720732
Test: unit tests on taimen
Change-Id: Iea3fabfb3afd800065119ce812fb454be1e82644
2019-05-14 22:32:54 -07:00
TreeHugger Robot
127f87770c Merge "Fix OEMCrypto UsageTableTest.GenerateReportWrongPST" into qt-dev 2019-05-14 22:01:11 +00:00
Rahul Frias
ed833222a6 Merge "Ref count Timer implementation" into qt-dev 2019-05-13 20:24:45 +00:00
Rahul Frias
19c6e57269 Merge "Single PSSH entitlement handling" into qt-dev 2019-05-13 16:26:16 +00:00
Rahul Frias
80f5e283ad Merge "Key Status should reflect key container security level" into qt-dev 2019-05-13 16:25:24 +00:00
Rahul Frias
4d917e3ee8 Ref count Timer implementation
[ Merge of http://go/wvgerrit/78763 ]

The android timer instance is held by a regular pointer rather
than reference counted as all classes that derive from RefBase
should be. This could result in a double deallocation, if the
timer is ever passed to a strong pointer.

Bug: 79364026
Test: WV unit/integration tests. GtsMediaTestCases. Play movies
      playback tests.

Change-Id: I01f622bc045e1012f2240b3775a6d121f9415463
2019-05-12 02:15:12 -07:00
Rahul Frias
7d78609548 Key Status should reflect key container security level
[ Merge of http://go/wvgerrit/77506 ]

Callers of MediaDrm can register to be notified when key status
changes and if they are usable for decryption. A number of factors
are evaluated when making this determination. Key container security
level will now be included in the evaluation.

Bug: 78652608
Test: WV unit/integration test, GtsMediaDrmTest, Play movies playback
      testing.

Change-Id: I20243e5cb160f7957e3239e8d05f715ff0ee6dd6
2019-05-09 22:16:23 -07:00
Fred Gylys-Colwell
5ee5d00514 Report OEMCrypto Build Information in License Request
Merge from Widevine repo of http://go/wvgerrit/78623

This updates the license request client identification to include
OEMCrypto build information.

Bug: 129070445
Test: ExoPlayer on crosshatch with mod mock
Change-Id: I0dbce0cca4e9810e14f60561e4e434f1dbcadfb6
2019-05-09 13:24:04 -07:00
Adam Stone
c71fb10b95 Merge "Correctly sets provisioning state for test." into qt-dev 2019-05-08 23:29:17 +00:00
Adam Stone
3a27d2d649 Correctly sets provisioning state for test.
[ Merge from http://go/wvgerrit/78383 ]

Bug: http://b/121049662

Test: Re-ran the unit test.
Change-Id: I62c00f425c93b588e123ddd8b1093177f2e9b241
2019-05-08 14:13:28 -07:00
John Bruce
8a0ba4d0fa Merge "Disallow Blank App Package Name on Q and Later" into qt-dev 2019-05-08 18:58:40 +00:00
Fred Gylys-Colwell
2f79fe2773 Merge "Update unit tests for v15.2" into qt-dev 2019-05-08 17:36:36 +00:00
Jeff Tinker
83068b97c8 Merge "hidl plugin: add sendKeysChange_1_2" into qt-dev 2019-05-08 17:17:43 +00:00
Rahul Frias
da25bce428 Single PSSH entitlement handling
[ Merge of http://go/wvgerrit/78425 ]

This CL refactors code, corrects comments and adds additional
integration tests.

Bug: 128462397
Test: WV unit/integration tests, GPlay playback tests and GtsMediaDrmTests
Change-Id: I679960d44c45cf4ff13c27eb960e66ec63f491b5
2019-05-07 23:07:05 -07:00
Fred Gylys-Colwell
96431e9c2d Update unit tests for v15.2
Merge from Widevine repo of http://go/wvgerrit/77609

For v15.2 we require that nonces not collide across sessions and there are
restrictions placed on the mac key's IV in LoadKeys.

Test: ran unit tests on reference code

Bug: 131325434
Bug: 131326334

Change-Id: I1bb01c30d8c15d66d762c28b57d7700c44daa835
2019-05-07 22:50:06 -07:00
John W. Bruce
edccc13510 Disallow Blank App Package Name on Q and Later
(This is a merge of http://go/wvgerrit/78105)

The Widevine Android CDM should not allow itself to be instantiated
without an app package name, as this breaks SPOID protection.
Unfortunately, pathways exist prior to Android Q that allow this to
happen, and we cannot break these devices by changing the behavior now.
As such, we will only refuse to allow instantiation without an app
package name on devices first launched with Q and later.

This change also migrates the WVDrmFactory and its tests away from
explicitly naming friend classes for individual test, in favor of the
now-recommended "test peer" pattern.

Bug: 65680731
Test: libwvdrmengine_hidl_test
Test: CTS NativeMediaDrmClearkeyTest
Change-Id: Icccd1d8b9972ef6ad7e5b0dbf2d37ec987656385
2019-05-08 01:08:11 +00:00
Fred Gylys-Colwell
407d39699b Test MAC signature after license reload
Merge from Widevine repo of http://go/wvgerrit/78143

This verifies that the correct mac keys are used to sign a message when
generating a usage report or secure stop.

Test: unit tests on ref code and taimen
Bug: 111261264
Change-Id: I7d56a6ff0aae68a5554f7ce84d467697d1f9997b
2019-05-07 19:09:53 +00:00
Robert Shih
a1d9094721 hidl plugin: add sendKeysChange_1_2
Bug: 116738851
Test: vts
Change-Id: Ifdf537ff2f4922741eba5abdd37dd2dd5e37e161
2019-05-06 20:23:06 -07:00
TreeHugger Robot
a1e94e2eb1 Merge "Test loading second call to LoadKeys fails" into qt-dev 2019-05-07 02:18:17 +00:00
Fred Gylys-Colwell
3b9b77c7c7 Merge "Update docs for OEMCrypto v15.2" into qt-dev 2019-05-06 19:00:43 +00:00
Fred Gylys-Colwell
d4801531e4 Fix OEMCrypto UsageTableTest.GenerateReportWrongPST
Merge from Widevine repo of http://go/wvgerrit/78063

This test incorrectly asserted a buffer size.

Bug: 131864150
Test: Unit tests ran on taimen.
Change-Id: If53fdd4cce9d6b3dfa85f50a3dbc08c99bceebfb
2019-05-06 11:41:21 -07:00
Fred Gylys-Colwell
c7a4c0c7db Test loading second call to LoadKeys fails
Merge from Widevine repo of http://go/wvgerrit/78144

This CL verifies that LoadKeys cannot be called twice a second time in
an OEMCrypto session.

Bug: 131359743
Test: unit tests on refernce code and taimen
Change-Id: I3da1c7639ed163799ee5996fd9f7f8b427c7ed30
2019-05-06 09:42:18 -07:00
Fred Gylys-Colwell
db534a6a05 Update docs for OEMCrypto v15.2
Merge from Widevine repo of http://go/wvgerrit/77604

Test: ran unit tests

Bug: 131326334 Nonce collision should be avoided in open sessions
Bug: 131325434 mac key iv should not be 16 bytes before encrypted mac key
Bug: 129368634 HDCP 2.3 and 2.2 are not distinguishable
Bug: 127423611 Question about OEMCrypto V15 API
Bug: 124312571 Picture-in-Picture -- is it really needed for Android TV?
Bug: 131175454 Extend Provisioning 3.0 Schedule
Bug: 131359743 Do not allow multiple LoadKeys in a session

Change-Id: I8db4ec921978ea918adb17420db86de69e806120
2019-05-05 21:42:35 -07:00
TreeHugger Robot
862cb96e77 Merge "Handle key rotation" into qt-dev 2019-05-03 20:50:17 +00:00
Srujan Gaddam
fce75c295b Call SelectKey regardless of entitled key mapping
Bug: b/129426820
Test: CE CDM, Android unit/integration, Linux, ExoPlayer key rotation
playback with modmock and L3
Merge of http://go/wvgerrit/77608

http://go/ag/6543431 modified the entitlement key session to select the
entitled content key if it had just been loaded in so that there's a
valid current content key loaded in OEMCrypto. However, this did not
account for the case where you have two entitlement to entitled key
pairs. If OEMCrypto does not select the key when you switch from the
first pair to the second pair back to the first pair, OEMCrypto will
still be using the key from the second pair during decrypt. This CL
changes it so we SelectKey each time to make sure that we update the
current content key.

Change-Id: I764ec13deb87e14188707b811a44eff132eeb5a1
2019-04-30 10:51:33 -07:00
Rahul Frias
2e2e92280e Handle key rotation
[ Merge of http://go/wvgerrit/77049 ]

Entitlement PSSHs can now be provided in follow on key generation
requests to cause keys to be rotated without needing a license
exchange.

Bug: 128462397
Test: WV unit/integration tests, Netflix and GPlay tests,
      GtsMediaDrmTests

Change-Id: I6ed0901a35c498240f42e405a522d82ea8dce2f7
2019-04-23 13:54:51 -07:00
Srujan Gaddam
3e5ade22f9 Handle not setting length in getUniqueID
Test: oc-mr1-release to q upgrade with L3 offline licenses, pi-dev to q
upgrade with L3 offline licenses, CE CDM tests, Android unit/integration
tests, Linux tests
Bug: b/112611429
Merge of http://go/wvgerrit/77111

The Level 3 uses the getUniqueID method to uniquely identify devices to
save device keys. This method needs to be consistent and as part of the
method, the length is set. In previous versions, this length isn't set,
but starting from Pi, it is. What this means is that decryption of the
device keys fails, and therefore offline licenses are lost. As a
workaround, we attempt to decrypt the device keys with the length
parameter and with the default if we failed to decrypt. Since the
generation number is also encrypted by the unique id, in the case where
we succeed in decrypting with the default, we reencrypt the generation
number so it can be read in when we handle the usage table. Finally, we
reencrypt everything with the correct length unique id.

Change-Id: Id682771c3921dea35592914fc7a1aaa92fa6737a
2019-04-22 12:11:39 -07:00
TreeHugger Robot
c5189c3d12 Merge "Update Android Integration Guide" into qt-dev 2019-04-18 23:38:52 +00:00
Fred Gylys-Colwell
704870bed6 Document Keys / Session
Merge from Widevine repo of http://go/wvgerrit/74624
and http://go/wvgerrit/77025

Several people have asked how many keys / session are required as a
function of OEMCrypto version. That is often enough that this
information should go in the version compatibility document.

Bug: 128628354
Test: documentation change only
Change-Id: I3031013aab2feb38a0c5ce7e5304ec0d50487ea3
2019-04-17 12:17:00 -07:00
Fred Gylys-Colwell
f3e0b357b6 Update Android Integration Guide
Merge from Widevine repo of http://go/wvgerrit/72624

Update the Android supplement for Android Q and OEMCrypto v15.

Test: doc change only
Bug: 119832138
Change-Id: Ie58dcadf4cdb0cd3264b630b5f6f80789ba50e9c
2019-04-16 15:40:35 -07:00
Srujan Gaddam
79a271fcce Merge "Reintroduce heaps into Level 3 obfuscation" 2019-04-03 02:50:31 +00:00
Srujan Gaddam
68a5505378 Reintroduce heaps into Level 3 obfuscation
Bug: b/116056586
Test: CE CDM, Android unit/integration, and GTS tests
Merge of http://go/wvgerrit/75891

Heapification was removed from the Level 3 in b/111246860 due to
contributing to performance issues. These issues are addressed in the
obfuscation tool and these libraries are built using those fixes.

Change-Id: I62dc09b41f845f3f7aa283af6968ac0cbc6cf368
2019-04-02 14:34:17 -07:00
Rahul Frias
1aed4dc670 hidl: return BAD_VALUE from RemoveOfflineLicense when keyset is not found
[ Merge from http://go/wvgerrit/75623 ]

This addresses code-review comments during the merge to the wv repo.

Bug: 127828539
Test: WV unit/integration tests
Change-Id: I12abe3eb0767bb9ccb76940dcca12c17d32e8e53
2019-04-01 20:10:25 -07:00
Rahul Frias
dcfe0f3690 Merge "Remove references to internal documents" 2019-03-28 23:29:43 +00:00
Rahul Frias
4e745ff203 Remove references to internal documents
[ Merge of http://go/wvgerrit/75303 ]

Bug: 117181780
Test: WV unit/integration tests
Change-Id: Ica12e270a9ac5fbcff069aace807bb4651814ad7
2019-03-28 09:32:30 -07:00
Srujan Gaddam
0613bb1614 Merge "Add script to diff test results between changes" 2019-03-27 21:26:08 +00:00
Fred Gylys-Colwell
dd64dedb51 Fix LD_LIBRARY_PATH in run_all_unit_test.sh
Merge from Widevine repo of http://go/wvgerrit/75383

Because the tests need to find liboemcrypto.so.

Bug: 129354680
Test: ran on taimen and bonito.
Change-Id: I9cc802a2396937739b164851f51726fbc80550d5
2019-03-26 14:29:06 -07:00
Rahul Frias
a45deef63b Merge "Corrections for limited duration licenses" 2019-03-26 16:24:48 +00:00
Adam Stone
eeb09779aa Merge "Add extra OEMCrypto metrics" 2019-03-25 22:36:42 +00:00
Rahul Frias
43efc6d84a Corrections for limited duration licenses
[ Merge of http://go/wvgerrit/74627 ]

Limited duration licenses (where license duration is unlimited and
playback window is set to a small value) did not work correctly when
the initial decrypt call occured before the license was received.

Bug: 109653883
Test: WV unit/integration tests
Change-Id: I0738e97db525b239455e2ac93ab0bedd6611b311
2019-03-23 00:53:26 -07:00
Fred Gylys-Colwell
d641797e05 Use hex for FDPT hash
Merge from Widevine repo of http://go/wvgerrit/75123
Merge from Widevine repo of http://go/wvgerrit/75114

This changes the encoding for the hash to be hex instead of base64.

Also, the bad frame number is initialized to 0 to make it easier to
debug. And the FDPT test app now uses the correct byte order.

Bug: 129100318
Test: unit tests, FDPT test app.
Change-Id: I296bab990125a4e18bec92f3316e8289a3b25a6b
2019-03-22 17:14:27 -07:00