Commit Graph

3668 Commits

Author SHA1 Message Date
Alex Dale
5558f13d57 Reworked DeleteEntry() into InvalidateEntry(). am: da48461ba2 am: 44cc2500b3
Change-Id: I858b69423e9eec2b1b96a35bc53cda1698503a3f
2020-05-01 01:38:00 +00:00
Alex Dale
44cc2500b3 Reworked DeleteEntry() into InvalidateEntry(). am: da48461ba2
Change-Id: Ic6a6d107a138f9a2ad9b2a935751249587bf540e
2020-05-01 01:22:29 +00:00
Alex Dale
da48461ba2 Reworked DeleteEntry() into InvalidateEntry().
[ Merge of http://go/wvgerrit/95406 ]

There was an issue with DeleteEntry() where it would result in an
invalid table state if shrinking the usage table when the number of
sessions is at its max.

This required changing how the usage table invalidates entries.  Now,
after invalidating an entry (marking an entry as kStorageTypeUnknown)
the table is defragmented if specified to.

Defragmentation involves:
1)  Move valid entries near the end of the table to the position of
    invalid entries near the front of the table.
2)  Shrinking the table to cut off trailing invalid entries.

This change updates the existing tests to pass, but still needs new
tests for some of the edge cases.

Bug: 150887808
Bug: 149100568
Test: Linux unit tests and Android unit tests
Change-Id: I70c7b296e5e4b367746fcdaabbf0f12dcfb39230
2020-04-30 18:00:25 -07:00
Alex Dale
f3d01f6f96 Merge "Suppress error for removing lingering offline licenses." into rvc-dev am: 792e17a8c4 am: 3c2ae73dba
Change-Id: I51a25bfed2aae1632eae22d249ba368bf79c5ed8
2020-05-01 00:24:35 +00:00
Alex Dale
f85508f4b3 Merge "Suppress error for removing lingering offline licenses." into rvc-dev am: 792e17a8c4 am: d7f5a74ea3
Change-Id: I3bca213757648556ed9ceb7b8ca0349ee170a119
2020-05-01 00:24:23 +00:00
Alex Dale
d7f5a74ea3 Merge "Suppress error for removing lingering offline licenses." into rvc-dev am: 792e17a8c4
Change-Id: Ia522d7b007a4088ff7f1812115196a06408ea186
2020-05-01 00:09:49 +00:00
Alex Dale
3c2ae73dba Merge "Suppress error for removing lingering offline licenses." into rvc-dev am: 792e17a8c4
Change-Id: Ie2e4862f5415f46cd5c3a78a5c8651017f8507c2
2020-05-01 00:09:40 +00:00
Alex Dale
792e17a8c4 Merge "Suppress error for removing lingering offline licenses." into rvc-dev 2020-04-30 23:53:44 +00:00
Rahul Frias
c600c70f8c Merge "Do not log nonces" into rvc-dev am: d627fdfdd4 am: da19e563f5
Change-Id: I97073ad5e2f8850ebe7757744ace8b49cfb124a7
2020-04-30 21:13:11 +00:00
Rahul Frias
96a3893440 Merge "Do not log nonces" into rvc-dev am: d627fdfdd4 am: d39e5f3ad3
Change-Id: I7359b0ed52308d96216b3c55b2fd2fc5efd5a2e9
2020-04-30 21:12:45 +00:00
Rahul Frias
da19e563f5 Merge "Do not log nonces" into rvc-dev am: d627fdfdd4
Change-Id: I1a767568408f306b5ff8b2070f362556ba331ef6
2020-04-30 20:55:12 +00:00
Rahul Frias
d39e5f3ad3 Merge "Do not log nonces" into rvc-dev am: d627fdfdd4
Change-Id: I3866ed9ac5df8873609a95303a716664fc293490
2020-04-30 20:54:36 +00:00
Rahul Frias
d627fdfdd4 Merge "Do not log nonces" into rvc-dev 2020-04-30 20:40:42 +00:00
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
874b639de1 [automerger skipped] Accept a security level to be specified during provisioning am: e27bc4ba6a am: 2ffb86ffca -s ours
am skip reason: Change-Id I8d9234eec2b23a9c913e77a709943b431e25e43e with SHA-1 e27bc4ba6a is in history

Change-Id: I889758a62f9c834e36aabf91a9a8bbc3ec28cf3b
2020-04-30 00:42:17 +00:00
Rahul Frias
d3920095ba Accept a security level to be specified during provisioning am: e27bc4ba6a am: 8429ab587a
Change-Id: I27505670c228a8cdfa4930814b205270b612eafb
2020-04-30 00:41:36 +00:00
Rahul Frias
2ffb86ffca Accept a security level to be specified during provisioning am: e27bc4ba6a
Change-Id: I40d648eadb71cc4677fb9b38f8e766ee4f552c19
2020-04-30 00:27:14 +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
aec7696984 Merge "Verify error code when usage entry in use" into rvc-dev am: 6bd68c9660 am: c14031eb7b
Change-Id: I392d826aa2e377612405dcd61261b9d9096520c0
2020-04-28 17:58:48 +00:00
TreeHugger Robot
248ec379d2 Merge "Fix buffer size on generic decrypt tests" into rvc-dev am: 9448696b9f am: 48a1c257fd
Change-Id: I993c4401359021539fcd668e978fb3f68d93d340
2020-04-28 17:58:28 +00:00
TreeHugger Robot
925db173aa Merge "Verify error code when usage entry in use" into rvc-dev am: 6bd68c9660 am: 6fd344812d
Change-Id: I9097d87eae51f821201e2cc6334c79b2f4494110
2020-04-28 17:57:59 +00:00
TreeHugger Robot
8b05bc3ed5 Merge "Fix buffer size on generic decrypt tests" into rvc-dev am: 9448696b9f am: ed4daa7583
Change-Id: I719260bb570ec546cf31c44146f10997f1755ad3
2020-04-28 17:57:53 +00:00
TreeHugger Robot
c14031eb7b Merge "Verify error code when usage entry in use" into rvc-dev am: 6bd68c9660
Change-Id: I9ee2b3a47a3a61e0596195de39f9e47a4128ec33
2020-04-28 17:42:16 +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
48a1c257fd Merge "Fix buffer size on generic decrypt tests" into rvc-dev am: 9448696b9f
Change-Id: I5d365b629a6c13c36b60d90680c012d81f360baf
2020-04-28 17:42:06 +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
70e71421eb Correct OpenSessions_1_1 test failure am: 3df8bc5133 am: 3601ac7387
Change-Id: Iec573e53829047daf055003815841c2cc30641c2
2020-04-24 23:27:56 +00:00
Rahul Frias
37606c6956 Correct OpenSessions_1_1 test failure am: 3df8bc5133 am: 086aa7b283
Change-Id: Icb635a36a2b60b6a9410fc786c57ba3020760ac7
2020-04-24 23:27:26 +00:00
Rahul Frias
3601ac7387 Correct OpenSessions_1_1 test failure am: 3df8bc5133
Change-Id: I3a11cc8034711d6e1219d3b248fdcf73d7f155e8
2020-04-24 23:11:45 +00:00
Rahul Frias
086aa7b283 Correct OpenSessions_1_1 test failure am: 3df8bc5133
Change-Id: I4c1eb3590a956967e85cb1d63969e002a026e8a0
2020-04-24 23:11:21 +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
d56a6bffd2 Merge "Correct reporting of KeyStatus usable in future" into rvc-dev am: d260c2cf2d am: 0b0d3500ec
Change-Id: I03c8b87873e5bb5bf806d7890629a5082caeb409
2020-04-20 19:38:38 +00:00
Rahul Frias
c00f9a3ce1 Merge "Correct reporting of KeyStatus usable in future" into rvc-dev am: d260c2cf2d am: dec9af442b
Change-Id: Ie281c339b05d7691b6e36b3abec67ee2db27aa7a
2020-04-20 19:37:20 +00:00
Rahul Frias
0b0d3500ec Merge "Correct reporting of KeyStatus usable in future" into rvc-dev am: d260c2cf2d
Change-Id: I44b9672e6d1ef99ef2ef95bdb8eb04edc811b27a
2020-04-20 19:20:22 +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
d89f49b089 Update OEMCrypto documents am: 15b1cd9cc9 am: b38e279ed6
Change-Id: Ife6573b0ab697e9f4de9a1f9f1f24b5936464e42
2020-04-13 18:53:23 +00:00
Fred Gylys-Colwell
045e637317 Update OEMCrypto documents am: 15b1cd9cc9 am: 02443e2142
Change-Id: I5e67c8eb7a93e8d8adb9cec006a1c3b38d869b85
2020-04-13 18:53:13 +00:00
Fred Gylys-Colwell
b38e279ed6 Update OEMCrypto documents am: 15b1cd9cc9
Change-Id: I2c5f7fc814a621642a2376f98ef25eb4d10c392f
2020-04-13 18:24:57 +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
bf48be8d9a WVDrmPlugin signRSA: check arguments before caller am: 2278917116 am: 1659f38dd4
Change-Id: I9f2ec442ca45e27b41caf7f0d560927539e027b2
2020-04-08 20:26:12 +00:00
Robert Shih
b8f7c9ce95 WVDrmPlugin signRSA: check arguments before caller am: 2278917116 am: 983698e6cb
Change-Id: Ib6b8e488f99ce244da01aad2fee7325d0db0ac34
2020-04-08 20:24:56 +00:00