Commit Graph

739 Commits

Author SHA1 Message Date
Jeff Tinker
d4fa39113d Improve Widevine MediaDrm plugin tests
1. add missing checks to set the overall result when some tests fail
(to verify b/10528466)

2. Fix test result on L1 devices where we can't hash the decrypt result
due to inaccessible memory buffers.

3. Configure the codec with a surface to avoid codec errors on L1 devices

b/10528466

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

Change-Id: I5c7ef5ce802cc4ff63f62524ef2120fb671920f4
2013-08-28 17:14:46 -07:00
Fred Gylys-Colwell
144f5ced83 Turn off verbose logging
This CL turns off the verbose logging if LOG_NDEBUG is 1, or if NDEBUG
is defined.  You can set the environment variable LOG_NDEBUG to 0 to
turn on verbose debugging for the CDM library on android.

Also, as in b/9672657, some applications call SelectKey when switching
between video and audio, which is much too verbose and affects
playback.  I have removed the log statements for SelectKey.

bug: 9672657

Change-Id: I635b997118996871356f7126852b4744fb05e810
2013-08-28 16:19:08 -07:00
John "Juce" Bruce
67a83a22f7 DO NOT MERGE - Update Widevine Classic to 4.5.0.10107
This updates the Widevine Classic libraries to version 4.5.0.10107.
This version has identical functionality to the previous version,
however the version number has changed because the Widevine build
system has been updated to support all six flavors. (2 security
levels x 3 instruction sets)

This change adds x86 L1 binaries and MIPS L3 binaries, as these have
been validated by partners.

Bug: 10246711
Change-Id: Ie14e48aec33b0cc5d63752e24ba88284c6e37aa9
2013-08-28 12:03:42 -07:00
Jeff Tinker
b4dae0af49 Merge "Backward compatibility for licenses and certificates" into klp-dev 2013-08-22 23:09:12 +00: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
Jeff Tinker
f51c0d27e1 Support New isContentTypeSupported API
Adds support and tests for the new isContentTypeSupported API to the
Widevine DrmEngine.

Bug: 10244066

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

Change-Id: I4f606de7897a49da745ff76faceeb358f8ac9073
2013-08-22 09:33:58 -07:00
Jeff Tinker
2fa6b63292 Replace event notification from when openSession fails
Merge of https://widevine-internal-review.googlesource.com/#/c/7280/1
from the Widevine CDM repo.

bug: 10396953
Change-Id: I085b60e01292f37379d19d059b39ac7a7f299012
2013-08-19 18:53:57 -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
John "Juce" Bruce
ba66224ef4 Report When Decrypt Is Attempted With No Key Loaded
This merges change 43c7fda (Do Not Obscure wvcdm::NEED_KEY) from the
Widevine repository.  After this change, decrypt calls will return
ERROR_DRM_NO_LICENSE if the CDM returns NEED_KEY.

Bug: 10157154
Change-Id: I97b3a3990abeebb620ee4925fabf5c4261d968c4
2013-08-08 14:56:49 -07:00
John "Juce" Bruce
e3ed6194fe Report Insufficient Resources for Crypto
This merges the following changes from the Widevine CDM repository:

bef58bc  Add new error codes
  Adds new error codes to OEMCryptoCENC.h and rearranges it to more
  closely match the documentation.

5fcfbca  Handle OEMCrypto_ERROR_INSUFFICIENT_RESOURCES on Decrypt
  Changes the CDM to support the new errors from the previous change.

d59c09d  Report Insufficient Crypto Resources
  Changes the DrmEngine to support the new errors from the previous
  change.

1085a21  Respond to Too Many Keys or Sessions Errors
  Allows errors around having too many keys or sessions to result in
  a unique error in the CDM.

Bug: 9695816
Change-Id: I826bc655109fa57e4f75de7158d7f392053666b1
2013-08-08 14:55:11 -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
ddf957faa5 Removing usage of a deprecated error code
A widevine-specific error should not have been defined in frameworks.
Submit before https://googleplex-android-review.git.corp.google.com/#/c/338406/

Change-Id: Ie47250ef987a028e09ff553881ac166214244927
2013-08-02 23:34:30 -07:00
Jeff Tinker
f4560f109f Squashed commit of the following CDM changes:
* Add additional parameters to CDM decryption API
  https://widevine-internal-review.googlesource.com/#/c/6500/

* Pass Length and Flags Parameters to Decrypt()
  https://widevine-internal-review.googlesource.com/#/c/6740/

* Remove core files from oemcrypto/mock
  https://widevine-internal-review.googlesource.com/#/c/6853/

Change-Id: I1c73f5454da20da99130b161543fb990e16e7130
2013-07-29 17:41:22 -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
edb987db07 am 6d93e43c: Part of fix for TEE resource leaks when app crashes
* commit '6d93e43c3a36ab66d4550c37c170a967fc1d6685':
  Part of fix for TEE resource leaks when app crashes
2013-07-07 12:32:03 -07:00
Jeff Tinker
6d93e43c3a Part of fix for TEE resource leaks when app crashes
bug: 9672606

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

Change-Id: I8ed27cbd9944c3459fce251f1261f7656f99e277
2013-07-03 15:45:56 -07:00
Lajos Molnar
d5f85fd131 Really fix stop() in samplePlayer when using MediaCodec mode
Make getBufferPercentage() and getPosition() work when the
media is reset.

Change-Id: I7d696fd9b5c62b42aa0d29348e73f1f5755eb075
Signed-off-by: Lajos Molnar <lajos@google.com>
Bug: 9516405
2013-06-28 08:07:02 -07:00
Lajos Molnar
39fa902e87 Fix stop() in samplePlayer when using MediaCodec mode
When stopping media, getBufferPercentage() and getPosition() may
still be called by MediaController, unless we disable it.

Change-Id: I947fbfb2de724bdcb3121ca9fb204c8bea2a84b2
Signed-off-by: Lajos Molnar <lajos@google.com>
Bug: 9516405
2013-06-27 14:00:16 -07:00
Fred Gylys-Colwell
bbf59475e8 am 9fdeabe3: Update Widevine Modular DRM Integration Guide
* commit '9fdeabe3ed1a55b056082d5565b10c3e685a351c':
  Update Widevine Modular DRM Integration Guide
2013-06-25 18:29:15 -07:00
Fred Gylys-Colwell
9fdeabe3ed Update Widevine Modular DRM Integration Guide
The function OEMCrypto_LoadKeys should accept a null pointer for the
enc_mac_keys pointer.   This indicates that the mac_keys are not being
updated. This CL just updates the documentation to clarify this behavior.

bug: 9549308
Change-Id: I1073e72f9c8d0fa712ad02e4c2d517202b3defab
2013-06-24 17:23:30 -07:00
Fred Gylys-Colwell
0b56285a62 Update JBMR1 Widevine Libraries to 4.5.0.10095 (DO NOT MERGE)
This change updates the Widevine binary libraries.
It includes the change:

Change name of DNS Server For Android Build
https://widevine-internal-review.googlesource.com/3322

Correct tool version for x86 jb-mr1 builds
https://widevine-internal-review.googlesource.com/3154

Update Build Script for Android
https://widevine-internal-review.googlesource.com/3340

Fixes to Jenkins build script for Android JBMR1 builds.
https://widevine-internal-review.googlesource.com/3551

Add Android property os.build.fingerprint to license request
https://widevine-internal-review.googlesource.com/3390

Bug: b/8173236
Bug: b/7594544 - Support x86 build on jbmr1
Bug: b/5425489
Change-Id: I6e32ab880c5768d724145d46a8b283bcdb2796ca
2013-06-24 21:17:43 +00:00
Edwin Wong
c49fe08576 Fixes GTS crash on Nexus 10.
When the video packets are clear, they are being
combined into a full frame between MediaExtractor or
DecryptCallback (where packets are never > 64k) and
MediaCrypto/DecryptVideo (where we are seeing clear
packets > 64k).

The max block size to be passed to DecryptVideo is
specified as 64K, handling of packets larger than 64K
is undefined and OEM implementation-dependent. In the
Nexus 10 case, it generates a SEG. fault.

Solution:
Add mClearSizes vector to keep track of each clear
packet size for android_media_MediaExtractor_getSampleCryptoInfo()
to process.

In android_media_MediaExtractor_getSampleCryptoInfo(), if it
does not see kKeyEncryptedSizes meta data, it will not
process the clear vector that contains the actual packet
sizes. Add a kKeyEncryptedSizes meta data that contains a zero
length size packet to trick the JNI code to process the
clear packets.

related-to-bug: 9261447

Change-Id: Ib0b655a95e099856babaf649f4a95fc7f9c17d41
2013-06-18 17:26:06 -07:00
Jeff Tinker
aae152cf78 am 47ef6eba: Fix erroneous "format unsupported " error in Play Movies
* commit '47ef6eba621fe95575d4bdda278d689fa84849e5':
  Fix erroneous "format unsupported " error in Play Movies
2013-06-14 09:11:21 -07:00
Jeff Tinker
47ef6eba62 Fix erroneous "format unsupported " error in Play Movies
Only the first 64K of the movie is pulled when sniffing,
if the widevine version metadata is not present in the
sniff buffer then a "format unsupported" error would occur.

This change increases the sniff buffer size to 128K.

bug: 9351294
Change-Id: If162cbea6915bf2b70122afd30e556e9206e8e43
2013-06-13 14:04:41 -07:00
Jeff Tinker
78b2231869 am f2afd994: Add Property for Provisioning ID
* commit 'f2afd99431694ac9f45ab729bbba6d7ff63505d6':
  Add Property for Provisioning ID
2013-05-30 18:51:47 -07:00
Jeff Tinker
f2afd99431 Add Property for Provisioning ID
Adds a property that allows applications to get the provisioning-unique serial
number.

Bug: 9175567

Also fixes some missing mutexes that were causing intermittent failures in
calls to OEMCrypto due to concurrency issues.

Bug: 9175583

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

Change-Id: I1d7e3ca9f3b06da345022f5f0d64e0c17a5cedca
2013-05-30 11:55:25 -07:00
Jeff Tinker
9bf8284362 am 0f2ff32f: Merge "Fix Level 3 Field Provisioning Device ID" into jb-mr2-dev
* commit '0f2ff32f7837fe969a19a046dd8fec563a064b51':
  Fix Level 3 Field Provisioning Device ID
2013-05-23 09:18:12 -07:00
Jeff Tinker
0f2ff32f78 Merge "Fix Level 3 Field Provisioning Device ID" into jb-mr2-dev 2013-05-23 16:13:57 +00:00
Jeff Tinker
5cac48a339 am 418f4b0e: License property for company_name should come from device on android
* commit '418f4b0e607316b90be54b3d0f3c09dddc3e59b6':
  License property for company_name should come from device on android
2013-05-22 12:19:25 -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
418f4b0e60 License property for company_name should come from device on android
The company_name was hardcoded in the CDM as "Google" for all devices.
On Android, it needs to come from the ro.product.manufacturer system
property.

bug: 9074091

This is a merge of https://widevine-internal-review.googlesource.com/#/c/5730/
from the Widevine CDM repository.

Change-Id: Ia3ae82abf350c32ba8b4d05b59e95361927dea40
2013-05-21 15:22:00 -07:00
Jeff Tinker
47a483fe3e am 32d61899: Merge "Fix intermitent bad nonce being passed to RewrapDeviceRSAKey." into jb-mr2-dev
* commit '32d61899a2a366036f0a1fe9b8ebb1d83e216226':
  Fix intermitent bad nonce being passed to RewrapDeviceRSAKey.
2013-05-21 10:01:20 -07:00
Jeff Tinker
bd01268490 am 9019e22b: Key derivation failure on key release
* commit '9019e22b118d1799fa96690bace42acf951a3b10':
  Key derivation failure on key release
2013-05-21 10:01:20 -07:00
Jeff Tinker
32d61899a2 Merge "Fix intermitent bad nonce being passed to RewrapDeviceRSAKey." into jb-mr2-dev 2013-05-21 16:57:53 +00:00
Jeff Tinker
9019e22b11 Key derivation failure on key release
Signing and encryption keys are not correctly setup in OEMCrypto, when
an offline license is restored, before generating a key release message.
This results in key release failures. Playing back the license response
causes keys to be derived and allows the key release message to be constructed.

b/9016545

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

Change-Id: Ica9f13acc7c87e3125fa706f3a56e95b77a14a3c
2013-05-17 11:23:54 -07:00
Jeff Tinker
71aa639c48 Fix intermitent bad nonce being passed to RewrapDeviceRSAKey.
Since CryptoSession::RewrapDeviceRSAKey takes a const std::string& nonce, the calling code
implicitly constructa temporary std::string from a character array with undefined termination
and sometimes bogus value when nonce.data() is passed in.

Bug: 9016828

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

Change-Id: Ia3beaa5f1a96924a8cc53a719f25af52217b8cc5
2013-05-17 11:19:45 -07:00
Jeff Tinker
8608e0be4d am eaebea91: Merge "Update 4.5.0.10098 of Widevine Classic Library" into jb-mr2-dev
* commit 'eaebea9141882fa3c86c8de864ff0ddfd4f7e55e':
  Update 4.5.0.10098 of Widevine Classic Library
2013-05-16 11:10:07 -07:00
Jeff Tinker
1caf4568c3 am 1b295f4c: Support Offline Licenses
* commit '1b295f4c8114c9bd0da4a6e62220633195884df9':
  Support Offline Licenses
2013-05-16 11:03:18 -07:00
Jeff Tinker
eaebea9141 Merge "Update 4.5.0.10098 of Widevine Classic Library" into jb-mr2-dev 2013-05-16 18:01:32 +00: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
John "Juce" Bruce
c9112ae31c Update 4.5.0.10098 of Widevine Classic Library
This CL replaces https://googleplex-android-review.git.corp.google.com/#/c/288483/
and adds the fix for error 408 preload timeouts due to badly configured IPv6
networks.

Bug: 8291064

Prefer IPv4 To Avoid Badly-Configured IPv6 Networks
https://widevine-internal-review.googlesource.com/#/c/5641/

The changes previously made on the AndroidOS_J branch, from
https://googleplex-android-review.git.corp.google.com/#/c/288483/
are:

Change name of DNS Server For Android Build
https://widevine-internal-review.googlesource.com/3322
(This is a no-op since the change to the android tree that
necessitated it was reverted.)

Update Build Script for Android
https://widevine-internal-review.googlesource.com/#/c/3340/

Fix Android OS Plugin Build on JB-MR2-DEV
https://widevine-internal-review.googlesource.com/#/c/5640/

Fixes to Jenkins build script for Android JBMR1 builds.
https://widevine-internal-review.googlesource.com/3551

Add Android property os.build.fingerprint to license request
https://widevine-internal-review.googlesource.com/3390

Change-Id: Ia13d322d853e843fd26582fa72c38ff7c7bd59a6
2013-05-15 20:07:02 -07:00
Jeff Tinker
a76e860d54 am 898d8701: Merge "Disable OEMCrypto tests that install a test keybox." into jb-mr2-dev
* commit '898d8701267c6d7b41cf4b36ac133984e0fcd8af':
  Disable OEMCrypto tests that install a test keybox.
2013-05-13 23:28:21 -07:00
Jeff Tinker
3594b9c56c am e1151975: Merge "Resize signature buffer" into jb-mr2-dev
* commit 'e1151975d093698816575fc7272272e61f8d3246':
  Resize signature buffer
2013-05-13 23:28:20 -07:00
Jeff Tinker
27875b13f4 am 8653c0bf: Merge "Device unable to recover from a bad certificate" into jb-mr2-dev
* commit '8653c0bfa5fc902be265adccc070e22ecc525b6a':
  Device unable to recover from a bad certificate
2013-05-13 23:28:20 -07:00
Jeff Tinker
898d870126 Merge "Disable OEMCrypto tests that install a test keybox." into jb-mr2-dev 2013-05-14 05:36:29 +00:00
Jeff Tinker
e1151975d0 Merge "Resize signature buffer" into jb-mr2-dev 2013-05-14 05:17:49 +00:00
Jeff Tinker
8653c0bfa5 Merge "Device unable to recover from a bad certificate" into jb-mr2-dev 2013-05-14 05:16:52 +00:00
Jeff Tinker
5d7ac644c5 Disable OEMCrypto tests that install a test keybox.
Because we do not want to accidentally install a test keybox on a
production device, most of the oemcrypto unit tests are being disabled
by default.

If you wish to run these tests, you can override this choice, by
running:
adb shell /system/bin/oemcrypto_test --gtest_also_run_disabled_tests

This change prompts for and requires positive confirmation before
running the disabled tests on a device that has a non-test keybox
already installed.

Bug: 8907626

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

Change-Id: Ib8e3605129ebf0861b4af15d04676f7a06cc5b78
2013-05-13 14:56:01 -07:00