Commit Graph

2056 Commits

Author SHA1 Message Date
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
Fred Gylys-Colwell
5228b538f0 Specify units for time based property fields.
Merge from widevine of http://go/wvgerrit/21381

Change-Id: I8b209e1403e94adc7843ff1009c8cd1d5761b917
2016-11-28 21:40:19 -08:00
Fred Gylys-Colwell
f0cee3ad20 Require 20 keys per session and 10 sessions
Merge from widevine repo of http://go/wvgerrit/20981

OMECrypto v12 requires at least 20 keys per session and at least 10
sessions.  This CL updates the unit tests to verify this, and updates
level 3 and mock code to conform.

This CL also updates the level 3 oemcrypto to support 16 sessions and
320 keys total.

b/30140448 Minimum 20 keys per OEMCrypto_Session

Change-Id: Idd38d8f2cdfd6acde6fa7622b5912372bee9e488
2016-11-28 21:36:03 -08:00
Jeff Tinker
97c2c74556 Removing widevine classic
bug:30505334
Change-Id: I312f83c0a13b28d0d98bb8003cabc09a63717ce3
2016-11-16 02:14:32 +00:00
Rahul Frias
3380679886 Address test network issues
[ Merge of http://go/wvgerrit/22140 ]

There are occasional issues when trying to connect to
http://widevine-proxy.appspot.com/proxy . This changes introduces upto
3 retry attempts. The UAT server on appspot is being replaced by UAT on borg
and so it is not worth our while to debug these issues furthur.

b/30022298

Change-Id: I76c1421e93c7c14b5d2bcd7ad07119a705245922
2016-11-10 18:40:10 -08:00
Fred Gylys-Colwell
f248bbb9ee Merge "File util, generic crypto, and key query" 2016-10-25 17:40:54 +00:00
John "Juce" Bruce
a7c4880777 Update Expected Version Number in Canary am: 2201d52b4c am: 2cbe56b613
am: ef03c6795e

Change-Id: I134e9c8f587b666b19debf8517a589208b256ed7
2016-10-19 23:53:06 +00:00
John "Juce" Bruce
ef03c6795e Update Expected Version Number in Canary am: 2201d52b4c
am: 2cbe56b613

Change-Id: I8356adb3b46e1b137fd21a6594c34e2180527386
2016-10-19 23:47:17 +00:00
John "Juce" Bruce
2cbe56b613 Update Expected Version Number in Canary
am: 2201d52b4c

Change-Id: I237cf5e36eca0da53ea6507d4e8e1f070884b61d
2016-10-19 23:30:37 +00:00
John "Juce" Bruce
2201d52b4c Update Expected Version Number in Canary
(This is a merge of go/wvgerrit/21580)

The version number for N-MR1 has been increased to 7.1.1, which
triggered our version number canary. Since this is still N-MR1, no
Widevine version number update is necessary as we already updated it for
N-MR1, but the canary needs to be updated.

Bug: 32018966
Change-Id: Ia1d673f837d9c6a5935f26beec7372b25ea3a6b9
2016-10-19 13:36:01 -07:00
Fred Gylys-Colwell
69ea0b7ed2 Merge "Update oemcrypto_test.cpp" 2016-10-11 00:13:33 +00:00
Fred Gylys-Colwell
3b4e1d80bb Update oemcrypto_test.cpp
This is a merge from the Widevine repo of these three CLs:

http://go/wvgerrit/18008 Update OEMCrypto Performance Unit Test

http://go/wvgerrit/17901 Remove static initialization for member variable

http://go/wvgerrit/17214 Lengthen allowed time for simultaneous decrypt

There's also some code cleanup from http://go/wvgerrit/17971.

Change-Id: I81e1366594e1dbe65260aad96d9c8f77a116f508
2016-10-07 13:09:52 -07:00
Edwin Wong
37b82101ec DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours am: 2ea811a508 am: 2f58b776ff am: c71446e166 am: 8c259382b8
am: 6c23b47497  -s ours

Change-Id: If4d223e4a7f4b3549ef5f97bda445e91757cdb1b
2016-09-23 02:16:53 +00:00
Edwin Wong
0de98c73b4 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours am: 2ea811a508 am: a46fb6b378
am: 01b2534aec  -s ours

Change-Id: I6300c797f54e70ec0df042d670ba6ceebca40d0f
2016-09-23 02:16:39 +00:00
Edwin Wong
6c23b47497 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours am: 2ea811a508 am: 2f58b776ff am: c71446e166
am: 8c259382b8

Change-Id: I54cf5fa260b6aec0cd66007feccce7421fb8881e
2016-09-23 00:42:54 +00:00
Edwin Wong
8c259382b8 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours am: 2ea811a508 am: 2f58b776ff
am: c71446e166

Change-Id: I386bd00bf5e0aa5151ab9b9f001d01d1e94a9ee8
2016-09-22 23:40:12 +00:00
Edwin Wong
01b2534aec DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours am: 2ea811a508
am: a46fb6b378

Change-Id: I20f503141af9d0348ded43089dd3ea911662afd2
2016-09-22 23:20:16 +00:00
Edwin Wong
c71446e166 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours am: 2ea811a508
am: 2f58b776ff

Change-Id: Ifa52d677cb2245f91e45108801a735f7e1b3f481
2016-09-22 21:58:14 +00:00
Edwin Wong
2f58b776ff DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours
am: 2ea811a508

Change-Id: If3714615668b5cad40782f5bff25e5e728633269
2016-09-22 18:09:03 +00:00
Edwin Wong
a46fb6b378 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884 am: 5b8ce1cd64 -s ours
am: 2ea811a508

Change-Id: I501c199f50fd8856c164bc74f7e38cd0b926477a
2016-09-22 13:14:16 +00:00
Edwin Wong
2ea811a508 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e am: 428a960884
am: 5b8ce1cd64  -s ours

Change-Id: Iffe795854a4cd89f5793746bb84d86ec3b38f2fc
2016-09-22 12:00:46 +00:00
Edwin Wong
5b8ce1cd64 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1 am: 5d4184e85e
am: 428a960884

Change-Id: If7ecda8b5c07d27da0bf66eb928da5a321890d6d
2016-09-22 11:58:03 +00:00
Edwin Wong
428a960884 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142. am: 0d1787e5a1
am: 5d4184e85e

Change-Id: I3788141d668dbfd0d3ede873f15589f08fd261bb
2016-09-22 08:14:08 +00:00
Edwin Wong
5d4184e85e DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142.
am: 0d1787e5a1

Change-Id: Ieb5d758c6061dc1d2fbaf78b6ab629064da0f5c7
2016-09-22 00:30:50 +00:00
Edwin Wong
0d1787e5a1 DO NOT MERGE Update Classic Widevine libs to 4.5.0.10142.
Remove openssl external symbols from libssl.a and libcrypto.a.

Widevine repo reference:
https://widevine-internal-review.googlesource.com/#/c/17990/
https://widevine-internal-review.googlesource.com/#/c/18004/

bug: 28013024
Change-Id: I8a6dd5a17f896a65da8209680ef200a953b21e80
2016-09-19 15:17:46 -07:00