[ 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
(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
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
(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
(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
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
[ 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
(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
(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
(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
(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
[ 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
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
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
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
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
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
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
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
[ 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
(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
(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
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
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
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
(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
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
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
[ 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
Also handle ResourceBusyException
merge of http://go/wvgerrit/14470 from widevine repo
bug: 21172957
Change-Id: I6815786eb7a678725cf2632f1009c7f566ba7499
[ 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