Commit Graph

1339 Commits

Author SHA1 Message Date
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
Fred Gylys-Colwell
d4312bb81d am 30abdd58: Merge "Add Tests With Different Sized Key IDs" into mnc-dev
* commit '30abdd58a038dde301957e63fd64d894025455dc':
  Add Tests With Different Sized Key IDs
2015-06-05 18:19:55 +00:00
Fred Gylys-Colwell
30abdd58a0 Merge "Add Tests With Different Sized Key IDs" into mnc-dev 2015-06-05 17:40:12 +00:00
Fred Gylys-Colwell
3304f088bd am 92958a0e: Protect OEMCrypto Mock and Level 3 From Null Pointers
* commit '92958a0e6aad8dd9ffeab8f494a26a084b3eede7':
  Protect OEMCrypto Mock and Level 3 From Null Pointers
2015-06-05 00:48:43 +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
Fred Gylys-Colwell
177c59033e Add Tests With Different Sized Key IDs
Merge from widevine repo of http://go/wvgerrit/14550

This CL adds several tests with different sized key ids to
oemcrypto_test.

bug: 21643096
Change-Id: I62a89c557f3f746f09ee5a2fe5bdd3ca821448e4
2015-06-04 15:57:56 -07:00
Fred Gylys-Colwell
92958a0e6a Protect OEMCrypto Mock and Level 3 From Null Pointers
Merge from widevine repo of http://go/wvgerrit/14502

If any OEMCrypto session call is made after Terminate is called, then
there was a null pointer access.  This is protected by the oemcrypto
adapter, but could still be a problem in unit tests which by-pass the
adapter.

bug: 21642892

Level 3 versions:
level3/arm/libwvlevel3.a  Level3 Library May 29 2015 14:03:11
level3/x86/libwvlevel3.a  Level3 Library May 29 2015 14:03:12

Change-Id: I84fd098c2faea71a79bc21658485593e22a8e994
2015-06-04 15:54:08 -07: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
Jeff Tinker
27103166b1 am 71a17797: Merge "Fix possible infinite loop in test code" into mnc-dev
* commit '71a177977618e54db6f2ea9b67493ddec851d2b3':
  Fix possible infinite loop in test code
2015-06-01 17:34:19 +00:00
Fred Gylys-Colwell
2ebb5a1a77 am 9dfa85ae: Replace some arrays with vectors and initialize
* commit '9dfa85ae2a988bbd96175ee544d3967f2ec902d5':
  Replace some arrays with vectors and initialize
2015-06-01 16:39:50 +00:00
Fred Gylys-Colwell
5b2a6bfb8f am 994a7fc4: Update OEMCrypto Offset Tests
* commit '994a7fc4c1f696226e08fe2d9f1e4852fca147bc':
  Update OEMCrypto Offset Tests
2015-06-01 15:48:41 +00:00
Jeff Tinker
71a1779776 Merge "Fix possible infinite loop in test code" into mnc-dev 2015-05-29 23:15:51 +00:00
Rahul Frias
05c8160ca7 am 93d32612: Enable tests that cover renewals/releases with client IDs
* commit '93d326129ad48966ff1cff768d0426ff43a7baf4':
  Enable tests that cover renewals/releases with client IDs
2015-05-29 21:07:08 +00:00
Fred Gylys-Colwell
9dfa85ae2a Replace some arrays with vectors and initialize
Merge from widevine side of http://go/wvgerrit/14462

This cleans up some tests in oemcrypto_test.cpp so that they use
vectors instead of arrays.  The two reasons this is needed are that
arrays are more likely to use up stack space, and that arrays on the
stack are not initialized.

The lack of initialization caused some negative tests to fail because
buffers that were reused from unencrypted data still contained values
that the test expected not to be there.

Change-Id: Ic1705b6bc581084a9fe3cd573adf34d8219a1a45
2015-05-29 13:53:08 -07:00
Fred Gylys-Colwell
994a7fc4c1 Update OEMCrypto Offset Tests
Merge from widevine repo of http://go/wvgerrit/14321

It is expected that OEMCrypto will only be given subsamples with a
block offset when there are multiple subsamples, so that the entire
sample may be decrypted after all calls are made.  This CL modifies
the existing tests so that the result of DecryptCTR is only checked
after all subsamples have been decrypted.

Also, the QueryKeyControl test has been modified so that failure does
not require a specific error code.

bug: 20757848
bug: 21063276
Change-Id: Ie2b12b287b0c9c661cd14111b2ae9eab004cd8b8
2015-05-29 13:50:20 -07:00
Rahul Frias
93d326129a Enable tests that cover renewals/releases with client IDs
[ Merge of http://go/wvgerrit/14480 ]

Server upgrades have been completed and allow these tests to run successfully
against UAT. They were earlier tested against staging.

b/21479112

Change-Id: Ifc5e5780fa5305c6ddfd662ada204db599cb5c6e
2015-05-28 00:33:00 -07:00
Jeff Tinker
92bf971ea8 Fix possible infinite loop in test code
Also handle ResourceBusyException

merge of http://go/wvgerrit/14470 from widevine repo

bug: 21172957
Change-Id: I6815786eb7a678725cf2632f1009c7f566ba7499
2015-05-27 16:52:28 -07:00
Rahul Frias
710382ed35 am 997ea4f4: Accept signed service certificates
* commit '997ea4f44712be9ffbaf5847bbb0942a4d1f0f3d':
  Accept signed service certificates
2015-05-26 19:17:15 +00:00
Rahul Frias
997ea4f447 Accept signed service certificates
[ Merge of http://go/wvgerrit/14410 ]

When specifying a service certificate though mediaDrm, the CDM earlier expected
serialized service certificates rather than signed ones.

b/21334970

Change-Id: I39af2aa25e8dc2a651cbdce84eb32f266b5b3382
2015-05-26 10:34:18 -07:00
Kongqun Yang
b16ec4fc93 am 3cdc43ca: Use 0 to represent unexpired license in OnExpirationUpdate
* commit '3cdc43caeb37173bc5bc60bd3f414da540640e03':
  Use 0 to represent unexpired license in OnExpirationUpdate
2015-05-23 00:39:31 +00:00
Kongqun Yang
3cdc43caeb Use 0 to represent unexpired license in OnExpirationUpdate
Also fix a missing change for
"playback duration should override license duration".

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

Bug: 21393975
Change-Id: Ibfcf3ae4c13db8944ea285bcc79b6312ea621e1b
2015-05-22 15:47:42 -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
Fred Gylys-Colwell
18d7469b96 am 3a7ef263: Merge "Update padding scheme in mock" into mnc-dev
* commit '3a7ef2637500f5879165e2fc15883595bbcab9ed':
  Update padding scheme in mock
2015-05-22 01:50:09 +00:00
Fred Gylys-Colwell
3a7ef26375 Merge "Update padding scheme in mock" into mnc-dev 2015-05-22 01:14:54 +00: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
Fred Gylys-Colwell
6639965d30 Update padding scheme in mock
Merge from widevine repo of http://go/wvgerrit/14370

In order to run on android, we need the mock to compile with
BoringSSL, which uses a different function call for
RSA_padding_add_PKCS1_PSS.

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

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

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

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

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

b/17791094

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

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

b/18709693

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

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

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

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

b/19247020

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

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

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

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

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

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

Change-Id: I3077c04047a7f2da6f64869d7a9af5ddcc62671f
2015-05-01 15:50:26 -07:00