Commit Graph

3084 Commits

Author SHA1 Message Date
Fred Gylys-Colwell
b10697a95c Merge "Update docs for OEMCrypto v15.2" into qt-dev am: 3b9b77c7c7
am: 2abed930c7

Change-Id: Ia49b0d7b8d3d7773bf9a9a6aa4dfeb3a1569b5d2
2019-05-06 12:56:59 -07:00
Fred Gylys-Colwell
2abed930c7 Merge "Update docs for OEMCrypto v15.2" into qt-dev
am: 3b9b77c7c7

Change-Id: I1b00f066e5e40cf06964fca9b24e33981877298d
2019-05-06 12:28:27 -07:00
Fred Gylys-Colwell
3b9b77c7c7 Merge "Update docs for OEMCrypto v15.2" into qt-dev 2019-05-06 19:00:43 +00:00
Fred Gylys-Colwell
db534a6a05 Update docs for OEMCrypto v15.2
Merge from Widevine repo of http://go/wvgerrit/77604

Test: ran unit tests

Bug: 131326334 Nonce collision should be avoided in open sessions
Bug: 131325434 mac key iv should not be 16 bytes before encrypted mac key
Bug: 129368634 HDCP 2.3 and 2.2 are not distinguishable
Bug: 127423611 Question about OEMCrypto V15 API
Bug: 124312571 Picture-in-Picture -- is it really needed for Android TV?
Bug: 131175454 Extend Provisioning 3.0 Schedule
Bug: 131359743 Do not allow multiple LoadKeys in a session

Change-Id: I8db4ec921978ea918adb17420db86de69e806120
2019-05-05 21:42:35 -07:00
Rahul Frias
4bd6f2bed0 Merge "Handle key rotation" into qt-dev am: 862cb96e77
am: 5b8fc4a05b

Change-Id: I0bbf6b0e12cde87c768d1b6408b7ef05801d7a3d
2019-05-03 23:00:50 -07:00
Rahul Frias
5b8fc4a05b Merge "Handle key rotation" into qt-dev
am: 862cb96e77

Change-Id: I8d3f1a43d85bb27798915c9b5bbd62fe87abd5f9
2019-05-03 18:15:39 -07:00
TreeHugger Robot
862cb96e77 Merge "Handle key rotation" into qt-dev 2019-05-03 20:50:17 +00:00
Srujan Gaddam
cee0887d20 Call SelectKey regardless of entitled key mapping am: fce75c295b
am: 09366bb6ce

Change-Id: I9b73230d68eecf47dd5caab94100c5f9144e75da
2019-04-30 20:04:44 -07:00
Srujan Gaddam
09366bb6ce Call SelectKey regardless of entitled key mapping
am: fce75c295b

Change-Id: Ibe1b1eefd267e875c16850c7910f26c3e413347a
2019-04-30 18:53:34 -07:00
Srujan Gaddam
fce75c295b Call SelectKey regardless of entitled key mapping
Bug: b/129426820
Test: CE CDM, Android unit/integration, Linux, ExoPlayer key rotation
playback with modmock and L3
Merge of http://go/wvgerrit/77608

http://go/ag/6543431 modified the entitlement key session to select the
entitled content key if it had just been loaded in so that there's a
valid current content key loaded in OEMCrypto. However, this did not
account for the case where you have two entitlement to entitled key
pairs. If OEMCrypto does not select the key when you switch from the
first pair to the second pair back to the first pair, OEMCrypto will
still be using the key from the second pair during decrypt. This CL
changes it so we SelectKey each time to make sure that we update the
current content key.

Change-Id: I764ec13deb87e14188707b811a44eff132eeb5a1
2019-04-30 10:51:33 -07:00
Srujan Gaddam
eecfe492f9 Handle not setting length in getUniqueID am: 3e5ade22f9
am: b8d6b35385

Change-Id: I53d198853707b8d3334420490545937dbef9fe00
2019-04-25 08:52:34 -07:00
Srujan Gaddam
b8d6b35385 Handle not setting length in getUniqueID
am: 3e5ade22f9

Change-Id: I383c12deb26595a0f8b854db61ba66acdc90fb10
2019-04-25 08:45:03 -07:00
Rahul Frias
2e2e92280e Handle key rotation
[ Merge of http://go/wvgerrit/77049 ]

Entitlement PSSHs can now be provided in follow on key generation
requests to cause keys to be rotated without needing a license
exchange.

Bug: 128462397
Test: WV unit/integration tests, Netflix and GPlay tests,
      GtsMediaDrmTests

Change-Id: I6ed0901a35c498240f42e405a522d82ea8dce2f7
2019-04-23 13:54:51 -07:00
Srujan Gaddam
3e5ade22f9 Handle not setting length in getUniqueID
Test: oc-mr1-release to q upgrade with L3 offline licenses, pi-dev to q
upgrade with L3 offline licenses, CE CDM tests, Android unit/integration
tests, Linux tests
Bug: b/112611429
Merge of http://go/wvgerrit/77111

The Level 3 uses the getUniqueID method to uniquely identify devices to
save device keys. This method needs to be consistent and as part of the
method, the length is set. In previous versions, this length isn't set,
but starting from Pi, it is. What this means is that decryption of the
device keys fails, and therefore offline licenses are lost. As a
workaround, we attempt to decrypt the device keys with the length
parameter and with the default if we failed to decrypt. Since the
generation number is also encrypted by the unique id, in the case where
we succeed in decrypting with the default, we reencrypt the generation
number so it can be read in when we handle the usage table. Finally, we
reencrypt everything with the correct length unique id.

Change-Id: Id682771c3921dea35592914fc7a1aaa92fa6737a
2019-04-22 12:11:39 -07:00
John W. Bruce
125856238c Rename WvGenericOperationsTest.
(This is a merge of http://go/wvgerrit/76043)

This renames the tests to be *GenericCrypto* to match the OEMCrypto
tests and ensures these tests are skipped when the device doesn't
support generic crypto.

Test: Android Unit Tests
Bug: 126392281
Change-Id: Ib16ca8c57ed5d99dde802d4d9a63eced0fa807a5
2019-04-19 22:22:59 +00:00
John W. Bruce
ea4e6d8c37 Add Windows support for clock-change test.
(This is a merge of http://go/wvgerrit/70363)

Test: Android Unit Tests
Bug: 122953649
Change-Id: I47d2120b4d280be316072c38fd7282e14f68c6a0
2019-04-19 22:20:23 +00:00
John Bruce
8efec483c9 Merge "Don't Use StringStream When It's Overkill" 2019-04-19 22:19:02 +00:00
Fred Gylys-Colwell
0fa38e7997 Merge "Update Android Integration Guide" into qt-dev am: c5189c3d12
am: 7482218715

Change-Id: I7c75be8483b400229c249cd24690149d2cd0507c
2019-04-18 17:17:53 -07:00
Fred Gylys-Colwell
363647f2b7 Document Keys / Session am: 704870bed6
am: fb45b0765b

Change-Id: I780cc916f3ff6ac90bbef5a8fc828ba327ed7188
2019-04-18 17:15:58 -07:00
Fred Gylys-Colwell
7482218715 Merge "Update Android Integration Guide" into qt-dev
am: c5189c3d12

Change-Id: I0c9f967b1398b868a5832b2e9a2457f1f4a922ae
2019-04-18 16:55:24 -07:00
Fred Gylys-Colwell
fb45b0765b Document Keys / Session
am: 704870bed6

Change-Id: I98863a671e3e874ac264c9498de916dfdbaa6e2b
2019-04-18 16:54:59 -07:00
TreeHugger Robot
c5189c3d12 Merge "Update Android Integration Guide" into qt-dev 2019-04-18 23:38:52 +00:00
John W. Bruce
5ea429ee2b Don't Use StringStream When It's Overkill
(This is a merge of http://go/wvgerrit/76063)

Now that we have C++11, many places that do string formatting or parsing
can be replaced with std::to_string() or one of the std::sto*() family
of functions. This patch updates places that do simple stringifying or
parsing to use these functions. Some parts of the code are left
untouched because they were using StringStream to do more complex
actions, such as constructing more complex output or checking the status
of the parsing.

Bug: 120599938
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: I482dc234ecd7c6014fa9b6874387ff51e04b772f
2019-04-17 17:46:31 -07:00
Fred Gylys-Colwell
704870bed6 Document Keys / Session
Merge from Widevine repo of http://go/wvgerrit/74624
and http://go/wvgerrit/77025

Several people have asked how many keys / session are required as a
function of OEMCrypto version. That is often enough that this
information should go in the version compatibility document.

Bug: 128628354
Test: documentation change only
Change-Id: I3031013aab2feb38a0c5ce7e5304ec0d50487ea3
2019-04-17 12:17:00 -07:00
Fred Gylys-Colwell
f3e0b357b6 Update Android Integration Guide
Merge from Widevine repo of http://go/wvgerrit/72624

Update the Android supplement for Android Q and OEMCrypto v15.

Test: doc change only
Bug: 119832138
Change-Id: Ie58dcadf4cdb0cd3264b630b5f6f80789ba50e9c
2019-04-16 15:40:35 -07:00
Bill Rassieur
7ab472a3d8 Merge master@5406228 into git_qt-dev-plus-aosp.
am: 592ec251ba

Change-Id: If533256d554584158ff568c8e4d6a31da9d19725
2019-04-03 19:31:56 -07:00
Srujan Gaddam
79a271fcce Merge "Reintroduce heaps into Level 3 obfuscation" 2019-04-03 02:50:31 +00:00
Srujan Gaddam
68a5505378 Reintroduce heaps into Level 3 obfuscation
Bug: b/116056586
Test: CE CDM, Android unit/integration, and GTS tests
Merge of http://go/wvgerrit/75891

Heapification was removed from the Level 3 in b/111246860 due to
contributing to performance issues. These issues are addressed in the
obfuscation tool and these libraries are built using those fixes.

Change-Id: I62dc09b41f845f3f7aa283af6968ac0cbc6cf368
2019-04-02 14:34:17 -07:00
Rahul Frias
1aed4dc670 hidl: return BAD_VALUE from RemoveOfflineLicense when keyset is not found
[ Merge from http://go/wvgerrit/75623 ]

This addresses code-review comments during the merge to the wv repo.

Bug: 127828539
Test: WV unit/integration tests
Change-Id: I12abe3eb0767bb9ccb76940dcca12c17d32e8e53
2019-04-01 20:10:25 -07:00
Bill Rassieur
592ec251ba Merge master@5406228 into git_qt-dev-plus-aosp.
Change-Id: Ib2208933a08912528cc7be112613194d3c952e78
BUG: 129345239
2019-03-29 04:36:36 +00:00
Rahul Frias
dcfe0f3690 Merge "Remove references to internal documents" 2019-03-28 23:29:43 +00:00
Rahul Frias
4e745ff203 Remove references to internal documents
[ Merge of http://go/wvgerrit/75303 ]

Bug: 117181780
Test: WV unit/integration tests
Change-Id: Ica12e270a9ac5fbcff069aace807bb4651814ad7
2019-03-28 09:32:30 -07:00
Srujan Gaddam
0613bb1614 Merge "Add script to diff test results between changes" 2019-03-27 21:26:08 +00:00
Fred Gylys-Colwell
dd64dedb51 Fix LD_LIBRARY_PATH in run_all_unit_test.sh
Merge from Widevine repo of http://go/wvgerrit/75383

Because the tests need to find liboemcrypto.so.

Bug: 129354680
Test: ran on taimen and bonito.
Change-Id: I9cc802a2396937739b164851f51726fbc80550d5
2019-03-26 14:29:06 -07:00
Rahul Frias
a45deef63b Merge "Corrections for limited duration licenses" 2019-03-26 16:24:48 +00:00
Adam Stone
eeb09779aa Merge "Add extra OEMCrypto metrics" 2019-03-25 22:36:42 +00:00
Rahul Frias
43efc6d84a Corrections for limited duration licenses
[ Merge of http://go/wvgerrit/74627 ]

Limited duration licenses (where license duration is unlimited and
playback window is set to a small value) did not work correctly when
the initial decrypt call occured before the license was received.

Bug: 109653883
Test: WV unit/integration tests
Change-Id: I0738e97db525b239455e2ac93ab0bedd6611b311
2019-03-23 00:53:26 -07:00
Fred Gylys-Colwell
d641797e05 Use hex for FDPT hash
Merge from Widevine repo of http://go/wvgerrit/75123
Merge from Widevine repo of http://go/wvgerrit/75114

This changes the encoding for the hash to be hex instead of base64.

Also, the bad frame number is initialized to 0 to make it easier to
debug. And the FDPT test app now uses the correct byte order.

Bug: 129100318
Test: unit tests, FDPT test app.
Change-Id: I296bab990125a4e18bec92f3316e8289a3b25a6b
2019-03-22 17:14:27 -07:00
Srujan Gaddam
5356c66f0d Add script to diff test results between changes
Merge of http://go/wvgerrit/74965

It isn't always obvious which changes introduced test failures or fixes,
and similarly, it's unideal to have to manually run the tests for HEAD
and with a new change to determine the test diff, so this script runs it
for the last n changes, and diffs the test results by comparing the test
runs. It doesn't handle flaky tests, partly because I don't think it
can.

Change-Id: I5380abcb2f5bcadf172dba3c1270e4258e0c8a82
2019-03-22 10:17:43 -07:00
Adam Stone
09c7473dea Add extra OEMCrypto metrics
[ Merge from http://go/wvgerrit/74924 ]

These were not previously being collected or were collected
insufficiently.

BUG: http://b/121090396 http://b/112919252
Test: Unit tests, Gplay, Nflix, GTS
Change-Id: I32b7206cbe6071519b4a483fbcd0920dc1a26961
2019-03-20 11:25:19 -07:00
John Bruce
a5bc8be7a0 Merge "Remove Passthrough When L3 is Used w/ Opaque Handles" 2019-03-19 18:50:29 +00:00
John Bruce
907630a018 Merge "Fix unconditional use of __attribute__." 2019-03-19 18:47:19 +00:00
Rahul Frias
1a16b7d5ca Merge "Add unit tests to remove usage entries" 2019-03-19 15:34:33 +00:00
Jacob Trimble
86f6fb0ef7 Fix unconditional use of __attribute__.
(This is a merge of http://go/wvgerrit/74844)

__attribute__ is not supported on all compilers, notably it's not
supported on MSVC.  Commenting out the variable should suppress the
warning this is trying to fix.

Test: Android CDM Build
Bug: 122953649
Change-Id: I0101df1cca271415a6444e5455eb0085676bcabf
2019-03-18 16:16:26 -07:00
Rahul Frias
8942f7682a Add unit tests to remove usage entries
[ Merge of http://go/wvgerrit/74343 ]

This replicates a Netflix test that adds secure stops and removes them
one at a time, while some of the sessions are still open. Usage
enties will be deleted at the time, but the usage header table
will not be shrunk if the last entry is in use. This happens later when
sessions are closed and the last usage entry is no longer in use.

Bug: 120894148
Test: WV unit/integration tests, CE CDM tests
Change-Id: Ib572950afc61754fe5f3c417e650d5d08503425a
2019-03-18 15:47:12 -07:00
Robert Shih
d54634baa4 hidl: return BAD_VALUE from RemoveOfflineLicense when keyset is not found
Bug: 127828539
Test: VtsHalDrmV1_2TargetTest
Change-Id: Ia567be076a9460546c59c2a38231e18bb0549ce3
2019-03-18 15:24:22 -07:00
Rahul Frias
fd420ccdc5 Merge "Enable CE CDM usage tests" 2019-03-16 01:15:08 +00:00
John W. Bruce
672a12dd8b Remove Passthrough When L3 is Used w/ Opaque Handles
(This is a merge of http://go/wvgerrit/74628)

There is some old legacy behavior in CryptoSession for supporting
Chromecast. When a platform tries to use a combination of L3 and opaque
handles, it silently substitutes the type "clear buffers" instead.

No platform uses this behavior anymore. In fact, the CE CDM contains
code that explicitly prevents this case from being triggered. That code
has broken in every one of the last 3 releases. To allow the CE CDM to
end that bug farm, this patch removes the behavior that no one wants.

Bug: 112703532
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: I7f70483fac46c75637da5378c5a8b1bf7a2c2860
2019-03-15 16:04:28 -07:00
Rahul Frias
f9ad1dad69 Update usage entry before closing a session
[ Merge of http://go/wvgerrit/74443 ]

When deleting a usage entry, a crypto session may need to be closed
and reopened if a usage entry has previously been loaded. Before closing
this session, the usage entry/usage table header information should be
saved.

This is for completeness rather than correctness. Looking at code,
usage header and entry information are saved after the license
release has been generated. This change might be helpful in case
that changes in the future.

Bug: 115920873
Test: CE CDM unit tests, WV unit/integration tests
Change-Id: Ifc8f761497198247db31dab2f47e8323af783681
2019-03-12 15:21:58 -07:00
Rahul Frias
77ec11b8a8 Merge "Add UsageTableHeader metrics" 2019-03-12 18:41:00 +00:00