Commit Graph

1369 Commits

Author SHA1 Message Date
Rahul Frias
460d24b135 Merge "Return Client Identification information in Secure Stop" into mnc-dev 2015-06-29 22:59:47 +00:00
Rahul Frias
6e2cc1a3ed Avoid multiple deletions of a usage entry
[ Merge of http://go/wvgerrit/14900 ]

When releasing a license, usage entries were being released twice with
both OEMCrypto_DeleteUsageEntry and OEMCrypto_ForceDeleteUsageEntry being
called. The second call would always fail because the usage information had
already been released. The CdmSession::DeleteLicense methods will now only
handles deletion of license metadata and leave deletion of usage entries to
the CdmLicense class.
b/22097805

Change-Id: Ic55764d5357043d136e7d88583f709a4ceea3e64
2015-06-29 14:47:24 -07:00
Rahul Frias
d220d41425 Return Client Identification information in Secure Stop
[ Merge of http://go/wvgerrit/14920 ]

The renew_with_client_id field was not being correctly set when licenses
were being restored for usage reporting.

b/22047007

Change-Id: Ib769431b1e49bb498f53d8153a970b6c0a2776d2
2015-06-29 14:06:17 -07:00
Chad Jones
53d9ade2ef Merge "Revert "Add XtsMediaTestCases.apk to google-tests.zip"" into mnc-dev 2015-06-26 15:34:45 +00:00
Chad Jones
c72407657a Revert "Add XtsMediaTestCases.apk to google-tests.zip"
This reverts commit fe71d17236.

Change-Id: I8119b307b7fa4dd0a9971e37c6c004de10400233
2015-06-26 15:33:56 +00:00
Kyle Alexander
7c1c5f77cc Merge "Add XtsMediaTestCases.apk to google-tests.zip" into mnc-dev 2015-06-25 21:52:57 +00:00
Kyle Alexander
fe71d17236 Add XtsMediaTestCases.apk to google-tests.zip
Need to add our Xts Media tests to the test package, so that we can
execute those tests with our nightly regression.

Bug: 22094009
Change-Id: I7e7ed8bf5f6edb905832495bea6347f97b6c5894
2015-06-25 12:22:36 -07:00
Rahul Frias
57eb7cb6ba Merge "Add unit tests for offline licenses without session usage" into mnc-dev 2015-06-25 06:40:21 +00:00
Fred Gylys-Colwell
666031026c Make MaxSessionsOpenCloseAPI10 More Lenient
Merge from widevine repo of http://go/wvgerrit/14870

OEMCrypto_GetMaxNumberOfSessions is not required to return a hard
limit for the number of sessions.  This CL adjusts the test to verify
we can open within 5% of the maximum number of sessions.

bug: 22029687
Change-Id: I6e72e39338cead8d547cdb194a32fb7e7dc53037
2015-06-24 17:49:06 -07:00
Rahul Frias
f5f2e826f2 Add unit tests for offline licenses without session usage
[ Merge of http://go/wvgerrit/14824 ]

OEMCrypto v9 added support for secure usage reporting with the help of
a session usage table. This was enabled through the replay control bits
in the key control block. It was expected that streaming licenses
would enable the nonce required bit, while offline licenses would
enable session usage table entry flag. There are certain cases
where content providers would prefer not to enable the flag for offline
licenses and this test verifies that this scenario works.

b/17514500

Change-Id: Icd1bea8cec2fd52be2be249424891ce1755d5f25
2015-06-22 15:38:33 -07:00
John "Juce" Bruce
9fcaf2c6ec Merge "Update Widevine Classic to 4.5.0.10139" into mnc-dev 2015-06-22 19:10:57 +00:00
Rahul Frias
9aca14e4fe Merge "Allow interspersed provisioning attempts to succeed." into mnc-dev 2015-06-20 01:06:01 +00:00
John "Juce" Bruce
256dd1a5b4 Merge "Re-Add MIPS to Android CDM Build" into mnc-dev 2015-06-20 00:33:01 +00:00
John "Juce" Bruce
da8e2beb28 Merge "Do Not Use GNU-Style Hashing on MIPS" into mnc-dev 2015-06-20 00:31:50 +00:00
John "Juce" Bruce
64d9be5615 Fix OEMCrypto Tests
(This is a merge of http://go/wvgerrit/14810)

By making this constant unsigned, all calculations in EXPECT_ALMOST
were cast to unsigned, leading to underflow problems when it was
subtracted from zero.

Change-Id: Iefc4e30604c45fec8b203375074b26fb12ec385f
2015-06-19 17:08:56 -07:00
Rahul Frias
a1895e7e2e Allow interspersed provisioning attempts to succeed.
merge of http://go/wvgerrit/14807 from the widevine repo.

The mediaDrm API only allows for a single provisioning attempt at a time.
If concurrent provisioning attempts occur, resources are released from
all but the last request, in order to allow at least that one to be successful.

Any provisioning responses received before one from the last request will
be rejected. A side-effect was that all provisioning resources would
then be released. This caused a provisioning response from the last attempt
to be rejected as well. This CL corrects this behavior and releases resources
only if a provisioning attempt is successful.

The side-effect is that, if the response to the last request is not received
or failure occurs while processing, a crypto session may be held until the
next provisioning attempt.

In other cases of concurrency, provisioning responses to requests other than
the last which are received after the last response will be declared successful.

b/21879484

Change-Id: I3a840ceda1a16ee6adb40c2dbca6c4adf3da12c3
2015-06-19 23:40:05 +00:00
John "Juce" Bruce
8443abc555 Re-Add MIPS to Android CDM Build
(This is a merge of http://go/wvgerrit/14795)

This change restores the ability to build the Widevine CDM for Android
for MIPS devices. It restores the precompiled binaries for MIPS and
re-adds MIPS to all makefiles.

This change includes a new build of the obfuscated binaries for
MIPS32r1 that were built using a MIPS device on the emulator.

level3/mips/libwvlevel3.a  Level3 Library Jun 19 2015 12:32:49

Bug: 19482469
Change-Id: Ifa1c299a5751f3772c42289d8333a2b8cec51f69
2015-06-19 16:34:08 -07:00
John "Juce" Bruce
123c469d3e Do Not Use GNU-Style Hashing on MIPS
(This is a merge of http://go/wvgerrit/14801)

The MIPS compiler does not support GNU hashing, which means this
compiler option needs to be excluded.

Bug: 19482469
Change-Id: I913f666a39eb535a33ebfbc49e5e7531115db5d4
2015-06-19 16:33:11 -07:00
John "Juce" Bruce
303a809cf4 Update Widevine Classic to 4.5.0.10139
This restores the MIPS builds of Widevine Classic. All targets are
also built against their respective mini-emulator targets instead of a
specific device, now.

Contains "Use Local libopenssl"
https://widevine-internal-review.googlesource.com/#/c/14606/

Contains "Fix MIPS Build"
https://widevine-internal-review.googlesource.com/#/c/14701/

Contains "Move Classic ARM and x86 Builds to Emulator By Default"
https://widevine-internal-review.googlesource.com/#/c/14741/

Contains "Re-Add MIPS to Android Build Script"
https://widevine-internal-review.googlesource.com/#/c/14746/

Bug: 19200196
Change-Id: Ib2366543746a688dc7b967dab78547b59c0e6315
2015-06-19 16:02:38 -07:00
Fred Gylys-Colwell
20b07afad9 Merge "Disable Flaky Key Id Length Tests" into mnc-dev 2015-06-19 22:27:26 +00:00
Fred Gylys-Colwell
592f8ad6db Disable Flaky Key Id Length Tests
Merge from widevine directory of http://go/wvgerrit/14784

These tests are not passing on multiple devices so I will disable them
until I am sure they are giving a clear signal.

bug: 21935358
Change-Id: I1e0cf01e64ea50b02d61d4b8334c0efb55e47d35
2015-06-19 13:29:52 -07:00
Rahul Frias
dcc5cc1ee1 Merge "Address compiler warning" into mnc-dev 2015-06-19 19:40:32 +00:00
John "Juce" Bruce
3efe87583d Merge "Be More Forgiving in EXPECT_ALMOST()" into mnc-dev 2015-06-19 18:20:30 +00:00
John "Juce" Bruce
b0cfa834f1 Merge "Fail Test if LoadOfflineLicense() Helper Fails" into mnc-dev 2015-06-19 18:17:55 +00:00
Rahul Frias
f08d6fae3a Address compiler warning
[ Merge of http://go/wvgerrit/14788 ]

A retired error code was not being handled when converting from
a WVStatus error code to a ERROR_DRM_VENDOR error code.

b/13976775

Change-Id: Ib4363792e4a5e9a20fc718d169b3e0348413267a
2015-06-19 11:14:21 -07:00
John "Juce" Bruce
6a773e3630 Be More Forgiving in EXPECT_ALMOST()
(This is a merge of http://go/wvgerrit/14776)

This change widens the range in EXPECT_ALMOST slightly, to allow for
slight timing errors in the tests.

Bug: 21489628
Change-Id: Ibb074c2d037566c307c0438efdda3841bc48f7ed
2015-06-18 19:00:06 -07:00
John "Juce" Bruce
57fd014f6d Fail Test if LoadOfflineLicense() Helper Fails
(This is a merge of http://go/wvgerrit/14775)

This change causes tests that call LoadOfflineLicense() to fail if
the session is still open after that call. Due to the way that gTest
handles ASSERT_*() macros, failures in LoadOfflineLicense() will leave
the session open, causing unexpected state and cascading failures
throughout the rest of the test. With this change, we will abort
sooner, reducing log noise.

Bug: 21489628
Change-Id: Ic35bc77bbc5f676f23deeefaacd1986e383538c8
2015-06-18 18:59:24 -07:00
John "Juce" Bruce
89682556ad Fix CanSetServiceCertificate Test
(This is a merge of http://go/wvgerrit/14783)

When validation was added to the service certificate property, it
broke the associated test, which sends random data. It also did not
do any testing of the new validation itself.

This fix makes the validation method on WvContentDecryptionModule
non-static so that it can be mocked and handled appropriately in the
test.

Bug: 21923281
Change-Id: Id5d2315709fce35f9347b3545f594371810349f0
2015-06-18 18:54:19 -07:00
John "Juce" Bruce
968993cd05 Allow Clearing of Privacy Cert
(This is a merge of http://go/wvgerrit/14782)

The ability to clear the privacy cert after setting it was
accidentally removed by adding validation, as an empty certificate is
invalid. This restores the ability to clear the certificate by not
validating if the value being set is empty.

Bug: 21923281
Change-Id: Ibb57481a398c9599163ab3512125a9d5b5fcaab4
2015-06-18 18:47:41 -07:00
Rahul Frias
99a2346e3a Return more descriptive error codes on license generation failure
[ Merge from http://go/wvgerrit/14745 ]

License generation errors previously would result in code -2916 being returned
though the mediaDrm API. More descriptive error codes are now being returned
from -2850 to -2836

b/13976775

Change-Id: I613ad650ab0a072ce9d8029e2af52b72dc617236
2015-06-17 17:32:11 -07:00
Fred Gylys-Colwell
b879cc6c3a Merge "Fix QueryKeyControl Unit Test" into mnc-dev 2015-06-17 23:35:23 +00:00
Fred Gylys-Colwell
854a409ae6 Accept Other Error Codes in TestSignatureBoth
Merge from widevine of http://go/wvgerrit/14744

The OEMCrypto unit test TestSignatureBoth verifies that a cast
certificate cannot be used to derive session keys.  This CL relaxes
the requirement that DeriveKeysFromSessionKey returns a specific error
code instead of just failing.

bug: 21708882
Change-Id: I4163a9616122ad709bab76f488d030239029861c
2015-06-17 15:58:58 -07:00
Fred Gylys-Colwell
b6f096d08a Fix QueryKeyControl Unit Test
Merge from widevine repo of http://go/wvgerrit/14720

The QueryKeyControl test expects an error message that the output
buffer is too small.  However, it also gives a bad key id.  Some
devices were correctly returning key not found.  This corrects the key
id length so that the only error is that the buffer is too small.

bug: 21881768
Change-Id: I96f59ede42eeddc9849fbac1e52acecdb562df08
2015-06-17 15:53:12 -07:00
Fred Gylys-Colwell
e16e4c1a49 Merge "Replace MockCDM with Android Smart Pointer to MockCDM" into mnc-dev 2015-06-17 21:43:25 +00:00
Fred Gylys-Colwell
87dbf0d941 Replace MockCDM with Android Smart Pointer to MockCDM
Merge from widevine repo of http://go/wvgerrit/14742

The CDM object can no longer be created on the stack because it
inherits from RefBase.  This caused some unit tests to hang in the
MockCDM destructor.

bug: 21881298

Change-Id: Ieeb7863031609f12ad3d9188c4525aa2fa1eb736
2015-06-17 13:57:44 -07:00
Fred Gylys-Colwell
f9453190fd Improve RSA performance in Level 3 OEMCrypto
Merge from widevine repo of http://go/wvgerrit/14668

This CL modifies the multiplication routine to avoid memory cache
misses.  This shows a 10-20% speed improvment in license requests on
an x86.

Level 3 library version:
level3/arm/libwvlevel3.a  Level3 Library Jun 15 2015 14:09:24
level3/x86/libwvlevel3.a  Level3 Library Jun 15 2015 14:09:10

bug: 18252910

Change-Id: I4429324374de46d1d710d5fcac80f7ed363c696c
2015-06-17 11:28:27 -07:00
Fred Gylys-Colwell
82bf03f062 Verify OEMCrypto supports Level 1
Merge from widevine repo of http://go/wvgerrit/14708

This CL adds a test to verify that oemcrypto is a level 1 device.  It
is part of oemcrypto_test_android.cpp, so it only applies to android
devices and to the widevine buildbot which also runs the android tests.

bug: 21814204

Change-Id: Icbcdd3496fb8a656891bd7c873c60cba23c9666a
2015-06-16 17:46:52 -07:00
Fred Gylys-Colwell
8bd1a40cd2 Verify Key Rewrapping Does Not Leave Key in Clear
Merge from widevine repo of http:/go/wvgerrit/14707

This CL adds a check to oemcrypto_test to verify that when a
certificate is rewrapped, it does not show up in the clear.  We can't
really verify that it is encrypted well, but we can check this.

bug: 21871738

Change-Id: I07c87c38a1e2a099a90a5be4e3350e91e09f6722
2015-06-16 11:16:46 -07:00
Fred Gylys-Colwell
1d934be5d1 Merge "Separate and Clarify Cast Reciever Tests" into mnc-dev 2015-06-15 20:24:02 +00:00
Fred Gylys-Colwell
bf484e95de Separate and Clarify Cast Reciever Tests
Merge from widevine of http://go/wvgerrit/14667

This CL updates oemcrypto_test.cpp so that devices that are not cast
recievers do not attempt to run those tests that are only needed by
cast recievers.

bug: 21708882
bug: 18948285

Change-Id: I75f9170cee13e66667db54c5f298ed5c6cf14a48
2015-06-15 11:22:46 -07:00
Rahul Frias
1b88e370cf Merge "Fix for concurrent provisioning attempts" into mnc-dev 2015-06-15 17:29:40 +00:00
Rahul Frias
b33298a742 Fix for concurrent provisioning attempts
[ Merge from http://go/wvgerrit/14670 ]

Concurrent provisioning attempts are declared successful if any one of them
succeeds. Earlier only the successful ones were declared as such.

b/21727698

Change-Id: I67dedca44790a4ae236e14f90a8fc91775273905
2015-06-12 14:37:41 -07:00
John "Juce" Bruce
6dbc3749b0 Merge "Validate Service Certificates Before Accepting Them" into mnc-dev 2015-06-12 19:49:46 +00:00
Jeff Tinker
69df7f61e6 Merge "Fix session count properties" into mnc-dev 2015-06-12 19:43:51 +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
Edwin Wong
e6ea4ff2d0 Change url to test content page to a more accessible Google URL.
Replace "http://pmweb.widevine.net/html/android/oem.html" with a more
accessible Google URL.

bug: 16630664
Change-Id: I90350ceb11bb9f53dc4c265c910e3a8258ff82a7
2015-06-11 15:31:46 -07:00
Edwin Wong
49ef93ccb3 Update Widevine Classic Library to 4.5.0.10136.
Update license request URL references. Replaces URL ending with
.../GetEMMs.cgi with the new url. Update portal to widevine.

Widevine repo reference: https://widevine-internal-review.googlesource.com/#/c/14659/.

bug: 16630664
Change-Id: I7b263c239af75ce35e5c7a0b6856d129ee25332c
2015-06-11 14:59:59 -07:00
Jeff Tinker
e1ba3ee601 Fix session count properties
bug: 21787354

merge of http://go/wvgerrit/14663 from the widevine repo

Change-Id: Ia8618c9daba2526234c5c5c84590e74d6feebf95
2015-06-11 14:57:18 -07: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
a54ae37ceb Merge "Correct mapping for too many open sessions" into mnc-dev 2015-06-08 16:52:25 +00:00