Commit Graph

1506 Commits

Author SHA1 Message Date
Rahul Frias
6e7e6122e3 am 6e7339f4: Merge "Playback duration should override license duration" into mnc-dev
* commit '6e7339f40fac42b67079401a40d2c78742b6736f':
  Playback duration should override license duration
2015-05-15 20:35:39 +00:00
Kyle Alexander
b513c016ed Merge "Updating expected Android version to M" into mnc-dev 2015-05-15 18:24:15 +00:00
Rahul Frias
6e7339f40f Merge "Playback duration should override license duration" into mnc-dev 2015-05-15 17:40:07 +00:00
Tim Kilbourn
2ea2bda335 Merge "Rename the internal copy of gmock." 2015-05-15 16:51:47 +00:00
Kyle Alexander
fdefa86e6e Updating expected Android version to M
Change-Id: Ie8f066658377e58af8c132125c815ef847c2938b
2015-05-15 09:08:00 -07:00
Tim Kilbourn
5b830f19b6 Rename the internal copy of gmock.
The external/gmock project does not include the patches needed for
widevine, so renaming the internal copy allows both to coexist in the
build system.

Change-Id: I77c956db30921afffe31d11e1cd2d99541925f35
2015-05-14 17:05:59 -07:00
Fred Gylys-Colwell
7fffdcdbd9 Print values in host byte order
Merge from widevine of http://go/wvgerrit/14361

In oemcrypto_test, we look at some control duration and control
bits. These are stored in network byte order.  However, it is easier
to read error messages if they are converted to host byte order before
printing them.

Change-Id: I116b5f43957351b0e40e05331c282c248128903c
2015-05-14 15:54:38 -07:00
Rahul Frias
d4900bc9a2 Playback duration should override license duration
[ Merge of go/wvgerrit/14360 ]

If within playback window, do not expire license on expiry of rental or
license duration. In this case playback duration will extend the license.

b/17791094

Change-Id: I26d255aa8f0287bd583ebdeec991c613d49d8f22
2015-05-14 15:51:01 -07:00
Rahul Frias
d2e91faf8e Respect Client Properties when reporting CDM Status
[ Merge from go/wvgerrit/14286 ]

CDM now reports status information associated with the specified security level.
Earlier information would be reported from the default security level.

b/18709693

Change-Id: I7a01e8ea9773b56951c207437ce85e567fd32b09
2015-05-07 16:35:51 -07:00
Chih-Hung Hsieh
1c6b675f0c Use gcc to build unit tests until vendor code is fixed.
BUG: 20893039
Change-Id: I649dae16bbc748defc8eb92c879140fe950fe936
2015-05-06 16:44:47 -07:00
Rahul Frias
7bfef98571 Merge "Add client information to release and renewal messages" into mnc-dev 2015-05-06 17:42:44 +00:00
Jeff Tinker
63d587fda7 Merge "Clarify decrypt error detail messages" into mnc-dev 2015-05-06 17:22:18 +00:00
Jeff Tinker
aae58981ea Clarify decrypt error detail messages
Merge of http://go/wvgerrit/14290 from widevine cdm repo.

Change-Id: I4c33a1202ca45064c65c7c1a4e36fed999f7bd82
related-to-bug: 20857014
2015-05-05 22:22:45 +00:00
Rahul Frias
20fc54e384 Add client information to release and renewal messages
[ Merge of go/wvgerrit/14240 ]

Client information is reported in release and renewal messages based on
flag in the license. License proto has been updated to match server updates.

There are two caveats
* Client IDs will be reported unencrypted when usage reports are requested.
* Release requests that enable privacy mode (encrypted client IDs) but do not
  specify a service certificate are not supported.

b/19247020

Change-Id: I95e709922122370f310936fbad3d312262128e49
2015-05-04 18:24:00 -07:00
Fred Gylys-Colwell
6573adc343 Merge "Use PRNG to Encrypt Needles in Haystack" into mnc-dev 2015-05-02 00:39:14 +00:00
Fred Gylys-Colwell
48e84580e9 Close Unused Sessions in NonceFlood Unit Test
Merge from widevine of http://go/wvgerrit/14263

The unit test PreventNonceFlood3 opens 8 sessions and floods the nonce
table.  It then opens one more session after a pause to verify that it
can still request nonces.  However, there is no requirement that we
can open more than 8 sessions.  This CL reuses one of the already open
sessions to verify that we can continue generating nonces.

Change-Id: If35f146477bd21e381ec5375dde7ec7fdbe8f366
2015-05-01 15:55:34 -07:00
Fred Gylys-Colwell
dfb1c39275 Use PRNG to Encrypt Needles in Haystack
This is a merge from the widevine repo of http://go/wvgerrit/14262

This CL replaces AES with a psuedorandom number generator to encrypt
the needles in the oemcyrpto level 3 haystack.  This speeds up the
overhead significantly, and reduces decrypt times by as much as 75%
for small buffers (1-3 kb).  This makes the obfuscation slightly less
secure but is worth the overall performance boost.

Level 3 library versions:
level3/arm/libwvlevel3.a  Level3 Library May  1 2015 15:45:12
level3/x86/libwvlevel3.a  Level3 Library May  1 2015 15:45:55

b/19582757 L3 Widevine extremely choppy on Nexus 6 (480p)

Change-Id: I3077c04047a7f2da6f64869d7a9af5ddcc62671f
2015-05-01 15:50:26 -07:00
John "Juce" Bruce
f18021f99a Merge "Remove Unnecessary Locking from Android" into mnc-dev 2015-05-01 21:12:19 +00:00
Kyle Alexander
de14893d9c Merge "Makefile to include Widevine tests in google_tests.zip package." into mnc-dev 2015-05-01 17:27:51 +00:00
Fred Gylys-Colwell
9585237b33 Merge "Add keybox definition to docs" into mnc-dev 2015-04-30 20:47:52 +00:00
Fred Gylys-Colwell
20bd476104 Add keybox definition to docs
Merge from widevine repo of http://wvgerrit/14219

This updates the integration guide to include a definition of the
keybox.  Previously, there was a broken link in the description of
IsKeyboxValid.

This CL also updates the android supplement to describe how to request
a keybox.  I just copied the information from the legacy integration
guide.

Change-Id: I486a3ccad9889a732a9c1374c40b793deb249459
2015-04-30 12:13:52 -07:00
John "Juce" Bruce
8c81d38a73 Remove Unnecessary Locking from Android
(This is a merge of http://go/wvgerrit/14242)

To try to fix b/17761616, I added a lock to the DRM Plugin. However,
the API guarantees that any single DrmPlugin will never be called into
from multiple threads at the same time, rendering this unnecessary.
Previously, b/18194977 meant that this was not always true, but now
that that bug is fixed, this lock is not needed and can be removed.

Bug: 18194977
Change-Id: I25ee5fa44f35706f863b036997453441eac29c95
2015-04-29 16:09:21 -07:00
Kyle Alexander
50704657e5 Makefile to include Widevine tests in google_tests.zip package.
Inclusion depends on a subsequent cl in vendor/google,
referencing the WIDEVINE_TEST_MAKE_TARGETS variable within.

Subsequent cl: https://googleplex-android-review.git.corp.google.com/681048

Change-Id: Ibaad415213b193dfb55426e4a9d725e39f4c05b3
2015-04-28 13:17:23 -07:00
Fred Gylys-Colwell
2229e51c18 Set default GTEST_FILTER in android script
Merge from widevine repo of http://go/wvgerrit/14218

If GTEST_FILTER was not set, it defaults to "" which matches no
tests.  This CL changes it to "*" if it was "".

Also, quotes are added around the environment variable and command so
that it multiple variables can be set.

Change-Id: Icad9a1fbca2d1b436f6e37a2a080a70a384f0a1d
2015-04-27 12:51:54 -07:00
John "Juce" Bruce
509471b058 Fix Case on InitDataResemblesPSSH()
(This is a merge of http://go/wvgerrit/14156)

This was Google-cased, not Android-cased like the rest of the file
it's in.

Change-Id: I79ecf490212428de9a668d49d6feca678379f3ae
2015-04-24 15:17:03 -07:00
Fred Gylys-Colwell
c4d9c1036e Merge "Update unit test make files to use BoringSSL" 2015-04-22 17:35:25 +00:00
Fred Gylys-Colwell
d6da9518ec Merge "Annotate logcat with current running test (oemcrypto)" 2015-04-22 17:34:53 +00:00
Fred Gylys-Colwell
f75fddcdf1 Update unit test make files to use BoringSSL
Merge from widevine of go://wvgerrit/14173

This CL updates the android makefiles to use the libcrypto_static.

Change-Id: I74567ff880ebdce366766a9ab44c92cc9540b8db
2015-04-22 07:47:51 -07:00
Fred Gylys-Colwell
39a86c688a Simplify Nonce Flood Test
Merge from widevine of http://go/wvgerrit/14134

This CL adjusts the nonce flood test so that the timing is more
explicit.  Also, if the test fails, the error message should tell us
exactly how many nonces were generated and the duration of the test.
Thus we'll be able to tell if the test almost passed.

b/19081206

Change-Id: I2c59755466b017910b86f6b02f2883a771d0ccb7
2015-04-20 11:38:59 -07:00
Adam Langley
96f5d1bef3 am f934d6fb: (-s ours) widevine: update to work with BoringSSL.
* commit 'f934d6fb41f5e75fb9fbd44fb74be2be1a2cd803':
  widevine: update to work with BoringSSL.
2015-04-18 18:46:08 +00:00
Adam Langley
f934d6fb41 widevine: update to work with BoringSSL.
This change:

1) Switches the Makefiles over to using LOCAL_STATIC_LIBRARIES, which I
understand is the new hotness, rather than setting a -I flag directly.

2) Switches to the non-deprecated _ex versions for EVP_EncryptFinal.

3) Uses the EVP_PKEY interface for checking PSS signatures. This is the
only supported interface in OpenSSL: the PSS padding check functions are
only exported in upstream OpenSSL because it's a library from the 90s
and they don't have a concept of "unexported". Also, by using the EVP
functions, OpenSSL/BoringSSL can do a better job of being constant-time.

Since there aren't any obvious tests for checking that the signtaure
verification still works, I tested with the code in the referenced
paste, which includes both the old and new verification functions and
checks that they both work on a sample signature. (And I also checked
that they both fail when a bit in the signature is changed.)

https://paste.googleplex.com/5747976139964416

(cherry picked from commit 4f01ef23d1)

Change-Id: Iae7409c53eeea9c3892a32c180d7181d72467dcb
2015-04-18 09:46:53 -07:00
Fred Gylys-Colwell
a745387c20 Annotate logcat with current running test (oemcrypto)
Merge from widevine repo of http://go/wvgerrit/14125

This copies code from http://go/wvgerrit/13847 to the oemcrypto unit
tests.  It puts the test name in the log file.

I also commented out some unused function parameters to avoid compiler
warnings.

Change-Id: I3ba259de2f408ec60e90db7f0ea1524d5aa8f8a4
2015-04-17 12:51:20 -07:00
Rahul Frias
dfe9a55a15 Merge "Fix offline key restoration failures" 2015-04-16 00:38:42 +00:00
Edwin Wong
2eb013691c Add more CdmResponseType to help with debugging in the field.
The errors in the range ERROR_DRM_VENDOR_MIN to ERROR_DRM_VENDOR_MAX are
reflected in the message that is reported to the app, which is
MediaDrmStateException.getDiagnosticInfo().

Many errors map to kErrorCDMGeneric, especially KEY_ERROR is used as a
generic error in CDM. This fix defines more specific error codes in the
CDM for places where KEY_ERROR is returned.

Merge from http://go/wvgerrit/14071

bug: 19244061
Change-Id: I688bf32828f997000fea041dd29567dde18ac677
2015-04-15 11:44:06 -07:00
Rahul Frias
a48331a747 Fix offline key restoration failures
[Merge of https://widevine-internal-review.googlesource.com/#/c/14110/ from
 widevine cdm repo]

Backward compatibility handling was causing L3 usage and clock information
to be moved. This caused nonce and other failures when attempting to restore
offline keys.

b/20025990

Change-Id: I6e0fa1030bcce1a5bdd811a9064989d3b6ce2f04
2015-04-15 11:01:39 -07:00
John "Juce" Bruce
c5f576585b Allow Setting of Session ID
Implements the optional setMediaDrmSession() method. To enble this,
support was added to the core to report if a session ID is valid.

As a consequence of this, in the tests for the CryptoPlugin,
construction of the plugin must be deferred until all gMock
expectations are set, as construction now calls into the CDM core.

This is a merge of two changes from the Widevine CDM repo:
http://go/wvgerrit/14083
  Allow Setting of Session ID
http://go/wvgerrit/14085
  Check If Session ID Is Valid When Changing CryptoPlugin IDs

Bug: 19570317
Change-Id: I7dbd777ce6efebd71fdb5e602663a0e35a48a9c4
2015-04-10 16:00:33 -07:00
John "Juce" Bruce
0540770280 Remove Backwards-Compatibility for Classic MediaCodec Mode
(This is a merge of http://go/wvgerrit/14082)

Previously, the CryptoFactory had special behavior to defer creation
to Widevine Classic if no session ID was provided. This functionality
has been deprecated, as MediaCodec Mode is no longer supported.

This is necessary as part of supporting the new API for session ID
changes because the expectation is that it is now legal to initialize
a modular CryptoPlugin without a session ID.

Bug: 19570317
Change-Id: Iad0cd01b6a8d2e66c94c5f53a8a60f5787bc02f8
2015-04-10 16:00:22 -07:00
John "Juce" Bruce
86fdcc744d Merge "Allow Unprovisioning of Origins" 2015-04-10 18:28:34 +00:00
John "Juce" Bruce
bf5515faa1 Merge "Support Per-Origin Provisioning" 2015-04-10 18:20:55 +00:00
John "Juce" Bruce
13afc71658 Merge "Update Protobufs to Include Per-Origin Provisioning ID" 2015-04-10 18:18:58 +00:00
Kyle Alexander
7cb708b8ad Merge "Fix compatibility for tests to execute on older OS versions" 2015-04-10 17:14:06 +00:00
Kyle Alexander
1e87ad760f Fix compatibility for tests to execute on older OS versions
Change-Id: I7b2554d097901cd5880b6cd3ddbe66c9b127dcfd
2015-04-10 09:15:23 -07:00
John "Juce" Bruce
efea2ddba4 Allow Unprovisioning of Origins
(This is a merge of http://go/wvgerrit/14051)

Adds support for passing a special provisioning response ("delete")
to the provisioning API in order to unprovision the current origin.
Note that the origin MUST be set or else this will fail.

The existing, system-only unprovisionDevice() method is unaffected.

Bug: 12247651
Change-Id: I16d296397d8e9e73c8f43e36c86838873318a398
2015-04-09 19:07:51 -07:00
John "Juce" Bruce
59811eed57 Support Per-Origin Provisioning
This is a merge of several Widevine-side commits that, cumulatively,
allow callers to specify an origin to be used to isolate data storage
as specified in the W3C Encrypted Media Extension specification.
Separate origins have separate certificates, and consequently cannot
share device identifiers with each other.

The changes included in this are:

Add Ability to Check for Existing Certificates
    http://go/wvgerrit/13974
Add Ability to Remove the Certificate
    http://go/wvgerrit/13975
Make CDM Origin-Aware
    http://go/wvgerrit/13977
Add Per-Origin Storage to Widevine CDM on Android
    http://go/wvgerrit/14026
Remove Automatic Origin Generation
    http://go/wvgerrit/14031

Bug: 19771858
Change-Id: I6a01c705d9b6b4887a9c7e6ff4399a125f781569
2015-04-09 19:02:31 -07:00
John "Juce" Bruce
786bbba499 Update Protobufs to Include Per-Origin Provisioning ID
(This is a merge of http://go/wvgerrit/13976)

Updates the certificate provisioning protobuf to include the stable_id
field.

Bug: 19771858
Change-Id: I6c1ed8c8c219a8cacc9798d189458d9861aa46d0
2015-04-09 19:00:16 -07:00
John "Juce" Bruce
b0b11bc534 Replace OS Version with Widevine Version
(This is a merge of http://go/wvgerrit/13813)

Removes the OS Version property which was only ever implemented on
Android to appease Netflix and never actually used by them. Adds,
instead, a Widevine library version property. Also adds
implementations of this function for both Android and CE Devices.

For Android, the version number is starting at 3.0.0-android, to
reflect that this is the third major revision of the Widevine CDM in
Android.

For CE Devices, the version number is not changing from its current
value (2.2.0) but is gaining a "-ce" on the end in order to
differentiate it from the Android version number.

Bug: 18376638
Change-Id: Ifb3fa0d62631b45d9e91a6a53bcab3be38763d3a
2015-04-09 18:53:49 -07:00
Fred Gylys-Colwell
3ff106f86a Merge "OEMCrypto Unit Tests" 2015-04-10 00:06:39 +00:00
Jeff Tinker
453eb29b57 Merge "Integrate OnExpirationUpdate and OnSessionKeysChange with Android" 2015-04-10 00:01:32 +00:00
Fred Gylys-Colwell
2527f77201 OEMCrypto Unit Tests
This is a merge from the Widevine repository of
http://go/wvgerrit/14024
Add Level 3 Oemcrypto Unit Tests To Run All Tests Script

This CL adds the ability to restrict the oemcrypto unit tests to only
use the fall back level 3.  This restriction is per-process, and is
only used while running the unit tests.  This allows us to automate
running the unit tests on an android device as both level 1 and level
3 without modifying files in /system/lib.  To turn on the restriction,
set the environment variable: FORCE_LEVEL3_OEMCRYPTO=yes.

New level 3 library versions are:
level3/arm/libwvlevel3.a  Level3 Library Apr  8 2015 13:09:05
level3/x86/libwvlevel3.a  Level3 Library Apr  8 2015 13:15:42

http://go/wvgerrit/14055
Remove Redundant Tests

This CL modifies the UsageTableTests in oemcrypto_test.cpp so that
they are not all parameterized by new_mac_keys_.  This parameter is
used when testing signatures.  In particular, we do not need to verify
timing twice.

Also, I modified the run_all_unit_tests.sh script so that the
environment variable GTEST_FILTER is passed down to the android
process.  This allows us to use the script to run a limited list of
tests while debugging.

http://go/wvgerrit/14054
Filter Out API Version 10 Tests

This CL updates the OEMCrypto tests so that all but one test will pass
for a device that implements the version 9 API.

Android LMP devices should pass tests with
        GTEST_FILTER="*-*MNC*:*CanLoadTestKeys*"

http://go/wvgerrit/13886
Update Documentation about Optional Features

The intergration guide has been updated to include reference to
OEMCrypto_LoadTestRSAKey.  It also now discusses optional features.

The Delta 10 document now mentions OEMCrypto_LoadTestRSAKey.
The android supplement warns that most optional features are required.

This also adds clarification about which functions should save the
usage table, in answer to:

b/16799904 OEMCrypto v9 ambiguous about saving usage table information

Change-Id: Ifb517d58952c9b332b2958ca99af64bc293b985f
2015-04-09 16:19:17 -07:00
John "Juce" Bruce
ac0e1cf07f Merge "Widevine CDM Now Goes to Eleven" 2015-04-09 21:50:03 +00:00