Commit Graph

262 Commits

Author SHA1 Message Date
Alex Dale
d859c1ab17 Use new Base64 encode functions.
[ Merge of http://go/wvgerrit/119806 ]

This change replaces all calls for base64 encoding which first converts
a string to a vector.  The new base64 encoding function allow for
encoding binary data contained within strings.

Bug: 181732604
Test: Android unittests
Change-Id: Ibfe79dba99e6a2ee2f2a96e85b62fbd22519aea7
2021-03-23 14:49:58 -07:00
Rahul Frias
b21be96b1b Verify DRM certificate validity
[ Merge of http://go/wvgerrit/120123 ]

DRM certificate creation and expiration times are now validated.

* New DRM (default) certificates will have an expiration time specified
by the provisioning service.

When stored, the client will include the time the certificate was
received. This allows for expiration calculation to occur when client
and provisioning service clocks are out of sync.

When read out, creation, expiration and acquisition times are
validated. The certificate is checked for expiry by making sure
that the time at the client since the license was acquired is not
greater than the expiration period. The time information stored at the
client may be tampered with. The license service will perform an
expiration check and reject the license request if tampered with.
The expiration time may be set to never expires/unlimited. This is not
a valid value for creation or acquisition time.

* Pre-existing (legacy) certificates from upgrading devices will not
have an expiration time set by the provisioning service. Instead
the client will calculate an expiration time 6 months with + or -
a random two month period in the future. This is stored along with the
certificate.

When read out, if no expiration time has been set by the client, one
will be calculated and written out. The certificate will be declared as
valid. If a client calculated expiration time is present, the
certificate will be validated. In case of tampering, the license service
can reject license requests and force reprovisioning when appropriate.

* ATSC certificates will continue to not have an expiration time.
No additional validation is required.

Other changes for non-ATSC licenses involve managing both default and
legacy certificate co-existance. When checking for DRM certificates,
the default certificate is attempted first. This is followed by a check
for the legacy certificate, if the default certificate is not present.

Bug: 169740403
Test: WV unit/integration tests
      DeviceFilesTest.StoreCertificateInvalidParams
      DeviceFilesTest.RetrieveAtscCertificate
      DeviceFilesTest.RetrieveAtscCertificateNotFound
      DeviceFilesTest.RetrieveCertificateInvalidParams
      DeviceFilesTest.RetrieveLegacyCertificateWithoutExpirationTime
      DeviceFilesTest.RetrieveLegacyCertificateWithClientExpirationTime
      DeviceFilesTest.RetrieveLegacyExpiredCertificateByClientExpirationTime
      DeviceFilesTest.RetrieveLegacyCertificateInvalidClientExpirationTime
      DeviceFilesTest.RetrieveCertificateWithoutKeyType
      DeviceFilesTest.RetrieveDefaultCertificate
      DeviceFilesTest.RetrieveDefaultCertificateNeverExpires
      DeviceFilesTest.HasCertificateAtsc
      DeviceFilesTest.HasCertificateDefault
      DeviceFilesTest.HasCertificateLegacy
      DeviceFilesTest.HasCertificateNone
      CertificateTest.StoreCertificateTest.DefaultAndLegacy/*
      CertificateTest.RetrieveLegacyCertificateTest.ErrorScenarios/*
      CertificateTest.RetrieveDefaultCertificateTest.ErrorScenarios/*

Change-Id: I7dbec7555fbd493c1ec61c6bb5d9428a2405b1fd
2021-03-19 02:49:20 -07:00
Rahul Frias
9a350eddbd Extract creation and expiration times from DRM cert
[ Merge of http://go/wvgerrit/119843 ]

Creation and expiration times are extracted from the device DRM
certificate. They are reported as
 * -1 if not set in the proto
 * 0 if unlimited
 * positive number otherwise

Bug: 169740403
Test: WV unit, integraiton tests
Change-Id: I9463954dfeb82b6a88ff5d608ed74d20f2424e83
2021-03-18 23:59:21 -07:00
Rahul Frias
094fabed5a Address compilation warnings
[ Merge of http://go/wvgerrit/119523 ]

Bug: 182299187
Test: compile vendor/widevine/libwvdrmengine
Change-Id: I39d1b62a3237bfb9163a7e157b871f22e3fec394
2021-03-10 18:49:57 -08:00
Rahul Frias
64d5b38ff5 Throw DeniedByServerException when provisioning detects a revoked device
[ Merge of http://go/wvgerrit/117267 ]

The client will now advertise the ability to handle provisioning errors
by a minor version updated to the provisioning protocol version.
The provisioning service may indicate that the individual device
is revoked or all devices with the same make/model have been revoked.

If the provisoning service has not been upgraded, the protocol version
field in the request will be ignored. The provisioning service/SDK
will respond with an HTTP 400 error to a provisioning request from
a revoked device.

Bug: 174174765
Test: WvCdmRequestLicenseTest.ProvisioningRevocationTest,
      WV unit/integration tests
Change-Id: I5ff61496685f310de6704a90452b8b76b3505cbb
2021-02-23 14:36:21 -08:00
Alex Dale
e15c0607c7 Enable the CDM to track the DRM private key type.
[ Merge of http://go/wvgerrit/110923 ]

The CDM is responsible for telling OEMCrypto the underlying DRM
private key type when loading it into a session.  To do this, the
CDM must determine and store the key type of a successfully loaded
provisioning response.  The type of key is available from the
DRM certificate proto that is provided in the reponse.

This change introduces a class to contain the wrapped key and
type together.  To store the type, the CDM device files have been
updated to include a key type with the DRM certificate and to
store from and load to the new class.

Unittests have been updated for using the new class where the
wrapped key was used before.

Test: Linux unit tests
Bug: 140813486
Change-Id: I09249afe9c291632fb651ecd00eac697d6939ec7
(cherry picked from commit 6c457402e944079271cef488aa4699f986da6a2e)
Merged-In: I09249afe9c291632fb651ecd00eac697d6939ec7
2021-02-18 23:10:39 +00:00
Rahul Frias
ec8bed38f4 Update Widevine Copyright header for android
[ Merge of http://go/wvgerrit/108084 ]

The Widevine License Agreement has been renamed to use inclusive
language. This covers files in the android directory.

Bug: 168562298
Test: verified compilation (comment only change)
Change-Id: I0f9e6445e0168ebe85425baeb81371e182e5a39c
2020-10-21 02:49:05 -07:00
Alex Dale
fb847c4704 Query analog output capabilities.
[ Merge of http://go/wvgerrit/107763 ]

This CL enables the ability to query the CDM for the analog output
capabilites of the device.  Due to the number of possibilities that
OEMCrypto can report, two queries are exposed:
- Output capabilities: None, Supported, CGMS-C, Unknown
- Can disable: True, False, Unknown

Bug: 168322023
Test: Android integration test
Change-Id: I8036a89237d698f170d2c1901c41d1d6b708c917
2020-10-15 17:46:13 -07:00
Alex Dale
f22cd20466 Enabled log formatting warnings.
[ Merge of http://go/wvgerrit/105025 ]

Clang and GCC allow for warnings against the arguments for printf-like
functions (e.i. LOGx).  These validate that the format type specified
in the format string match the corresponding argument type.

Most of the time, format specifer errors are benign; hence why they
haven't been seen as an error so far.  However, with the enabling of
specifier warnings and the enabling of warnings as errors on certain
platforms, these existing errors need to be addressed.

This CL enables format specifier warnings for most of the Widevine
code, with the OEMCrypto L3 implementation which has a single error
which requires a fix in the haystack code before being fixed in the
Widevine branch.

Strict format string warnings are not enabled for non-LP64 systems.

Bug: 137583127
Test: Compiled for Linux and Android
Change-Id: I051398332d31a20457b86563a90ad8f6d428445f
2020-09-08 15:46:15 -07:00
Rahul Frias
79eabb0989 Allow offline licenses to be loaded and restored in the same session
[ Merge of http://go/wvgerrit/103243 ]

Include review comments from wv gerrit CL.

Bug: 161551490
Test: WV unit integration tests, GtsMediaTestCases and
      WidevineConcurrentDrmCertificatesTest#testConcurrentDrmCertificates,
      MediaDrmTest#testMultipleLoadKeys on a redfin
Change-Id: Ie9b41a2e68b95692f9353578f6955637411d4dfc
2020-08-04 15:02:06 -07:00
Rahul Frias
c8cff5274c Allow offline licenses to be loaded and restored in the same session am: 3709a4f419 am: 693d58e17d am: e37249c1de
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/12209028

Change-Id: I53f56740230c5e085f6210d5149cc4a77d475a8d
2020-07-26 18:48:36 +00:00
Rahul Frias
3709a4f419 Allow offline licenses to be loaded and restored in the same session
[ Merge of http://go/wvgerrit/103243 ]

In v16, OEMCrypto specifications required that an error be returned if
multiple attempts are made to load an offline license into a session.
This caused the GTS test testConcurrentDrmCertificates to fail. It was
introduced to verify that a license could retrieved and loaded into a
session and then restored. This was based on an app use case.

Ideally we would like to disallow a this behavior but need to make sure
it is not being used by apps.

For now this will be allowed. If detected, the CDM will reintialize the
OEMCrypto session and allow the license to be restored.

Bug: 161551490
Test: WV unit integration tests, GtsMediaTestCases and
      WidevineConcurrentDrmCertificatesTest#testConcurrentDrmCertificates,
      MediaDrmTest#testMultipleLoadKeys on a redfin
Change-Id: I0834e4419c3a6dccfd77aaea3afa3d65c2c0c742
2020-07-24 07:27:19 -07:00
Rahul Frias
347917e505 Correct ordering of test expectations
[ Merge of http://go/wvgerrit/102804 ]

This addresses post-merge review comments.

Bug: 150393659
Test: WV unit/integration tests
Change-Id: I221ed1c82b20bd0c2b0b824a2d52a2dd918fa459
2020-07-14 02:24:41 -07:00
Alex Dale
0aaf1df125 Test CDM sessions prevent multiple usage entries.
[ Merge of http://go/wvgerrit/102068 ]

CDM sessions should not be able to load multiple usage entries.
OEMCrypto already prevents multiple entries from being loaded by the
same OEMCrypto session; however, restoring a key typically creates a
new OEMCrypto session, which should not be allowed twice within the
same CDM session.

This test verifies that CDM returns an error if restore key is called
multiple times within the same session.

Bug: 136143733
Test: Android integration test
Change-Id: I594c91250217fd958837328162f909bc931d373f
2020-06-19 20:40:54 -07:00
Rahul Frias
8da1145012 Add ATSC support - part 2
[ Merge of http://go/wvgerrit/100905 and http://go/ag/10708438 ]

Add support for ATSC certificate and licenses handling. ATSC
files are distinguished from the apps DRM certificate and licenses
by file naming conventions.

Bug: 139730600
Test: WV unit/integration test, GtsMediaTestCases
Change-Id: I295f66f92fe01d7716978deac9dc360d74addedd
2020-06-12 03:48:58 -07:00
Rahul Frias
bbe9f6afc4 Add ATSC support - part 1
[ Merge of http://go/wvgerrit/100864 and http://go/ag/10704773 ]

ATSC 3.0 allows for licenses to be downloaded OTA and are tied to
a DRM certificate that may be shared across apps. The provisioning
process for ATSC may happen at the factory or during an OS update.

This contrasts from the regular OTT model, which requires that
provisioning and license download have an uplink as well as a
downlink connection.

This adds support for the ATSC mode property. ATSC mode can only be
set (or unset) before sessions are opened. Once the CDM identifier is
set/sealed, requests to modify the ATSC mode will be rejected.

If one needs to open sessions with both ATSC mode and regular (non-ATSC)
mode, separate MediaDrm objects will need to be created. The default
mode is to not use ATSC.

Enable ATSC mode by calling
  mediaDrm.setPropertyString("atscMode", "enable")

Disable ATSC mode by calling
  mediaDrm.setPropertyString("atscMode", "disable")

Provisioning and unprovisioning requests for ATSC will be rejected as
certificates will be retrieved by the ATSC service.

Bug: 139730600
Test: WV unit/integration test, GtsMediaTestCases
Change-Id: I142f286c711fe007ff42125c3c8cdc6450b6ea36
2020-06-08 14:56:48 -07:00
Alex Dale
dd70d63b76 Rolled expected version number for R.
[ Merge of http://go/wvgerrit/100403 ]

VersionNumberTest.VersionNumberChangeCanary was expecting a version
string of "R".  However, Android rvc branch is now far enough into
development to use a numbered version: version "11".

Bug: 156853733
Test: Android license request test
Change-Id: I63d33f742c849b672b2d2402ab8423fdf2450f6f
2020-05-27 17:27:46 +00:00
Fred Gylys-Colwell
f6229788b0 Start playback timer in integration tests
Merge from Widevine repo of http://go/wvgerrit/100328

Several integration tests in WvCdmRequestLicenseRollbackTest had been
testing the duration of a license. However, the license they request
sets the playback duration and not the rental duration. That means the
timer we are checking does not start until the first playback. To fix
the tests, we simply add a decrypt operation right after the license
is received.

Test: integration tests w/v16 mod mock.
Bug: 156854660
Change-Id: Ie4f017c82db8aaf084ad050de3fcb7f51987c97e
2020-05-18 20:57:41 +00:00
Fred Gylys-Colwell
760bf71908 License release does not use core message
Merge from Widevine repo of http://go/wvgerrit/99843

When processing a license release, the license is not loaded, so
OEMCrypto does not know nonce version information for the core
message. It assumes that all license releases are v15, so it is not an
error for a license release to not have a core message.

This CL also adds some extra logging to tests so that we can track
content id and the pssh. This CL also updates some of the test content
policies when running the local license server. The local license
server is only used for debugging problems.

Bug: 152648172 Integration test WvCdmEngineTest.LicenseRenewal failing
Bug: 156259697 License release does not need core message
Test: Unit tests with v16 mod mock
Change-Id: I04c896adadfb17877ce1115345d2419e0d2489f0
2020-05-13 21:22:43 +00:00
Alex Dale
2a16d70a06 Suppress error for removing lingering offline licenses.
[ Merge of http://go/wvgerrit/97963 ]

There are situations where an offline license file will remain on the
system after it's usage entry has been deleted.  This would result in
its key set ID being reported as present by the CDM, but any
operations acting upon it will result in an error.

The app should be able to remove the license without error, so long
as the license file exists and no other OEMCrypto operations fail.

This change introduces a new error code LICENSE_USAGE_ENTRY_MISSING,
which indicates that a license's usage entry cannot be found.

A new integration test checks that the CDM can handle the calls to
removeOfflineLicense().

Bug: 137034719
Test: Android unit and integration tests
Change-Id: Ibdbe963b7f7e3ac97b446300d8e3896cdee7abc5
2020-04-29 17:48:26 -07:00
Rahul Frias
e27bc4ba6a Accept a security level to be specified during provisioning
[ Merge of http://go/wvgerrit/97267 ]

In earlier releases, provisioning would occur based on a cached
security level. If an open session call returned a NotProvisionedException
the security level would be cached for use with any future provisioning
call.

An app would have to set the security level, then call openSession,
have it fail and then request provisioning. This fits the normal flow of
most apps. Still on occasion, an app might change requested security level
after an openSession call failed. Using the cached security level
would result in unexpected behavior.

This change allows provisioning to occur at the last security level that
was set.

Bug: 129356527
Test: wv unit/integration tests, GTS tests (GtsMediaTestCases)
Merged-In: I8d9234eec2b23a9c913e77a709943b431e25e43e
Change-Id: I8d9234eec2b23a9c913e77a709943b431e25e43e
2020-04-28 11:58:59 -07:00
Rahul Frias
ca39586f8d Move the CDM version string to a header file
[ Merge of http://go/wvgerrit/95943 ]

The CDM version for android is now defined in a platform specific
header file. A check for version number match has been removed
from integration tests as it will always be true. We will still
get a notification to change the CDM version when the Android OS
version gets updated.

Bug: 151663718
Test: WV unit/integration tests
Change-Id: I96bac87186e30a709585514be7f338ad2209cdf6
2020-03-16 14:55:37 -07:00
Rahul Frias
a42273e67f Expect Provisioning ID length of upto 64 bytes
[ Merge of http://go/wvgerrit/95508 ]

The provisioning ID length will be 32 bytes when the device supports a
keybox or OEM certificates and does not implement |OEMCrypto_GetDeviceId|.
If a device supports OEM Certificates and implements |OEMCrypto_GetDeviceId|
it may be an arbitrary length upto 64 bytes.

Bug: 150393659
Test: WV unit/integration tests
Change-Id: I5e4dbc8f2f9ca326425d0313f4823b72bd6ac7c0
2020-03-12 12:30:37 -07:00
Fred Gylys-Colwell
1c8fac32d3 Use staging provisioning server even more
Merge from Widevine repo of http://go/wvgerrit/94745

I missed a few in http://go/wvgerrit/94067

Test: ran unit tests
Bug: 149622735
Change-Id: I2289adb05bbd41376528e09bbaa62430644a3e20
2020-02-29 00:50:04 +00:00
Fred Gylys-Colwell
7f006997cb Change some test EXPECT to ASSERT to avoid segfaults
Merge from Widevine repo of http://go/wvgerrit/94505

Some tests use an EXPECT when checking an array size or to verify a
pointer is not null. Then they access the pointer or array. When they
use an EXPECT, this access results in a segfault.

I also removed a compiler warning about unused parameters.

Bug: 149856581
Test: request_license_test (now lists failed tests)
Change-Id: I08ac11250921245c89ed5c0c43cc5f4321e0a9cc
2020-02-26 13:11:25 -08:00
Fred Gylys-Colwell
18da273c42 Adjust provisioning retry
Merge from Widevine repo of http://go/wvgerrit/94243

When generating a second provisioning request, a new session should be
opened because a session can only have one nonce for v16.

For Provisioning 3.0 devices, the OEM Cert's private key must be
loaded in the new session.

Test: WvCdmRequestLicenseTest.ProvisioningInterposedRetryTest
Bug: 135288420 Nonce reuse
Bug: 141655126 Cert reload
Change-Id: I8a96566142c4d4380e2bdd571e8d363a7a1f74d4
2020-02-19 13:42:55 -08:00
Fred Gylys-Colwell
3012ff29bd Use staging provisioning server
Merge from Widevine repo of http://go/wvgerrit/94067

The android tests should use the staging provisioning server until
production is able to support core messages.

Test: ran WvCdmRequestLicenseTest.ProvisioningTest with v16 mod mock
Bug: 149622735
Change-Id: I4ec0cc8e8474dc4250e092473fef90d7358260de
2020-02-18 14:26:29 -08:00
Alex Dale
c9f586f81a Updated expected resource rating for integration tests.
[ Merge of http://go/wvgerrit/93603 ]

When the new "very high" resource rating tier was introduced, the
Android integration test was not updated to accept this value.  The
integration test has now been updated to use "min" and "max" instead
of fixed levels.  This will make future updates easier.

Bug: 140831533
Test: Android integration test (on master)
Change-Id: Ib92bf0afbfbfd81b46c90243651396dfcb74b91f
2020-02-14 10:08:32 -08:00
Rahul Frias
a85a0726a3 Merge changes I420fb181,Id0c38b45
* changes:
  Policy Engine refactoring
  Update license proto
2020-02-14 01:47:59 +00:00
Fred Gylys-Colwell
eeeb0304ed Don't use empty core message
Merge from Widevine repo of http://go/wvgerrit/93824

This treats an empty core message as not having a core message.

Bug: 149110740
Change-Id: Icacfc5d9a5bdce9b136c25c59205eee575cfba72
Tests: Ran ExoPlayer on taimen
2020-02-12 14:36:45 -08:00
Rahul Frias
c2cea58d0b Update license proto
[ Merge of http://go/wvgerrit/93506 ]

This updates the license_protocol.proto to match the one used by
the license service. It introduces new fields such as
|soft_enforce_rental_duration|. Additional changes address proto field
naming changes.

Bug: 139372190
Test: WV android unit/integration tests
Change-Id: Id0c38b457e9079c0afc6848c355c07f96a19e073
2020-02-11 13:19:05 -08:00
Fred Gylys-Colwell
0d0235ae0e Merge changes from topic "oemcrypto-v16"
* changes:
  OEMCrypto v16.2
  OEMCrypto v16.1
2020-02-05 16:10:47 +00:00
Fred Gylys-Colwell
7665614b2e OEMCrypto v16.1
Merge of http://go/wvgerrit/93404

This CL updates the Widevine CDM to support OEMCrypto v16.1

Test: Tested in 16.2 CL
Bug: 141247171
Change-Id: I69bd993500f6fb63bf6010c8b0250dc7acc3d71b
2020-02-03 14:45:32 -08:00
Alex Dale
d5bee31c24 Added HDCP V2.3 to known supported values in GTS.
[ Merge of http://go/wvgerrit/92546 ]

The integration test for L1 and L3 HDCP levels was missing an
acceptable value of QUERY_VALUE_HDCP_V2_3.

Bug: 147396294
Test: Android integration test
Change-Id: I66f7164b7b6a6d63f81fdcfffff0d2d891fd5699
2020-02-03 10:37:12 -08:00
Rahul Frias
b8a6035298 Address compilation warnings
[ Merge of http://go/wvgerrit/90350 ]

Bug: 145244554
Test: wv android unit/integration tests
Change-Id: I5cd8a132836ce097a7b539fffdcef574f64cbdcf
2019-12-02 17:44:56 -08:00
Rahul Frias
af15f8c83d Send spoids in provisioning requests
[ Merge of http://go/wvgerrit/87283 ]

SPOIDs (Stable Per-Origin IDentifiers) were not correctly being
set during CdmEngine construction. This resulted in SPOID values not
being sent in provisioning requests. This caused the serial number in
the drm certificate to not be stable after a reprovision.
This behaviour appears to be true going back to O.

CdmEngine no longer takes a SPOID in the constructor since not all
callers use SPOIDs. A setter has been added in its place. Previously
spoid had a default argument to the constructor.

Bug: 142368328
Test: android unit/integration tests
Change-Id: I711346df609636ecf1475dc37873454a7ef000c0
2019-10-23 00:17:24 -07:00
Alex Dale
bdcb79a442 Ran clang-format on android/cdm/ files.
[ Merge of http://go/wvgerrit/87123 ]

Certain android files have yet to be formated since we introduced
clang-formatting.

Test: built for android
Bug: 134365840
Change-Id: Ia316b039e7469f7cf803464ee95a919fe7966450
2019-10-02 12:50:59 -07:00
Alex Dale
4e2c4d14fe Replaced NULL with nullptr in Android CDM.
[ Merge of http://go/wvgerrit/85503 ]

Replacing a few instances of C's NULL with C++'s nullptr in some of the
smaller sub-directories in the CDM.

Note that clang-format has performed additional changes to some of the
test files that have not yet been formatted.

Bug: 120602075
Test: Android unittest
Change-Id: I926135ed4b85e9d2d58a014b4a62098b0cb7a373
2019-09-05 20:40:01 +00:00
Alex Dale
0b3edf73a8 Changed Widevine CDM version to "16.0.0".
[ Merge of http://go/wvgerrit/83629 ]

In a previous change, the `VersionNumberChangeCanary` test started
to fail when Android changed their version number from "10" to "R".
I forgot to also change the Widevine CMD version string from "15.0.0"
to "16.0.0".

Test: Run `request_license_test` on Android
Bug: 137784842
Change-Id: I157aa6ac518423911e806b1278d723a86579c8cd
2019-07-25 13:58:07 -07:00
Alex Dale
22b35ab95b Merge "Created an ArraySize utility function." 2019-07-23 22:08:39 +00:00
Alex Dale
fe3c401154 Changed expected version-number to "R".
[ Merge of http://go/wvgerrit/83184 ]

On master branch, `request_license_test` should be expecting the latest
android release version (now "R").

Test: Run `request_license_test` on Android R
Bug: 137784842
Change-Id: I09add2c2752b5af09bd2f27bd9f4ce7bc6fc07eb
2019-07-18 16:19:56 -07:00
Alex Dale
182ca34fca Created an ArraySize utility function.
[ Merge of http://go/wvgerrit/82232 ]

The new function `ArraySize` will only work for compile-time fixed-length
arrays, and will provide compiler errors if the provided argument is not an
array.

This will replace the commonly used macro `N_ELEM()` which uses `sizeof()`.

Test: Linux unittest
Bug: 137041745
Change-Id: I0f5c268197a8062a99ccba43c73349e97f66eb02
2019-07-15 17:09:14 -07:00
Rahul Frias
57f2a7fe31 Address request license test failures
[ Merge of http://go/wvgerrit/81743 and http://go/ag/7747989 ]

This fixes some failures in tests. A platform property has been added
which controls whether an offline license can be restored if a release
request has been previously made. This behaviour was introduced by
CE CDM in b/113167010 but is not permitted for android.

The tests failures addressed are
* ProvisioningTestWithServiceCertificate
* ReleaseRetryOfflineKeyTest
* ReleaseRetryL3OfflineKeyTest
* ReleaseRetryL3OfflineKeySessionUsageDisable

Bug: 119428680
Bug: 133684744
Test: WV unit/integration tests
Change-Id: I5beacecea32f26c8a319a6d73a45cc36f04d8aa1
2019-06-28 14:10:01 -07:00
Rahul Frias
6004c2a945 Ref count WvCdmDecryptionModule in cdm_extended_duration_tests
[ Merge of http://go/wvgerrit/79884 ]

WvCdmDecryptionModule needs to be refcounted since it inherits
from RefBase. The test code instantiates it as a member variable.

Bug: 133188706
Test: WV unit/integration tests
Change-Id: I8ae3d92ae148677ea9a8290a6c0553c1a43e3454
2019-06-19 11:02:28 -07:00
Srujan Gaddam
6d196d8496 Change prov retry test to use prov models
Bug: b/133641240
Tests: ProvisioningInterspersedRetryTest L3 & modmock
Merge of http://go/wvgerrit/80164

The ProvisioningInterspersedRetryTest tests that the response tied to
the provisioning request before the latest fails to be handled. This is
only true for provisioning 2.0 where we use derived keys. In
provisioning 3.0, the number of requests allowed to be handled is tied
to the number of nonces, which from OEMCrypto v15.2 onwards, is exactly
4. This CL modifies the test to handle that behavior.

Change-Id: I9f4e555acab145487d6e409779afe7b9b63fd4af
2019-06-07 09:43:15 -07:00
Srujan Gaddam
dcf3f21289 Add query to CDM to get provisioning model
Bug: b/133855570
Tests: Android tests/CE CDM tests/Linux tests
Merge of http://go/wvgerrit/80163

Adds a query option to QueryStatus to get the provisioning model of the
OEMCrypto.

Change-Id: I1896984be6294a5ada9a97b63e6d9080297e92b0
2019-06-07 09:40:59 -07:00
Rahul Frias
6c9c4697f0 Merge "Return key request type none after key rotation" into qt-dev am: 999a466275 am: 4690da2bcb
am: 4c9a3a6f02

Change-Id: Iddcac699401f64d920fcb8ff73053410019ec028
2019-05-31 09:55:31 -07:00
Rahul Frias
3c9175fec5 Return key request type none after key rotation
[ Merge of http://go/wvgerrit/80084 ]

Corrected the key type being returned after entitled keys from
init data are loaded. Made test changes to validate.

Bug: 133903028
Test: WV unit/integration tests
Change-Id: Icb44587f5c3aba3b0facae6d83dc9344d6b60833
2019-05-29 19:03:43 -07:00
Rahul Frias
776996d6d2 Ref count WvCdmDecryptionModule
[ Merge of http://go/wvgerrit/78803 ]

WvCdmDecryptionModule needs to be refcounted since it inherits
from RefBase. The test code instantiates it as a member variable.

Bug: 133188706
Test: WV unit/integration tests
Change-Id: Ib41f3477a55923fb4cc26472e42d3e18eb2b84d4
2019-05-21 11:41:52 -07:00
Rahul Frias
4f273991b9 Correct android version number in test
[ Merge of http://go/wvgerrit/79144 ]

Bug: 132908020
Test: WV unit/integration tests
Change-Id: Idf5cf3e1e886af3bfed157320fa09d66dfa55c0d
2019-05-16 14:44:40 -07:00