Commit Graph

137 Commits

Author SHA1 Message Date
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
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
Fred Gylys-Colwell
42f7458cfc Fix Memory Leak In OEMCrypto Level 3 Haystack
Merge from Widevine repo of http://go/wvgerrit/10308

There was a memory leak in the oemcrypto RSA code.

Also, when saving the usage table, some session variables were
allocated twice.  This results in session data  being lost.

There were also some leaks and uninitialized values in oemcrypto_test.

I added some checks and profiling to the debug runtime for the
haystack.  It will warn if a variable is left unencrypted or is
unencrypted twice.  I also added the profile code.

Versions of L3 library:
android/level3/arm/libwvlevel3.a  Level3 Library Apr  1 2015 11:40:06
android/level3/x86/libwvlevel3.a  Level3 Library Apr  1 2015 12:44:32

b/19950814

Change-Id: Ic752e36c09fce121dcaf92f9209591e74f3eb070
2015-04-01 12:52:29 -07:00
Fred Gylys-Colwell
bd2ac27684 Add backwards compatibility for OEMCrypto version 9
This is a merge of http://go/wvgerrit/13710

The oemcrypto adapter loads a version 8, 9 or 10 library and adds
backwards compatibility for version 8 or 9.

The only function whose signature has changed from v9 to v10 is
OEMCrypto_GetHDCPCability. This CL adds backwards compatibility for
that function.

Level 3 libraries are now:
level3/arm/libwvlevel3.a  Level3 Library Mar 17 2015 14:33:34
level3/x86/libwvlevel3.a  Level3 Library Mar 17 2015 14:30:23

b/19785099 L1 Widevine missing/broken on master (Fugu)
b/19789909 L1 Widevine missing on master (AAY75B)

Change-Id: I9bd716f5cdffaf1bfbdfcd8ed067af3f5d0ac9ba
2015-03-17 15:35:56 -07:00
Fred Gylys-Colwell
68034dd900 OEMCrypto Version 10 API
This is a merge of http://go/wvgerrit/13391 from the Widevine repository.

This CL adds the OEMCrypto version 10 API to the header, and changes
just enough code so that code still compiles.  There are no unit tests
or implementation.

The level 3 libraries are just stubs so that tests will compile.
level3/arm/libwvlevel3.a  Level3 Library Mar 11 2015 13:33:21
level3/x86/libwvlevel3.a  Level3 Library Mar 11 2015 15:20:27

Change-Id: I41de753a2a60da29b756c3327341ece72069d8bb
2015-03-11 15:29:45 -07:00
John "Juce" Bruce
854a47981a Generate New Obfuscated L3 Libraries for Android
(This is a merge of http://go/wvgerrit/13420 from the Widevine
repository.)

Generates new obfuscated libraries that include @kqyang's recent
changes to add OEMCrypto_GetMaxNumberOfSessions().

libwvdrmengine/level3/arm/libwvlevel3.a  Level3 Library Mar  6 2015 15:16:17
libwvdrmengine/level3/x86/libwvlevel3.a  Level3 Library Mar  6 2015 15:20:30

Change-Id: Ibea299a372617f98c0f24861c673f56a97845ad8
2015-03-06 16:14:18 -08:00
Dan Albert
723d67c88f Remove Widevine CDM Dependency on STLPort
* Replace an stlport static assert with a C++11 static_assert.
 * Move some libraries that were being built with the NDK but
   statically included into platform code off the NDK.
 * Rebuild the obfuscated binaries to use the new STL.
 * Remove MIPS support temporarily due to an inability to generate
   obfuscated binaries for it. (To be fixed in b/19482469.)

Bug: 15193147
Change-Id: Icc166583b0c6af68550baf17ab8c33076a1179d3
2015-02-25 15:53:36 -08:00
Jeff Tinker
4dd748597a Fix illegal instruction fault in libwvdrmengine.so
Merge of https://widevine-internal-review.googlesource.com/#/c/12020/
from the widevine CDM repo.

bug: 18606686
Change-Id: Iafc27f51c8d486065620c9140ce88b285fc0067c
2014-12-12 00:56:19 +00:00
Fred Gylys-Colwell
d2ca9d448e Merge "Level 3 OEMCrypto library for mips" into lmp-mr1-dev 2014-12-05 02:57:26 +00:00
Fred Gylys-Colwell
cb9360fb65 Level 3 OEMCrypto library for mips
This CL is a merge of the widevine change
https://widevine-internal-review.googlesource.com/#/c/11881

The function rand() was not available on the mips build used to
generate the level 3 oemcrypto fallback library.  This function has
been replaced by the openssl RAND_bytes(), so that compilation may
complete.

New version of library:
libwvdrmengine/level3/mips/libwvlevel3.a  NONOB Level3 Library Dec  3 2014 17:11:00

bug: 17288466
Change-Id: Ibe2ae3add4f5830ddc1cce501d76aeb4be5ce926
2014-12-03 17:39:50 -08:00
Fred Gylys-Colwell
1811a8ac12 Level 3 OEMCrypto library for x86
This is a merge of the Widevine change:
https://widevine-internal-review.googlesource.com/#/c/11871

The level 3 oemcrypto fall back now compiles cleanly on a Fugu, and
passes all unit tests.

New version of library:
libwvdrmengine/level3/x86/libwvlevel3.a  Level3 Library Dec  3 2014 13:06:03

bug: 17289103

Change-Id: I677888536dd2ca12e27b5985737e080b69d81477
2014-12-03 13:28:57 -08:00
Fred Gylys-Colwell
5acf3cdc3d Save and load usage table in level 3 OEMCrypto
This is a merge of the widevine change:
https://widevine-internal-review.googlesource.com/#/c/11781

The OEMCrypto did not save the usage table correctly after a key was
loaded and not used.

Also, oemcrypto uses the keybox to verify and sign the usage table.
On library initialization, the usage table was being loaded before the
keybox, so the signature was not verified correctly.

Both these problems have been corrected.

Current Library Version:
arm:  Level3 Library Nov 19 2014 16:53:43

bug: 17328418 Can't play pinned content
Change-Id: Ia753e2f47b36433931fbe8dba78939581e647222
2014-11-19 17:02:33 -08:00
Fred Gylys-Colwell
95658e73b2 Flush instruction cache for arm in haystack code
This is a merge of the widevine CL:
https://widevine-internal-review.googlesource.com/11254

On arm64, some devices are having random issues that probaby relate to
a stale instruction cache.  This code change flushes the cache for
pages that are going to be made executable.

b/17400000

Current Library Version:
  arm64:  Level3 Library Sep 25 2014 17:10:03

Change-Id: I3904e96e922654c055a478079aa52c29cbde8b9f
2014-09-30 14:43:22 -07:00
Fred Gylys-Colwell
457998d677 Correctly handle missing entry in DeactivateUsageEntry
This is a copy of
https://widevine-internal-review.googlesource.com/#/c/11110/

The level 3 oemcrypto library version of DeactivateUsageEntry now
returns OEMCrypto_ERROR_INVALID_CONTEXT if there is no entry in the
usage table.

Current Library Version:
arm:  Level3 Library Sep  3 2014 18:13:47

b/17373630

Change-Id: Iaeb65b4ad4b2b9f3c6733a2c9c8d96e2be263d09
2014-09-05 14:21:07 -07:00
Fred Gylys-Colwell
e51f8ba7a1 Catch null pst in OEMCrypto
This is a copy of
https://widevine-internal-review.googlesource.com/#/c/11030

It is an error for the key control block to have a nonzero replay
control flag and a null pst.  This CL adds unit tests to
oemcrypto_test to verify that oemcrypto checkes this.  A unit test is
also added for verifying that an offline license has a valid nonce the
first time it is loaded.

It also updates the reference implementation (mock) to check that the
pst is not empty when the replay control flag is nonzero.

It also updates the level 3 implementation to check that the pst is
not empty when the replay control flag is nonzero.

This change is compiled into the arm library, but because of
compilation errors, is not included in x86 or mips.

    Current Library Version:
    arm:  Level3 Library Aug 27 2014 18:42:40

bug: 16525204 OEMCrypto unit test for reloading offline license
bug: 16844305 Mock OEMCrypto does not catch null pst
Change-Id: Icdb090e80fc92522c187b26f30e5ba082f26363b
2014-09-03 11:46:10 -07:00
Fred Gylys-Colwell
d5f06554b3 Build Level 3 Haystack for Android MIPS
Merge of Widevine CDM change:
https://widevine-internal-review.googlesource.com/#/c/10644/

android/level3/mips/libwvlevel3.a  NONOB Level3 Library Jul  2 2014 11:40:23
android/level3/x86/libwvlevel3.a  Level3 Library May 16 2014 23:14:03
android/level3/arm/libwvlevel3.a  Level3 Library Jul  2 2014 12:34:56

bug: 15186272
Change-Id: I9d89476f20a69a66849a20f7b9b6be0d6175578b
2014-07-02 14:22:30 -07:00
Fred Gylys-Colwell
b5e8b87fed Merge Changes from CDM repository
This CL merges the following changes from the Widevine repository:

Avoid CdmSession reinitialization
https://widevine-internal-review.googlesource.com/#/c/10530/

Fix timer-related unit tests.
https://widevine-internal-review.googlesource.com/#/c/10510/

Correct return statement
bug: 15590802
https://widevine-internal-review.googlesource.com/#/c/10553/

Usage reporting fixes
bug/15388863
https://widevine-internal-review.googlesource.com/#/c/10460/

Make public methods virtual
https://widevine-internal-review.googlesource.com/#/c/10500/

Fix the SetTimer contract in the CDM.
https://widevine-internal-review.googlesource.com/#/c/10493/

Move inline CDM methods, add OVERRIDE.
https://widevine-internal-review.googlesource.com/#/c/10475/

Simplify storage APIs related cleanup.
https://widevine-internal-review.googlesource.com/#/c/10473/

Duration values are not correctly reported when queried
b/15592374
https://widevine-internal-review.googlesource.com/#/c/10437/

Propagate IsKeyValid() through ContentDecryptionModule.
https://widevine-internal-review.googlesource.com/#/c/10483/

Minor clean up in config_test_env.
https://widevine-internal-review.googlesource.com/#/c/10440/

General clean up.
https://widevine-internal-review.googlesource.com/#/c/10441/

Refactor HttpSocket and simplify UrlRequest interface.
https://widevine-internal-review.googlesource.com/#/c/10410/

Install good keybox at end of unit tests
b/15385981
https://widevine-internal-review.googlesource.com/#/c/10374/

Privacy crypto fixes
b/15475012
https://widevine-internal-review.googlesource.com/#/c/10383/

Incorporate header files to resolve build issued based on customers feedback.
https://widevine-internal-review.googlesource.com/#/c/10420/

Support unprovisioning
b/12247651
https://widevine-internal-review.googlesource.com/#/c/10356/

Correct usage of Host::Allocate and Cdm::Decrypt.
https://widevine-internal-review.googlesource.com/#/c/10378/

Fix logging bug, arguments in wrong order.
https://widevine-internal-review.googlesource.com/#/c/10380/

Rename types that look like constants.
https://widevine-internal-review.googlesource.com/#/c/10379/

Fix offline test failures
b/13909635
https://widevine-internal-review.googlesource.com/#/c/10348/

Add -DUNIT_TEST to the unit test makefile for Android
https://widevine-internal-review.googlesource.com/#/c/10375/

Refactor privacy-crypto and add dummy version.
https://widevine-internal-review.googlesource.com/#/c/10353/

Remove References to Apiary
https://widevine-internal-review.googlesource.com/#/c/9924/

Delete oldest entry in usage table when full
bug: 15184824
https://widevine-internal-review.googlesource.com/#/c/10295/

Port DeviceFiles to iOS.
https://widevine-internal-review.googlesource.com/#/c/10355/

Make testing functions in DeviceFiles private.
https://widevine-internal-review.googlesource.com/#/c/10354/

Add RSA encryption to haystack
https://widevine-internal-review.googlesource.com/#/c/10280/

Add string and vector includes to CDM header.
https://widevine-internal-review.googlesource.com/#/c/10352/

First version of oemcrypto logging
https://widevine-internal-review.googlesource.com/#/c/10252/

Update Names of Secure Stop Methods
bug: 11987015
https://widevine-internal-review.googlesource.com/#/c/10152/

Adjust timing on the Usage Table unit test
https://widevine-internal-review.googlesource.com/#/c/10307/

Fix all compiler warnings in CDM source release.
https://widevine-internal-review.googlesource.com/#/c/10293/

Fix memset bug: args in wrong order
https://widevine-internal-review.googlesource.com/#/c/10292/

Partial revert of 'Remove refs to test prov server, Level3 support...'
https://widevine-internal-review.googlesource.com/#/c/10281/

Pack structure OEMCrypto_PST_Report
https://widevine-internal-review.googlesource.com/#/c/10243/

Remove refs to test prov server, Level3 support; remove dead code
https://widevine-internal-review.googlesource.com/#/c/10220/

Partial revert of 'Document data strings; clean up license server parameters.'
https://widevine-internal-review.googlesource.com/#/c/10188/

Document data strings; clean up license server parameters.
https://widevine-internal-review.googlesource.com/#/c/10120/

Fix broken build after partner branch merge.
https://widevine-internal-review.googlesource.com/#/c/10181/

TODO Cleanup - core/src, core/include
https://widevine-internal-review.googlesource.com/#/c/9965/

TODO Cleanup - cdm, chromium, core/test.
https://widevine-internal-review.googlesource.com/#/c/9419/

Remove unneeded properties.
https://widevine-internal-review.googlesource.com/#/c/10162/

Change-Id: If2bb9d743a562a3875bebb91933c0aaadea286b2
2014-06-27 18:59:56 +00:00
Fred Gylys-Colwell
6f3e866882 Pack structure OEMCrypto_PST_Report
Because the OEMCrypto_PST_Report is sent as a signed block to the
server, it needs to be a fixed, platform independent, size.  This CL
adds the packed attribute to the structure, which reduces its size
from 56 bytes to 48 bytes.

Copy of widevine change:
https://widevine-internal-review.googlesource.com/#/c/10321/

Library Versions:
libwvdrmengine/level3/x86/libwvlevel3.a  Level3 Library May 30 2014 15:40:50
libwvdrmengine/level3/arm/libwvlevel3.a  Level3 Library May 30 2014 15:39:04

bug: 15184821
Change-Id: I54db2c3bbc4e20ee0c19c33d6fd56f86f432e110
2014-05-30 15:47:16 -07:00
Fred Gylys-Colwell
d68e1f8307 Usage Table for Level 3 OEMCrypto
This is a copy of the widevine CL.
https://widevine-internal-review.googlesource.com/#/c/10174/

This CL adds the OEMCrypto v9 functionality to the level 3 haystack
version of OEMCrypto.  Mostly, this is to support usage tables.

The code is feature complete, but the timing tests are a little flakey
-- I'm not sure if the problem is in the code or if the test has too
tight a tolerance.

Also, the storage of the generation number needs to be made more
secure.

Change-Id: I73fecf8934b6a46785f1f8b6f40b40ffe39b88de
2014-05-18 19:44:28 -07:00
Fred Gylys-Colwell
ba6b5c293a Allow OEMCrypto v8 or v9
From Widevine CL:
https://widevine-internal-review.googlesource.com/#/c/9184/

This is some shim code that will load either an OEMCrypto
version 8 or version 9 library.  This should allow us
to test and run stable devices until all OEM's have
updated to version 9.

Android Level 3 library versions are:
level3/mips/libwvlevel3.a  Level3 Library Feb 27 2014 18:18:34
level3/x86/libwvlevel3.a  Level3 Library Feb 27 2014 18:22:14
level3/arm/libwvlevel3.a  Level3 Library Feb 27 2014 12:31:29

Change-Id: I82911e3b4d9056cf3c3ab2b47194fe81ac2776d9
2014-03-21 18:29:06 +00:00
Fred Gylys-Colwell
dd75655102 Changes from Widevine CDM repo
Squashed commit of these CLs from the widevine cdm repo:

Update YT CP server URI to point to the UAT server
https://widevine-internal-review.googlesource.com/#/c/9327/

OEMCrypto Version 9 API
https://widevine-internal-review.googlesource.com/#/c/9142/

Correct Device ID length in OEMCrypto reference version
https://widevine-internal-review.googlesource.com/#/c/8723/

Modify tests to prevent intermittent failures
https://widevine-internal-review.googlesource.com/#/c/8982/

Generate a unique license request ID
https://widevine-internal-review.googlesource.com/#/c/8721/

Re-enable android timer mechanisms
https://widevine-internal-review.googlesource.com/#/c/8833/

Do not close CDM session on removeKeys
https://widevine-internal-review.googlesource.com/#/c/8703/

And numerous changes required by Eureka, Steel, and CTE versions of
Widevine CDM, as highlighted here:
https://widevine-internal-review.googlesource.com/#/c/8596/
https://widevine-internal-review.googlesource.com/#/c/8955/
https://widevine-internal-review.googlesource.com/#/c/8922/
https://widevine-internal-review.googlesource.com/#/c/8890/
https://widevine-internal-review.googlesource.com/#/c/8871/
https://widevine-internal-review.googlesource.com/#/c/8706/
https://widevine-internal-review.googlesource.com/#/c/8425/

Change-Id: Iafd33905227e74eb2132c240b929d2282ab68042
2014-03-17 20:29:51 +00:00
Colin Cross
d6b79557ab widevine: support multilib builds
Support builds for multiple architectures the same time:
Use LOCAL_MODULE_TARGET_ARCH to restrict building to specific arches
Use LOCAL_C_INCLUDES_x86 to set the include path for only x86 builds

Change-Id: I7c33c27f1c9bfb6e3318a07514698992482f6cd7
2014-02-20 12:48:45 -08:00
Fred Gylys-Colwell
c53e0c778c Correct SelectKey return value when no keys loaded
Previously, Level 3 SelectKey returned no error when called before
any keys were loaded.  After this CL, it will return
OEMCrypto_ERROR_NO_CONTENT_KEY.

Library version:
arm  - Level3 Library Nov 20 2013 18:09:31
mips - Level3 Library Nov 20 2013 17:58:56
x86  - Level3 Library Nov 20 2013 18:13:01

bug: 11769839
Change-Id: I1b3f057e3ae9f2f174cae91f6849080345f02003
2013-11-20 18:18:43 -08:00
Fred Gylys-Colwell
becb1bf0be Haystack and Obfuscated OEMCrypto Level 3
This CL contains working versions of the haystack tools and the
OEMCrypto Level 3 library for android ARM, MIPS and x86.

The version number of the level 3 library is:
android/level3/arm/libwvlevel3.a  Level3 Library Nov  4 2013 18:39:06
android/level3/mips/libwvlevel3.a Level3 Library Nov  4 2013 18:42:29
android/level3/x86/libwvlevel3.a  Level3 Library Nov  4 2013 18:41:07

bug: 9374954 MediaDrm haystack based L3 code hardening implementation.
Change-Id: Ifef13900a11e83e4257723d3c6fc7107550882a8
2013-11-05 10:32:11 -08:00
Rahul Frias
f6c2a60485 Allow Apps to Voluntarily Downgrade to L3 Crypto
This merges the following changes from the Widevine CDM repository:

564f4cc  Add CdmClientPropertySet to CDM
  Adds an interface to the CDM that allows it to query its client for
  certain properties.  In this case, this includes the ability to
  specify what security level is desired, as well as support for
  service ceritifcate privacy mode.

9cfbd3e  Force Level 3 fallback
  Adds support for voluntarily invoking L3 crypto to the OEMCrypto
  wrapper.

95d12c1  Add pointer to CdmClientPropertySet class to OpenSession.
  Adds support for storing the property set on a session-by-session
  basis and choosing the appropriate crypto level.

17de442  Add Settable Properties for Clank to Android
  Adds support for setting the aforementioned properties to the
  DrmEngine

bbe704d  Fixes to force fallback to level three security
  Corrections to invoke provisioning, OEMCrypto API with configured
  security level rather than the default. Unit tests were also revised.

Note that some parts of this are also support for the ability to use
a service certificate-based privacy mode. The remaining code for
supporting this mode is still forthcoming.

Bug: 10109249
Change-Id: I2755e4dea1de3e8a56cff237360298f7b7f1bddc
2013-08-15 11:31:45 -07:00
John "Juce" Bruce
b0d85ac1af Add Call to Install Keybox to Widevine CDM
This merges the following changes from the Widevine CDM repository:

1a72a7e  Combine utility code into single library on Android
  Combines several previously-separate files into a static library,
  libcdm_utils, so that it can easily be used by both CDM and
  OEMCrypto.

8c4d04d  Install Keybox
  If the keybox has not been installed, install it from
  /factory/wv.keys.

Bug: 9972451
Change-Id: I8688ecd0adcf321e0c7d0faf55dd10f3910c12ec
2013-08-08 14:52:31 -07:00
Jeff Tinker
424ead3417 Fix Level 3 Field Provisioning Device ID
The field provisioning code generates a randum number to use as the
device id, and then restricts the data to alphanumeric characters.
Previously, it could have also included a 0 byte in the data.  This CL
corrects that.

bug: 9073146

Merge of https://widevine-internal-review.googlesource.com/#/c/5740/
from the Widevine CDM repository

Change-Id: Iaf3e9e733f7c66c19d4168178a8e25ee0ba7e936
2013-05-22 12:10:11 -07:00
Jeff Tinker
1b295f4c81 Support Offline Licenses
Bug: 8621588

Merge of the following CLs from the Widevine CDM repository:

https://widevine-internal-review.googlesource.com/#/c/5602/
https://widevine-internal-review.googlesource.com/#/c/5431/
https://widevine-internal-review.googlesource.com/#/c/5660/

Change-Id: If37940e2535e1a1eca95e4394d8cf9bf689e9c3a
2013-05-15 21:18:20 -07:00
Jeff Tinker
4cf8594a87 Replaces staging provisioning server url with production server url
The default provisioning server url now points to the production server.
Also switches to the real field provisioning system ID that works
only on the production servers, and updates the unit tests to work
properly with the prod servers.

Bug: 8724358

Merge of:
  https://widevine-internal-review.googlesource.com/#/c/5270/
  https://widevine-internal-review.googlesource.com/#/c/5550/
  https://widevine-internal-review.googlesource.com/#/c/5321/
  https://widevine-internal-review.googlesource.com/#/c/5501/
from the Widevine CDM repository

Change-Id: Iff1d7349c6a84bf30c6cdd534933ae747d5cff55
2013-05-09 15:54:33 -07:00
Jeff Tinker
63c597d330 Update path to Widevine MediaDrm engine credentials
Use separate directories for unit test-generated
credentials vs actual credentials, so the unit test
credentials don't interfere with the real ones.

related-to-bug: 8620943

Merge of:

Update path to where CDM persistently stores data
https://widevine-internal-review.googlesource.com/#/c/5300/

Rename Keybox File
https://widevine-internal-review.googlesource.com/#/c/5240/

... from the widevine CDM repo.

Change-Id: Idefa484b3a2f71f723238f033460bf431ce4209b
2013-04-25 14:12:11 -07:00
Jeff Tinker
f2406daae1 Use /data/mediadrm for MediaDrm plugin-related storage
related-to-bug: 8702754

Merge of:

Rename Keybox File
https://widevine-internal-review.googlesource.com/#/c/5240/

Store persistent data in /data/mediadrm
https://widevine-internal-review.googlesource.com/#/c/5234/

...from Widevine CDM repository

Change-Id: I4030257942e572e6f42cc8f32872a6409d9e3892
2013-04-24 22:10:44 -07:00
Jeff Tinker
1aff209f91 Field provisioning for L3 OEMCrypto
bug: 8621460

Merge of https://widevine-internal-review.googlesource.com/#/c/4955/
from Widevine CDM repository.

Change-Id: I30cf4314283db51c8e706c026501784259c87c13
2013-04-23 15:37:58 -07:00
Fred Gylys-Colwell
39ea1df671 Part of Qualcomm L1 OEMCrypto integration
Upgrade to version 2.1 of license protocol in OEMCrypto.

related-to-bug: 8621521

Merge of https://widevine-internal-review.googlesource.com/#/c/4952/
from Widevine CDM repository to android repository.

Change-Id: I0d85dae1981b7525ab17aec5f21cf668d078bf47
2013-04-22 16:15:03 -07:00
Jeff Tinker
e6b1fedc4c Widevine CENC drm engine update
bug: 8601053

This import syncs to the widevine git repository change
commit 6a99ad1b59ad39495f62954b3065ddc22b78da49

It includes the following changes from the widevine git
repository, which complete the jb-mr2 features

    Fix Unit Test Makefile
    Adds support for device certificate provisioning.
    Support application parameters
    Certificate based licensing
    Proto for client files
    Implement Property Query API
    Add Device Query For Unique ID
    Implement Generic Crypto in DrmEngine
    Do not validate Key IDs on clear playback
    Allow OEMCrypto_DecryptCTR with clear content and no key
    Add a case to the MediaDrm API test to repro b/8594163
    Implement requiresSecureDecoderComponent
    Implement Eventing API
    Add end-to-end decryption test with vectors
    Refactoring of properties class
    Refactor OEMCrypto unittest.
    Fix for b/8567853: License renewal doesn't renew license.
    Add KEY_ERROR callback to WvContentDecryptionModule() ctor.
    Merged certificate_provisioning.proto and
      client_identification.proto to license_protocol.proto.
    Fix nonce check failure after a malformed key in OEC Mock.
    asynchronize decryption
    Allow querying of control information
    make debugging AddKey & Decrypt statuses easier
    Revert "Revert "Send KEY_ERROR event to app on license
      expiration or failure""
    Revert "Send KEY_ERROR event to app on license expiration
      or failure"
    Send KEY_ERROR event to app on license expiration or failure
    remove extra session id copy
    use KeyError constants directly
    replace variable-length arrays with std::vector and fixed-sized array
    pass session ids as const references
    refactor key extraction and update keys on renewal
    Updates to enable renewals and signaling license expiration.
    fix error constant in OEMCrypto_DecryptCTR

Change-Id: I5f7236c7bdff1d5ece6115fd2893f8a1e1e07c50
2013-04-12 14:21:37 -07:00
Jeff Tinker
c0f1d6750e Fix broken full_x86 and full_mips builds
Also cleans up some redundant files.

Change-Id: Id9a18bcb917ae999865f7c5564a72dba27b0ce97
2013-04-04 19:44:27 -07:00
Jeff Tinker
f3ec8c19d6 Import updates to the Widevine CENC DRM Plugin
This change incorporates the following CLs from the Widevine
cdm repository:

    Update the java request/response test app to match Drm API changes
    Don't build the mock liboemcrypto.so by default
    Do not build CDM tests by default
    Fix Build Break in DrmEngine Unit Tests
    Fix Build Break in WVDrmPlugin
    Initial version of roadmap for CDM projects.
    Implement License Query
    Implement Generic DRM in OEMCrypto Reference Implementation
    Add key_data_length field when calling OEMCrypto_LoadKeys
    Policy engine unittests
    Generalized DRM API for OEMCrypto
    Fixes proto buf libraries build.
    Add Version Number to OEMCrypto API
    Test key control block duration field in OEMCrypto
    Add fix for missing crypto offset.
    Fixed android/media*/test builds and added proto files for Cert. provisioning
    Refactor and clean up callback code in CDM.
    Add "device_id" name-value pair to LicenseRequest::ClientIdentification
    Separate unit and end-to-end tests from the top level makefie.
    Includes changes for 'fall back to l3 oemcrypto lib' in top level makefile.
    Fall Back to Level 3 if Level 1 Fails
    Fix compilation error in wvcdm_unittest.
    Fix Android build break due to Decrypt() signature change in cdm_engine.h.
    Wire up callbacks and errors in the Steel proxy.
    Fix lock assert if there is no keybox on the device.
    RSA Certificate Unit Test
    Change Generic_Verify signature to constant.

Change-Id: I2e42db9d0b4f8d4e833675ae81d0714509bbfd2c
2013-04-03 19:53:12 -07:00
Jeff Tinker
1a8aa0dd05 Initial import of Widevine Common Encryption DRM engine
Builds libwvmdrmengine.so, which is loaded by the new
MediaDrm APIs to support playback of Widevine/CENC
protected content.

Change-Id: I6f57dd37083dfd96c402cb9dd137c7d74edc8f1c
2013-03-22 11:14:17 -07:00