Commit Graph

114 Commits

Author SHA1 Message Date
John W. Bruce
0b47bd6a50 Increase size of BCC buffer in OEC tests
We are receiving reports from partners in the field that they are
failing the OEMCrypto tests only because the tests assume the BCC will
fit into 5k of memory but their BCC is nearly 8k in size.

This patch increases the buffer to 10k.

Bug: 354834629
Test: x86-64
Merged from https://widevine-internal-review.googlesource.com/204773

Change-Id: I360196518b7651139c003505253d1aed6a0c3907
2024-08-21 05:12:51 +00:00
Cong Lin
c33960cb7c Fix default cipher mode for CAS unit test
[ Merge of http://go/wvgerrit/194571 ]

Default to OEMCrypto_CipherMode_CBC instead of OEMCrypto_CipherMode_CENC
which is not used by CAS.

Test: CAS unit tests
Bug: 325639114
Bug: 322928572
Merged from https://widevine-internal-review.googlesource.com/193650

Change-Id: I8876d5262643015fb6a322eae6444ef4001d146d
2024-04-16 10:25:38 -07:00
Fred Gylys-Colwell
34ac11b187 Document OEMCrypto_LoadProvisioningCast
Bug: 314222872
Change-Id: I05031d1eacefceb73931b979ef69e69fdba871a7
2024-02-22 15:16:09 -08:00
Vicky Min
d5157c536d OEMCrypto unit tests for license release
Bug: 295956275
Change-Id: I3c8fc5fcadeae051cc734a64378e473492437c34
2024-02-22 15:10:08 -08:00
Jacob Trimble
4b32cb4b10 Implement license protocol 2.2 for OEMCrypto v19
This updates the code and tests to allow for using license protocol 2.2
when using OEMCrypto v19.

Issue: 80428549
Issue: 121031064
Issue: 232464183
Change-Id: Ib6bb61f86dd310b566227462658530bca5940b88
2024-02-22 14:31:54 -08:00
Jacob Trimble
488a4647db Merge OEMCrypto KDF and usage functions
Since KDF functions are only used right before specific functions, this
merges them to simplify internal state within OEMCrypto.

Fixes: 299527712
Change-Id: I426cfcdc102bd73cf65cd809b213da2474f44b34
2024-02-22 14:24:35 -08:00
Robert Shih
7abdd4d0ae Misc formatting fix
Bug: 323289757
Test: TreeHugger
Change-Id: I26ec60855bf19a3ef87ca7bc86f3cb024e393c2b
2024-02-01 13:40:52 -08:00
Ian Benz
35cf9c2f99 Fix OEMCrypto test issues identified by Coverity
Change-Id: Ic9f4982bf022292d10a0a88f10648a46077ec0cf
2024-02-01 13:40:51 -08:00
Matt Feddersen
0dbc42f10e CAS demo app
Adds a new `cas` directory to the ports/linux project. This contains
an end-to-end demo of OEMCrypto CAS functionality, using the Linux
tee_simulator as a base.

Test: from ports/linux/cas dir: `CDM_DIR=~/work/cdm-dupe ./scripts/build.sh && CDM_DIR=~/work/cdm-dupe ./scripts/run.sh`

Merged from https://widevine-internal-review.googlesource.com/178250

Change-Id: I781b403100ad2e069d99650d9ddae8e7acbc309a
2024-02-01 13:40:50 -08:00
Vicky Min
678b3332db Allow ODKs to be tested against older versions for Qualcomm
Bug: 276889732
Merged from https://widevine-internal-review.googlesource.com/179801
(cherry picked from commit af81eefde596cf1644e5451b03230c77cfde410b)

Change-Id: I7a99d3c3104f16898258785d17a9b9b7a2f53ad1
2024-02-01 13:40:50 -08:00
Cong Lin
9d97c2bf60 Implement OEMCrypto_LoadCasECMKeys() with TODO WTPIs
Add function body of OEMCrypto_LoadCasECMKeys() with a few TODOs. At the
end, Cas content keys and IVs shall be installed to key slot by WTPIs,
which will be declared in the next CL.

Test: opk_ta
Bug: 241146324
Merged from https://widevine-internal-review.googlesource.com/169378

Merged from https://widevine-internal-review.googlesource.com/178139

Change-Id: Idf3930ec916e95012067741e46254018fc6e4381
2024-02-01 13:40:50 -08:00
Matt Feddersen
4fa979b43d Fix CastReceiver unit tests
Test: opk_ta, opk_ta_p40
Bug: 259454969

Merged from https://widevine-internal-review.googlesource.com/175370

Change-Id: I6cefe7fb85db539ecb066498b51525a04b8bbd51
2024-02-01 13:40:50 -08:00
Matt Feddersen
27421a9161 Add OEMCrypto tests for Cast prov 4 flow
Expected flow, which begins with a device that has already been
provisioned with Prov 4 stage 1:
1. OEMCrypto_InstallOEMPrivateKey()
2. OEMCrypto_GenerateCertificateKeyPair() -> wrapped_csr_priv
3. OEMCrypto_LoadDRMPrivateKey(wrapped_csr_priv)
4. OEMCrypto_PrepAndSignProvisioningRequest() to create a Prov 4
   provisioning request message type with a CAST request in the
   message body
5. Server sends a Prov 2 response. Server side derivation uses CSR keys
   to derive session key, mac keys, and encryption keys.
6. OEMCrypto_DeriveKeysFromSessionKey(), same derivation as server side
7. OEMCrypto_LoadProvisioning(), use derived keys to verify + decrypt

The OEMCrypto_LoadDRMPrivateKey() step can happen before or after the
PrepAndSignProvisioningRequest() call.

Test: tests fail
Bug: 259452440

Merged from https://widevine-internal-review.googlesource.com/172310

Change-Id: Id5e6737b187339ec93e3d0d03c28e2b379d60747
2024-02-01 13:40:50 -08:00
Ian Benz
b9d857649e Add clang-tidy support for the OPK Linux port
Bug: 256230932
Change-Id: I4f46e285376101ff129c1fca5c80a259c70cc0c7
2024-02-01 13:40:49 -08:00
Fred Gylys-Colwell
981c7e97d9 Replace reference to SelectKey with GetKeyHandle in docs
Bug: 300514029
Merged from https://widevine-internal-review.googlesource.com/187930

Change-Id: I3134f9d12692dbd2916c576a872c79c87ad192fe
2024-01-30 16:09:41 -08:00
Robert Shih
cc8f885e2b Merge oemcrypto fuzz tests into Android main
Change-Id: If7fb815fa6193ddfe9a94e925356cc177ae3bacc
2024-01-30 16:03:00 -08:00
Vicky Min
ff80927f90 Allow server to send license with larger ODK_MAX_NUM_KEYS
PiperOrigin-RevId: 538676411
Merged from https://widevine-internal-review.googlesource.com/175915

Change-Id: Iadef2115fe3f9001034223e647cbfa6228484281
2024-01-29 12:31:03 -08:00
Ian Benz
5c5433a8d8 Update OEMCrypto_LoadLicense corpus for ODK_Packing_ParsedLicense
- Regenerate corpus files.
- Change nonce endianness.

Merged from https://widevine-internal-review.googlesource.com/177010

Change-Id: I5f288a054325097d6ea696cd755fc0557d0eadd1
2024-01-26 16:20:39 -08:00
Vicky Min
28e68a866b Fix crash in wvoec::LicenseRoundTrip::InjectFuzzedResponseData
After the ODK_MAX_NUM_KEYS change, the core response is a pointer to an
array instead of an array. This check should ensure the index of the key
array can always be accessed.

Bug: 286531859
Change-Id: I44604eb977be722ef692de2b61e1f626266a42a7
2024-01-26 16:18:40 -08:00
Cong Lin
e8add8eed8 Sync oemcrypto files from cdm udc-dev to Android
Changes included in this CL:

166806: Update OEMCrypto_GetDeviceInformation() | https://widevine-internal-review.googlesource.com/c/cdm/+/166806
166808: Update Android L3 after OEMCrypto_GetDeviceInformation() signature changes | https://widevine-internal-review.googlesource.com/c/cdm/+/166808
166809: Decode device info and write it to CSR payload | https://widevine-internal-review.googlesource.com/c/cdm/+/166809
167158: Fix Android include path and copy_files | https://widevine-internal-review.googlesource.com/c/cdm/+/167158
167159: Fix common typos and use inclusive language suggested by Android linter | https://widevine-internal-review.googlesource.com/c/cdm/+/167159

165618: Explicitly state python3 where needed. | https://widevine-internal-review.googlesource.com/c/cdm/+/165618

166757: Update Android.bp for Android | https://widevine-internal-review.googlesource.com/c/cdm/+/166757
164993: Refactor basic oemcrypto unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/164993
164978: Update OEMCrypto Unit Test Docs | https://widevine-internal-review.googlesource.com/c/cdm/+/164978
166941: Update make files for OEMCrypto | https://widevine-internal-review.googlesource.com/c/cdm/+/166941

165279: Refactor license unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165279
165318: Refactor provisioning unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165318
164800: Add extra check for renew on license load unit test | https://widevine-internal-review.googlesource.com/c/cdm/+/164800
165860: Remove duplicate definition of MaybeHex() | https://widevine-internal-review.googlesource.com/c/cdm/+/165860

164889: Updated CoreCommonRequestFromMessage and fix test | https://widevine-internal-review.googlesource.com/c/cdm/+/164889
164967: Add OPK pre-hook and post-hook error codes | https://widevine-internal-review.googlesource.com/c/cdm/+/164967
165140: Add hidden device_id_length to v18 provisioning message | https://widevine-internal-review.googlesource.com/c/cdm/+/165140
165204: Fix memory leak in oemcrypto test | https://widevine-internal-review.googlesource.com/c/cdm/+/165204

165958: Fix oemcrypto_generic_verify_fuzz mutator signature offset | https://widevine-internal-review.googlesource.com/c/cdm/+/165958

166037: Support SHA-256 in OEMCrypto Session Util | https://widevine-internal-review.googlesource.com/c/cdm/+/166037

Test: Run GtsMediaTests on Pixel 7
Bug: 270612144

Change-Id: Iff0820a2de7d043a820470a130af65b0dcadb759
2023-02-28 11:21:05 -08:00
Kyle Zhang
11255b7426 Pick widevine oemcrypto-v18 change
No-Typo-Check: From a third party header file
Bug: 260918793
Test: unit tests
Test: atp v2/widevine-eng/drm_compliance
Change-Id: I36effd6a10a99bdb2399ab1f4a0fad026d607c70
2022-12-21 00:03:50 +00:00
Kyle Zhang
af0168dbed Merge cdm changes to android repo
Bug: 251924225
Test: GtsMediaTestCases
Change-Id: I1b4e64c0abf701fe1f5017f14dc72b72c3ea6770
2022-10-11 00:40:42 +00:00
Alex Dale
d874fffaec Support 32 bytes session key
[ Merge of http://go/wvgerrit/149849 ]

With ECC based DRM cert, the session key is expected to be 32, as
compared to 16 bytes in RSA case. This CL adds supports for 32 bytes
session key.

Bug: 236317198
Test: oemcrypto_test
Change-Id: I657fdd92d17736a23375ddcd457f83efa6ca6d1f
2022-06-23 14:48:19 -07:00
Alex Dale
9b04109b60 Merge "Updated OEMCrypto tests to use DRM key objects." 2022-06-21 20:52:08 +00:00
Cong Lin
8c4c238324 Add unit test for clear KCB in LS SDK 16.4 response
This is a merge from:
https://widevine-internal-review.googlesource.com/c/cdm/+/152897
and http://go/wvgerrit/153709

Adding a new OEMCrypto unit test will allow partners to correct a
problem earlier in their integration.

Verifies current oemcrypto implementation handles clear KCB in a
mocked 16.4 license response.

Unit test release date updated to 2022-06-17.

Test: run_x86_64_tests; opk_ta
Bug: 235870170
Bug: 234645065
Change-Id: I59fef2c25f5c007624447d4f46147d96adeddad9
2022-06-17 15:02:09 -07:00
Alex Dale
bfa2d782bd Updated OEMCrypto tests to use DRM key objects.
[ Merge of http://go/wvgerrit/147275 ]

Swapped out use of OpenSSL/BoringSSL RSA and EC_KEY to use OEMCrypto
reference utility classes RsaPublicKey/EccPublicKey.  This enables
further test development with ECC keys, and removes duplicate OpenSSL/
BoringSSL code.

For Android makefiles, only the minimally required files have been
added.

Bug: 205902021
Bug: 236317198
Test: run_prov30_test run_prov40_test oemcrypto_test
Change-Id: I64491018e8ffb69bf986083e3aae446eb9e5cf39
2022-06-16 21:13:22 -07:00
Alex Dale
1069ae39cc Resize OEMCrypto buffer-based results on success.
[ Merge of http://go/wvgerrit/151191 ]

Within the CDM and OEMCrypto tests, there were a few OEMCrypto function
calls where the final size of the output buffers were not being
resized.  For several of these functions, an initial call is made with
zero-length output buffers, expecting OEMCrypto to return
ERROR_SHORT_BUFFER; followed by a call with buffers at least as large
as specified by OEMCrypto.  However, for some operations, OEMCrypto
makes an estimate on the final size on the first call, specifying the
exact size only after performing the operations.

This is the case for the wrapped key returned by
OEMCrypto_LoadProvisioning().  The provisioning response contains a
padded + encrypted DRM key.  OEMCrypto does not know the actual size
of the key until decrypted, and the actual DRM key might be smaller.

There was a OEMCrypto test for OEMCrypto_BuildInformation() which
was enforcing the wrong behaviour.  This has been updated.

Bug: 230661565
Test: oemcrypto_test
Change-Id: Iad297d56ffbb085894641fdf8698ce5fd18edbf2
2022-05-04 21:32:08 -07:00
Rahul Frias
a6a99c416f Free EC key in test session destructor
[ Merged from http://go/wvgerrit/148030 ]

Bug: 224375138
Test: GtsMediaDrmTests
Change-Id: Ic1d42756cb1a03fa52d90c5fb0bd496e87a43c65
2022-03-21 14:37:58 -07:00
Rahul Frias
139310fd05 Fix key_control_iv in OEMCrypto tests
[ Merge of http://go/wvgerrit/145989 ]

The key_control_iv field is used with an encrypted KCB.  With v17, the
KCB is in the clear and this field should have a length of 0.  This
updates the tests to set the field correctly.

Bug: 224375138
Test: GtsMediaTestCases on sunfish
Change-Id: I2973bc064705557c878bb1fe943e5fde92977dcc
2022-03-16 01:37:32 -07:00
Kyle Zhang
642965c678 Merge latest oemcrypto-v17 change
No-Typo-Check: Not related to this change.

Bug: 161477208
Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
2022-01-27 20:07:15 -08:00
John "Juce" Bruce
df23c7da03 Fix errors being hidden by Protobuf warning-disabling
(This is a merge of http://go/wvgerrit/140850.)

This patch fixes a number of minor issues in the codebase (mostly
instances of 0-as-nullptr, but also some member shadowing and a missing
override) that were being hidden by the fact that depending on Protobuf
disables these diagnostics. And which will be unhidden when a later
patch removes that behavior from Protobuf.

Bug: 208304830
Test: x86-64
Change-Id: I4b0b1264748880b3726a6388d589868d898f949e
2022-01-21 01:49:40 +00:00
John W. Bruce
f2457565c0 Output BoringSSL errors in OEMCrypto test to stderr
(This is a merge of http://go/wvgerrit/135033 from the Widevine repo.)

Previously, errors from BoringSSL in OEMCrypto were printed to stdout.
This patch moves them to stderr.

Bug: 202752544
Test: OEMCrypto unit tests
Change-Id: Ifad3e4db40e796e0320863e5a58882822e657a31
2021-10-11 12:23:52 -07:00
John W. Bruce
68187b9f02 Fix -Wshorten-64-to-32 errors in BoringSSL interactions
(This is a merge from the Widevine Repo of http://go/wvgerrit/134310.)

This patch fixes code that would trigger -Wshorten-64-to-32 by
implicitly narrowing a variable from 64 to 32 bits. Most of the time, it
does this by making the implicit conversion explicit. The cause of most
of these is that OpenSSL uses "int" for the length of things rather than
size_t. (While BoringSSL sometimes uses int and sometimes uses size_t.)

One exception is LogBoringSSLError(). We have a couple copies of this
function around, and they varied slightly. This patch brings them all
in-line, which conveniently also removes any code in them that would
deal with integer variables.

GetRandBytes() now takes a size_t and downcasts to BoringSSL's native
int internally, so that callers can pass in a size_t value as they would
expect.

There's also an interesting case in oec_session_util.cpp. Because
BoringSSL and OpenSSL disagree about the width of an error code, we have
to use the "auto" type for a temporary variable that holds an error, in
order to retain compatibility with both.

Bug: 194971260
Test: x86-64
Test: x86-64-openssl
Change-Id: I88bc62b4cda396f8a1eabd1a3cb7d1b03f47a33f
2021-09-27 18:17:04 -07:00
John W. Bruce
d742daf9c7 Validate decryption with entitled keys in OEC tests
(This change is merged from http://go/wvgerrit/124825)

The OEMCrypto tests have tests that verify that entitled keys can be
loaded but not that they can be successfully used for decrypt. This
patch adds a decrypt portion to the existing tests.

As part of this, the existing Session::EncryptCTR() method and portions
of Session::TestDecryptCTR() are lifted to be static functions so they
can be shared across unrelated classes in oec_session_util.cpp.
EncryptCTR() had no dependence on its enclosing class and is unchanged
other than being moved outside the class.

To reduce ambiguity with the new decrypt verification, this patch also
renames EntitledMessage::VerifyEntitlementTestKeys() to the
more-specific EntitledMessage::VerifyKCBs(). Its behavior is unchanged.

Bug: 186782279
Test: x86-64 platform
Test: opk_ta platform
Test: build_and_run_all_unit_tests
Change-Id: I15156882907b0987215087aaf43b4666fedc171a
2021-05-11 12:52:24 -07:00
John W. Bruce
ed17d09c1b Remove asserts from GenerateSimpleSampleDescription()
(This change is merged from http://go/wvgerrit/124824)

GenerateSimpleSampleDescription() only had asserts to check parameters
that only came from other test code, so they weren't testing anything of
use. With the asserts removed, it's no longer necessary to wrap calls to
GenerateSimpleSampleDescription() with ASSERT_NO_FATAL_FAILURE(), which
a lot of callers were already forgetting to do anyway. This also
simplifies a future patch that will generalize the decryption test code
to work with entitlement licenses.

Bug: 186782279
Test: x86-64 platform
Test: build_and_run_all_unit_tests
Change-Id: I987427fdfee4826d77ab95344f9aca8c374b2001
2021-05-11 12:49:22 -07:00
Fred Gylys-Colwell
e51c9fbbb8 Update license comment
Merge from Widevine repo of http://go/wvgerrit/121950

Remove term "Master" from "Widevine Master License Agreement".

Bug: 168562298
Change-Id: I655babf1bc447f4872f6a0f849107262be42df7a
2021-04-12 14:10:08 -07:00
Fred Gylys-Colwell
ef65e86ee2 Modify OEMCrypto unit tests to allow 16.3 or 16.4
Merge from Widevine repo of http://go/wvgerrit/121790

Some unit tests expected OEMCrypto to be the latest ODK version,
but we do not require this for v16.

Bug: 184905579
Change-Id: Iccdbcc0b28587aad79a2a63d8c39a564a47fb585
2021-04-12 14:00:53 -07:00
Fred Gylys-Colwell
6628c7f693 Update OEMCrypto test comments and logs
Merge from Widevine repo of http://go/wvgerrit/121886

This CL merges some changes from branch rvc-dev to sc-dev
that prepared it for merge.

One change is that the unit tests now say they are part of
Android S instead of R.

Bug: 180546871
Change-Id: I2ebbd8f7b8586389ebb75f3743a2dc2ad8caa214
2021-04-12 14:00:53 -07:00
Bharath Chandra Elluru
6b548748b2 Merge oemcrypto buffer overflow tests from cdm
Widevine CLs:
http://go/wvgerrit/112243
http://go/wvgerrit/110563
http://go/wvgerrit/95483
http://go/wvgerrit/107047
http://go/wvgerrit/111123
http://go/wvgerrit/106224
http://go/wvgerrit/106263
http://go/wvgerrit/106223
http://go/wvgerrit/104223
http://go/wvgerrit/108583
http://go/wvgerrit/111403
http://go/wvgerrit/111623
http://go/wvgerrit/106264
http://go/wvgerrit/110483
http://go/wvgerrit/111944
http://go/wvgerrit/108684
http://go/wvgerrit/104183
http://go/wvgerrit/111443
http://go/wvgerrit/111869
http://go/wvgerrit/108843
http://go/wvgerrit/104363
http://go/wvgerrit/104423
http://go/wvgerrit/104263
http://go/wvgerrit/106584
http://go/wvgerrit/105924
http://go/wvgerrit/104524
http://go/wvgerrit/113023

Bug:175401639

Test: We would like to run these tests on pixel devices from master
branch using go/wv-and-dash

Change-Id: Ic4188504af64de9ce79941f75ac6feaf29189a4d
2021-01-11 22:13:16 +00:00
Fred Gylys-Colwell
20bb84ffee Merge recent doc changes for OEMCrypto
This is a cherry pick of recent changes to OEMCrypto and ODK. Most of
these are part of the document migration to doxygen.

See http://go/wvgerrit/106005 and its parents for code reviews.

Bug: 144715340
Bug: 148232693
Bug: 167580674
Change-Id: I658f99c8117b974faed97322d61fac0f382283af
2020-09-15 19:10:53 -07:00
Fred Gylys-Colwell
1106e2e913 Unit test for loading nonce-free offline license am: a615671f48 am: ed900f242b am: 32b318e7c4 am: 38d465b042
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/11677947

Change-Id: I63c865fd7574289061ffe929f2ed03a30c56eac0
2020-06-02 22:26:53 +00:00
Fred Gylys-Colwell
a615671f48 Unit test for loading nonce-free offline license
Merge from Widevine repo of http://go/wvgerrit/100964

The previous nonce-free test used the same session to generate the
request as to load the license. However, it is a realistic use case to
have a new session used for loading the license.

The use case relates to a pre-loaded, shared license.

Test: Ran unit tests on taimen and on v16 ref implementation
Bug: 156853321
Change-Id: Ibc07744a16edcd3952d88d73660a75d0c3e8eeb8
2020-06-02 08:30:34 -07:00
John Bruce
265ba61b5c Merge "OEMCrypto Unit Test Fix: Do Not Derive Keys Immediately" into rvc-dev am: 729723b3d2 am: b349680d3f am: 00792ac231 am: 1c7dab441a
Change-Id: I1bada2a5657eb38a8271d2da2199b145a8966d6c
2020-05-30 00:32:39 +00:00
John W. Bruce
b8e13cec2d OEMCrypto Unit Test Fix: Do Not Derive Keys Immediately
(This is a merge of http://go/wvgerrit/100053.)

The OEMCrypto Unit Tests were previously deriving keys from the session
key as part of loading the test RSA key. This creates an invalid
function call order, since the OEMCrypto session will likely next be
used for actions that need to be done *before* deriving these keys. With
ODKiTEE, which is more strict about this order, all OEMCrypto tests were
failing.

Bug: 156655072
Test: OEMCrypto Unit Tests
Change-Id: Ibfede587da30cfff4a44a5e0687e4199b1430372
2020-05-27 01:19:48 +00:00
Fred Gylys-Colwell
cd4d4f564a Update TimeRollbackPrevention unit test am: 75575418d0 am: 7cd14be01d am: 51cf7e4668 am: 40e2e7fa08
Change-Id: I21b29668ed8a9b39e8a7679ed65281d14587bba3
2020-05-21 23:05:32 +00:00
Fred Gylys-Colwell
75575418d0 Update TimeRollbackPrevention unit test
Merge from Widevine repo of http://go/wvgerrit/100110

The unit test TimeRollbackPrevention was broken for several
reasons. This CL reduces the test to its most basic functionality and
updates it to be compatible with a v16 oemcrypto.

This CL also adjusts the fake clock used by the buildbot to fake
sleeping backwards, so that the TimeRollbackPrevention test can also
be run on the buildbot.

Bug: 155773482
Bug: 79422351
Test: unit tests on buildbot, and on flame w/v16 modmock
Change-Id: I3027018b17b738281989e63ae6b0729757217d05
2020-05-20 13:47:28 -07:00
Fred Gylys-Colwell
efb0452042 Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey am: 56b836bda3 am: bb42e9bd41 am: 6b56c1c5ec am: b3657d0a6e
Change-Id: I0dc2f37ce34771592cdd0af4ce905a896a88fccd
2020-03-29 20:13:22 +00:00
Fred Gylys-Colwell
56b836bda3 Replace OEMCrypto_LoadDeviceRSAKey with OEMCrypto_LoadDRMPrivateKey
Merge from Widevine repo of http://go/wvgerrit/96783

This CL updates the reference code, unit tests, and adapter to use the
new v16 function OEMCrypto_LoadDRMPrivateKey. This is just an API
change to allow ECC support in the future. The reference code does not
yet support ECC certificates, and the CDM code assumes that all
certificates have an RSA key.

Bug: 152558018
Test: unit tests on taimen and w/v16 mod mock.
Change-Id: I0793b416513b81b3d74849f0b58dbdc91f075ac6
2020-03-29 10:43:54 -07:00
Fred Gylys-Colwell
9265752bce Add unit test for preloaded license am: ca404aae6f am: ab82b4b78f am: d8ea3672c4 am: 3cdcf12c20
Change-Id: I0ed6e8f8d26afa3e7eb9e81fcc06e480ff958803
2020-03-27 20:01:37 +00:00
Fred Gylys-Colwell
ca404aae6f Add unit test for preloaded license
Merge from Widevine repo of http://go/wvgerrit/96508

This adds a unit test for to verify that a preloaded license may be
loaded into OEMCrypto. A preloaded license is a license that does not
have a nonce, and for which there is no license request. This is used
in CAS and ATSC.

I also updated the test version string to
OEMCrypto unit tests for API 16.2. Tests last updated 2020-03-27

Bug: 144105097
Test: ran oemcrypto unit tests on taimen and with v16 modmock.
Change-Id: I6a4926917f36a084d15defa7b908d067612c4dcf
2020-03-26 15:38:38 -07:00