Commit Graph

593 Commits

Author SHA1 Message Date
Edwin Wong
138160ddea Update license request url to new signed Widevine UAT proxy.
Bug: 16631113
Change-Id: I442f9c9decd03213912c8c2befcbeccc2a332c53
2014-09-13 01:32:29 +00:00
Rahul Frias
4819a26bd4 Fixes for query information and usage reporting
* The Usage APIs return usage reports from either L1 or L3 (if available).
* Correction to when usage reports are saved. In addition to other events
  they are now saved when keys are loaded, usage reports are released and soon
  after first decryption and periodically (60 seconds) after that,
  if decryption takes place.
* Usage reports now get deleted on an unprovision request.
* Policy timer is now started when offline licenses are restored.
* Usage session is now released, when a usage response is received.
* Usage tests ahev been enabled.
* Added CDM extended duration (integration) tests to test usage reporting
  and querying. These need to be run manually as they take a while (currently
  half an hour).

b/15592374

[ Merge of https://widevine-internal-review.googlesource.com/#/c/10800
  from the Widevine CDM repo ]

Change-Id: Ia817e03ebbe880e08ba7b4a235ecb82b3ff35fbf
2014-08-07 10:58:40 -07:00
Rahul Frias
7a933ee48e Merge of usage reporting and license changes from WV CDM repo
* CdmSession unittest and license request time changes
  b/15914199
  Merge of https://widevine-internal-review.googlesource.com/#/c/10597/

* Specify OEMCrypto API version in client capabilities
  b/15388863
  Merge of https://widevine-internal-review.googlesource.com/#/c/10616/

* Report start and last play time in license request
  b/15995227
  Merge of https://widevine-internal-review.googlesource.com/#/c/10617/

* Respect can_play flag
  b/15330338
  Merge of https://widevine-internal-review.googlesource.com/#/c/10619/

* Restore offline session information
  b/16009274
  Merge of https://widevine-internal-review.googlesource.com/#/c/10641/

Change-Id: I17fdc309efbc1d44385a86a368df11b1349b29c2
2014-07-02 17:17:38 -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
Jeff Tinker
4af7ac78a3 Fix offline test failures
GPlay offline tests were failing due to additional query parameters that were
introduced with b12789275. Additional changes caused offline failures,
as the content pointed to by the test vectors was HD only and did not
allow for offline playback.

This addresses the problem by switching request license tests to point to UAT.
UAT is now the default license server destination for request license tests.
Test vectors for GPlay will be added back as a secondary option when they
are available.

b/13909635

Merge of https://widevine-internal-review.googlesource.com/#/c/10261/
from the widevine cdm repo.

Change-Id: I5e5a2b477b6d591747123e8eeb3cd00b7f762090
2014-06-02 17:04:20 +00:00
Jeff Tinker
1035bb32e0 Deprecate provisioning test URI
Certificate provisioning requests will be made to the production server
since the other URI is being deprecated.

Merge of https://widevine-internal-review.googlesource.com/#/c/10230/
from the widevine cdm repo.

b/15145406

Change-Id: If0cbcaa66fc871568507ee56656c04f8341fcdcf
2014-05-30 15:18:23 -07:00
Rahul Frias
e56e58fbf5 Enable usage reporting
[ Merge from Widevine CDM repo of
  https://widevine-internal-review.googlesource.com/#/c/10171/ and
  https://widevine-internal-review.googlesource.com/#/c/10172/ ]

Updated license_protocol.proto from constituent protos in google3

These changes make use of OEMCrypto v9 changes to support usage reporting.
Usage reporting may be enabled for streaming (by means of secure stops) and
offline playback by a provider session token specified in the license.

Changes include periodically updating usage information for relevant
sessions and reporting and releasing usage information as needed.

The CDM has removed all references to Secure Stops. This change
updates the Android API implementation to comply.

b/11987015

Change-Id: Ibb6f2ced4ef20ee349ca1ae6412ce686b2b5d085
2014-05-18 21:07:12 -07:00
Jeff Tinker
8aec8fe0bd Merge "Clean comments, namespace, and variable names" 2014-05-19 02:25:54 +00:00
Fred Gylys-Colwell
6bac5bc50d Clean comments, namespace, and variable names
This CL removes TODOs and email addresses from comments, unifies some
namespaces and cleans a few variable names.  It is a copy of multiple
CLs on the widevine side.

Change-Id: I1bb649096476a5001a56d746427399de6a88ff69
2014-05-16 15:53:12 -07:00
Fred Gylys-Colwell
86e73deb4c Make test URLs more external
This CL changes several test URLs so that they do not reference
internal test servers.

Copied from many CLs on the widevine side.

Change-Id: Ia0e6d6faa19e1841bacaf3b90043aca3a12aaf8a
2014-05-16 13:14:22 -07:00
Fred Gylys-Colwell
b0694bef17 Correct test vector in base64 test
This is a copy of
https://widevine-internal-review.googlesource.com/#/c/10050

The non-encoded base64 test vectors were modifed for the source
release, but the encoded test vectors were not updated to match.  This
CL updates the encoded test vectors to match.

Change-Id: I95ed881007e80da2d464f303eacf55cda38b586d
2014-05-07 13:06:30 -07:00
Fred Gylys-Colwell
1cd8195d88 OEMCrypto Usage Tables
This CL adds usage tables to the OEMCrypto reference implementation
(mock) and unit tests.

There is also a new parameter called oem_crypto_require_usage_tables
that determines if the usage tables are required or not.  This is set
to true for Android and false for all other platforms.

This CL is most of OEMCrypto version 9 updates.

This CL is a copy of
https://widevine-internal-review.googlesource.com/#/c/9720
https://widevine-internal-review.googlesource.com/#/c/9874
https://widevine-internal-review.googlesource.com/#/c/9873

Change-Id: I78c4f7651306f9f79ba2260c3e04fb1eca7e20e3
2014-04-24 11:40:30 -07:00
John "Juce" Bruce
951f08c2da Support Latest Version of EME Spec Init Data Specification
(This is a merge of
https://widevine-internal-review.googlesource.com/9711 from the
Widevine CDM repo.)

This change updates the CDM's handling of init data types, previously
known as MIME types, to comply with the latest version of the EME
spec.

Following this change, in addition to accepting the deprecated MIME
types "video/mp4", "audio/mp4", "video/webm", and "audio/webm", the
CDM will accept the new standard: Init data types "cenc" and "webm".

Furthermore, this removes the non-PSSH-parsing path from the CDM. All
platforms have unified on the CDM being responsible for parsing the
concatenated PSSH box list, as outlined in the latest EME spec.

As Android has shipped code that expects pre-unwrapped PSSH boxes and
must maintain backwards-compatibility, code has been inserted on that
platform to detect pre-unwrapped data and re-wrap it with a PSSH
header before sending it to the CDM.

There are some small changes to unit tests because of this change:

1) The CDM Engine unit test now no longer needs to unwrap the PSSH on
   any platforms when testing ISO-BMFF. It now pre-caches the
   unwrapped key ID for use when testing WebM.

2) Several substantially-similar unit tests in the Android code have
   been rolled into one test.

Bug: 13564917
Bug: 13570595
Bug: 9465346
Bug: 13570288
Change-Id: I7f27b16b8503f24a26746b5dce71fb61b6fd1bb2
2014-04-17 20:35:02 +00:00
John "Juce" Bruce
31aa8eea04 resolved conflicts for merge of 7eea20df to master
Change-Id: Ibd8b16745d36b24041856f315fbb09a6c25cf4fb
2014-04-02 18:59:05 -07:00
John "Juce" Bruce
7eea20df86 Add Support for Audio MIME Types
The EME spec technically requires CDMs to treat audio/mp4 and
video/mp4 equivalently, as well as audio/webm and video/webm. We had
only been accepting video/mp4 and video/webm up until now.

This change also centralizes handling of init data types in the shared
CDM code instead of having it spread across multiple places in the
codebase.

(This is a merge of https://widevine-internal-review.googlesource.com/9532/
from the Widevine CDM repo.)

Bug: 13564917
Change-Id: Ib8bdfb2b003ffb00e8f0559561335abb3c5778b0
2014-04-02 15:39:12 -07:00
Jeff Tinker
965cedd5ee resolved conflicts for merge of 3db90f54 to master
Change-Id: Ie9e46292e003fefce9ca44a31cb338a0ecf51930
2014-04-01 16:57:14 -07:00
Rahul Frias
ef875d25ed am 7e5c5c75: am cbcc609d: Update YT CP server URI to point to the UAT server
* commit '7e5c5c75d6f3064ce76b64fa1f389ab24dbeddaf':
  Update YT CP server URI to point to the UAT server
2014-04-01 22:15:09 +00:00
Jeff Tinker
3db90f54c1 Support CAST V2 authentication
bug: 12702350

Squashed commit of these CLs from the widevine cdm repo:

Cast V2 cdm support
https://widevine-internal-review.googlesource.com/#/c/9190/

Add CASTv2 Support to DrmPlugin
https://widevine-internal-review.googlesource.com/#/c/9228/

Test for CastV2 authentication APIs
https://widevine-internal-review.googlesource.com/9550

Change-Id: I6d66bc1bbd653db5542c68687b30b441dd20617f
2014-04-01 14:26:27 -07:00
Rahul Frias
cbcc609d5b Update YT CP server URI to point to the UAT server
Privacy tests from request license were failing as the YTCP drm
server location had changed.

Also updates the MediaDrmAPI test to reference the UAT server

This affects OEMs doing Widevine integrations on KK devices.

Merge of https://widevine-internal-review.googlesource.com/#/c/9233/
from wv cdm git repository

b/13324394

Change-Id: I97152b2a79a9088303e5fc4a5c07a413e4c85e15
2014-04-01 01:36:49 +00:00
John "Juce" Bruce
c3444dc9e9 resolved conflicts for merge of f111bea1 to master
Change-Id: I7f95eba8d5fb1e9a20800b9c1ef7fcb813eff41c
2014-03-31 17:35:24 -07:00
John "Juce" Bruce
702aadf853 Add Support for WebM Back
Adds support for WebM to the CDM. Decryption remains untouched,
however the initialization data is passed differently for WebM.

The previous version of this change broke playback for certain
apps that were being allowed to pass invalid MIME types before
this change was made. This version maintains backwards-compatiblity
for these apps for now by rewriting their MIME types as "video/mp4".

Merge of https://widevine-internal-review.googlesource.com/9225/
and https://widevine-internal-review.googlesource.com/9611/ from
the Widevine cdm repo.

Bug: 10638562
Change-Id: Ib37e838d08363f07b34b3a2e79a3f80a1f43e9ad
2014-03-31 16:16:18 -07:00
Jeff Tinker
55f1de2fe5 resolved conflicts for merge of 66cadaa9 to master
Change-Id: I2a052d56516f0e246d77148a38191430ff139c3e
2014-03-29 12:33:46 -07:00
Jeff Tinker
66cadaa9fa Revert "Add Support for WebM"
This reverts commit ab95cf27f1.

Change-Id: Ie78c2c14fa9b598b5ea67d6e9e60479e652b0b06
2014-03-29 17:09:28 +00:00
John "Juce" Bruce
f23c54d834 resolved conflicts for merge of ab95cf27 to master
Change-Id: I194f2a00507a8469b3f15bd2d629d41dc07c1b45
2014-03-28 16:30:31 -07:00
John "Juce" Bruce
ab95cf27f1 Add Support for WebM
Adds support for WebM to the CDM. Decryption remains untouched,
however the initialization data is passed differently for WebM.

Merge of https://widevine-internal-review.googlesource.com/#/c/9225/
from the widevine cdm repo.

Bug: 10638562
Change-Id: I7b8cf4888fa408af77cee103f768f5a7c8ffdc7e
2014-03-27 14:46:45 -07: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
Rahul Frias
f32baf91b5 Address unit test failures
A number of failures were observed,
* GPlay dev license server is being worked on. This causes random
  failures when running unit tests. Switching to the staging
  server for now.
* Occasionally, the license server times out. Introducing a retry
  mechanism do deal with HTTP responses (merge from master #45e8ddd5f)
* Release license tests are now disabled. Tests were previously passing,
  even though they were not in fact supported by the GPlay license server.
  The response included just enough information to be a valid license and
  passed minimal verification that was taking place. Additional verification
  was not necessary because session is torndown and resources released as
  soon as the response has been received.
  A change at the GPlay server now causes the release license request to be
  flagged as an error and the tests to fail. Work is in progress to
  support release of licenses at the GPlay server.
* The wrong message test (from request license tests) fails. This is
  because GPlay behaviour changed from returning a HTTP 500, when
  processing an invalid PSSH, to returning a HTTP 200 without any included
  license.
* Security level path backward compatibility tests on L3 which failed and
  caused the succeeding license request tests to fail.

b/12000457

Change-Id: I8e6adc490504475d1039793ea555a17799cb78c4
2013-12-11 16:22:58 -08:00
Rahul Frias
774a078f1d Allow license renewals after expiry
Licenses could be renewed uptil the point of expiry. After that point
we expected that the session would have to be closed and a new one
opened with a new license loaded. Clank requested that we support
renewal of sessions past expiry.

In addition, the error returned on decryption, if OEMCrypto
determines that the KCB duration has expired, is NEED_KEY rather than
KEY_ERROR.

Merge of https://widevine-internal-review.googlesource.com/#/c/8240
from the widevine cdm repo.

b/11390539

Change-Id: I023320f3f25514cd07b368701a92100429ce1c04
2013-11-05 16:40:17 -08:00
Jeff Tinker
db41502f86 Backward compatibility for licenses and certificates
Certificates and offline licenses are stored in security level
specific directories in klp. When devices transition from jb-mr2,
their persistent information has to be ported to these directories.

bug:10366036

Merge of https://widevine-internal-review.googlesource.com/#/c/7310/
from the widevine CDM repo

Change-Id: I70b4a79dc5b69bda7fc3a4b92fdcde7ef8b41836
2013-08-22 09:37:18 -07:00
Rahul Frias
a2e15186e5 Add Privacy Mode and Serivce Certificate Support
This merges the following changes from the Widevine CDM repository:

da001b6  Add Privacy mode and service certificate
  This adds support to the CDM for privacy mode and service certificates.

92bf200  Add support for using Youtube Content Protection server for testing
  Enables testing with Youtube Content Protection server. Google Play license
  server is still the default. Select YTCP server by using the flag -icp
    e.g. adb shell '/system/bin/request_license_test -icp'

85dcd60  Fixes to enable privacy mode
  These includes changes to use PKCS7 padding, corrected root CA formatting
  and changes to integration test. Also refactored service certificate
  handling.

989971c  Correction to request license test
  Corrected PropertySetTest to provision when needed. Also added disabled
  privacy tests to run against YTCP staging server until GooglePlay
  integration is complete.

Bug: 10109249
Change-Id: If81d68c65d743d77a485406f48d1be41a74de0af
2013-08-15 13:29:58 -07: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
0fa3e16999 Remove Stale Licenses on Reprovisioning
Merges change 267713c (Remove stale licenses on reprovisioning) from
the Widevine CDM repository.  This change removes licenses belonging
to the previous provisioning when provisioning changes.

Bug: 9761923
Change-Id: I473816dd11dd950f4fb009b5b004630bd2d2b579
2013-08-08 14:57:40 -07:00
Jeff Tinker
0190f99fb3 Migration from jb-mr2 to master for Widevine CDM
Android development of the widevine CDM has been done
on the jb-mr2 branch of the cdm code base.  This CL
contains a merge of that jb-mr2 work to CDM master, and
also reflects the evolution of the common Modular DRM
code base since jb-mr2 branched.

Change-Id: I1d7e1a12d092c00044a4298261146cb97808d4ef
2013-07-29 17:29:07 -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
d0f1784615 Sends signed provisioning request as query string instead of payload.
Bug: 8790775

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

Change-Id: I749303eee8162f37982f6dd5d83b6cf254b96847
2013-05-06 16:28:32 -07:00
Jeff Tinker
3cfb86cea1 Generate renewal and expiry events
The android timer class was not generating timer events correctly. This caused
renewal and expiration events not to be sent. A strong pointer to the
timer thread was not held and this caused the android util timer
thread to exit after firing once. This is now addressed.

Bug: 8736545

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

Change-Id: I2d904e55d4d10eacc1a51f1c6b5c1a267c92c8d8
2013-05-02 16:42:04 -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
958bbe6d05 Certificate provisioning verification
bug: 8620943

This is a merge of changes made to the Widevine CDM
repository during certificate provisioning verification.

The following changes are included:

Fixes for certificate based licensing
https://widevine-internal-review.googlesource.com/#/c/5162/

Base64 encode and decode now handles non-multiple of 24-bits input
https://widevine-internal-review.googlesource.com/#/c/4981/

Fixed issues with device provisioning response handling
https://widevine-internal-review.googlesource.com/#/c/5153/

Persistent storage to support device certificates
https://widevine-internal-review.googlesource.com/#/c/5161/

Enable loading of certificates
https://widevine-internal-review.googlesource.com/#/c/5172/

Provide license server url
https://widevine-internal-review.googlesource.com/#/c/5173/

Change-Id: I0c032c1ae0055dcc1a7a77ad4b0ea0898030dc7d
2013-04-22 20:12: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
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