Because the OEMCrypto_PST_Report is sent as a signed block to the
server, it needs to be a fixed, platform independent, size. This CL
adds the packed attribute to the structure, which reduces its size
from 56 bytes to 48 bytes.
Copy of widevine change:
https://widevine-internal-review.googlesource.com/#/c/10321/
Library Versions:
libwvdrmengine/level3/x86/libwvlevel3.a Level3 Library May 30 2014 15:40:50
libwvdrmengine/level3/arm/libwvlevel3.a Level3 Library May 30 2014 15:39:04
bug: 15184821
Change-Id: I54db2c3bbc4e20ee0c19c33d6fd56f86f432e110
This is a copy of the widevine CL.
https://widevine-internal-review.googlesource.com/#/c/10174/
This CL adds the OEMCrypto v9 functionality to the level 3 haystack
version of OEMCrypto. Mostly, this is to support usage tables.
The code is feature complete, but the timing tests are a little flakey
-- I'm not sure if the problem is in the code or if the test has too
tight a tolerance.
Also, the storage of the generation number needs to be made more
secure.
Change-Id: I73fecf8934b6a46785f1f8b6f40b40ffe39b88de
This CL removes TODOs and email addresses from comments, unifies some
namespaces and cleans a few variable names. It is a copy of multiple
CLs on the widevine side.
Change-Id: I1bb649096476a5001a56d746427399de6a88ff69
This change is copied from the widevine CL:
https://widevine-internal-review.googlesource.com/#/c/10163/
Because the OEMCrypto_PST_Report is sent as a signed block to the
server, it needs to be a fixed, platform independent, size. This CL
adds the packed attribute to the structure, which reduces its size
from 56 bytes to 47 bytes.
Change-Id: I2bae058b7eb0ac54ba9fad355f3d85ddc2cd4a58
This is a copy of https://widevine-internal-review.googlesource.com/#/c/10040/
The message size was wrong on several OEMCrypto_RewrapDeviceRSAKey
unit tests. The function was supposed to fail in these tests.
However, a vendor found that they were failing with a different error
code because the buffer size was incorrect. Now the function should
fail with the correct error code, and the test should pass for the
vendor.
Change-Id: Iea27b489f9bc386241d9add4f99ccb50560dfef6
This is a copy of the Widevine CL:
https://widevine-internal-review.googlesource.com/#/c/9708/
This CL refactors some of code in oemcrypto/mock and oemcrypto/test in
preparation for adding usage table code.
Change-Id: I7e58c8ecd6d92b3e177cb915733212fcad645485
This is a copy of the Widevine CL:
https://widevine-internal-review.googlesource.com/#/c/9480/
This change is part of OEMCrypto API version 9.
This CL adds verification that a key control block which requires a
specific version of HDCP can be loaded. Also, if secure data path is
not set, it verifies that data is still decrypted.
This CL also adds test that verify DecryptCTR fails when the current
HDCP version is below that in the key control block. The expected
error is OEMCrypto_ERROR_INSUFFICIENT_HDCP. This error code is newly
introduced in this CL.
This is one attempt to clarify HDCP, as specified in b/13626021, and
is a slight modification from previous behavior for the mock and the
level 3 haystacked code.
This CL also tests the two valid verification codes "kctl"
and "kc09".
bug: 13626021
Change-Id: If380709d2306a3489470b29fb148a45b609b089d
This is a copy from the Widevine CDM repository:
https://widevine-internal-review.googlesource.com/#/c/9177/4
This CL modifies some unit tests to make sure that OEMCrypto returns
the correct error code when the key has expired. This behaviour is
required for OEMCrypto version 9.
It also updates the code for the reference implementation and the
Level 3 implementation.
This is half of b/9205119
The other half is for the CDM layer to respond to this error code.
bug: 9205119
Change-Id: I60f934886f4ecdd1ee04825dea289fda1c0a4303
This is a copy of the Widevine CDM change:
https://widevine-internal-review.googlesource.com/#/c/9337/
This CL provides some shim code that allows the Eureka
version 8 oemcrypto library to be linked and run with CDM.
As part of this change, obfuscated names in OEMCryptoCENC.h have been
changed.
Change-Id: I18a1f91f0dfde0006591f800f8f8a034f32d9004
From the Widevine CDM repository:
https://widevine-internal-review.googlesource.com/#/c/9182/
This CL adds a test to verify that at most 20 nonces may be created in
one second. This should prevent the replay attack that an
appplication could do by generating large quantities of nonces until
it finds a repeat.
I've also updated the Level 3 and reference implementations.
This feature is required for OEMCrypto version 9.
Change-Id: Ia86323133810fcbbd79d7bb27bd5a004d7c87314
From the Widevine CDM repository:
https://widevine-internal-review.googlesource.com/#/c/9183/
This adds unit tests for RSA signing with PKCS1 block type 1. It also
adds a reference implementation. This is part of OEMCrypto v9.
Change-Id: I2a40dbff65f6e09d75f16ae048499512f60c168d
From Widevine CL:
https://widevine-internal-review.googlesource.com/#/c/9184/
This is some shim code that will load either an OEMCrypto
version 8 or version 9 library. This should allow us
to test and run stable devices until all OEM's have
updated to version 9.
Android Level 3 library versions are:
level3/mips/libwvlevel3.a Level3 Library Feb 27 2014 18:18:34
level3/x86/libwvlevel3.a Level3 Library Feb 27 2014 18:22:14
level3/arm/libwvlevel3.a Level3 Library Feb 27 2014 12:31:29
Change-Id: I82911e3b4d9056cf3c3ab2b47194fe81ac2776d9
This CL contains working versions of the haystack tools and the
OEMCrypto Level 3 library for android ARM, MIPS and x86.
The version number of the level 3 library is:
android/level3/arm/libwvlevel3.a Level3 Library Nov 4 2013 18:39:06
android/level3/mips/libwvlevel3.a Level3 Library Nov 4 2013 18:42:29
android/level3/x86/libwvlevel3.a Level3 Library Nov 4 2013 18:41:07
bug: 9374954 MediaDrm haystack based L3 code hardening implementation.
Change-Id: Ifef13900a11e83e4257723d3c6fc7107550882a8
Merge of change https://widevine-internal-review.googlesource.com/7950.
In the OEMCrypto library, it is valid to call LoadKeys with an empty
mac key. The library should not update the mac and enc keys and
should not throw an error.
Since we have seen this behavior in several implementations, a unit
test should be added that verifies the correct behavior.
bug: 11032674
Change-Id: I011ba39c8abc47547226a722143e92dac3f63dc5
Swallows the error NEED_KEY if it comes back from AddKey(), as this
is expected behavior. (It means privacy mode is on and the key that
was just added was the privacy certificate, ergo the real decryption
key is still absent.) Note that this carefully does not squelch the
notification that comes from NEED_KEY, which is still necessary in
order for the app to make a second key request.
Also streamlines a test case that I noticed was overcomplicated for
what it did while poaching code from it for new test cases.
Also removes a .gyp file that was erroneously being copied to the
Android tree. Android does not use GYP.
Bug: 10495563
Change-Id: Ife3ff0270a0d09dac1b0eb0d84bddffd811e1eef
In order to run all disabled OEMCrypto unit tests with one gtest
filter, one of them needs to be renamed so it matches the others.
These tests are disabled by default because they install a test
keybox, which would be dangerous on a production device.
Merged from CDM change
https://widevine-internal-review.googlesource.com/7440
bug: 10508973
Change-Id: I9508b133c6500ec28ce8890a4af89f016344b842
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
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
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
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
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
There is an OEMCrypto wrapper that loads the OEM provided library.
For debugging and initial implementation, this only verified that some
of the API existed before continuing.
With this CL, the level 1 library is not used if any of the API
functions are missing, or if the version number is not correct. There
is no plan to make this library backwards compatible.
bug: 8621521
Merge of https://widevine-internal-review.googlesource.com/#/c/5264/
from the Widevine CDM repo.
Change-Id: Ie82907925450b9fe93d0d857c1133f5382f55d21
The test for refresh keys with a stale nonce was not performed
correctly. It was supposed to test that RefreshKeys fails when the
nonce is stale. However, the nonce in the test was not stale. The reference
implementation did fail, but it failed because the control bits were
in network byte order instead of host byte order. Both of these
problems are fixed in this CL.
This CL changes test code only. The change has already been
communicated with Qualcomm.
bug: 8621521
Merge of https://widevine-internal-review.googlesource.com/#/c/5263/
from Widevine CDM repo.
Change-Id: I0821eff914d1680481006b9b68d49e8f2c5b9cd8
Upgrade to version 2.1 of license protocol in OEMCrypto.
related-to-bug: 8621521
Merge of https://widevine-internal-review.googlesource.com/#/c/4952/
from Widevine CDM repository to android repository.
Change-Id: I0d85dae1981b7525ab17aec5f21cf668d078bf47
bug: 8601053
This import syncs to the widevine git repository change
commit 6a99ad1b59ad39495f62954b3065ddc22b78da49
It includes the following changes from the widevine git
repository, which complete the jb-mr2 features
Fix Unit Test Makefile
Adds support for device certificate provisioning.
Support application parameters
Certificate based licensing
Proto for client files
Implement Property Query API
Add Device Query For Unique ID
Implement Generic Crypto in DrmEngine
Do not validate Key IDs on clear playback
Allow OEMCrypto_DecryptCTR with clear content and no key
Add a case to the MediaDrm API test to repro b/8594163
Implement requiresSecureDecoderComponent
Implement Eventing API
Add end-to-end decryption test with vectors
Refactoring of properties class
Refactor OEMCrypto unittest.
Fix for b/8567853: License renewal doesn't renew license.
Add KEY_ERROR callback to WvContentDecryptionModule() ctor.
Merged certificate_provisioning.proto and
client_identification.proto to license_protocol.proto.
Fix nonce check failure after a malformed key in OEC Mock.
asynchronize decryption
Allow querying of control information
make debugging AddKey & Decrypt statuses easier
Revert "Revert "Send KEY_ERROR event to app on license
expiration or failure""
Revert "Send KEY_ERROR event to app on license expiration
or failure"
Send KEY_ERROR event to app on license expiration or failure
remove extra session id copy
use KeyError constants directly
replace variable-length arrays with std::vector and fixed-sized array
pass session ids as const references
refactor key extraction and update keys on renewal
Updates to enable renewals and signaling license expiration.
fix error constant in OEMCrypto_DecryptCTR
Change-Id: I5f7236c7bdff1d5ece6115fd2893f8a1e1e07c50
This change incorporates the following CLs from the Widevine
cdm repository:
Update the java request/response test app to match Drm API changes
Don't build the mock liboemcrypto.so by default
Do not build CDM tests by default
Fix Build Break in DrmEngine Unit Tests
Fix Build Break in WVDrmPlugin
Initial version of roadmap for CDM projects.
Implement License Query
Implement Generic DRM in OEMCrypto Reference Implementation
Add key_data_length field when calling OEMCrypto_LoadKeys
Policy engine unittests
Generalized DRM API for OEMCrypto
Fixes proto buf libraries build.
Add Version Number to OEMCrypto API
Test key control block duration field in OEMCrypto
Add fix for missing crypto offset.
Fixed android/media*/test builds and added proto files for Cert. provisioning
Refactor and clean up callback code in CDM.
Add "device_id" name-value pair to LicenseRequest::ClientIdentification
Separate unit and end-to-end tests from the top level makefie.
Includes changes for 'fall back to l3 oemcrypto lib' in top level makefile.
Fall Back to Level 3 if Level 1 Fails
Fix compilation error in wvcdm_unittest.
Fix Android build break due to Decrypt() signature change in cdm_engine.h.
Wire up callbacks and errors in the Steel proxy.
Fix lock assert if there is no keybox on the device.
RSA Certificate Unit Test
Change Generic_Verify signature to constant.
Change-Id: I2e42db9d0b4f8d4e833675ae81d0714509bbfd2c
Builds libwvmdrmengine.so, which is loaded by the new
MediaDrm APIs to support playback of Widevine/CENC
protected content.
Change-Id: I6f57dd37083dfd96c402cb9dd137c7d74edc8f1c
In order to match the other implementations of CDM, we are going
to replace the android OEMCrypto mockup with the one in the cdm
repository.
This would be disruptive to the clear key library because it
relies on the current implementation of the mockup. In order to
prevent that, I am moving the current mockup into the same directory
as the clear key library. Then, we can put the new mockup under
the directory libwvdrmengine.
This mockup will then be deleted when the clear key library is deleted.
Change-Id: I89ee23f249dacd18241ae5ca499329e620bf5a2c
This is a software only implementation of the OEMCrypto library for
testing the rest of the DRM code. It currently implements the
OEMCrypto_DecrtyptCTR function using a clear key.
I've included the license request code so the rest of the group can
play with it, but I have only tested part of it.
This patch also has some makefiles and an integration testing. You
should be able to generate the shared library libclearkeydrmengine.so with
cd vendor/widevine/libclearkeydrmengine; mm
You can create some unit test and integration test programs from the
directories:
vendor/widevine/libwvdrmengine/oemcrypto/test
vendor/widevine/libclearkeydrmengine/test
vendor/widevine/libclearkeydrmengine/inttest
vendor/widevine/libclearkeydrmengine/crypto/test
This change also addresses some comments about comments in OEMCryptoDASH.h
which were made in https://googleplex-android-review.googlesource.com/257323
Change-Id: Id6899b9f8d2f09e09be2ea493baa83a6b929073b
I added a few error codes for out-of-resource type conditions.
I added comments explain which functions may be called simultaneously.
Basically, info only functions, like getDeviceId, may be called anytime after
initialization. Functions that have a session parameter may be called at the
same time as other functions for a different session, but not for the same session.
Functions that create or delete sessions may not be called as the same time as any
each other, or at the same time as any session functions. The CDM is required to
honor these conventions.
If the OEM can only decrypt for one session at a time, it is the OEM's
responsibility to hold a lock.
Change-Id: If4b11afd70b5b2e67d78802ea0057fb25271ae90
The file OEMCrypto.h was renamed to OEMCryptoDASH.h and all
functions that are only needed for legacy support were removed.
Change-Id: I3a7a6f8cbb3ee415b4a313416a25ed78785ecdd7
I added a Mock OEMCrypto implementation with stubs only.
I corrected the "extern C" location in OEMCrypto.h. (Thanks, Jerry!)
I added some Android.mk files that allows us to compile and
run a few simple unit tests.
Unit Test 1: The library compiles. (passes)
Unit Test 2: The test program links and runs. (passes)
Change-Id: Ib4c9554553de49645b5841b0bae889728cbfc8b1