Commit Graph

2591 Commits

Author SHA1 Message Date
Fred Gylys-Colwell
86db60d097 Refine OEMCrypto Mock Logging
Merge from Widevine repo of http://go/wvgerrit/24727

This separates out the logging of decrypt calls from all other calls.
This is useful because we sometimes want to trace all the calls in a
license request, but we don't want logging of decrypt calls which
would slow down playback.

b/37353534
b/35141278

Change-Id: I3f172c02778d86e66d0e1f90344a34c4d3b15a9e
2017-04-20 14:40:38 -07:00
John Bruce
7ef74bf0bc Merge changes Ib82cf7a1,Ice6a8eab into oc-dev am: 3c37343e5c
am: cd3fd8c24b

Change-Id: I628b98c3c02b4367dfc460e040c576c2b131d614
2017-04-20 19:05:07 +00:00
John Bruce
2c963f242d Merge "Move SPOID Enable/Disable Logic Out of WVDrmPlugin" into oc-dev am: 9574bc849a
am: 37e7e51090

Change-Id: Iccb9c0ed6a373fa02758c899242e02aa63195271
2017-04-20 19:04:57 +00:00
Rahul Frias
54b2b6a595 Merge "Prevent segfaults when a session is deallocated" into oc-dev am: 518ce632f7
am: 1627bd1b41

Change-Id: Iba8053f83a17f5ca181c1410cf02f513903c0395
2017-04-20 19:04:45 +00:00
John Bruce
cd3fd8c24b Merge changes Ib82cf7a1,Ice6a8eab into oc-dev
am: 3c37343e5c

Change-Id: I6658996c4b4f16091526a70ce6c731b6b712137c
2017-04-20 17:28:24 +00:00
John Bruce
37e7e51090 Merge "Move SPOID Enable/Disable Logic Out of WVDrmPlugin" into oc-dev
am: 9574bc849a

Change-Id: Ib12e6324072cbc7996afe011051c03ae4598c614
2017-04-20 17:28:14 +00:00
Rahul Frias
1627bd1b41 Merge "Prevent segfaults when a session is deallocated" into oc-dev
am: 518ce632f7

Change-Id: Ibb52c6689a6693795288e0d9c7fdf88ea972045f
2017-04-20 17:28:05 +00:00
John Bruce
3c37343e5c Merge changes Ib82cf7a1,Ice6a8eab into oc-dev
* changes:
  Hash OEM Certificate
  Maxing Out Sessions Can Cause SPOID Failures
2017-04-20 17:21:46 +00:00
John Bruce
9574bc849a Merge "Move SPOID Enable/Disable Logic Out of WVDrmPlugin" into oc-dev 2017-04-20 17:19:50 +00:00
Rahul Frias
518ce632f7 Merge "Prevent segfaults when a session is deallocated" into oc-dev 2017-04-20 17:19:45 +00:00
Fred Gylys-Colwell
06caf917a7 Replace mips library with stubs file am: 45bf89ff8b
am: e06c711519

Change-Id: I69bc86a74fa85b4d27c89d6cee49f6627bb84576
2017-04-20 08:19:08 +00:00
Fred Gylys-Colwell
e06c711519 Replace mips library with stubs file
am: 45bf89ff8b

Change-Id: I3b287f73e12e2214ca962b19cbd738c28398873b
2017-04-20 06:58:41 +00:00
Fred Gylys-Colwell
45bf89ff8b Replace mips library with stubs file
Merge from Widevine repo of http://go/wvgerrit/26202

This is a workaround to fix a broken mips build.

Test: Built for sdk_phone_mips.
b/37523523

Change-Id: I56ce65919303113f712d422d33e335b594292d42
2017-04-19 21:16:57 -07:00
Rahul Frias
f2fccc20cd Prevent segfaults when a session is deallocated
[ Merge of http://go/wvgerrit/26201 ]

Race conditions arose when a session was closed while data was
still queued for decryption in MediaCodec buffers. If a session
is closed while data is still queued for decryption, subsequent
decryption requests will be rejected with a CryptoException
ERROR_SESSION_NOT_OPENED.

Test: Verified by wv unit/integration test and
      WvCdmExtendedDurationTest.DecryptionCloseSessionConcurrencyTest

b/36747801

Change-Id: I044d1d6b9fc886a1c353d20b9c6365319aa71e80
2017-04-19 19:24:04 -07:00
Rahul Frias
0dd1ee8739 Merge changes I9039bc1f,I43758cd2 into oc-dev am: c2969ef0f4
am: 221ac95f1a

Change-Id: Iada5ea5199ea1f9b625152f3313ce4127a4dc0f5
2017-04-20 01:31:34 +00:00
Rahul Frias
221ac95f1a Merge changes I9039bc1f,I43758cd2 into oc-dev
am: c2969ef0f4

Change-Id: I95eda1b053fa299e50d85886258a231c9300f6ed
2017-04-19 23:58:12 +00:00
John W. Bruce
68d26ef98b Remove API Version TODO Comments
(This is a merge of http://go/wvgerrit/26221)

We have agreed on API 26 for O, so these comments can be removed without
making any further changes.

Bug: 34548395
Test: This is a comment-only change. But I verified it builds.
Change-Id: I490befba4f47902a84b60e562a7a5eb162a9f3be
2017-04-19 16:48:14 -07:00
Rahul Frias
c2969ef0f4 Merge changes I9039bc1f,I43758cd2 into oc-dev
* changes:
  Allow decryption of unencrypted data before key has been retrieved
  Correct CryptoException error returned before keys have been loaded
2017-04-19 23:40:51 +00:00
John W. Bruce
ce6bd41627 Define Provisioning-Unique ID for New Device IDs
(This is a merge of wvgerrit/25583)

Devices that use Provisioning 3.0 did not have a Provisioning-Unique ID
defined. Attempting to retrieve it would result in an error.

Devices that use SPOIDs with keyboxes would expose the keybox's real
Provisioning-Unique ID when asked. This is a security flaw.

To solve both cases, an alternative Provisioning-Unique ID is used,
consisting of the Device-Unique ID bitwise-inverted.

Bug: 36065223
Test: run_all_unit_tests.sh
Change-Id: I32512a3e11403e679939187e156904a57a9e24ef
2017-04-19 16:35:29 -07:00
John W. Bruce
8513b71499 Hash OEM Certificate
(This is a merge of wvgerrit/25582)

Provisioning 3.0 devices that do not use SPOIDs have been returning
their full OEM Public Certificate as their device ID. While this is not
a security concern, (it is a PUBLIC cert) the cert is many times larger
than applications are likely expecting. (several kilobytes vs. just a
few bytes) This patch hashes the OEM Public Certificate to produce a
smaller value, but only when it is being provided out of the CDM to a
caller.

Bug: 34716264
Test: run_all_unit_tests.sh
Change-Id: Ib82cf7a174a8bf02ff606edd0394ada13842224c
2017-04-19 16:03:22 -07:00
John W. Bruce
8c5cfa5c7f Rebuild Haystack and Store L3 Keybox in /data/vendor am: 76d3ca9091
am: 84ae8875bf

Change-Id: Ifc4285b0743bb4e0c202f8d97c7844ad0c1fe7e2
2017-04-19 22:21:25 +00:00
John W. Bruce
84ae8875bf Rebuild Haystack and Store L3 Keybox in /data/vendor
am: 76d3ca9091

Change-Id: Ib61e1b2b3ff01addb9bedbbe3d434db337861c6d
2017-04-19 22:01:14 +00:00
TreeHugger Robot
091d35e771 Merge "Undo bad merge" 2017-04-19 19:53:57 +00:00
Rahul Frias
3c971c8964 Merge "Allow OfflineLicenseRenewal test to be repeatedly invoked" into oc-dev am: 6260d4d628
am: 76e0c7b5d3

Change-Id: I74c116f751d23e352ba0df6e8e41558ea567b8a7
2017-04-19 18:27:28 +00:00
Rahul Frias
64de078bc0 Merge "Add usage information tests to device files unit tests" into oc-dev am: 3b68424d1f
am: f3c6cea6dc

Change-Id: I20cad95318f972c4848c2b93a6fcdd62ac62aedc
2017-04-19 18:27:20 +00:00
Rahul Frias
76e0c7b5d3 Merge "Allow OfflineLicenseRenewal test to be repeatedly invoked" into oc-dev
am: 6260d4d628

Change-Id: Id4f4f3f2222be6ddfb45413010e0f192db151158
2017-04-19 18:24:52 +00:00
Rahul Frias
f3c6cea6dc Merge "Add usage information tests to device files unit tests" into oc-dev
am: 3b68424d1f

Change-Id: I841b1a2cbb445415996b0328ded5a36daf99b1df
2017-04-19 18:24:38 +00:00
John W. Bruce
76d3ca9091 Rebuild Haystack and Store L3 Keybox in /data/vendor
(This is a merge of http://go/wvgerrit/25900 and http://go/wvgerrit/25920)

This commit contains the latest Haystack prebuilt binaries based on
the latest OEMCrypto code in the Widevine tree. This is to pick up the
change "Report error OEMCrypto_ERROR_ENTRY_IN_USE", which fixes
several failing unit tests. This CL also adjusts the L3 library so
that it stores its data in the directory specified by the layer above.

level3/x86_64/libwvlevel3.a    Level3 Library 7284 Apr 13 2017 16:58:07
level3/arm/libwvlevel3.a       Level3 Library 4445 Apr 13 2017 16:48:19
level3/mips64/libwvlevel3.a    Level3 Library 7285 Apr 13 2017 23:52:51
level3/mips/libwvlevel3.a      Level3 Library 4465 Apr 13 2017 23:16:02
level3/arm64/libwvlevel3.a     Level3 Library 7283 Apr 13 2017 17:05:12
level3/x86/libwvlevel3.a       Level3 Library 4464 Apr 13 2017 16:36:25

Bug: 36656178
Bug: 37210088
Test: build_and_run_all_unit_tests.sh and GTS tests
Change-Id: Ia5b272cd945f0c9f2fe37ecd0f3ccd2f2ff398bc
2017-04-19 11:23:06 -07:00
Rahul Frias
6260d4d628 Merge "Allow OfflineLicenseRenewal test to be repeatedly invoked" into oc-dev 2017-04-19 18:11:48 +00:00
Rahul Frias
3b68424d1f Merge "Add usage information tests to device files unit tests" into oc-dev 2017-04-19 18:09:40 +00:00
Rahul Frias
0f374af4ab Allow decryption of unencrypted data before key has been retrieved
[ Merge of http://go/wvgerrit/25987 ]

Test: Added Cdm/WvCdmSessionSharingNoKeyTest to request_license_test.
      Verified by wv unit and integration tests.

b/28182987

Change-Id: I9039bc1fca83e2c1044c3af2f47f31dc4fb5c910
2017-04-19 00:47:40 -07:00
Rahul Frias
3d599197be Correct CryptoException error returned before keys have been loaded
[ Merge of http://go/wvgerrit/25983 ]

Earlier versions of android returned CryptoException with
error code ERROR_NO_KEY, when a decrypt call was received before keys were
loaded. Changes to O resulted in ERROR_SESSION_NOT_OPENED being returned
instead. This CL reverts the behaviour.

Also a change to correct CDM error code numbering in comments.

Test: Verified by unit and integration tests

b/37219830

Change-Id: I43758cd29cf9d1945f878ac352a5f26538b48cdb
2017-04-19 00:40:48 -07:00
Rahul Frias
f7c44ee4f7 Merge "Revert "Detect when unable to meet policy requirements"" into oc-dev am: 80798ae11c
am: 0f5f05f9cd

Change-Id: If1e958e1ed2be78a72fc37846b983a207a68a0a7
2017-04-18 20:56:39 +00:00
Rahul Frias
0f5f05f9cd Merge "Revert "Detect when unable to meet policy requirements"" into oc-dev
am: 80798ae11c

Change-Id: Ic5463e04aa477b8af351ea03436263514dafd9ec
2017-04-18 20:51:11 +00:00
Rahul Frias
80798ae11c Merge "Revert "Detect when unable to meet policy requirements"" into oc-dev 2017-04-18 20:37:22 +00:00
Rahul Frias
e733943729 Revert "Detect when unable to meet policy requirements"
This reverts commit 1223330ccc.

b/37460568

Change-Id: I936c06f679126ac50fb2d4753b4270b4ba42def5
2017-04-18 20:03:56 +00:00
John W. Bruce
c0a7655834 Maxing Out Sessions Can Cause SPOID Failures
(This is a merge of http://go/wvgerrit/25581)

To prevent dead DRM Plugins from being instantiated when there are no
sessions available, the time at which the device ID is queried has been
moved from instantiation-time to SPOID-calculation-time.

SPOIDs can now fail to be generated. Which means anything that depends
on a SPOID may fail because of this. However, this is a more actionable
problem for apps than having them receive a dead or unusable DRM Plugin
object.

Bug: 36660726
Test: libwvdrmdrmplugin_hidl_test
Change-Id: Ice6a8eabfee8d48bf2af02e2e7169aa95af9f2e4
2017-04-18 10:25:39 -07:00
John W. Bruce
19947dfe6f Move SPOID Enable/Disable Logic Out of WVDrmPlugin
(This is a merge of http://go/wvgerrit/25580)

While writing fixes for b/36660726, b/34716264, and b/36065223, it
became clear that having the logic that checks whether the device
supports SPOIDs embedded inside WVDrmPlugin was complicating its code
and inhibiting testing of the class. By moving this check into the code
that instantiates WVDrmPlugin, the result of the calculation can be
independently tested while the tests for WVDrmPlugin can put it in
whatever state they need for the sake of unit testing.

As a consequence of this, the check on retrieving the "deviceUniqueId"
byte array property, which was removed when SPOIDs were implemented, can
be reinstated.

Bug: 36660726
Bug: 34716264
Bug: 36065223
Test: libwvdrmdrmplugin_hidl_test & libwvdrmengine_hidl_test
Change-Id: I961d2ee42bbdc42f0c324e36d9a74ac92205a437
2017-04-18 09:56:58 -07:00
Rahul Frias
92ef632596 Merge "Detect when unable to meet policy requirements" into oc-dev am: 551f4cb474
am: 3bf36c4321

Change-Id: I53bc708174ff281581065d80e822110ae870ea1d
2017-04-15 06:58:33 +00:00
Rahul Frias
3bf36c4321 Merge "Detect when unable to meet policy requirements" into oc-dev
am: 551f4cb474

Change-Id: Ic0a7095525471ca0ebb514a396aae352c23e5311
2017-04-15 06:55:54 +00:00
Rahul Frias
551f4cb474 Merge "Detect when unable to meet policy requirements" into oc-dev 2017-04-15 06:50:05 +00:00
Rahul Frias
66549ec1e1 Merge "Correct KeySetId value when returned by AddKey" into oc-dev am: f655f329e2
am: 16e76d3bb5

Change-Id: Ia5de9c3ce85d48d16a73094ca5543bf1a559a50a
2017-04-15 06:43:32 +00:00
Rahul Frias
16e76d3bb5 Merge "Correct KeySetId value when returned by AddKey" into oc-dev
am: f655f329e2

Change-Id: I0d1225d188edae07945a6f687abd5ef99a8f969c
2017-04-15 06:40:51 +00:00
Rahul Frias
f655f329e2 Merge "Correct KeySetId value when returned by AddKey" into oc-dev 2017-04-15 06:37:06 +00:00
Fred Gylys-Colwell
cab913f848 Undo bad merge
This CL undoes the merge cc28abea0b by
TreeHugger that should not have gone to master.  We re-enable a unit
tests that is required for OC MR1, but is not required for OC.

It also includes a minor change that allows the oemcrypto mock to be
built by an Android NDK:
Merge from Widevine repo of http://go/wvgerrit/24681

b/31458046
b/35141278

Change-Id: I8edc51504a16f1825ef765aeaff6f77f034f0362
2017-04-15 00:38:11 +00:00
Rahul Frias
57bb6c29ca Add usage information tests to device files unit tests
[ Merge of http://go/wvgerrit/24445 ]

Test: Verified by wv unit and integration tests

b/36048120

Change-Id: I9d067e79654331e8e58df5dce5411fbadc73e575
2017-04-14 15:12:25 -07:00
Jeff Tinker
1e9fe59e9c Merge "Translate CDM session not opened errors" into oc-dev am: 6116fdb97a
am: 5ea9fc8cb4

Change-Id: I62a9982c0737399fdd36bce171026462747fa0b6
2017-04-14 21:47:23 +00:00
Jeff Tinker
11c9dc0b98 Merge "Add an offline test asset for the drm vts test" into oc-dev am: 45910edd19
am: b2e501c1e4

Change-Id: I14d0507d1247ab9c72c1829af1fec298638fbac8
2017-04-14 21:47:22 +00:00
Jeff Tinker
5ea9fc8cb4 Merge "Translate CDM session not opened errors" into oc-dev
am: 6116fdb97a

Change-Id: I9d888f35db146164f52e9450107fce76d4448316
2017-04-14 21:44:55 +00:00
Jeff Tinker
b2e501c1e4 Merge "Add an offline test asset for the drm vts test" into oc-dev
am: 45910edd19

Change-Id: I6c7db741362d17acee78d1abd28b12e906da9e23
2017-04-14 21:44:53 +00:00