(This is a merge of http://go/wvgerrit/17452)
When the Crypto API was updated, several unit tests were removed, as
they did not work with the new API. This patch restores those tests.
Note that this does not add NEW tests for the new functionality
enabled by the API changes. Those will be coming in a separate patch.
This patch merely restores the previous tests and their functionality.
Bug: 26901698
Change-Id: I3315408804bdc6871b58c3620e482bf6d61fe03b
[ Merge from http://go/wvgerrit/17429 ]
This is to correct for when HDCP validation failure at the OEMCrypto level
ends up returning a CryptoException through MediaCrypto with error code
Unknown Error (-2998).
b/27849488
Change-Id: Ib3a9b1c3a17b9323f3d079a678cf88dedeec3b4b
Merge from widevine repo of http://go/wvgerrit/17393
This CL changes the installation directory for oemcrypto reference
code. In particular, it uses the new build rules to specifies the library
should go in /vendor/lib instead of /system/lib or /vendor/lib64.
This library should not be used on a production device.
b/26425759
Change-Id: I3a58d0d1ddeb5601b0f2f97cc87c2d4a2a41f0d8
(In addition to being a merge of http://go/wvgerrit/17394, this commit
updates tests/Android.mk to no longer try to build the private gMock.)
Previously, we maintained our own version of gMock (named libwvgmock
to avoid naming conflicts) and depended on it for our unit tests. Now
that Android has gMock in the externals/ directory and vaage@ has
eliminated the need for us to customize gMock's arity, we can stop
depending on or maintaining our own copy.
Bug: 26907374
Change-Id: Ia01d6c02e2f28a642480d7ef178b9bc3dde6d306
Merge from widevine side of http://go/wvgerrit/17355
The previous build of this library had some filenames and linker
symbols left in that should not be leaked. This build removes them.
Library versions:
level3/mips/libwvlevel3.a Level3 Library 4465 Mar 30 2016 13:29:24
level3/arm/libwvlevel3.a Level3 Library 4445 Mar 30 2016 13:23:54
level3/x86/libwvlevel3.a Level3 Library 4464 Mar 30 2016 13:26:29
b/27831262
Change-Id: I7801c6f953af338f5e80e95aa27098ae4c7a6c93
Merge from widevine repo of http://go/wvgerrit/17223
This CL turns off the mips64 bit build for widevine. This is because
the level 3 mips32 library does not build and run correctly for a 64
bit target.
b/27786231
Change-Id: I3388d9ebc80ae3cf477a8a54adfd1f22dfac4dda
Merge from widevine repo of http://go/wvgerrit/17202
This allows more checks in the test to run. Returning the correct
error code is less important than the next check, which verifies the
signature was not computed.
This helps diagnose b/21708882, but does not fix it.
b/27787064
Change-Id: I65306c54b77370951bc54e8ef9f6140f58bea32c
[ Merge of http://go/wvgerrit/17204 ]
Sleep was being employed, to introduce a delay so that one license expired
but the other was still active. The duration was long enough that
occasionally the second license would also expire, causing the test to fail.
Reduce the sleep duration to correct this behaviour.
b/27673513
Change-Id: Ieef9100c98783c16fc5ab8fe345fa1dd26604f18
Some decryption errors were being reported as
vendor-unique diagnostic codes that were not generally
actionable by an app. Recently a new
MediaCodec.CryptoException code was added so these types
of failures can be reported as ERROR_UNSUPPORTED_OPERATION,
in which case the app can use an alternate DRM
configuration in a way that does not require
vendor-specific handling. This change remaps this class
of decrypt errors to the new error code.
Merge of http://go/wvgerrit/17110
bug: 25929554
Change-Id: Iff44c2f04f9ee28d065fb17d59bca4032c5d55ca
Merge from widevine of http://go/wvgerrit/17178
These are the OEMCrypto Level 3 libraries, built using a stable
version of GCC and build tools on nyc-dev. Code changes are just
merged from master. Aside from build tool updates, the CL contains a
fix for b/26567162.
Current version (as printed by oemcrypto/level3/print-version-strings):
level3/arm/libwvlevel3.a Level3 Library 4445 Mar 17 2016 14:11:16
level3/x86/libwvlevel3.a Level3 Library 4464 Mar 17 2016 13:14:40
level3/mips/libwvlevel3.a Level3 Library 4465 Mar 17 2016 11:34:50
bug: 26917438
bug: 26567162
Change-Id: I07d526f28e61c5a9b66fa59b78041a93a99dc8e6
Merge from widevine of http://go/wvgerrit/17128
This CL adds a unit test for an edge case that would be handled
differently for HLS and CENC standards. We enforce the CENC standard.
b/27524491
Change-Id: Ie3cdfaac0fe37dd0eb991179fd84f4e113e07dae
[ Merge of https://go/wvgerrit/17055 ]
There are a few bugs that need to be addressed to get HLS to work.
* Content ID in json init data is base64 encoded and needs to be decoded
before being added to the WidevineCencHeader proto.
* Protection scheme was not set in the WidevineCencHeader proto.
* HLS initialization data should be sent as a CENC content identification
in a license request.
b/20630275
Change-Id: Ie0ac33ac061931df6f26c0afbf3e62e5d01e5041
Merge of http://go/wvgerrit/17040
The delta document specified the wrong error code if
Minimum_Security_Patch_Level is not valid. The correct error is
OEMCrypto_ERROR_UNKNOWN_FAILURE.
b/27524999
Change-Id: I0c5d9b6d40b384ae3550348569d78c60093a65d4
[ Merge of https://go/wvgerrit/16940 ]
An alternate scenario to renewing keys is to load the same keys in
a separate session and make use of them by using the session sharing
feature.
Session sharing involves iterating through a map of sessions and
returning the first session that contains the Key ID. In certain cases
(license about to expire) we might prefer an alternate session
be chosen.
Licenses may expire in two ways. Policy engine, driven by a 1 second
timer may detect expiry and send an asynchronous event. OEMCrypto may
also detect expiry based on information in the key control block
and return an error during decryption. It is possible that these
may differ by upto a second. This can lead to issues where decryption
fails but EVENT_KEY_EXPIRED is not generated till later.
It is possible to address this by using information from both timers
to notify the app about expiry. To implement this correctly will
add complexity and require synchronization between threads. To avoid
this an alternate solution is, if session sharing is used, to pick
the session that has a license with the longest remaining validity.
b/27041140
Change-Id: I398cc4c10ee3a2f192d4a0befe7c8a469dd5bf86
When merging the change from Widevine's repo over to NYC,
some deletes were missed. This change removed the unused
classes profiler_session and stats.
The make file still had a reference to Stats, which was
likely due to a merge conflict.
Change-Id: Ic39baafab4bfd84e2b462f6749761c8a228244c7
This aligns our test script with the functionality found in our TF
test configuration for preventing concurrency issues with DroidGuard.
Matching Widevine cl: go/wvgerrit/16791
Change-Id: Icc891de0a5f3795d8582b21e1bcf734049ddbf42
This change is a merge of the following changes:
1. Remove MultipleSessions (go/wvgerrit/16763)
2. Increase Memory Budget (go/wvgerrit/16764)
3. Fixing Possible Integer Overflow (go/wvgerrit/16765)
4. Creating Call Table (go/wvgerrit/16766)
5. Creating Call History (go/wvgerrit/16767)
6. Connecting Profiled Scope (go/wvgerrit/16768)
7. Adding Call Table Version Number (go/wvgerrit/16780)
8. Add Version Number to Call History (go/wvgerrit/16781)
bug: 27157796
Change-Id: Ia3f088a1714f3f5b426fee6141daa4ea8d832cf4
[ Merge of http://go/wvgerrit/16769 ]
Protos have been updated to match the google3 copy. This introduces
protection scheme to support HLS and MetricData to assist
in reporting. Changes have been made to set or consume data
from appropriate fields.
b/27146600
Change-Id: Ic928a406efb8fbb959b95a77dda6848e839b1948
[ Merge of http://go/wvgerrit/16544, http://go/wvgerrit/16639 ]
* This fixes the oemcrypto unit tests to build with the ce cdm.
The unit tests do not build when it is detected that a long (NULL)
is compared to a pointer.
* Remove NULL pointer comparison
On some platforms ASSERT_NE(NULL, ptr) does not work. This CL
replaces it with ASSERT_TRUE(NULL != ptr).
* Test Simultaneous Decrypt
With the increasing number of devices that support multiple screens or
windows, it is desireable to verify that OEMCrypto can have several
sessions open and actively decrypting at the same time.
Calls to OEMCrypto are still serialized -- this is not a threading
test -- but we still have multiple sessions open and decrypt from each
of them.
* Remove unused variable in initialization_data
Change-Id: I1a4be38fb30a14f610544416db653a81342f16b3
[ Merge of http://go/wvgerrit/16625 and http://go/wvgerrit/16633 ]
Reduce the number of parameters needed by GenerateKeyRequest.
Combining all output values into a single struct.
BUG: 26162546
Change-Id: Ibeb3f4df4a8e877511f8ab2e6c543001a921f285
[Merge of http://go/wvgerrit/16626]
[Cherrypick from http://go/ag/858552 to nyc-dev branch]
Setting umask to ensure only owner can access sensitive files.
Fixes request_license_test which creates directories and files
accessible by group and others.
bug: 26567162
Change-Id: I63553ec9210f3a4c160cd4c4f2a49c9e0a4157db
This silences the canary test to match the Android version string
change from NYC to N. properties_android.cpp has already previously
been updated for N, so no need to bump the Widevine Android version
number at this time (see: go/ag/800077)
Matching Widevine cl: go/wvgerrit/16664
Bug: 26901110
Change-Id: Ib8f47f77bbb4dd2c7c302102fe43007059af2d50
[ Merge of http://go/wvgerrit/16628 ]
Jsmn will replace a local method that parsed json init data.
Added a fix to include all key Ids in the WidevineCencHeader rather than
just the first. Also modified the content_id to reflect that it is a
base64 encoded value.
b/20630275
Change-Id: I7080c8cea21be4dea09a4905a96b4cc03e584c1d
[ Merge for http://go/wvgerrit/16617 ]
This adds additional test coverage to verify HLS EXT-X-KEY attribute
lists.
b/20630275
Change-Id: I72d7aa13b9b190728a56668ab79fa5e93bfa0d8b
[ Merged of http://go/wvgerrit/16576 ]
The WV EXT-X-KEY attribute list earlier expected a cenc PSSH box in the
URI field, in a hexadecimal sequence format. To ease the burden on
content providers, the URI field will now contain init data in a json
format and base64 encoded. The platform will assume responsibility
to parse this data and create a widevine init data protobuf that
can be included in the license request.
b/20630275
Change-Id: I49e270bedbe96791fc9b282214a9a358d95d163e
[ Merge of http://go/wvgerrit/16550 ]
This is in addition to Web safe Base64 encode/decode support by core.
Change-Id: I9ed51721b138a7f15fb4d216796deadd5d5b31a2
This CL is a merge from the widevine repo of
http://go/wvgerrit/16553 Prebuilt Level 3 OEMCrypto for Android
http://go/wvgerrit/16238 Require OEMCrypto v11 for Android N Unit Tests
http://go/wvgerrit/16484 Shared License Tests (OEMCrypto v11)
http://go/wvgerrit/16448 Pattern Decrypt Unit Tests and Reference Implementation
http://go/wvgerrit/16489 Enforce UNUSED Variables
http://go/wvgerrit/16479 Pattern Decrypt for Level 3 OEMCrypto
http://go/wvgerrit/16280 Correctly handle bad RSA key
http://go/wvgerrit/16315 Security Patch Level - haystack version
http://go/wvgerrit/16282 Correctly handle null pointer in GetKeyData
http://go/wvgerrit/16294 Initialize data for generation number
It contains the Level 3 implementation, as well.
mips/libwvlevel3.a Level3 Library Jan 22 2016 14:30:27
arm/libwvlevel3.a Level3 Library Jan 22 2016 15:03:55
x86/libwvlevel3.a Level3 Library Jan 22 2016 13:52:29
b/26692954 [DRM] OEMCrypto v11 needed for Nexus devices
Change-Id: Ibb1384959620f63a1be1e82ce2952ec9f48f0d3e
Merge from Widevine repo of http://go/wvgerrit/16499
With the increasing number of devices that support multiple screens or
windows, it is desireable to verify that OEMCrypto can have several
sessions open and actively decrypting at the same time.
Calls to OEMCrypto are still serialized -- this is not a threading
test -- but we still have multiple sessions open and decrypt from each
of them.
Change-Id: I5b24f4a464ed05a5b21625c66fe7989644b67a5a
[This is a merge of http://go/wvgerrit/16522 ]
This commit adds support for CBC and Pattern Mode to the MediaCrypto
implementation. These are the only changes needed to support HLS. (No
change is needed for MediaDrm, as it already passes HLS initialization
data along to the core without closely inspecting it, as it should.)
Following this change, the glue layer also supports the CENC, CBC1,
CENS, and CBCS modes from the forthcoming update to the ISO-CENC spec.
Note that, in order to differentiate CBC1 and CBCS, we have to cue on
the presence or absence of a pattern, which may not continue to be
sufficient in the future if a third CBC mode using patterns is ever
added.
Note that the unit tests for this code remain disabled for now. New
unit tests are forthcoming in a separate commit.
Bug: 25666017
Change-Id: I5942a8b70393e63b4de9d7dab985c4c2a98a20b3
[ Merge from http://go/wvgerrit/16498 ]
The CDM now supports AES CTR and CBC block cipher modes. The license
specifies the mode to be used in the key container. The mode is
also specified in mediaCrypto when calling decrypt. This adds
verification for the cipher block mode.
Change-Id: I2587fc1e4b6d77161f2f8653f8516024c73dd8ac
[ Merge from http://go/wvgerrit/16499 ]
Passing clear subsamples to OEMCrypto_CopyBuffer and encrypted subsamples
to OEMCrypto_DecryptCTR was causing performance issues as a lack of crypto
session information made it hard to associate clear and encrypted
subsamples with each other.
[ Based on a patch from Kelly Ren/Qualcomm ]
b/26538744
Change-Id: I4644f197b2ec481f6aa89d3fce29b22ebb7b0c06