Commit Graph

3640 Commits

Author SHA1 Message Date
Alex Dale
b535120ccd Merge "Test CDM sessions prevent multiple usage entries." into rvc-dev am: c628c5aca2 am: 3adda0dfe1
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11925460

Change-Id: I2bf4c438575cb22bd350bb9c364a2543f04423d3
2020-06-25 19:50:04 +00:00
Alex Dale
3adda0dfe1 Merge "Test CDM sessions prevent multiple usage entries." into rvc-dev am: c628c5aca2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11925460

Change-Id: Ia63d263ae89bc14836704f1dc2d95f5b06590754
2020-06-25 19:39:21 +00:00
Alex Dale
c628c5aca2 Merge "Test CDM sessions prevent multiple usage entries." into rvc-dev 2020-06-25 19:25:18 +00:00
Rahul Frias
abad87b79f Merge "Handle SPOID calculation for L3" into rvc-dev am: 25d1646138 am: 652258d70e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11736137

Change-Id: I11dff2a7fc64d467cc7e31206b2b3c521c397006
2020-06-22 18:21:38 +00:00
Rahul Frias
652258d70e Merge "Handle SPOID calculation for L3" into rvc-dev am: 25d1646138
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11736137

Change-Id: Ifb2d04b609a00905c5c42ee629e83674822b64cb
2020-06-22 18:14:27 +00:00
Rahul Frias
25d1646138 Merge "Handle SPOID calculation for L3" into rvc-dev 2020-06-22 18:04:18 +00:00
Alex Dale
0aaf1df125 Test CDM sessions prevent multiple usage entries.
[ Merge of http://go/wvgerrit/102068 ]

CDM sessions should not be able to load multiple usage entries.
OEMCrypto already prevents multiple entries from being loaded by the
same OEMCrypto session; however, restoring a key typically creates a
new OEMCrypto session, which should not be allowed twice within the
same CDM session.

This test verifies that CDM returns an error if restore key is called
multiple times within the same session.

Bug: 136143733
Test: Android integration test
Change-Id: I594c91250217fd958837328162f909bc931d373f
2020-06-19 20:40:54 -07:00
Rahul Frias
7e689a1828 Handle SPOID calculation for L3
[ Merge of http://go/wvgerrit/101443 ]

The WVDrmPlugin has a single CdmIdentifier. The CdmIdentifier contains
a SPOID that is calculated from the device ID (keybox or OEM cert),
an application reverse domain name and possibly an origin.

The CdmIdentifier is set and SPOID calculated on certain calls into
WVDrmPlugin. Once it is set, it will not be recalculated. We prevent
certain operations such as modifying the origin once the CdmIdentifier
has been set as this will require recalculating the SPOID.
Recalculating the SPOID may affect open sessions or calls in progress.

In a similar way, modifying the security level, will affect the
Device ID value and in turn the SPOID. The security level cannot be modified
if any sessions are open. This does leave open the possibility that the
SPOID may be calculated at one security level, sessions are then closed,
and the security level is then changed without an error being flagged.

The provisioning certificate file name is based on the SPOID. When
the SPOID does not match the security level, either the provisioning
information may not be found even though that security level has
been provisionined or the provisioning information may be stored
in an incorrect location if provisioning occurs.

The correct solution is to prevent modifications to the security level
once the CdmIdentifier is set. This is a behavior change and might
impact apps. We will reevaluate this for the next release.

For now, we will work around this. When the CdmIdentifier is set for L3,
we will calculate SPOIDs with both L1 and L3 device IDs and check if
provisioning previously occurred with SPOIDs calculated for that level.
If so, use that level, otherwise use L3.

Bug: 147703382
Test: Android unit/integration tests, GtsMediaDrmTests
Change-Id: Ia64adfc5848e431ee3876af03eebdb4b6eb83116
2020-06-17 00:50:14 -07:00
Edwin Wong
456caca048 Merge "Add v16 Widevine Integration Guide Android Supplement" into rvc-dev am: 6b8d0e034d am: 656db1857b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11838915

Change-Id: I3bf7e672c918824a493402022d54c317f02655f6
2020-06-17 01:14:02 +00:00
Edwin Wong
656db1857b Merge "Add v16 Widevine Integration Guide Android Supplement" into rvc-dev am: 6b8d0e034d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11838915

Change-Id: I3b1f5fa74f157d7ffc336ec53f61f6dacf29d2d9
2020-06-17 00:59:46 +00:00
Edwin Wong
6b8d0e034d Merge "Add v16 Widevine Integration Guide Android Supplement" into rvc-dev 2020-06-17 00:47:04 +00:00
Edwin Wong
72dc93ed1d Add v16 Widevine Integration Guide Android Supplement
The doc is based on
WidevineSecurityIntegrationGuideforCENCAndroidSupplement_v15.pdf.
The "Build Files" and "Reference Implementation" sections are
updated for v16.

merged from http://go/wvgerrit/101747

Please see revision history in:
https://docs.google.com/document/d/19pSOpV5_6AtyK82p1b5DajlYZnVOfyL63p5h72yWW5k/edit?usp=sharing

Test: revision history

bug: 147596889
Change-Id: If3e9fc6bb268d1d3be62b56e2e43752d8df3fc03
2020-06-16 15:19:34 -07:00
Rahul Frias
bde967aa74 Merge changes I295f66f9,I142f286c into rvc-dev am: 05fbb3dd87 am: 0db9b974c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11620164

Change-Id: I0bdb926501259cce1a74c631bd284a7a8073fa9d
2020-06-16 09:07:19 +00:00
Rahul Frias
0db9b974c2 Merge changes I295f66f9,I142f286c into rvc-dev am: 05fbb3dd87
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11620164

Change-Id: I59aa80b62824a29a8350b99a8f9a35d193aa968e
2020-06-16 08:54:27 +00:00
Rahul Frias
05fbb3dd87 Merge changes I295f66f9,I142f286c into rvc-dev
* changes:
  Add ATSC support - part 2
  Add ATSC support - part 1
2020-06-16 08:46:02 +00:00
Fred Gylys-Colwell
8dafa15521 Remove Android.mk for OEMCrypto ref code am: 119932ea69 am: 859038e6c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11870737

Change-Id: I0c42f412da1de1624577700887db1f6bd7ca937c
2020-06-16 02:20:30 +00:00
Fred Gylys-Colwell
859038e6c8 Remove Android.mk for OEMCrypto ref code am: 119932ea69
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11870737

Change-Id: Iab024d334ba53aacd6813a350749f6a31568d635
2020-06-16 02:12:45 +00:00
Fred Gylys-Colwell
119932ea69 Remove Android.mk for OEMCrypto ref code
Merge from Widevine repo of http://go/wvgerrit/101905

The reference OEMCrypto should not be built as part of Android.

Test: Builds
Bug: 146361995
Change-Id: Ic25e6e567fcac519636f64dabc0d59b3df78990e
2020-06-15 17:40:28 -07:00
Rahul Frias
8da1145012 Add ATSC support - part 2
[ Merge of http://go/wvgerrit/100905 and http://go/ag/10708438 ]

Add support for ATSC certificate and licenses handling. ATSC
files are distinguished from the apps DRM certificate and licenses
by file naming conventions.

Bug: 139730600
Test: WV unit/integration test, GtsMediaTestCases
Change-Id: I295f66f92fe01d7716978deac9dc360d74addedd
2020-06-12 03:48:58 -07:00
Rahul Frias
bbe9f6afc4 Add ATSC support - part 1
[ Merge of http://go/wvgerrit/100864 and http://go/ag/10704773 ]

ATSC 3.0 allows for licenses to be downloaded OTA and are tied to
a DRM certificate that may be shared across apps. The provisioning
process for ATSC may happen at the factory or during an OS update.

This contrasts from the regular OTT model, which requires that
provisioning and license download have an uplink as well as a
downlink connection.

This adds support for the ATSC mode property. ATSC mode can only be
set (or unset) before sessions are opened. Once the CDM identifier is
set/sealed, requests to modify the ATSC mode will be rejected.

If one needs to open sessions with both ATSC mode and regular (non-ATSC)
mode, separate MediaDrm objects will need to be created. The default
mode is to not use ATSC.

Enable ATSC mode by calling
  mediaDrm.setPropertyString("atscMode", "enable")

Disable ATSC mode by calling
  mediaDrm.setPropertyString("atscMode", "disable")

Provisioning and unprovisioning requests for ATSC will be rejected as
certificates will be retrieved by the ATSC service.

Bug: 139730600
Test: WV unit/integration test, GtsMediaTestCases
Change-Id: I142f286c711fe007ff42125c3c8cdc6450b6ea36
2020-06-08 14:56:48 -07:00
Fred Gylys-Colwell
a4b30d900e Update OEMCrypto documentation to v16.3 am: aa5fc5afd0 am: 30ea7ee843
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11707216

Change-Id: Ie80d8d3aa4f0825ac68065ab38eeaba46169ca29
2020-06-04 22:00:27 +00:00
Fred Gylys-Colwell
30ea7ee843 Update OEMCrypto documentation to v16.3 am: aa5fc5afd0
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11707216

Change-Id: Ie462379eedd98d16a3ac33d9184147baf7a47988
2020-06-04 21:34:08 +00:00
Fred Gylys-Colwell
aa5fc5afd0 Update OEMCrypto documentation to v16.3
Merge from Widevine repo of http://go/wvgerrit/101243

Changed the version number to 16.3 and the date to June 1st.  The
delta document has a short description of CL's added since
April 6th.

Test: documentation changes only
Bug: 157030231
Change-Id: I93c2b09d6a24efc71ed77110b115cafbd6fde1c6
2020-06-03 06:14:35 -07:00
Fred Gylys-Colwell
ed6f7c1347 Update OEMCrypto unit tests to require ODK 16.3 am: 45681615b8 am: d599c74011
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677949

Change-Id: I53611ff17e99da2aa051b3222f3eb6ac8a248ca5
2020-06-02 22:01:57 +00:00
Fred Gylys-Colwell
b72520df48 Do not verify decrypt hash when no key selected am: 36968de671 am: 51992ab155
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677948

Change-Id: I2664ea17c562ae77c192abff4cd54328dc2867ee
2020-06-02 22:01:55 +00:00
Fred Gylys-Colwell
299d866412 Unit test for loading nonce-free offline license am: a615671f48 am: ed900f242b
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677947

Change-Id: I08a1dddc3bd787a4c8484373e1614a83cf79c67c
2020-06-02 22:01:53 +00:00
Fred Gylys-Colwell
0f63c0191d Check for null pointers in oemcrypto adapter am: 42eb79a3ff am: 7a4313483c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677946

Change-Id: Ibdd1da583e249fc412e3a2c2d2a40835f7a77f65
2020-06-02 22:01:50 +00:00
Fred Gylys-Colwell
253eb191ea Update ODK Library to 16.3 am: 166b3e8403 am: 62802d8e10
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11699230

Change-Id: Ife7bba778cd3a2eca3da66898539e81faaee2051
2020-06-02 22:01:48 +00:00
Fred Gylys-Colwell
d2830141cc ODK: forward compatibility and nonce-free offline license support am: 8dc1d7a11d am: 5bb396fb72
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11688972

Change-Id: I92345d75991bfbe9f1214dd61350b0be90eac8fb
2020-06-02 22:01:46 +00:00
Fred Gylys-Colwell
d599c74011 Update OEMCrypto unit tests to require ODK 16.3 am: 45681615b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677949

Change-Id: Ic8c45cc7fce842f67777ab0a003a541fbae7f9fb
2020-06-02 21:49:26 +00:00
Fred Gylys-Colwell
51992ab155 Do not verify decrypt hash when no key selected am: 36968de671
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677948

Change-Id: I7f9acec222c2840720be3b36423b502582c2ee25
2020-06-02 21:49:24 +00:00
Fred Gylys-Colwell
ed900f242b Unit test for loading nonce-free offline license am: a615671f48
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677947

Change-Id: Ia129aba764568a853b6b89a7f35f902ef2068942
2020-06-02 21:49:22 +00:00
Fred Gylys-Colwell
7a4313483c Check for null pointers in oemcrypto adapter am: 42eb79a3ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677946

Change-Id: I01d29869ce9f1ce6c252066cbb8f9b4f5286a5ef
2020-06-02 21:49:21 +00:00
Fred Gylys-Colwell
62802d8e10 Update ODK Library to 16.3 am: 166b3e8403
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11699230

Change-Id: I4d951b808e21128d8dbe4e0fafe4fd24b4753124
2020-06-02 21:49:19 +00:00
Fred Gylys-Colwell
5bb396fb72 ODK: forward compatibility and nonce-free offline license support am: 8dc1d7a11d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11688972

Change-Id: I61a70e52e875c017a706f1337d75405f19748dfa
2020-06-02 21:49:17 +00:00
Fred Gylys-Colwell
45681615b8 Update OEMCrypto unit tests to require ODK 16.3
Merge from Widevine repo of http://go/wvgerrit/101144

This CL updates the version string of the oemcrypto unit tests.

Test: unit tests on taimen and with reference oemcrypto v16.
Bug: 156789529
Change-Id: I504a32f0c3781870052b58d30312c58e090b145c
2020-06-02 09:36:38 -07:00
Fred Gylys-Colwell
36968de671 Do not verify decrypt hash when no key selected
Merge from Widevine repo of http://go/wvgerrit/101143

This CL removes the check for a decrypt hash error when CopyBuffer is
used instead of DecryptCenc because a key was not selected.

We also remove the attempt to check the decrypt hash when there are
multiple buffers, because that is not well defined behavior.

Bug: 155185867
Bug: 155192141
Test: ran unit tests on taimen and on v16  reference oemcrypto
Change-Id: I640e904e256f0913ca606bb5db891430b23f44a3
2020-06-02 08:30:34 -07:00
Fred Gylys-Colwell
a615671f48 Unit test for loading nonce-free offline license
Merge from Widevine repo of http://go/wvgerrit/100964

The previous nonce-free test used the same session to generate the
request as to load the license. However, it is a realistic use case to
have a new session used for loading the license.

The use case relates to a pre-loaded, shared license.

Test: Ran unit tests on taimen and on v16 ref implementation
Bug: 156853321
Change-Id: Ibc07744a16edcd3952d88d73660a75d0c3e8eeb8
2020-06-02 08:30:34 -07:00
Fred Gylys-Colwell
42eb79a3ff Check for null pointers in oemcrypto adapter
Merge from Widevine repo of http://go/wvgerrit/100963

Test: unit tests on taimen
Bug: 156967805
Change-Id: Ic8ba7461ffcaa371a5239dca84e8a3007b0df517
2020-06-02 08:30:34 -07:00
Fred Gylys-Colwell
166b3e8403 Update ODK Library to 16.3
Merge from Widevine repo of http://go/wvgerrit/101130

https://cr/314253512
ODK Library: roll version number to 16.3

https://cr/314253425
ODK Library: Accept release request as renewal request

To support forward compatibility, the v16 server should parse a
release request as a renewal request.

https://cr/314213725
ODK: Accept larger message sizes

The ODK should accept a message size that is larger than the
current
API requires. This allows for future API versions to append
fields to
a message that current the current license SDK will
ignore.

https://cr/313962712
ODK: accept messages with future API version numbers

This CL updates the ODK parse functions to accept future versions
of
the message. This will allow a v16 server to talk to a v17
device.

https://cr/313814938
ODK Version String

Add an automatically generated version string to odk_structs.h

Bug: 157030231
Bug: 157512150
Bug: 157822248
Bug: 157512322
Test: unit tests on taimen
Change-Id: I346f73c41bc984fe17856d3b61cd08cf92b39919
2020-06-02 08:30:34 -07:00
Fred Gylys-Colwell
8dc1d7a11d ODK: forward compatibility and nonce-free offline license support
Merge of http://go/wvgerrit/101183

This is a combination of multiple commits from google3:
* http://cl/313814938
  ODK Version String
* http://cl/313962712
  ODK: accept messages with future API version numbers
* http://cl/312219187
  Ignore hash if initial load of license, and the nonce not required
  (squashed into http://cl/313962712)

Test: OEMCryptoLicenseTest.LoadKeyWithNoRequest
Bug: 157822248
Bug: 156853321
Change-Id: I735d355241876bddb0c52440b0049efb72a4b26f
2020-06-01 19:13:32 +00:00
Cong Lin
f588353820 Merge "Fix implicit type conversion issue in ODK" into rvc-dev am: c34e2af181 am: 4f895ec8ec
Change-Id: I5c0a0f13e91c8f0182683a1deacc26ec3c43cb25
2020-05-30 03:31:05 +00:00
Cong Lin
4f895ec8ec Merge "Fix implicit type conversion issue in ODK" into rvc-dev am: c34e2af181
Change-Id: Idcdbf54471e640b79a9af2a924b139d1c5def0f5
2020-05-30 03:13:36 +00:00
Cong Lin
c34e2af181 Merge "Fix implicit type conversion issue in ODK" into rvc-dev 2020-05-30 02:56:31 +00:00
John Bruce
00792ac231 Merge "OEMCrypto Unit Test Fix: Do Not Derive Keys Immediately" into rvc-dev am: 729723b3d2 am: b349680d3f
Change-Id: I98a604729446a2e3ade173e4e473331034937dd0
2020-05-29 23:57:09 +00:00
John Bruce
b349680d3f Merge "OEMCrypto Unit Test Fix: Do Not Derive Keys Immediately" into rvc-dev am: 729723b3d2
Change-Id: I72df59375a2c05e47978abc37418ebc69f308bdc
2020-05-29 23:40:52 +00:00
John Bruce
729723b3d2 Merge "OEMCrypto Unit Test Fix: Do Not Derive Keys Immediately" into rvc-dev 2020-05-29 23:26:50 +00:00
Cong Lin
69e7e21882 Fix implicit type conversion issue in ODK
Merging CL
https://widevine-internal-review.googlesource.com/c/cdm/+/100924 Fix implicit type conversion issue in ODK

1. Implicit cast is reported as error when compiling ODK with Level3
2. Override odk_add_overflow_xxx function with the built in functions can cause
redefinition issue when compiling Level3; Let's use odk customized overflow functions.

Bug: b/157510403
Test: ODK unittests and CDM unittests passed.
Change-Id: Ieef8ccfb41d08007ec72f4a061f92968e55539cb
2020-05-29 10:07:08 -07:00
Alex Dale
de022fbb0a Rolled expected version number for R. am: dd70d63b76 am: 9329bf331c
Change-Id: Iae1998e8dd00a286c7d44bdb2093be860d97fb0d
2020-05-27 21:43:58 +00:00
Alex Dale
9329bf331c Rolled expected version number for R. am: dd70d63b76
Change-Id: Id8ddfa7e676b57eb0ab8261d166dd0cf8901a458
2020-05-27 21:24:39 +00:00