Commit Graph

3709 Commits

Author SHA1 Message Date
Rahul Frias
6ea6723462 Do not log nonces
[ Merge of http://go/wvgerrit/99063 ]

Bug: 155329753
Test: wv unit/integration tests
Change-Id: I642b19f817ce69cb0838512cb8922a2e9c51cef2
2020-04-30 00:34:44 -07:00
Alex Dale
2a16d70a06 Suppress error for removing lingering offline licenses.
[ Merge of http://go/wvgerrit/97963 ]

There are situations where an offline license file will remain on the
system after it's usage entry has been deleted.  This would result in
its key set ID being reported as present by the CDM, but any
operations acting upon it will result in an error.

The app should be able to remove the license without error, so long
as the license file exists and no other OEMCrypto operations fail.

This change introduces a new error code LICENSE_USAGE_ENTRY_MISSING,
which indicates that a license's usage entry cannot be found.

A new integration test checks that the CDM can handle the calls to
removeOfflineLicense().

Bug: 137034719
Test: Android unit and integration tests
Change-Id: Ibdbe963b7f7e3ac97b446300d8e3896cdee7abc5
2020-04-29 17:48:26 -07:00
Rahul Frias
8cc100c11a Accept a security level to be specified during provisioning am: e27bc4ba6a am: 8429ab587a
Change-Id: I713649c76556b91afcd6ebcc0042c415ff2eee4b
2020-04-30 00:42:47 +00:00
Rahul Frias
8429ab587a Accept a security level to be specified during provisioning am: e27bc4ba6a
Change-Id: I20b0adbb6c27507b7d63a6cd0084b4230d5ed6e0
2020-04-30 00:27:03 +00:00
Rahul Frias
e27bc4ba6a Accept a security level to be specified during provisioning
[ Merge of http://go/wvgerrit/97267 ]

In earlier releases, provisioning would occur based on a cached
security level. If an open session call returned a NotProvisionedException
the security level would be cached for use with any future provisioning
call.

An app would have to set the security level, then call openSession,
have it fail and then request provisioning. This fits the normal flow of
most apps. Still on occasion, an app might change requested security level
after an openSession call failed. Using the cached security level
would result in unexpected behavior.

This change allows provisioning to occur at the last security level that
was set.

Bug: 129356527
Test: wv unit/integration tests, GTS tests (GtsMediaTestCases)
Merged-In: I8d9234eec2b23a9c913e77a709943b431e25e43e
Change-Id: I8d9234eec2b23a9c913e77a709943b431e25e43e
2020-04-28 11:58:59 -07:00
TreeHugger Robot
8118bb3bc4 Merge "Verify error code when usage entry in use" into rvc-dev am: 6bd68c9660 am: 6fd344812d
Change-Id: I552f241a05393459f83a5ad53373221483649d00
2020-04-28 17:58:03 +00:00
TreeHugger Robot
04d320094e Merge "Fix buffer size on generic decrypt tests" into rvc-dev am: 9448696b9f am: ed4daa7583
Change-Id: I0cf5b550600d0d0b487bfe9a20ad8e035778c191
2020-04-28 17:57:52 +00:00
TreeHugger Robot
6fd344812d Merge "Verify error code when usage entry in use" into rvc-dev am: 6bd68c9660
Change-Id: I59fa7ba554c560f0c8e68f69747a4eb98f297e51
2020-04-28 17:42:14 +00:00
TreeHugger Robot
ed4daa7583 Merge "Fix buffer size on generic decrypt tests" into rvc-dev am: 9448696b9f
Change-Id: I6d367165623fd96fa21fee3e274b9c9b99b0aba3
2020-04-28 17:42:03 +00:00
TreeHugger Robot
6bd68c9660 Merge "Verify error code when usage entry in use" into rvc-dev 2020-04-28 17:25:22 +00:00
TreeHugger Robot
9448696b9f Merge "Fix buffer size on generic decrypt tests" into rvc-dev 2020-04-28 17:23:37 +00:00
Rahul Frias
e8e0dcd887 Correct OpenSessions_1_1 test failure am: 3df8bc5133 am: 3601ac7387
Change-Id: I98328c3518339defb48053038aa4c3d82e983e07
2020-04-24 23:27:30 +00:00
Rahul Frias
3601ac7387 Correct OpenSessions_1_1 test failure am: 3df8bc5133
Change-Id: I3a11cc8034711d6e1219d3b248fdcf73d7f155e8
2020-04-24 23:11:45 +00:00
Fred Gylys-Colwell
a3a61a68c4 Verify error code when usage entry in use
Merge from Widevine repo of http://go/wvgerrit/98265

Previously, if we tried to shrink the usage table over an entry in
use, we expected an error. Now, we expect the specific error,
OEMCrypto_ERROR_ENTRY_IN_USE.

Test: unit tests on taimen
Bug: 124776024
Change-Id: I2b4b872943bf65401c0a6b5dc1237d77341b1f5b
2020-04-24 14:13:15 -07:00
Rahul Frias
3df8bc5133 Correct OpenSessions_1_1 test failure
[ Merge of http://go/wvgerrit/98025 ]

This adds mocking for WvContentDecryptionModule::QuerySessionStatus
to WvDrmPluginTest which was missing. This corrects the failure in
WVDrmPluginTest.OpensSessions_1_1 from libwvdrmdrmplugin_hidl_test

Bug: 154011452
Test: wv unit/integration tests
Change-Id: I9904595a62a71541ab534aca7d7dfbf95f3225c9
2020-04-20 15:48:20 -07:00
Rahul Frias
7ef5203a00 Merge "Correct reporting of KeyStatus usable in future" into rvc-dev am: d260c2cf2d am: dec9af442b
Change-Id: Idd0c126798678cd92b3c61f8c2f217914e8155f5
2020-04-20 19:38:37 +00:00
Rahul Frias
dec9af442b Merge "Correct reporting of KeyStatus usable in future" into rvc-dev am: d260c2cf2d
Change-Id: I8f6bd2763d68abbba6e7728ea58cc80a8f6516be
2020-04-20 19:19:37 +00:00
Rahul Frias
d260c2cf2d Merge "Correct reporting of KeyStatus usable in future" into rvc-dev 2020-04-20 19:06:18 +00:00
Rahul Frias
6404b42fb2 Correct reporting of KeyStatus usable in future
[ Merge of http://go/wvgerrit/98004 ]

This corrects mapping for KeyStatus event kKeyStatusUsableInFuture in
the legacy WVDrmPlugin. It earlier reported DrmPlugin KeyStatusType
kKeyStatusType_StatusPending and now reports kKeyStatusType_UsableInFuture.

This fixes the test failure WVDrmPluginTest.MarshalsEvents

Bug: 153509007
Bug: 116738851
Test: WV unit/integration tests
Change-Id: I4b2c74f5a0757975861ef41fa575a749ff9da391
2020-04-20 10:23:27 -07:00
Fred Gylys-Colwell
eb227bdc61 Fix buffer size on generic decrypt tests
Merge from Widevine repo of http://go/wvgerrit/98264

The generic decrypt tests changed the variable controlling buffer size
after it initialized the buffer -- so the buffer was not changed. This
CL fixes that.

Also, RefreshLargeBuffer changed the size of the license message
buffer, not the renewal message buffer.

Bug: 153590142
Test: ran unit tests on taimen
Change-Id: Ib01b411478a181ba956ac2e23c03634a2d971cc0
2020-04-18 09:07:07 -07:00
Fred Gylys-Colwell
0214b1eb5e Update OEMCrypto documents am: 15b1cd9cc9 am: 02443e2142
Change-Id: Icffccaa3f44c618d615e352cbfa93c3138c9f9a9
2020-04-13 18:52:56 +00:00
Fred Gylys-Colwell
02443e2142 Update OEMCrypto documents am: 15b1cd9cc9
Change-Id: I3036f1fb8c73fa3c8ede0c3686e466f24a90c000
2020-04-13 18:23:24 +00:00
Fred Gylys-Colwell
15b1cd9cc9 Update OEMCrypto documents
Merge from Widevine repo of http://go/wvgerrit/97763

There were no function signature changes, so the API version number
did not change from 16.2. There were several grammar and spelling
errors. There were also the following corrections:

1. The description of OEMCrypto_LoadProvisioning now says that devices
with a keybox use keys derived from the keybox device key, and devices
using Provisioning 3.0 use keys derived from the session key. The
description was previously reversed.

2. The function OEMCrypto_SupportedPatterns is no longer
discussed. This function was never fully defined.

3. The function OEMCrypto_LoadRenewal no longer says that keys and key
control blocks should be verified. This is because the function
OEMCrypto_LoadRenewal processes a message with no key control
block. It should update timers for the entire license.

Test: doc and comment change only
Bug: 153731804
Change-Id: I11a3069fcdbf67b369e2e2bc3fea8c08842eeb7b
2020-04-10 10:12:10 -07:00
Robert Shih
4337951ae6 WVDrmPlugin signRSA: check arguments before caller am: 2278917116 am: 983698e6cb
Change-Id: I876f45a8f9d101dc2019e73bc9623cab8c6786c2
2020-04-08 20:25:07 +00:00
Robert Shih
983698e6cb WVDrmPlugin signRSA: check arguments before caller am: 2278917116
Change-Id: Ic5b158f14835176a412b3d350cdd080f674f6b61
2020-04-08 20:08:33 +00:00
Robert Shih
2278917116 WVDrmPlugin signRSA: check arguments before caller
Merge of http://go/wvgerrit/97444

Bug: 153356263
Test: VtsHalDrmV1_0Target
Test: VtsHalDrmV1_3Target
Change-Id: Ic27056d86804972859a85c0eb2a0e79a0563d040
2020-04-06 16:13:40 -07:00
John W. Bruce
1dbfe524cd Fix Entitlement Licenses am: 4444ba3b47 am: c9caa507b3
Change-Id: I0a82b9409708fb4a32609be4c663954f896b9194
2020-04-03 23:17:09 +00:00
John W. Bruce
c9caa507b3 Fix Entitlement Licenses am: 4444ba3b47
Change-Id: I8fc3a51bf829a0036928d2ae7b55d6d69cd7a483
2020-04-03 22:54:25 +00:00
John W. Bruce
4444ba3b47 Fix Entitlement Licenses
(This is a merge of http://go/wvgerrit/97083.)

The switch from LoadKeys to LoadLicense broke entitlement licenses
entirely because the LoadLicense path in CryptoSession didn't include
any affordances for updating the KeySession, unlike the LoadKeys path.
This patch adds code to handle this.

Bug: 152814106
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: Id0c33a566e17e6be8da04e12be4b0fc87559aa8f
2020-04-03 22:33:40 +00:00
Fred Gylys-Colwell
f7da678770 Merge "Adjust time for unit tests" into rvc-dev am: bab44e0ad4 am: b1d7728b29
Change-Id: Ib139a700f2bc6b74999abdfb7618ad9d265cae22
2020-04-03 17:16:11 +00:00
Fred Gylys-Colwell
b1d7728b29 Merge "Adjust time for unit tests" into rvc-dev am: bab44e0ad4
Change-Id: Ib75c6d6ba0ede24858827da7c611d1888bf5baf3
2020-04-03 16:54:40 +00:00
Fred Gylys-Colwell
bab44e0ad4 Merge "Adjust time for unit tests" into rvc-dev 2020-04-03 16:30:53 +00:00
Fred Gylys-Colwell
67aaa1c309 Adjust time for unit tests
Merge from Widevine repo of http://go/wvgerrit/96843

This CL modifies the system time used by the reference OEMCrypto so
that it recovers from a clock rollback. When the clock rolls back, it
now adjusts the current time and continues forward. This is needed
when running unit tests on some platforms that reset the clock at
the beginning of a test.

Bug: 152649427
Test: unit tests on buildbot. (No production code on Android)
Change-Id: I7edcdc0cd4e5938c9a54e745d3a0e008f9eb13ed
2020-04-03 16:28:38 +00:00
TreeHugger Robot
52616ab94b Merge "CryptoSession: Propagate err from GetSystemIdInternal in Open" into rvc-dev am: 4fe638a779 am: 3fdeb011df
Change-Id: I924777b8ab8abe5d08fffa43335bdeb9d9c8643b
2020-04-01 23:49:31 +00:00
TreeHugger Robot
3fdeb011df Merge "CryptoSession: Propagate err from GetSystemIdInternal in Open" into rvc-dev am: 4fe638a779
Change-Id: I24b593df28cc9a0000901c813b6fd1bd72e6d61b
2020-04-01 23:20:39 +00:00
TreeHugger Robot
4fe638a779 Merge "CryptoSession: Propagate err from GetSystemIdInternal in Open" into rvc-dev 2020-04-01 22:52:21 +00:00
Robert Shih
07f40d1bed CryptoSession: Propagate err from GetSystemIdInternal in Open
Merge of http://go/wvgerrit/96509

Bug: 151231204
Test: GtsMediaTestCases
Change-Id: Ib29691fcea1c9d5fcfa981caf3e5bdab00cbb0bf
2020-04-01 07:01:24 +00:00
TreeHugger Robot
4d3ebc6b87 Merge "CryptoSession: handle 0-length buffer in DecryptSample" into rvc-dev am: e59339ed6d am: 94108cdbe8
Change-Id: I1ad7226acc3d63a19d7178450499972eeffd7c40
2020-04-01 05:44:29 +00:00
TreeHugger Robot
94108cdbe8 Merge "CryptoSession: handle 0-length buffer in DecryptSample" into rvc-dev am: e59339ed6d
Change-Id: Ie427ca27c16376f1202e3a43b58a50f19ecc0d94
2020-04-01 05:32:01 +00:00
TreeHugger Robot
e59339ed6d Merge "CryptoSession: handle 0-length buffer in DecryptSample" into rvc-dev 2020-04-01 05:12:53 +00:00
Robert Shih
dc9809f7c3 CryptoSession: handle 0-length buffer in DecryptSample
In `Combine Decrypt Calls to OEMCrypto`,
OEMCrypto_ERROR_BUFFER_TOO_LARGE is used as the default error code to
signal fallback to legacy decrypt (sending subsamples separately).
The error code would not be updated if no calls to OEMCrypto were
made (e.g. 0-length buffers).

This change resets error code to OEMCrypto_SUCCESS after fall back to
legacy decrypt. Consequently, buffers that do no require OEMCrypto
calls would return OEMCrypto_SUCCESS.

Merge of http://go/wvgerrit/96743

Bug: 150188155
Test: GtsMediaTestCases
Test: DashTest#testWidevineH264AdaptiveWithRendererDisabling
Change-Id: Ib23803c51f16bc809bda5c2720e628e81f1df1dc
2020-04-01 02:47:13 +00:00
John Bruce
6ae7e5e14a Merge "Update OEMCrypto Version Compatibility Document" into rvc-dev am: c113df815d am: d57c09b29b
Change-Id: I097e489a6858ca3ed9a62f8cd3b2a6b05f8ec54d
2020-03-30 18:14:31 +00:00
John Bruce
d57c09b29b Merge "Update OEMCrypto Version Compatibility Document" into rvc-dev am: c113df815d
Change-Id: I4e1f3e8ff3e11e7d06defad929bf08ef828b23eb
2020-03-30 18:00:26 +00:00
John Bruce
c113df815d Merge "Update OEMCrypto Version Compatibility Document" into rvc-dev 2020-03-30 17:46:33 +00:00
Fred Gylys-Colwell
fc1326554e Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey am: 56b836bda3 am: bb42e9bd41
Change-Id: I8c35f3c05793844ce4bf24cde418936f31cc6d04
2020-03-29 19:46:03 +00:00
Fred Gylys-Colwell
bb42e9bd41 Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey am: 56b836bda3
Change-Id: I2478269c1165c4dac094b6f79eae77c80b65668e
2020-03-29 19:30:45 +00:00
Fred Gylys-Colwell
56b836bda3 Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey
Merge from Widevine repo of http://go/wvgerrit/96783

This CL updates the reference code, unit tests, and adapter to use the
new v16 function OEMCrypto_LoadDRMPrivateKey. This is just an API
change to allow ECC support in the future. The reference code does not
yet support ECC certificates, and the CDM code assumes that all
certificates have an RSA key.

Bug: 152558018
Test: unit tests on taimen and w/v16 mod mock.
Change-Id: I0793b416513b81b3d74849f0b58dbdc91f075ac6
2020-03-29 10:43:54 -07:00
Rahul Frias
bb38d223f8 Merge "Reject partial clear subsamples when keys are not loaded" into rvc-dev am: 3560247878 am: c79babac4c
Change-Id: I1e826fc634e3517898c10caa61624cc905242608
2020-03-28 19:09:26 +00:00
Rahul Frias
c79babac4c Merge "Reject partial clear subsamples when keys are not loaded" into rvc-dev am: 3560247878
Change-Id: I1a0ebfba3f4648e44dc3f28870076c6a6e0f1cc2
2020-03-28 18:42:55 +00:00
Rahul Frias
3560247878 Merge "Reject partial clear subsamples when keys are not loaded" into rvc-dev 2020-03-28 18:24:15 +00:00