Commit Graph

3701 Commits

Author SHA1 Message Date
Automerger Merge Worker
a0eb7bfe04 Merge "Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b am: 089fe5d90b" into rvc-d1-dev-plus-aosp 2020-05-27 04:17:36 +00:00
TreeHugger Robot
e3a6cee1ed Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b am: 089fe5d90b
Change-Id: I1eddafa565b76b571a54dfacb96e02b8049cdc33
2020-05-27 04:17:33 +00:00
TreeHugger Robot
fbd9ca7eca Merge "The Entitlement key map was not being cleaned up." into rvc-dev am: bd8e573e0c am: 5bedd9c4ad
Change-Id: I0114b7dd12054575199c5eeb021617842f1d5b4a
2020-05-27 04:17:32 +00:00
TreeHugger Robot
3889252bfc Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b am: 208a088e8e
Change-Id: I174696645e9885044023ad9177fcc6780d928178
2020-05-27 04:17:20 +00:00
TreeHugger Robot
5bedd9c4ad Merge "The Entitlement key map was not being cleaned up." into rvc-dev am: bd8e573e0c
Change-Id: I992d0c2d9da83a6d192a019b1fca2c1b774bad92
2020-05-27 04:00:54 +00:00
TreeHugger Robot
089fe5d90b Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b
Change-Id: If61e903fb3b32cb9cf610511c07585eeb942f157
2020-05-27 04:00:28 +00:00
TreeHugger Robot
208a088e8e Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b
Change-Id: I9e2aadbdbfa628e5987df9ea780c85f8a64e7b86
2020-05-27 04:00:22 +00:00
TreeHugger Robot
bd8e573e0c Merge "The Entitlement key map was not being cleaned up." into rvc-dev 2020-05-27 03:43:48 +00:00
TreeHugger Robot
7534d9795b Merge "Start playback timer in integration tests" into rvc-dev 2020-05-27 03:43:30 +00:00
Fred Gylys-Colwell
0a165bbf44 Update TimeRollbackPrevention unit test am: 75575418d0 am: d22ef11122
Change-Id: Ia251d06305a373715303be4c315401552e8d44f9
2020-05-21 22:41:23 +00:00
Fred Gylys-Colwell
51cf7e4668 Update TimeRollbackPrevention unit test am: 75575418d0 am: 7cd14be01d
Change-Id: Ifc0acc1b95a25f071bafdaf6474bdadfe594a483
2020-05-21 22:41:00 +00:00
Fred Gylys-Colwell
d22ef11122 Update TimeRollbackPrevention unit test am: 75575418d0
Change-Id: I1a0345208fcbce3a03798d9641725a67f218ea6f
2020-05-21 22:29:15 +00:00
Fred Gylys-Colwell
7cd14be01d Update TimeRollbackPrevention unit test am: 75575418d0
Change-Id: I3c6e54676e35581d0dfa255e230b7b4094f783bb
2020-05-21 22:29:14 +00:00
Fred Gylys-Colwell
75575418d0 Update TimeRollbackPrevention unit test
Merge from Widevine repo of http://go/wvgerrit/100110

The unit test TimeRollbackPrevention was broken for several
reasons. This CL reduces the test to its most basic functionality and
updates it to be compatible with a v16 oemcrypto.

This CL also adjusts the fake clock used by the buildbot to fake
sleeping backwards, so that the TimeRollbackPrevention test can also
be run on the buildbot.

Bug: 155773482
Bug: 79422351
Test: unit tests on buildbot, and on flame w/v16 modmock
Change-Id: I3027018b17b738281989e63ae6b0729757217d05
2020-05-20 13:47:28 -07:00
Fred Gylys-Colwell
e9dfca1219 The Entitlement key map was not being cleaned up.
Merge from Widevine repo of http://go/wvgerrit/100385

The map now contains unique_ptr instead of raw pointers
to ensure the memory is released.

Bug: 156780432 OEMCrypto Fuzzing: Fix OEMCrypto Memory Leak.
Test: oemcrypto reference code only
Change-Id: I78054f9207399f052d6e4bfdfa96824f6e050bac
2020-05-19 10:58:05 -07:00
Fred Gylys-Colwell
f6229788b0 Start playback timer in integration tests
Merge from Widevine repo of http://go/wvgerrit/100328

Several integration tests in WvCdmRequestLicenseRollbackTest had been
testing the duration of a license. However, the license they request
sets the playback duration and not the rental duration. That means the
timer we are checking does not start until the first playback. To fix
the tests, we simply add a decrypt operation right after the license
is received.

Test: integration tests w/v16 mod mock.
Bug: 156854660
Change-Id: Ie4f017c82db8aaf084ad050de3fcb7f51987c97e
2020-05-18 20:57:41 +00:00
Fred Gylys-Colwell
7ed988ef1f License release does not use core message am: 760bf71908 am: 75cae91c79
Change-Id: I1aedd3a72479940d8a35d96f13e3c91031abf712
2020-05-14 22:05:45 +00:00
Fred Gylys-Colwell
fa074ccc04 License release does not use core message am: 760bf71908 am: 98ca694dcd
Change-Id: I303f3b4d8893f9d99f34f7db118588a7c433ed25
2020-05-14 22:05:22 +00:00
Fred Gylys-Colwell
75cae91c79 License release does not use core message am: 760bf71908
Change-Id: I5c941e7813b880684b344e56fa84f01c2d0ca97f
2020-05-14 21:45:15 +00:00
Fred Gylys-Colwell
98ca694dcd License release does not use core message am: 760bf71908
Change-Id: Ief5646322d0311f44d9b1040bda5200fdfe76cee
2020-05-14 21:45:15 +00:00
Fred Gylys-Colwell
760bf71908 License release does not use core message
Merge from Widevine repo of http://go/wvgerrit/99843

When processing a license release, the license is not loaded, so
OEMCrypto does not know nonce version information for the core
message. It assumes that all license releases are v15, so it is not an
error for a license release to not have a core message.

This CL also adds some extra logging to tests so that we can track
content id and the pssh. This CL also updates some of the test content
policies when running the local license server. The local license
server is only used for debugging problems.

Bug: 152648172 Integration test WvCdmEngineTest.LicenseRenewal failing
Bug: 156259697 License release does not need core message
Test: Unit tests with v16 mod mock
Change-Id: I04c896adadfb17877ce1115345d2419e0d2489f0
2020-05-13 21:22:43 +00:00
Alex Dale
aebce2017d Update AddEntry() for usage table changes. am: 66e3d69300 am: 0a7e070618
Change-Id: I9ea504a397e2a8fb72deeb88ab0a2ed350ad3b0b
2020-05-01 01:38:43 +00:00
Alex Dale
6088db2efa Added a few edge case unittests for InvalidateEntry(). am: 1e5e221909 am: 4793f1f1b3
Change-Id: I3725b256afaf7d402ff0a903cdb54c42379f38cb
2020-05-01 01:38:42 +00:00
Alex Dale
5f944c1602 Reworked DeleteEntry() into InvalidateEntry(). am: da48461ba2 am: 49458c55d1
Change-Id: I7807c0cb554c18fbccea33b9946feca9dae60b26
2020-05-01 01:38:42 +00:00
Alex Dale
c15d453a9d Update AddEntry() for usage table changes. am: 66e3d69300 am: 4c97abd57a
Change-Id: I01ab56cc902d455d2827af70e54ee57870a52be0
2020-05-01 01:38:03 +00:00
Alex Dale
069de13b94 Added a few edge case unittests for InvalidateEntry(). am: 1e5e221909 am: 51f5315a62
Change-Id: I2389b404ec92b17fac807fd15c2838678d2c3a82
2020-05-01 01:38:01 +00:00
Alex Dale
5558f13d57 Reworked DeleteEntry() into InvalidateEntry(). am: da48461ba2 am: 44cc2500b3
Change-Id: I858b69423e9eec2b1b96a35bc53cda1698503a3f
2020-05-01 01:38:00 +00:00
Alex Dale
0a7e070618 Update AddEntry() for usage table changes. am: 66e3d69300
Change-Id: Id13aecce1f3d62b373517a30bdb6b557e1fc0b4c
2020-05-01 01:22:38 +00:00
Alex Dale
4793f1f1b3 Added a few edge case unittests for InvalidateEntry(). am: 1e5e221909
Change-Id: I5f34d2c928d5e7c6bced7dd8d1f623ef1d651820
2020-05-01 01:22:35 +00:00
Alex Dale
4c97abd57a Update AddEntry() for usage table changes. am: 66e3d69300
Change-Id: I83808cf7ebd0ed0f616766564864943fd152f7c3
2020-05-01 01:22:33 +00:00
Alex Dale
49458c55d1 Reworked DeleteEntry() into InvalidateEntry(). am: da48461ba2
Change-Id: I3c73c57cfc6da856130ad7ba723dd60522285941
2020-05-01 01:22:33 +00:00
Alex Dale
51f5315a62 Added a few edge case unittests for InvalidateEntry(). am: 1e5e221909
Change-Id: I3afd210c896fd0ffa794f1565bf7baee53e4b77e
2020-05-01 01:22:30 +00:00
Alex Dale
44cc2500b3 Reworked DeleteEntry() into InvalidateEntry(). am: da48461ba2
Change-Id: Ic6a6d107a138f9a2ad9b2a935751249587bf540e
2020-05-01 01:22:29 +00:00
Alex Dale
66e3d69300 Update AddEntry() for usage table changes.
[ Merge of http://go/wvgerrit/96071 ]

Changes to how the usage table method InvalidateEntry() behaves
required additional changes to CDM code that uses this method.

This involved some refactoring to AddEntry(), moving the LRU
related code to its own function.

A few unittests had to be changed / removed as the moving
multiple entries changes expectations of several existing tests.

Several additional helper methods have been created to improve
readability.  These include getters for information about the
usage table, a method for releasing stale entries, and a method of
recording LRU metrics.

Bug: 150890014
Bug: 150887808
Bug: 154269671
Test: Linux unit tests and Android unit tests
Change-Id: I11a98f9a2dea9b2ae57b37d7d4483a37be721763
2020-04-30 18:00:25 -07:00
Alex Dale
1e5e221909 Added a few edge case unittests for InvalidateEntry().
[ Merge of http://go/wvgerrit/95365 ]

The changes made to how DeleteEntry (now InvalidateEntry) works
introduced a few additional edge cases which were not covered from the
previous set of unit tests.

Bug: 150887808
Bug: 149100568
Test: Linux unit tests and Android unit tests
Change-Id: I263b72fb708c6546294af23ae5ddbd2e82da34df
2020-04-30 18:00:25 -07: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