Commit Graph

293 Commits

Author SHA1 Message Date
John "Juce" Bruce
06339504be am 6dbc3749: Merge "Validate Service Certificates Before Accepting Them" into mnc-dev
* commit '6dbc3749b08226f4aea4cd5500db82a792095d6d':
  Validate Service Certificates Before Accepting Them
2015-06-12 20:21:58 +00:00
John "Juce" Bruce
c400a37d19 Validate Service Certificates Before Accepting Them
(This is a merge of http://go/wvgerrit/14630)

To create a better flow when an application sets a service certificate
manually, we will now validate the certificate when it is given to us,
and if it is invalid, we will not allow the property to be set.

Bug: 21307186
Change-Id: If980ad075604223fc962a859fae93e98d86a7f4f
2015-06-12 11:46:32 -07:00
John "Juce" Bruce
b4658a6198 am a8328dd2: Delete Singleton on Library Unload
* commit 'a8328dd2f945e8357b3a58c76b0a71a4a2463aa1':
  Delete Singleton on Library Unload
2015-06-10 02:32:14 +00:00
John "Juce" Bruce
a8328dd2f9 Delete Singleton on Library Unload
(This is a merge of http://go/wvgerrit/14531)

As an optimization, the Media Server now unloads our library when not
in use. This has exposed a bug by which we were never deleting the CDM
singleton. Fix is to make WvContentDecryptionModule an Android smart
pointer ref base and then make sure all the plugins store a strong
pointer to it. The singleton is a weak pointer, so when the last
plugin is cleaned up, the CDM will be as well. And on the off chance
that the library isn't immediately unloaded, the singleton code will
generate a new CDM next time one is needed.

Bug: 21153732
Change-Id: Ifaf02fa9afe0a70a8b53e8b92ee0a3d1359ca001
2015-06-09 14:58:01 -07:00
Jeff Tinker
8ef609a4ff am a54ae37c: Merge "Correct mapping for too many open sessions" into mnc-dev
* commit 'a54ae37ceb536329fbd8d62aa8124d7c5453523b':
  Correct mapping for too many open sessions
2015-06-08 19:55:43 +00:00
Jeff Tinker
a54ae37ceb Merge "Correct mapping for too many open sessions" into mnc-dev 2015-06-08 16:52:25 +00:00
Jeff Tinker
2478c36b51 Correct mapping for too many open sessions
The drm resource manager expects openSession to fail
with ERROR_DRM_RESOURCE_BUSY, but in some cases the
WV DRM plugin is returning a vendor-specific code
kErrorTooManySessions instead.  This change updates
the error code mapping to match what the resource
manager expects.

Merge of http://go/wvgerrit/14564 from widevine repo

bug: 21640598
Change-Id: I0b296ff5eeef8a6b94cfe0fd450b15f15cf03eab
2015-06-05 00:03:00 +00:00
John "Juce" Bruce
c8b4eaefb7 am 4fce36e9: Use ToVector Everywhere
* commit '4fce36e91f426421172ab006d84ccfcaa0b06809':
  Use ToVector Everywhere
2015-06-02 19:24:08 +00:00
John "Juce" Bruce
4fce36e91f Use ToVector Everywhere
(This is a merge of http://go/wvgerrit/14390)

Expands usage of the ToVector() helper that kqyang@ wrote across the
entire DRM Plugin.

Bug: 20037441
Change-Id: I55112245af6fdf21ea3d3db87b1564af2f54929d
2015-06-01 16:47:13 -07:00
Rahul Frias
a3b714762c am 5f227dd8: Avoid throwing exceptions when sessions are closed
* commit '5f227dd85d5407620cd68c17caae6e1949cd06c9':
  Avoid throwing exceptions when sessions are closed
2015-05-22 22:23:41 +00:00
Rahul Frias
5f227dd85d Avoid throwing exceptions when sessions are closed
[ Merge of http://go/wvgerrit/14404 ]

Closing a non-existant (already closed) session results in an exception
being thrown though mediaDrm. The mediaDrm plugin will now ignore
errors when called though MediaDrm.closeSession.

b/21122725

Change-Id: Ib1c48ade4bdb131195ee56ce2af32bf0cd2166da
2015-05-22 11:17:25 -07:00
Kongqun Yang
9736d87707 am ce68b8ee: Fix expiry time overflow if it is unlimited
* commit 'ce68b8ee8835cd202e40a2d1246023dcd22fcc05':
  Fix expiry time overflow if it is unlimited
2015-05-21 19:10:18 +00:00
Kongqun Yang
ce68b8ee88 Fix expiry time overflow if it is unlimited
Bug: 21324836

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/14392

Change-Id: I2a8da14c98f8ae0fece3667b6f6b8517577f8a98
2015-05-20 18:31:06 -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
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
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
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
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
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
Jeff Tinker
453eb29b57 Merge "Integrate OnExpirationUpdate and OnSessionKeysChange with Android" 2015-04-10 00:01:32 +00:00
John "Juce" Bruce
2ebfce52ef Merge "Add Getter for App ID" 2015-04-09 21:49:50 +00:00
John "Juce" Bruce
7a8e33ca21 Add Getter for App ID
(This is a merge of http://go/wvgerrit/13973)

The app ID was write-only because no getter was ever written.

Change-Id: Ie5e383ee3a2dcf2843a6671becb6ff1f88e97d24
2015-04-07 16:34:33 -07:00
Ying Wang
0c850a4cb3 Remove setup of proto generated include/header dependency.
They are now set up automatically by the build system.

Bug: 20093047
Change-Id: I3ab1256952915e402adf6510c0f6fdb158feb802
2015-04-07 12:51:20 -07:00
Kongqun Yang
8a37cd4538 Clean up get/set property code
Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13970

Change-Id: I2b52248e71c18808f36730a438390f855309cc14
2015-04-02 15:22:17 -07:00
Kongqun Yang
7c003cdb0e Merge "Report key status change" 2015-04-02 17:18:20 +00:00
Kongqun Yang
d9b274cb4a Merge "Report change in session expiration" 2015-04-02 17:18:06 +00:00
Kongqun Yang
de35e1e228 Add Android property for numberOfOpenSessions
Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13960

Change-Id: I04c63c75987b7cd81fd60af925676c6d99368b22
2015-04-01 19:30:15 -07:00
Kongqun Yang
f7c449e93a Integrate OnExpirationUpdate and OnSessionKeysChange with Android
Also removes OnSessionExpiration which is no longer needed with
OnSessionKeysChange.

Bug: 19771612
Bug: 19771431

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13951/

Change-Id: I0603e808e8d50ff7bb1fb1d5e44fabd8d268ee8a
2015-04-01 19:28:35 -07:00
Kongqun Yang
4621028434 Report key status change
Also modified PolicyEngine::CanDecrypt to use the new Keys_status_.

Bug: 19771431

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13904/

Change-Id: If7fb7fa45ecf9ff4e65278cda00ad7230b57f50b
2015-04-01 19:25:39 -07:00
Kongqun Yang
bdb82e04f8 Report change in session expiration
Bug: 19771612

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13885/

Change-Id: I754f06a7ed9476554f9e1da3fe23f4563f9fc07e
2015-03-31 14:33:53 -07:00
KongQun Yang
85e838b957 Replace generic OnEvent with actual event callbacks
Also pass session_id and event_listener to PolicyEngine to make it easier
to dispatch events from PolicyEngine.

Bug: 19771437

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13816/

Change-Id: I5723cb371cb3c43c945051af3402b09069ba5859
2015-03-27 21:42:20 +00:00
Kongqun Yang
8ea1ab7f5e Report key request type in GenerateKeyRequest
Bug: 19771299

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13830/

Change-Id: Id9b4547febcabbb73a4be5dbb2e4c63b1c3eacd3
2015-03-26 13:35:38 -07:00
Jeff Tinker
a0e6f2804e WV DRM plugin stubs to report key request type for unprefixed EME
This CL allows the framework CLs to compile.  The stubs need to
be implemented properly in the DRM plugin and CDM.

bug: 19771299
Change-Id: I9e4b107370a4d73851ee28bcb9ab6087fdffeb13
2015-03-23 17:02:04 -07:00
KongQun Yang
fddbc89136 Refactor WvCdmEventListener and some cleanups
Bug: 19771437

It is a merge of below CLs from Widevine CDM repo:

Clean up CdmSession and PolicyEngine testing injection
https://widevine-internal-review.googlesource.com/#/c/13700

Refactor WvCdmEventListener handling
https://widevine-internal-review.googlesource.com/#/c/13702

Change-Id: I356b90000c056113d394926862b859aab380d305
2015-03-20 11:25:52 -07:00
Fred Gylys-Colwell
12a986f808 Clean up some compiler warnings
This is a cherry pick of http://go/wvgerrit/13665

Added a few static casts and removed some unused parameters.

Change-Id: I4f2d1c26580a188de429defc8d1d22757f4c6917
2015-03-16 11:31:48 -07:00
KongQun Yang
23c95a1251 Merge MaxNumberOfSessions changes from CDM
Bug: 18377675

Implement new OEMCrypto function to get max number of sessions
https://widevine-internal-review.googlesource.com/#/c/12980/

Add oemcrypto static adapter for v9
https://widevine-internal-review.googlesource.com/#/c/13022/

Support new property to query MaxNumberOfSessions in CDM
https://widevine-internal-review.googlesource.com/#/c/13020/

Fix GetHdcpCapabilities incorrect return if not initialized
https://widevine-internal-review.googlesource.com/#/c/13210/

Change-Id: I02738c543cedd6e38d8826f845fec6cb2b1ede3c
2015-03-09 13:05:21 -07:00
John "Juce" Bruce
b331822558 Fix C++11 Narrowing Errors in WVDrmPlugin
(This contains a merge of http://go/wvgerrit/13382 from the Widevine
repository.)

This undoes the previous change to silence harmless C++11 narrowing
warnings and instead changes the code to no longer trigger them. The
fix was to delcare the type of our PSSH prefix constant to be uint8_t*
and then convert it to char* at usage-time rather than defining the
not-technically-char* data as a char* to start.

Change-Id: I68ff8c3ed0859096863b49c61cd60ae8461b5b29
2015-03-06 15:57:40 -08:00
John "Juce" Bruce
6d1ceb2e18 Merge "Rename CancelKeyRequest" 2015-03-05 20:03:40 +00:00
Chih-Hung Hsieh
a15abbe428 Ignore benign clang/llvm warnings.
Change-Id: Ibb8d60c6e238504dfe6a15425a65405bcf083358
2015-03-04 15:37:31 -08:00
John "Juce" Bruce
2ae1f717f3 Rename CancelKeyRequest
(This is a merge of http://go/wvgerrit/10674 from the Widevine CDM
repository.)

Now that the CE CDM has CloseSession to handle closing sessions, we
can rename CancelKeyRequest on the CDM Engine & CDM Session to better
resemble its purpose and the name it is known by on Android.

Change-Id: I68d55b3be733579e5875ab33d8e94a62fe1f651d
2015-03-04 12:24:57 -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 Davidson
dfab729fd7 Remove references to protobuf 2.3.0.
Change-Id: I08b9e6441e26083cf182402916288ae073425f9c
2015-01-08 19:01:44 -08:00
Dan Albert
de4bc34719 Fix build.
This project is still using stlport (without telling the build system
about it), which was causing (broken) stlport headers to override
libc++ headers, leading to a broken copy of std::enable_if, which in
turn caused <atomic> to fail to compile. Since this project has
prebuilts that will need to be updated before this project can
actually move away from stlport, tell the build system that it is
still using stlport for now.

Bug: 18433002
Change-Id: I38b356428977ed2184eb28a07bd5e7424a4ace8d
2014-11-25 13:41:47 -08:00
Fred Gylys-Colwell
20191d996c Allow Secure Stops to be queried and deleted by application ID
This CL changes the WVDrmPlugin so that an application can segregate
its secure stops from those of other applications by setting an
application ID.

This CL is a merge of the following Widevine CLs:
https://widevine-internal-review.googlesource.com/#/c/11565/
Add getSecureStop by ssid

https://widevine-internal-review.googlesource.com/#/c/11572
Add getSecureStop by SSID and releaseAllSecureStops by app id.

https://widevine-internal-review.googlesource.com/#/c/11564/
Store Usage Info by App Id (device_file stubs)

https://widevine-internal-review.googlesource.com/#/c/11563/
Add application id to StoreUsageInfo.

https://widevine-internal-review.googlesource.com/#/c/11561/
Added Application ID to PropertySet for secure stop.

bug: 18053197
bug: 18076411
Change-Id: I5444baf67ba1b960dee2dc958bced8de82ab70a3
2014-11-05 17:39:44 -08:00
John "Juce" Bruce
3da4f9d7d5 Protect Session ID List With a Lock
(This is a merge of
https://widevine-internal-review.googlesource.com/#/c/11405
from the Widevine CDM Repo.)

AUPT is revealing a crash when destructing WVDrmPlugin due to
multi-threaded contention over the session map. As a fix, we are now
protecting access to the map via a mutex.

Bug: 17761616
Change-Id: Iddeca657effd3c7f3ff35ce334d7979291667cef
2014-10-13 13:40:44 -07:00
Rahul Frias
9bc13a07a0 Corrections for license release on fallback to L3
When falling back to L3, release requests were failing. Information
requesting falling back to L3 is passed along when the session is opened.
Licenses however are released using the key set ID and information
requesting fallback to L3(CdmClientPropertySet) at that point is
unavailable. The release was actually attempting to release a license
at the default security level which is incorrect.

In addition, the mac keys were not being setup correctly and the release
message was signed with keys derived from the license request and not the
response.  Both these issues have been addressed and unit tests added
to track release of offline licenses and usage reporting scenarios.

[ Merge of https://widevine-internal-review.googlesource.com/#/c/11062
  from wv cdm repo ]

b/17073910

Change-Id: I5cd95a7dfe58ebae7ae27ece6c92e67755c1d665
2014-09-04 10:29:10 -07:00
Jeff Tinker
fbe0994902 Fix widevine unit test builds on 64-bit devices
bug: 17080975
Change-Id: Ic54d484e18fe0416855264ca073474f3d597e1a3
2014-08-16 12:11:05 -07:00
John "Juce" Bruce
b608e17e08 Add Properties to Query HDCP Status and Usage Reporting Support
This is a merge of http://go/wvgerrit/10846/ from the Widevine repository.

Change-Id: I682069073d9ec58c03781de25d9c6fa5ec5864ff
2014-08-05 18:29:25 -07:00
John "Juce" Bruce
4db7780cb5 Support Device Unprovisioning
Merge of https://widevine-internal-review.googlesource.com/#/c/10845/
from the widevine cdm repo.

Bug: 12247651
Change-Id: Ice6ec95865640fa2f736c7a9f09956395d648337
2014-08-04 13:07:20 -07:00