Commit Graph

1945 Commits

Author SHA1 Message Date
John Bruce
0d1a9e9b3c Merge "Break Decrypt Buffers Into 100KiB Blocks As Needed" 2017-01-19 19:48:00 +00:00
John W. Bruce
d30c5f8d33 Break Decrypt Buffers Into 100KiB Blocks As Needed
(This is a merge of go/wvgerrit/22949)

Starting with OEMCrypto v12, we are guaranteeing to integration partners
that the buffers passed to OEMCrypto_DecryptCENC and
OEMCrypto_CopyBuffer will not be more than 100KiB (102400 bytes) in
size. For requests larger than this, we will first try to send the
buffer to OEMCrypto anyway. (in case the integration supports buffers
larger than the minimum) In the event that the buffer is rejected, we
will break it up into 100KiB chunks and send them down individually for
decryption.

Breaking a subsample into smaller subsamples necessitates knowledge of
how to update other decryption parameters (like the offsets and the IV)
that previously the CDM Core has not needed to know about. Until now,
this knowledge lived in the glue layer on the Android CDM and nowhere
on the CE CDM. Now, the CryptoSession has a subset of this knowledge, in
order to break up buffers successfully.

For testing purposes, the Mock OEMCrypto has been modified to only
support the smallest buffer size. In order to make sure the chunking
code was being exercised by them, the CE CDM tests had to have the
amount of data they decrypt increased by several orders of magnitude. To
contain this growth, I have moved the test data to its own file.

Bug: 31381719
Test: Ran the updated CE CDM integration tests
Test: Modified the OEMCrypto dynamic adapter to pretend both L3 and L1
only support 100KiB buffers on a Marlin and a Ryu. Confirmed that the
GTS H.264 tests (which have subsamples over 100KiB) passed still. A
similar test was attempted on Fugu but Fugu cannot pass these tests even
without this change present.
Change-Id: Iabe7db3d87554cd1352f10a7524cd55352818397
2017-01-17 16:07:45 -08:00
Rahul Frias
b413037733 Merge "Don't read from closed sockets" 2017-01-13 09:14:07 +00:00
Rahul Frias
41ba5aa745 Don't read from closed sockets
[ Merge of http://go/wvgerrit/17958 ]

This CL might help diagnose the build bot problem.

b/34261498

Test: All unittests other than some oemcrypto, request_license_test
passed. Those tests failed with or without this CL.

Change-Id: I71e48284b52a1177c6e3b4c9a8bdd12b77cc9f2d
2017-01-12 17:56:59 -08:00
Rahul Frias
0ee9d95a03 Rename PolicyEngine::CanDecrypt to CanDecryptContent.
[ Merge of http://go/wvgerrit/22517 ]

b/34211676

Test: All unittests other than some oemcrypto, request_license_test
passed. Those tests failed with or without this CL.

Change-Id: I86a2ff041aae57ac46e9f9f7bac38ec4599a0fa7
2017-01-11 15:44:52 -08:00
Rahul Frias
516718727e Rename "Is*Expired" to "Has*Expired" in PolicyEngine
[ Merge of http://go/wvgerrit/22516 ]

b/34211676

Test: All unittests other than some oemcrypto, request_license_test
passed. Those tests failed with or without this CL.

Change-Id: Ie973f468f9efd05bdafcf90164dae185a6ce11dc
2017-01-11 15:44:38 -08:00
Rahul Frias
8e3206c1be Update duration semantics for PolicyEngine.
[ Merge of http://go/wvgerrit/22237 ]

This only changes the existing fields of the policy.

License::Policy::license_duration_seconds represents the end time
(relative to the license start time) that the license can be used.
This overriding other times if this is earlier.

License::Policy::rental_duration_seconds represents the end time
(relative to the license start time) that the license can be used
before playback starts. Once playback starts, this no longer applies.

License::Policy::playback_duration_seconds represents the end time
(relative to the playback start time) that the license can be used after
playback has started.

b/34211676

Test: Ran new unittests and reran old tests. All tests other than some
oemcrypto, request_license_test passed. Those tests failed with or
without this CL.

Change-Id: I34e7e39a7ab864300806c557b480f093aec8e545
2017-01-11 15:44:23 -08:00
Rahul Frias
a83a9ae540 Merge "Add Cdm::setVideoResolution()" 2017-01-11 09:19:47 +00:00
Rahul Frias
40159825e8 Add Cdm::setVideoResolution()
[ Merge of http://go/wvgerrit/22744 ]

Pass resolution information into policy engine for constraint
checking.

b/33380824

Test: Reran unittests. All tests other than some oemcrypto,
request_license_test passed. Those tests failed with or without this CL.

Change-Id: I405099b1f66a47fa0c2579e2ae248dd78fa4e98a
2017-01-09 21:42:42 -08:00
Rahul Frias
079ee03869 Offline playback for fastball
[ Merge of http://go/wvgerrit/18560 ]

This adds support for offline playback. If the content contains
mutiple playlists which contain differing EXT-X-KEY attribute lists,
each of those keys will need to be saved and restored into separate
sessions.

b/30041089

Test: Added unit tests to cover new functionality. Some oem_crypto,
request_license_test failures but the same as without this CL.

Change-Id: Ia1b877e12a67e8a720d29897ac7e2da236090123
2017-01-09 19:07:42 -08:00
Jeff Tinker
3bb90b9450 DO NOT MERGE Move legacy widevine classic global lock from framework to vendor/widevine implementation. am: eb9ea09db6
am: 73cb652308  -s ours

Change-Id: I538598cf40b21f168c1ef5a5143482fbbd808c9a
2017-01-09 16:15:25 +00:00
Jeff Tinker
73cb652308 DO NOT MERGE Move legacy widevine classic global lock from framework to vendor/widevine implementation.
am: eb9ea09db6

Change-Id: I5180b05591fe9bd96b0a7fea8dbddc3c601ee033
2017-01-09 16:10:47 +00:00
Jeff Tinker
eb9ea09db6 DO NOT MERGE Move legacy widevine classic global lock from framework to
vendor/widevine implementation.

This prevents a hang on contention for the lock if the datasource
read blocks during sniffing.

bug:28888414
Change-Id: I3568a36b9de10b7e977b19f2f6c66106ff784d01
2017-01-07 14:56:36 -08:00
Rahul Frias
182f3c8058 Avoid race condition on closing CDM session.
[ Merge from go/wvgerrit/22920 ]

Automated tests reveal a race condition between closing
a session and the periodic policy timer event. If a close
session was in progress (WVDrmPlugin::closeSession) and
CdmEngine::CloseSession caused the CdmEngine::session_list_lock_
to be held, a call into CdmEngine::OnTimerEvent would pend on the
release of the lock.

The close session would continue to deallocate the session
and disable (stop) the policy timer leaving the CdmEngine::OnTimerEvent
call in an undefined state. This would result in an ANR.

This subtle race-condition was introduced when changes were made
to add in per-origin storage [ http://go/wvgerrit/17971 ]. This seems
to happen at a low frequency (~ < 0.5%).

To address a lock has been introduced to protect the map
WvContentDecryptionModule::cdms_.

Test: Unit tests + 200 aupt test iterations

b/33343891

Change-Id: I9788db8a7d1df84f0df82cdbadb9d0f0fbe21e4e
2017-01-06 16:43:48 -08:00
John W. Bruce
5f4397fdc4 NYC-MR2 Widevine Version Number Bump am: 1b298c6ec7
am: 8309a406b3

Change-Id: I10117c8fd120a64489b0094a231c9b3e63ba3b2c
2017-01-06 02:03:24 +00:00
John W. Bruce
8309a406b3 NYC-MR2 Widevine Version Number Bump
am: 1b298c6ec7

Change-Id: Ifa32ac7618652789acd9281cd5d2d9ba2eed8735
2017-01-06 02:01:00 +00:00
John W. Bruce
1b298c6ec7 NYC-MR2 Widevine Version Number Bump
(This is a merge of go/wvgerrit/22897)

Bumps the Widevine version to 4.2.0 for NYC-MR2 and also updates the
test to expect the NYC-MR2 OS version number.

Bug: 32955300
Test: request_license_test
Change-Id: I2f186928f20e0848cbeef5fef2182045ad27140a
2017-01-05 15:50:31 -08:00
Fred Gylys-Colwell
89bd713a35 Merge "Level 3: Throw out keybox with wrong system id *DO NOT MERGE*" into nyc-mr2-dev am: cc8d6942d6
am: b6c6ac8d5b  -s ours

Change-Id: I54954d3dc0dd135afb678af46cb39d0d1000e652
2017-01-05 01:02:55 +00:00
Fred Gylys-Colwell
244b98ba67 Level 3: Throw out keybox with wrong system id *DO NOT MERGE* am: 7e7ef2bb58
am: dddd1c738c  -s ours

Change-Id: I620873690b53be34e4e73aa56f70efcc90e1ea75
2017-01-05 01:02:45 +00:00
Fred Gylys-Colwell
b6c6ac8d5b Merge "Level 3: Throw out keybox with wrong system id *DO NOT MERGE*" into nyc-mr2-dev
am: cc8d6942d6

Change-Id: Ic61e7cd16c98d108485c9d587f720056a7098244
2017-01-05 00:59:40 +00:00
Fred Gylys-Colwell
dddd1c738c Level 3: Throw out keybox with wrong system id *DO NOT MERGE*
am: 7e7ef2bb58

Change-Id: Iebd010ff1967ef6135cfa72862307de2c7c2f9cf
2017-01-05 00:59:39 +00:00
Fred Gylys-Colwell
cc8d6942d6 Merge "Level 3: Throw out keybox with wrong system id *DO NOT MERGE*" into nyc-mr2-dev 2017-01-05 00:55:39 +00:00
Fred Gylys-Colwell
2d0bf3e813 Merge "OEMCrypto v12 Documentation" 2016-12-28 20:12:38 +00:00
Aaron Vaage
45ff894f62 Merge "[ OEMCrypto Profiler ] Removed Call Table" into nyc-mr2-dev am: 37fc42c5b8
am: f4e81ee21e

Change-Id: I0920702d354279b57223a6a53e1a90bca6d166f8
2016-12-13 18:17:08 +00:00
Aaron Vaage
9d464cff5d [ OEMCrypto Profiler ] Removed Call Table am: 4ad500d878
am: 9ae9de59d4

Change-Id: Ic34ac456ba79b8fcdf215eb7174bfc40181d1974
2016-12-13 18:16:58 +00:00
Aaron Vaage
f4e81ee21e Merge "[ OEMCrypto Profiler ] Removed Call Table" into nyc-mr2-dev
am: 37fc42c5b8

Change-Id: Ibbf96ea5b391278e810648290f785515aa73a352
2016-12-13 18:03:34 +00:00
Aaron Vaage
9ae9de59d4 [ OEMCrypto Profiler ] Removed Call Table
am: 4ad500d878

Change-Id: I52bc32fef3a70681c3443f6f862e1bee83bf17f2
2016-12-13 18:03:32 +00:00
Aaron Vaage
37fc42c5b8 Merge "[ OEMCrypto Profiler ] Removed Call Table" into nyc-mr2-dev 2016-12-13 17:41:19 +00:00
Rahul Frias
98a3e25685 Merge "Address test network issues" into nyc-mr2-dev am: f77df16bd5
am: 152629290b

Change-Id: Ic13b178277db6a7d75215903c9a8b54dde82117c
2016-12-13 09:30:33 +00:00
Rahul Frias
91f0894685 Address test network issues am: 3380679886
am: 939401861e

Change-Id: I3ff1b57f1978053394db042265a5de20e389424a
2016-12-13 09:30:21 +00:00
Rahul Frias
152629290b Merge "Address test network issues" into nyc-mr2-dev
am: f77df16bd5

Change-Id: I3d9410fc4a7bc5582996ee0c6335433e11a20559
2016-12-13 09:23:21 +00:00
Rahul Frias
939401861e Address test network issues
am: 3380679886

Change-Id: I0cadd9a2713f1614b3f4a97b234a1d065cb42425
2016-12-13 09:23:21 +00:00
Rahul Frias
f77df16bd5 Merge "Address test network issues" into nyc-mr2-dev 2016-12-13 09:18:10 +00:00
Fred Gylys-Colwell
7e7ef2bb58 Level 3: Throw out keybox with wrong system id *DO NOT MERGE*
This CL modifies the haystack code to throw out the keybox if the
system id is wrong.  This should help prevent b/33344450 from
persisting.

Part of this code change was to backport some updates to the haystack
tools on master.

arm/libwvlevel3.a  Level3 Library 4445 Dec  6 2016 16:58:47
x86/libwvlevel3.a  Level3 Library 4464 Dec  6 2016 17:06:21
mips/libwvlevel3.a  Level3 Library 4465 Dec  7 2016 13:36:32

b/33556871

Change-Id: I8dadf4bc7981af6afb970533df61d34b80d133a7
2016-12-12 16:11:08 -08:00
Aaron Vaage
4ad500d878 [ OEMCrypto Profiler ] Removed Call Table
This is a merge of go/wvgerrit/22627

The call table was meant to be a long-term way to track
the performance of all OEMCrypto function calls.

This feature does not get used. Apps that call into the
profiler can generate this from the history.

This change was designed to go into Android O
(go/wvgerrit/22503) but since the Call Table is causing problems
on specific chip sets its being removed in NYC MR2.

Bug: 33550032
Bug: 33459261
Change-Id: I2af417a32452e7d0d0a1ada8794efd849c497dc8
2016-12-12 15:05:07 -08:00
Fred Gylys-Colwell
c268ce1da2 Merge "OEMCrypto_GetDeviceID should return Not Implemented for Prov 3.0" 2016-12-12 22:52:30 +00:00
Fred Gylys-Colwell
264c75cde9 Merge "OEMCrypto Refresh License Tests with PST" 2016-12-12 22:52:17 +00:00
Fred Gylys-Colwell
14d70e666f OEMCrypto v12 Documentation
Merge from Widevine repo of http://go/wvgerrit/18603

This is the documentation changes for OEMCrypto v12.  This
includes Provisioning 3.0 changes.

Comments can be put in the original Google docs:
http://go/oemcrypto WV Modular DRM Security Integration Guide for
Common Encryption (CENC)

http://go/wvdelta12
WV Modular DRM Version 12 Delta

The following features and changes are documented, but not
implemented:
b/28887904 Buffer Size Unit Tests
b/28294273 All OEMCrypto functions should return same error code
           when key expires
b/24469550 Enforce Maximum 16 Byte Key ID Length
b/30140448 Minimum 16 keys per OEMCrypto_Session
b/28316108 Feature Request Key Control Block "No Digital Output"
b/8608578 OEMCrypto_RefreshKeys should not alter key control
          setting except duration
b/30120064 Add OEMCrypto Unit Test for non-paired subsamples
           (for VP9)
b/30141311 Sample OEM Certificate Needed
b/31381719 Divide Samples into Subsamples of at most 100k bytes

Change-Id: Ibf03b55cda822a676cd174ddc292bb35177cddbe
2016-12-06 14:53:19 -08:00
Rahul Frias
e62301a660 Merge "Correct subsample flags in request_license_test" into nyc-mr2-dev am: dab8aab4a8
am: bd0fd7f4d2

Change-Id: I0a96819d61000f1ee8f08ec3ec3ff637bc18c370
2016-12-05 23:07:09 +00:00
Rahul Frias
4c89e58f9b Correct subsample flags in request_license_test am: e7782c1e27
am: 541c9e632a

Change-Id: Ib97b8d7a9bfe57f68275e9193943df84afa729e5
2016-12-05 23:06:59 +00:00
Rahul Frias
bd0fd7f4d2 Merge "Correct subsample flags in request_license_test" into nyc-mr2-dev
am: dab8aab4a8

Change-Id: Ie4a286555edce5ea249257f40f5338dadfa7fc72
2016-12-05 23:03:12 +00:00
Rahul Frias
541c9e632a Correct subsample flags in request_license_test
am: e7782c1e27

Change-Id: I7667fe5cd3ae42b72b5c65686bc9ae8f78fb61af
2016-12-05 23:03:12 +00:00
Rahul Frias
dab8aab4a8 Merge "Correct subsample flags in request_license_test" into nyc-mr2-dev 2016-12-05 22:58:51 +00:00
Rahul Frias
d6d568bd80 Merge "Release offline release sessions" 2016-12-05 22:15:52 +00:00
Rahul Frias
0d307569ea Release offline release sessions -- DO NOT MERGE am: 9a55ca3249
am: 9e5f74eeba  -s ours

Change-Id: I9e3a9620ce45433f4902081e5b6e6caf4c183748
2016-12-05 19:00:35 +00:00
Rahul Frias
9e5f74eeba Release offline release sessions -- DO NOT MERGE
am: 9a55ca3249

Change-Id: If92d87a6d1cf98a786c72070122d7db68444be4f
2016-12-05 18:53:29 +00:00
Rahul Frias
e6f668ca16 Release offline release sessions
[ Merge of http://go/wvgerrit/21960 ]

When an offline release message is generated, a session is created
internally to generate the release and handle the release response.
If the response is never provided (network, server errors),
or there is an error when the response is being processed, the
session may not be closed. This change introduces a time to live for
release sessions of 60 seconds and will be reclaimed after this period.

Test: verified by unittests on angler

b/32223945

Change-Id: I3bd4637733ddf6c343956ed9f97c68d84dc7d4e4
2016-12-04 01:51:09 -08:00
Rahul Frias
9a55ca3249 Release offline release sessions -- DO NOT MERGE
[ Merge of http://go/wvgerrit/21960 ]

When an offline release message is generated, a session is created
internally to generate the release and handle the release response.
If the response is never provided (network, server errors),
or there is an error when the response is being processed, the
session may not be closed. This change introduces a time to live for
release sessions of 60 seconds and will be reclaimed after this period.

b/32223945

Change-Id: I3bd4637733ddf6c343956ed9f97c68d84dc7d4e4
2016-12-02 14:43:53 -08:00
Fred Gylys-Colwell
e363c649ee Merge changes I6c215b40,I60c1fd88,Ib1a5566d,Ib7065ce8,Ib579a322, ...
* changes:
  Update Key Control Verification String
  Implement provisioning 3.0 functionality in oemcrypto mock
  OEMCrypto rewrap rsa key 3.0 unit tests
  OEMCrypto Tests Provisioning Method
  Refactor OEMCrypto Unit Tests
  OEMCrypto v12 Haystack and Adapter
2016-12-02 18:59:24 +00:00
Rahul Frias
e7782c1e27 Correct subsample flags in request_license_test
[ Merge of  http://go/wvgerrit/21980 ]

b/32487750

Change-Id: I5a3c3a768f3d1a81af4e8d897f68cfdbeb3526da
2016-12-01 11:17:59 -08:00