Commit Graph

3477 Commits

Author SHA1 Message Date
Rahul Frias
eba182293d Merge "Reject partial clear subsamples when keys are not loaded" into rvc-dev am: 3560247878
Change-Id: I8af7288266e5ad5ec82685ea7b467e8ef35a29cb
2020-03-28 18:43:07 +00:00
Rahul Frias
3560247878 Merge "Reject partial clear subsamples when keys are not loaded" into rvc-dev 2020-03-28 18:24:15 +00:00
Rahul Frias
734aea940b Reject partial clear subsamples when keys are not loaded
[ Merge of http://go/wvgerrit/96514 ]

The combined decryption call feature was introduced in android R.
In earlier releases, subsamples were passed one at a time for
decryption within the plugin. A decryption request that consists
entirely of clear data should be passed on to OEMCrypto even if
no keys are loaded.

A sample might consist of subsamples of clear and protected data.
In legacy mode, this proved to be an issue for OEMCrypto if the clear
subsamples were passed on but the protected ones were rejected (b/110251447).

For legacy mode and in the absence of keys being loaded, the subsample will
be passed to OEMCrypto only if the clear lead/frame is in a single subsample
and not broken up across multiple subsamples.

Bug: 150316417
Test: WV android unit/integration tests
Change-Id: Iff8ae8f58530cb9c5d31ce388742443ae807c16f
2020-03-27 15:07:29 -07:00
Fred Gylys-Colwell
6bd4b47612 Add unit test for preloaded license am: ca404aae6f
Change-Id: Ieeff31dfb52a182da5217ab26ddd168d39e44381
2020-03-27 19:05:43 +00:00
Fred Gylys-Colwell
ca404aae6f Add unit test for preloaded license
Merge from Widevine repo of http://go/wvgerrit/96508

This adds a unit test for to verify that a preloaded license may be
loaded into OEMCrypto. A preloaded license is a license that does not
have a nonce, and for which there is no license request. This is used
in CAS and ATSC.

I also updated the test version string to
OEMCrypto unit tests for API 16.2. Tests last updated 2020-03-27

Bug: 144105097
Test: ran oemcrypto unit tests on taimen and with v16 modmock.
Change-Id: I6a4926917f36a084d15defa7b908d067612c4dcf
2020-03-26 15:38:38 -07:00
Cong Lin
275b896d9c Merge "Use unique_ptr in oemcrypto ref" into rvc-dev am: a55244025b
Change-Id: I266de93e39d6754539b562da6b24ce42892b294d
2020-03-26 18:28:22 +00:00
Cong Lin
a55244025b Merge "Use unique_ptr in oemcrypto ref" into rvc-dev 2020-03-26 18:15:33 +00:00
Cong Lin
a53a6bf355 Use unique_ptr in oemcrypto ref
Merge from Widevine repo of http://go/wvgerrit/95945

The reference oemcrypto and testbed still use old style pointers, even
though we now require a more modern C++ compiler. Updated a few places
where smart pointer would be appropriate.

Bug: 141393616
Test: Ran unit tests
Change-Id: I8b1e155bce241075928e373478d6f8e1001233f9
2020-03-26 16:15:24 +00:00
Alex Dale
d650718c27 Merge "Usage table header operations no longer need an open session." into rvc-dev am: 73f301a66c
Change-Id: I2853ab3f534c8f1c3d7a5597bfc69a4685574d19
2020-03-26 03:45:43 +00:00
Alex Dale
4188d4478b Merge "New CDM error codes for usage table errors." into rvc-dev am: 8d45d93d0e
Change-Id: Iab515ba54795d43abd7eefd02d41461aabd777bb
2020-03-26 03:45:24 +00:00
Alex Dale
73f301a66c Merge "Usage table header operations no longer need an open session." into rvc-dev 2020-03-26 03:27:31 +00:00
Alex Dale
8d45d93d0e Merge "New CDM error codes for usage table errors." into rvc-dev 2020-03-26 03:26:30 +00:00
TreeHugger Robot
b82da207fd Merge "Address review comments" into rvc-dev am: d035d76ed6
Change-Id: I66931f849edf67e9d1bde00a5d948969615a16b9
2020-03-25 19:31:01 +00:00
TreeHugger Robot
d035d76ed6 Merge "Address review comments" into rvc-dev 2020-03-25 19:14:55 +00:00
Fred Gylys-Colwell
80b0005d44 Address review comments
Merge from Widevine repo of http://go/wvgerrit/96163

This CL just addresses some review comments from the big merge to
master. The header OEMCryptoCENC.h is now synced with the
document http://go/oemcrypto.

Test: unit tests
Bug: 148907684
Change-Id: Ic825126e0dd3d7e86eefab2c51b4abb5d57fb568
2020-03-25 16:16:58 +00:00
Alex Dale
193d5c384d Usage table header operations no longer need an open session.
[ Merge of http://go/wvgerrit/95405 ]

There are several OEMCrypto functions that do not require an open
session to be called.  This change updates the OEMCrypto functions
related to the Usage Table Header.

Bug: 150888316
Test: Linux unit tests and Android build
Change-Id: Ic879876dd190fb3e058bbe8e0cce37273030b105
2020-03-23 12:56:41 -07:00
Alex Dale
c9e4dd2495 New CDM error codes for usage table errors.
[ Merge of http://go/wvgerrit/95404 ]

There are three situtations where error codes from a usage table
operations were not being mapped to unique CDM response types.  These
particular errors provide useful information for the CDM during table
defragging.

Also fixed misspelled error code.

Bug: 150890014
Bug: 150891685
Test: Linux unit tests and Android build
Change-Id: I683abdd5fc0871317eede960ea36cfafac7e7f49
2020-03-23 12:54:27 -07:00
Rahul Frias
32643b1899 Merge "Move the CDM version string to a header file" into rvc-dev am: 8c1f8f1469
Change-Id: I320879e8fce824035385e8d6ff5c47457174590b
2020-03-20 02:23:17 +00:00
Rahul Frias
8c1f8f1469 Merge "Move the CDM version string to a header file" into rvc-dev 2020-03-20 01:59:36 +00:00
Fred Gylys-Colwell
7fae7e41b8 Log oemcrypto unit test version number am: 88934aa322
Change-Id: I48114dba4e2e95f3457d0f984e2a32212b0a0b96
2020-03-19 19:09:13 +00:00
Fred Gylys-Colwell
88934aa322 Log oemcrypto unit test version number
Merge from Widevine repo of http://go/wvgerrit/95483

This adds a log message to the oemcrypto unit tests so that if
somebody sends us a log, we can tell which version they are
running.

With this CL, the version string is
OEMCrypto unit tests for API 16.2. Tests last updated 2020-03-18

This can be found in the logs and in stdout when running the unit test
OEMCryptoClientTest.VersionNumber. One can verify the executable on
android using
strings $OUT/data/nativetest/oemcrypto_test | grep -i "oemcrypto unit tests"

Test: ran oemcrypto_test and verified version string
Bug: 144713981
Change-Id: Ie10b2f270b783ed10a3ff9855b7ca32a5327ea1c
2020-03-18 15:13:57 -07:00
Robert Shih
ba0f9cd656 Merge "hidl WVDrmPlugin: check for listener transport errors" into rvc-dev am: e77874f376
Change-Id: Ibf58f45d750f9efb4eb008d738ad22e906050dd9
2020-03-18 19:41:29 +00:00
Robert Shih
e77874f376 Merge "hidl WVDrmPlugin: check for listener transport errors" into rvc-dev 2020-03-18 19:27:39 +00:00
Robert Shih
18fec07897 hidl WVDrmPlugin: check for listener transport errors
Transport errors usually happen when hidl client crashes in DRM event
handler.

Merged from http://go/wvgerrit/95963

Bug: 150204874
Test: artificial crashes in client DRM event listener
Change-Id: I8037374550357d003e302f2a25fbb2305ae5a5e7
2020-03-18 00:56:55 -07:00
Cong Lin
4f90f4f023 (WV to Android) Fix un-initialized-value warning as error in odk_test am: 78fddc230a
Change-Id: I277324d66ec0f684b4db5545831f89b441e22be3
2020-03-18 02:51:17 +00:00
Cong Lin
78fddc230a (WV to Android) Fix un-initialized-value warning as error in odk_test
Merge from Widevine repo of http://go/wvgerrit/95968

Un-initialized int array allocated on heap is detected by MemorySanitizer using this command:

rabbit test --config=msan --keep_going --compilation_mode=opt --runs_per_test=1 //video/widevine/export/common/oemcrypto_core_message/odk:odk_test

Bug: 151339875
Test: cdm and odk unit tests
Change-Id: Ic3329b918636a58eccb518ded7b262c4d98c3644
2020-03-17 21:44:17 +00:00
Rahul Frias
ca39586f8d Move the CDM version string to a header file
[ Merge of http://go/wvgerrit/95943 ]

The CDM version for android is now defined in a platform specific
header file. A check for version number match has been removed
from integration tests as it will always be true. We will still
get a notification to change the CDM version when the Android OS
version gets updated.

Bug: 151663718
Test: WV unit/integration tests
Change-Id: I96bac87186e30a709585514be7f338ad2209cdf6
2020-03-16 14:55:37 -07:00
Automerger Merge Worker
c8ca1caf7d Merge "Use production provisioning server for unit tests" into rvc-dev am: 7cd0aacedb
Change-Id: I6a9d254b9b8984d4b550aac0dc3c23347fe60f87
2020-03-16 06:38:33 +00:00
TreeHugger Robot
7cd0aacedb Merge "Use production provisioning server for unit tests" into rvc-dev 2020-03-16 06:19:31 +00:00
Automerger Merge Worker
58a6b37d02 Merge "Remove the access to net.hostname" into rvc-dev am: 7461d0bc38
Change-Id: I34eb3b444b7978696e6650aae4e6270dd4bf9d7c
2020-03-14 01:13:36 +00:00
Cong Lin
7461d0bc38 Merge "Remove the access to net.hostname" into rvc-dev 2020-03-14 00:55:08 +00:00
Automerger Merge Worker
1324af2899 Merge "Clear sessionId regardless of what closeSession returns" into rvc-dev am: 53f52cef0b
Change-Id: I1cdb120c57b236ee7c9c18422b5d5803cada4606
2020-03-14 00:18:45 +00:00
Edwin Wong
53f52cef0b Merge "Clear sessionId regardless of what closeSession returns" into rvc-dev 2020-03-14 00:01:36 +00:00
Automerger Merge Worker
3f479621da Merge "Disable delayed termination on unprovisioning" into rvc-dev am: 587f488ac1
Change-Id: If416900f9bf30a9c71adb14dd71711805b19dc0e
2020-03-13 23:42:25 +00:00
Fred Gylys-Colwell
80d93c31f9 Use production provisioning server for unit tests
Merge from Widevine repo of http://go/wvgerrit/95848

The production provisioning server supports v16 now. Time to go back
home.

Bug: 149720416
Test: unit tests w/v16 mod mock
Change-Id: Ie67165d7e30dd22c54a08626d50346c4aa57cb72
2020-03-13 16:37:23 -07:00
Rahul Frias
587f488ac1 Merge "Disable delayed termination on unprovisioning" into rvc-dev 2020-03-13 23:26:45 +00:00
Automerger Merge Worker
da9e54342a ODK: Address review comments am: 5a6a2075f5
Change-Id: Iee171a63c04244553f5c9dfb4b0efcc05e660c48
2020-03-13 21:21:09 +00:00
Cong Lin
a9889aafd7 Remove the access to net.hostname
Merge of http://go/wvgerrit/95723

This is to remove the reference to net.hostname in
get_unique_id_android.cpp for L3. Keep ro.serialno, and just change the
net.hostname call to setting the constant string.

Bug: 130028203
Test: Ran unit tests
Change-Id: I90d955c117924c16c71f145dea53fe32644d2875
2020-03-13 14:12:09 -07:00
Edwin Wong
a66d2b392e Clear sessionId regardless of what closeSession returns
After succeeding openSessionCommon(), when the call to
getSecurityLevel() fails, the code calls closeSession()
and only clears the sessionId if closeSession() fails.
We should always clear sessionId in this case.

Also, make it clearer that the status returned by
getSecurityLevel() does not overwrite the value from
openSessionCommon().

Merged from http://go/wvgerrit/95845

Test: unit test
adb shell LD_LIBRARY_PATH="/vendor/lib64" /data/nativetest/libwvdrmdrmplugin_hidl_test

Bug: 151364587
Change-Id: I3a9106ffa44c654d3e072a0b0597398d410fc84f
2020-03-13 11:40:20 -07:00
Cong Lin
5a6a2075f5 ODK: Address review comments
Merge of http://go/wvgerrit/95666

Mostly fixing coding styles and a few vulnerability check.
Updating tests according to the fix.

Bug: 150614088
Bug: 150881959
Test: Ran cdm and odk unit tests
Change-Id: I109a96ee8ded089d59ab49c2f94b6833c932fd1e
2020-03-12 18:25:46 -07:00
Automerger Merge Worker
4f0f2a90ec Merge "openSession_1_1 should return error for wrong security level" into rvc-dev am: fae5d3f7a9
Change-Id: Idb2ae8f90efd0639ac4e6e5f36e5e976e8a6033e
2020-03-12 23:20:22 +00:00
Edwin Wong
fae5d3f7a9 Merge "openSession_1_1 should return error for wrong security level" into rvc-dev 2020-03-12 23:06:33 +00:00
Rahul Frias
89d19be766 Disable delayed termination on unprovisioning
[ Merge of http://go/wvgerrit/95784 ]

On unprovisioning, all persistent state/files are deleted. If a
provisioning session is opened soon after, |OEMCrypto_Terminate|
and |OEMCrypto_Initialize| will not be called. The (deleted) device
key will remain resident in memory and will not be regenerated until
|OEMCrypto_Initialize| is called. Any L3 licenses created will be
associated with a device key that does not exist, at least after
OEMCrypto is terminated.

By disabling delayed termination of OEMCrypto, OEMCrypto will be
terminated and initialized immediately on unprovisioning.

Bug: 149808504
Test: WV unit/integration tests on L3
Change-Id: Id3fbce621b47a723ff624cf45f1ac203421a8dba
2020-03-12 15:58:33 -07:00
Automerger Merge Worker
77aeff11fc Merge "Expect Provisioning ID length of upto 64 bytes" into rvc-dev am: f14dea8b89
Change-Id: I5b33480bfd1a7f1c03166bc3d7001e1e8460851b
2020-03-12 21:39:07 +00:00
Rahul Frias
f14dea8b89 Merge "Expect Provisioning ID length of upto 64 bytes" into rvc-dev 2020-03-12 21:22:35 +00:00
Rahul Frias
a42273e67f Expect Provisioning ID length of upto 64 bytes
[ Merge of http://go/wvgerrit/95508 ]

The provisioning ID length will be 32 bytes when the device supports a
keybox or OEM certificates and does not implement |OEMCrypto_GetDeviceId|.
If a device supports OEM Certificates and implements |OEMCrypto_GetDeviceId|
it may be an arbitrary length upto 64 bytes.

Bug: 150393659
Test: WV unit/integration tests
Change-Id: I5e4dbc8f2f9ca326425d0313f4823b72bd6ac7c0
2020-03-12 12:30:37 -07:00
Automerger Merge Worker
b12241151a Merge "Match usage entry to header" into rvc-dev am: 042efc971d
Change-Id: Ibaa51743d7e2dd60e62ceb2dc976f53bda40d14b
2020-03-12 18:13:43 +00:00
TreeHugger Robot
042efc971d Merge "Match usage entry to header" into rvc-dev 2020-03-12 18:00:06 +00:00
Edwin Wong
bdb69f73e8 openSession_1_1 should return error for wrong security level
Currently, if requestedLevel is not the same as the
current security level, openSession_1_1 still returns
Status::OK, we should return an error status.

Merged from http://go/wvgerrit/95507

Test: unit test
  adb shell LD_LIBRARY_PATH="/vendor/lib64" /data/nativetest/libwvdrmdrmplugin_hidl_test

Bug: 150407669

Change-Id: I5673ac7bbe7a234ddd07bb9c145135486fb9e583
2020-03-11 17:39:44 -07:00
Automerger Merge Worker
93e106639c L3 oemcrypto: Replace NULL with nullptr am: 5cd0fd7992
Change-Id: If73c5faa27ee6da1c237c3045291a57638e23453
2020-03-11 23:23:22 +00:00