Commit Graph

4715 Commits

Author SHA1 Message Date
Cong Lin
e20bd444bf Merge "Fix implicit type conversion issue in ODK" into rvc-dev am: c34e2af181 am: 5bac96c72c am: 272f490e32
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11661188

Change-Id: I21ef577c99f4475f58f017725ce54f2e2db09f39
2020-09-15 01:01:34 +00:00
Fred Gylys-Colwell
ebdecfbd68 Update OEMCrypto unit tests to require ODK 16.3 am: 45681615b8 am: cd53dfca76
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677949

Change-Id: I6e2696e359f7f1e69ce7c42748df92dea55098e2
2020-09-15 00:52:01 +00:00
Fred Gylys-Colwell
9efaecdee2 Do not verify decrypt hash when no key selected am: 36968de671 am: ea86db9a2a
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677948

Change-Id: I58fcad399df8533bed5f267e53c998ea5c85a0ff
2020-09-15 00:51:59 +00:00
Fred Gylys-Colwell
9b222ef2c5 Unit test for loading nonce-free offline license am: a615671f48 am: df9740ecda
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677947

Change-Id: I35ff4ff4fc13982dac48a9547c14fb7e68ec57e4
2020-09-15 00:51:58 +00:00
Fred Gylys-Colwell
3eb34674d2 Check for null pointers in oemcrypto adapter am: 42eb79a3ff am: 8ec81840f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677946

Change-Id: I25696ace1bd30134fe17cdc54d1e6d0f8f7e0f20
2020-09-15 00:51:56 +00:00
Fred Gylys-Colwell
6d2b618296 Update ODK Library to 16.3 am: 166b3e8403 am: b33068bf35
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11699230

Change-Id: I3b972e56a57f4bca0823300d783707c6e3c8e6e6
2020-09-15 00:51:54 +00:00
Fred Gylys-Colwell
922411f468 ODK: forward compatibility and nonce-free offline license support am: 8dc1d7a11d am: 1bd515cc47
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11688972

Change-Id: I87f74e5c9dd6da3ca812a83a5fca5fcf01211e55
2020-09-15 00:51:52 +00:00
Cong Lin
272f490e32 Merge "Fix implicit type conversion issue in ODK" into rvc-dev am: c34e2af181 am: 5bac96c72c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11661188

Change-Id: I4484ce8db14a75b74c232e235d5da44830bced45
2020-09-15 00:37:30 +00:00
John Bruce
d749e66d2b Merge "OEMCrypto Unit Test Fix: Do Not Derive Keys Immediately" into rvc-dev am: 729723b3d2 am: 5ce6971993 am: 1f234b899f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11606170

Change-Id: I18bc34273d108c01f08c03ddf5323fec8d1cd61b
2020-09-15 00:18:35 +00:00
John Bruce
1f234b899f Merge "OEMCrypto Unit Test Fix: Do Not Derive Keys Immediately" into rvc-dev am: 729723b3d2 am: 5ce6971993
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11606170

Change-Id: I89e61467d0aa55c31131e2415d4e87b6b70922af
2020-09-14 23:42:00 +00:00
Alex Dale
5d13325c47 Rolled expected version number for R. am: dd70d63b76 am: 50e966a8d0 am: a806eec2dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11530830

Change-Id: I8757e6c402ebf3d51fafb2b1258d7e9417e864e0
2020-09-14 23:26:55 +00:00
Alex Dale
a806eec2dd Rolled expected version number for R. am: dd70d63b76 am: 50e966a8d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11530830

Change-Id: I309f6bc9263c5f2a4353b00ea5869b3752d02574
2020-09-14 23:18:45 +00:00
TreeHugger Robot
33f954893a Merge "The Entitlement key map was not being cleaned up." into rvc-dev am: bd8e573e0c am: 5d92fea3cd am: 5c796ea5b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11546312

Change-Id: I140b73792edaae9cb90e6be149e4f94916120c67
2020-09-14 23:12:43 +00:00
TreeHugger Robot
5c796ea5b7 Merge "The Entitlement key map was not being cleaned up." into rvc-dev am: bd8e573e0c am: 5d92fea3cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11546312

Change-Id: Ib71713ec896c58fa8009ea05cc6904b8c3c8792f
2020-09-14 22:14:01 +00:00
TreeHugger Robot
b59e9aae01 Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b am: 63a473d645 am: 0a5ec97f2f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11520639

Change-Id: I4fcb641e4ca53b4e465ae6d32db9e3a3c07a753a
2020-09-14 11:39:31 +00:00
Fred Gylys-Colwell
6fe4cad9b8 Update TimeRollbackPrevention unit test am: 75575418d0 am: 86c4cc8dcd am: fb0c6e0e7c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11506307

Change-Id: I85e9816a55143cd45ee84b5e0812a8971787881f
2020-09-14 11:21:26 +00:00
Fred Gylys-Colwell
a0451b013d License release does not use core message am: 760bf71908 am: a59c349816 am: 459ebef588
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11443770

Change-Id: I31dc1ceb80c951054c3eda81463fd7414384aa01
2020-09-14 03:38:13 +00:00
TreeHugger Robot
0a5ec97f2f Merge "Start playback timer in integration tests" into rvc-dev am: 7534d9795b am: 63a473d645
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11520639

Change-Id: Ie51f3119431e844e9c205181449033d8b7890041
2020-09-13 14:15:04 +00:00
Fred Gylys-Colwell
fb0c6e0e7c Update TimeRollbackPrevention unit test am: 75575418d0 am: 86c4cc8dcd
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11506307

Change-Id: I1def8aca779a0541ddb23a6cbe4f30fceb7559be
2020-09-13 13:42:56 +00:00
Fred Gylys-Colwell
459ebef588 License release does not use core message am: 760bf71908 am: a59c349816
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11443770

Change-Id: Ic536befe7a758be03ee2e997c2ea3a7eed892127
2020-09-13 13:12:06 +00:00
Edwin Wong
c705534a3f Rename metrics.proto to wv_metrics.proto. am: 051e879438
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12553272

Change-Id: I388f71c46a6808c63046bcc0006b8cb130a05b4a
2020-09-11 22:04:00 +00:00
Edwin Wong
051e879438 Rename metrics.proto to wv_metrics.proto.
Merge from http://go/wvgerrit/105767

To avoid conflict with metrics.proto in
frameworks/av/drm/libmediadrm/proto.
This is in preparation of moving metrics_dump tool
to build under Android.

bug: 161783052
Test: unit test
Test: Play Movies & Tv and Netflix streaming
Change-Id: I2406b66db4d61cca7c6260ea8847a555d96c8d42
2020-09-10 12:26:28 -07:00
Alex Dale
202a6fbb1b Merge "Enabled log formatting warnings." am: 7686e28e15
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12427377

Change-Id: I499b07d0c1d1984ac3f18526231326e48c9db0a8
2020-09-09 04:26:15 +00:00
Alex Dale
7686e28e15 Merge "Enabled log formatting warnings." 2020-09-09 04:13:02 +00:00
Alex Dale
9c9404f22d Merge "Correctly handle local display only for SRM version." am: 1defd1c7fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12482976

Change-Id: I6f13487f5443da1c0f70393344300732ffe9e961
2020-09-09 03:57:11 +00:00
Alex Dale
1defd1c7fc Merge "Correctly handle local display only for SRM version." 2020-09-09 03:38:48 +00:00
Alex Dale
f22cd20466 Enabled log formatting warnings.
[ Merge of http://go/wvgerrit/105025 ]

Clang and GCC allow for warnings against the arguments for printf-like
functions (e.i. LOGx).  These validate that the format type specified
in the format string match the corresponding argument type.

Most of the time, format specifer errors are benign; hence why they
haven't been seen as an error so far.  However, with the enabling of
specifier warnings and the enabling of warnings as errors on certain
platforms, these existing errors need to be addressed.

This CL enables format specifier warnings for most of the Widevine
code, with the OEMCrypto L3 implementation which has a single error
which requires a fix in the haystack code before being fixed in the
Widevine branch.

Strict format string warnings are not enabled for non-LP64 systems.

Bug: 137583127
Test: Compiled for Linux and Android
Change-Id: I051398332d31a20457b86563a90ad8f6d428445f
2020-09-08 15:46:15 -07:00
Rahul Frias
4fa369ad34 Do not store information for kLicenseTypeTemporary am: 315bf42c4f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12535604

Change-Id: I6f0041edac73a6efd3a6cefecfbd0a685c7d7ab5
2020-09-08 22:18:29 +00:00
Rahul Frias
315bf42c4f Do not store information for kLicenseTypeTemporary
[ Merge of http://go/wvgerrit/105624 ]

Temporary licenses do not allow for license information to be stored
in any form, whether it is usage information or persisting license
information. Information should not be stored even if can_persist is
set to true and a PST is specified as those are suggestions rather than
a requirement.

Bug: 167684104
Test: WV unit/integration tests
Change-Id: I141a2bd5de4d86f0e5f31fc8f0ea9e20710d6469
2020-09-07 18:50:13 -07:00
Alex Dale
b96b58628c Correctly handle local display only for SRM version.
[ Merge of http://go/wvgerrit/105343 ]

If a device only supports local display (eliminating the need for an
SRM version), then the CDM should treat this as no SRM version.

Bug: 166009716
Test: License request integration test
Change-Id: I2d9c3f98735563df6d7c7a287abab41bf0a8c513
2020-09-02 21:36:37 -07:00
Ben Lin
2ffa7f3bb1 Remove mediadrm/test/Android.bp file. am: e929a5dcdd
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12426378

Change-Id: Ief311b61b6dc0c56ea589e0b2aa2b001b6af14e7
2020-08-21 23:54:24 +00:00
Ben Lin
e929a5dcdd Remove mediadrm/test/Android.bp file.
The Blueprint file doesn't seem to be compatible with some 64-bit
targets (namely bertha_x86_64) - remove for now to stop build breakage.

Test: make -j32 libwvdrmdrmplugin_test
Bug: 165933287
Change-Id: I36d8238cc1a78eefef2ba2a06a4360ea46080349
2020-08-21 15:29:29 -07:00
Edwin Wong
51302613f7 Merge "Convert Android.mk to Android.bp" am: c64903759d
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12381118

Change-Id: Ib93c37a699e7910dd318a3234e1d013dd4bc96bb
2020-08-21 17:31:27 +00:00
Edwin Wong
c64903759d Merge "Convert Android.mk to Android.bp" 2020-08-21 17:13:00 +00:00
Edwin Wong
307cf378a9 Convert Android.mk to Android.bp
This CL builds the Widevine drm services and libraries.
Soong makefile conversion for unit and integration
tests will be in a different CL.

This doc may help with the review:
https://docs.google.com/document/d/1lK3X9RFPwbbwewLNlS4TfSMhxIlPuAkHRnGcgwWpChU/edit?usp=sharing

Test: build
Test: Play Movies and Netflix streaming
Test: unit tests
  build_and_run_all_tests.sh
Test: gts
  ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases -t com.google.android.media.gts.MediaDrmTest

  atest GtsExoPlayerTestCases:com.google.android.exoplayer.gts.DashTest

Test: vts
  ANDROID_BUILD_TOP= PATH="$PWD/android-vts/tools:$PATH" vts-tradefed run commandAndExit vts --module VtsHalDrmV1_3Target

Bug: 162321744
Change-Id: I50c0fb2e8f28dfe7901587e3d3203542943e23b1
2020-08-19 14:54:47 -07:00
TreeHugger Robot
3faf2d7024 Merge "Test renewal against same and different server" am: 9ca0979e7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12380233

Change-Id: I2763019a0df0c143c664de7552cb266e26b51e0e
2020-08-19 20:54:33 +00:00
TreeHugger Robot
9ca0979e7f Merge "Test renewal against same and different server" 2020-08-19 20:47:27 +00:00
Fred Gylys-Colwell
7604158d6f Test renewal against same and different server
Merge from Widevine repo of http://go/wvgerrit/102843

The test WvCdmEngineTest.LicenseRenewal is split into two tests. One
test verifies that the renewal may be fetched from the server
specified in the license. The second test verifies that the renewal
may be fetched from the same server that the license was fetched from.

These might be the same server, but when we run against an
experimental server, a staging server, or UAT Nightly, these
will be different.

Test: ran the tests
Bug: 141438127
Change-Id: Ia11441bd2ba0c6ddb264ee38bfcb5060b9ddb476
2020-08-19 20:45:33 +00:00
John W. Bruce
af60c6b247 Fix Undefined Behavior Around Enums am: 7f028d25c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12404605

Change-Id: If5509b1909d499ba484e6697895458957a03c923
2020-08-19 19:11:33 +00:00
John W. Bruce
7f028d25c8 Fix Undefined Behavior Around Enums
(This is a cherry-pick of http://go/wvgerrit/104184.)

UBSan has detected several places where our code tripped over what is
technically Undefined Behavior when handling enums, although in practice
any compiler would still generate safe code.

Some of these were places a variable was not being initialized and thus
was filled with garbage data. These have been fixed.

Understanding the rest depends on a bit of C++ trivia I had certainly
never heard before: An enum that doesn't specify its backing type will
frequently have a gap between the range of values the compiler will let
it take (which is limited only by the size of the backing type assigned
by the C++ standard) and the range of values for which the C++ standard
defines the behavior. (which is limited by the minimum number of bits
needed to hold the largest valid enumeration entry) So, for example, an
enum containing ten entries numbered 0 through 9 would be stored in
memory as an int and could thus take any value in the range of an int.
But it only takes 4 bits to represent the numbers 0 through 9. The
largest number that can be represented in 4 bits is 15. So reading the
value of a variable of this enum type when its stored value is outside
the range 0 to 15 is undefined behavior.

An enum that specifies its backing type is not subject to this because
it is defined behavior to access any value representable in the backing
type if one was explicitly specified.

If you think this sounds a bit silly, you'll be happy to know it doesn't
apply from C++17 onwards and most compilers generate code that handles
the undefined behavior values correctly.

Nonetheless, to appease UBSan and protect us from any compilers that
actually rely on this undefined behavior for optimizations, I have
defined backing types for all our enums. I have defaulted to the type
the compiler was already using (int32) and have deviated only where an
enum exists to be compared to or filled from a protobuf field and that
field in the protobuf is unsigned, in which case I used a uint32.

In the case of the CE CDM exported API, this also required changing our
enums from C-style to C++-style.

Bug: 163080356
Test: CE CDM Build & Unit Tests Pass even with UBSan
Test: Android Build & Tests
Change-Id: Id7e0064129e7c4d2827bb4a94825d144eeaacec8
2020-08-18 18:02:36 -07:00
Alex Dale
e9a6b6981f [automerger skipped] DO NOT MERGE Handle unlimited usage table capacity. am: 99335a6aa8 am: 601d910d17 -s ours am: fe06541507
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12266132

Change-Id: I71b48a64f2efeed173e82a70cbdaf4dd1dd0705f
2020-08-17 19:45:25 +00:00
Alex Dale
fe06541507 [automerger skipped] DO NOT MERGE Handle unlimited usage table capacity. am: 99335a6aa8 am: 601d910d17 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12266132

Change-Id: I6629b3ea2434acc913109641f6d3272425287f79
2020-08-17 19:31:06 +00:00
Alex Dale
601d910d17 DO NOT MERGE Handle unlimited usage table capacity. am: 99335a6aa8
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12266132

Change-Id: I25cb6ad05f466357fa4e2485a093ae8598bd5b51
2020-08-17 19:19:36 +00:00
Rahul Frias
7f683d5621 Merge "Log OEMCrypto_CloseSession error" am: 17e0562098
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12264983

Change-Id: Iae3448695d72d3a243cd7867e6e26985f35440b9
2020-08-13 02:06:08 +00:00
Rahul Frias
17e0562098 Merge "Log OEMCrypto_CloseSession error" 2020-08-13 01:49:35 +00:00
Alex Dale
5d783210af Merge "Log X-Google fields on failed HTTP requests." am: aa7ed24123
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12253154

Change-Id: I9ffed9f32caf4191db61218ab57247b3c2207a5a
2020-08-10 20:47:14 +00:00
Alex Dale
aa7ed24123 Merge "Log X-Google fields on failed HTTP requests." 2020-08-10 20:34:12 +00:00
Alex Dale
02243a7712 Merge "Handle unlimited usage table capacity." am: be2e32d09e
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12221244

Change-Id: Ia570cb4672d1b0b7a65030be49de0ceb97811b01
2020-08-07 20:51:41 +00:00
Alex Dale
be2e32d09e Merge "Handle unlimited usage table capacity." 2020-08-07 20:35:43 +00:00
Rahul Frias
e50c7d6ed1 Allow offline licenses to be loaded and restored in the same session am: 79eabb0989
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12309365

Change-Id: I04f37e6440e7f09ed40df3c3d65cd3ff3f31b83f
2020-08-07 09:46:25 +00:00