Commit Graph

2030 Commits

Author SHA1 Message Date
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
Fred Gylys-Colwell
50fe997cf2 OEMCrypto_GetDeviceID should return Not Implemented for Prov 3.0
Merge from Widevine repo of http://go/wvgerrit/22402

This CL updates the oemcrypto reference implementation (mock) to
return OEMCrypto_ERROR_NOT_IMPLEMENTED from OEMCrypto_GetDeviceID when
the device is configured to use provisioning 3.0.

This CL also moves unit test for OEMCrypto_GetDeviceID to the section
that is run only for keybox using devices.

b/33178932

Change-Id: Ie4f9346132ce305bdbd47474dc4c0f6268f3d444
2016-11-30 15:54:00 -08:00
Fred Gylys-Colwell
1d5a03cb40 OEMCrypto Refresh License Tests with PST
Merge from widevine repo of http://go/wvgerrit/22409

This CL adds unit tests for refreshing online and offline licenses
that have usage table entries.

b/32609464

Change-Id: I5166a43525ebb324bc2f253cee6b6f34da697cec
2016-11-30 15:52:29 -08:00
John Bruce
e990c82466 Merge "Simplify IV Incrementation" 2016-11-30 23:39:42 +00:00
John W. Bruce
3847adb78e Simplify IV Incrementation
(This is a merge of go/wvgerrit/22441)

The IV incrementation code in Widevine DRM Plugin includes complexity
for handling partial crypto blocks in "cens" mode, a situation that
cannot actually happen. This commit changes the code to no longer handle
this case specially.

Bug: 28696811
Test: No tests for this code path due to bug 28295739
Change-Id: I77f8434a9785bf028509387c06db217a5de2b91b
2016-11-30 11:17:17 -08:00
Fred Gylys-Colwell
7fc037f1a9 Update Key Control Verification String
Merge from widevine repo of http://go/wvgerrit/22382

This updates the key control verification string in the haystack, in
the reference oemcrypto (mock), and in the oemcrypto unit tests.

The unit tests now set the key control block to be kc12 for all
licenses if the API is set to version 12.  Previously, we only used
the more recent verification codes if the key control block used
recent features.

This should help prevent future incidents like b/32830469.

Change-Id: I6c215b4058445a6d807610af94457598f26d591a
2016-11-29 16:10:13 -08:00
Fred Gylys-Colwell
08ad98cad9 Implement provisioning 3.0 functionality in oemcrypto mock
Merge from widevine repo of http://go/wvgerrit/21684

This CL adds provisioning 3.0 functionality to the OEMCrypto reference
implementation.

Change-Id: I60c1fd88f246d443e0ae59ad56862c2ea9d95445
2016-11-29 16:07:00 -08:00
Fred Gylys-Colwell
3e525dfdd3 OEMCrypto rewrap rsa key 3.0 unit tests
Merge from widevine repo of http://go/wvgerrit/21683

This CL adds unit tests for OEMCrypto_RewrapDeviceRSAKey30 for devices
that use provisioning 3.0.

Change-Id: Ib1a5566de343365b2ae3531f375ac2cc6d86ee53
2016-11-29 15:18:19 -08:00
Fred Gylys-Colwell
053ff5bd3c OEMCrypto Tests Provisioning Method
Merge from widevine repo of http://go/wvgerrit/21682

This CL updates oemcrypto/test/oec_device_features.cpp to figure out
the provisioning method and filter out tests that are not relevant to
the device's method.

This CL also introduces unit tests for GetOEMPublicCertificate.

Unit tests for RewrapDeviceRSAKey30 will be in a future CL.

Change-Id: Ib7065ce866d1171ca61b9aa08188fa2ac8d90fc2
2016-11-29 15:15:08 -08:00
Fred Gylys-Colwell
0fb76d5c1b Refactor OEMCrypto Unit Tests
Merge from widevine repo of http://go/wvgerrit/21681

This CL refactors some oemcrypto unit tests in preparation for adding
Provisioning 3.0 tests.

- The signature GenerateNonce has changed.  Instead of the caller
  passing in a pointer for the nonce, we store the nonce in a member
  variable of Session.

- GenerateDerivedKeys is being replaced by InstallTestSessionKeys.
  This sets up and calls the appropriate derive keys method.  This
  function is in the test class, instead of the session class so that
  multiple sessions in a class can share the same wrapped rsa key.
  This will be modified for provisioning 3.0 in a future CL.

- Rename tests that require a keybox.  Some tests are specific for
  using a keybox to request a DRM cert. These tests are renamed so we
  can filter them out on devices that use an OEM Cert.  Corresponding
  tests for devices using provisioning 3.0 will be in a future CL.

- Some member variables and methods in the class Session were not
  used.  They are removed.

- Added openssl smart pointer.

- Comments.  I added comments.

- clang format.

Change-Id: Ib579a322858e0ef92652a42167241b35cf85a041
2016-11-29 15:05:23 -08:00
Fred Gylys-Colwell
4cac936b10 OEMCrypto v12 Haystack and Adapter
Merge of several CLs from the widevine repo.

Merge from widevine repo of http://go/wvgerrit/22440
Build OEMCrypto v12 Haystacks with cache flush

level3/mips/libwvlevel3.a  Level3 Library 4465 Nov 29 2016 13:34:45
level3/arm/libwvlevel3.a  Level3 Library 4445 Nov 29 2016 14:02:08
level3/x86/libwvlevel3.a  Level3 Library 4464 Nov 29 2016 14:22:21

Merge from widevine repo of http://go/wvgerrit/22403
Pull cache flush out of Haystack

Merge from widevine repo of http://go/wvgerrit/21145
OEMCrypto v12 stubs -- just the header file changes.

Merge from widevine repo of http://go/wvgerrit/21146
Add OEMCrypto v12 functions to profiler

This CL adds the new oemcrypto v12 functions for provision 3.0 to the
list of profiler functions.

Merge from widevine repo of http://go/wvgerrit/21143
OEMCrypto v12 adapter

This CL updates the oemcrypto dynamic and static adpaters to include
oemcrypto v12 funtionality.  It adds the three new Provisioning 3.0
functions.

It also adds code in the initialization routine to null out all of
the function pointers if any of them fail to load.  It is better to
fall back to level 3 than to use an inconsistent level 1.

b/31528025

Change-Id: I3579dc93e00ad7e7c743beecdd8291eac557d4e4
2016-11-29 14:56:36 -08:00
Fred Gylys-Colwell
6d000b5295 OEMCrypto v12 Header
Merge from widevine repo of http://go/wvgerrit/21710

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

This CL was split off from http://go/wvgerrit//18603 because that
review is now concentrating on clarification and wording issues.

This CL is just for the header, and API changes.

Change-Id: I7cc423726433dcac9fb907246b6b6dd64f5c3367
2016-11-28 21:56:00 -08:00
Fred Gylys-Colwell
a200710d53 Add unit test to verify signature
Merge from widevine repo of http://go/wvgerrit/21521

On devices that use provisioning 3.0, the function
OEMCrypto_GenerateSignature will only be used for a license renewal.
This CL adds a call to OEMCrypto_GenerateSignature to the refresh key
tests.  Otherwise, there would be no coverage at all for that
function.

Change-Id: Icbd568eea3f9f256cc9b0b441f7907b316bb5b69
2016-11-28 21:54:03 -08:00
Fred Gylys-Colwell
47f454839e Unit Test for OEMCrypto_ERROR_KEY_EXPIRED
Merge from widevine repo of http://go/wvgerrit/21141

All of the decrypt calls and the SelectKey call should return
OEMCrypto_ERROR_KEY_EXPIRED on error.  This CL updates the oemcrypto
unit tests, reference mock, and level 3 code.

b/28294273

Change-Id: I7ac6a3652e0b2fe5a46071e1c2eda00daeed7a33
2016-11-28 21:52:11 -08:00
Fred Gylys-Colwell
7214064635 Use fast random for unit tests
Merge from widevine repo of http://go/wvgerrit/21560

For OEMCrypto v12 we explicitly require OEMCrypto_GetRandom to handle
buffers up to 32 bytes long.  This CL relaces the use of GetRandom
with openssl's RAND_psuedo_bytes to fill test vectors.

b/31464102

Change-Id: Ia0006b92bb12b98e9c130068dbb31b5f67281de2
2016-11-28 21:47:44 -08:00
Fred Gylys-Colwell
67b06a70e4 Buffer Size Unit Tests
Merge from widevine repo of http://go/wvgerrit/21260

This CL adds some oemcrypto unit tests for various buffer sizes, as
described in b/28887904 and the OEMCrypto v12 specification.

Encryption and Decryption buffers can be 100k large.  License request
and response messages can be 8k. A provider session token (pst) can be
at most 255 bytes long.

I also passed the code through clang-format.

b/28887904

Change-Id: Ia3e317c0f6466e663461e66b610c9a98a90efb0a
2016-11-28 21:44:36 -08:00