Merge "Restrict CAS unit tests to devices that support CAS" into tm-dev am: 6e4cf1f1a9 am: 699e4255b9

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/18128971

Change-Id: I241956fb9a0660108f0789c1477bab42a276f3be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-05-09 15:12:49 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 0 deletions

View File

@@ -63,6 +63,10 @@ void DeviceFeatures::Initialize() {
OEMCrypto_Generic_Encrypt(session, buffer, 0, iv,
OEMCrypto_AES_CBC_128_NO_PADDING, buffer));
printf("generic_crypto = %s.\n", generic_crypto ? "true" : "false");
supports_cas =
(OEMCrypto_ERROR_NOT_IMPLEMENTED !=
OEMCrypto_LoadCasECMKeys(session, nullptr, 0, nullptr, nullptr));
printf("supports_cas = %s.\n", supports_cas ? "true" : "false");
OEMCrypto_CloseSession(session);
api_version = OEMCrypto_APIVersion();
printf("api_version = %u.\n", api_version);
@@ -137,6 +141,7 @@ std::string DeviceFeatures::RestrictFilter(const std::string& initial_filter) {
FilterOut(&filter, "OEMCryptoLoadsCert*");
if (!generic_crypto) FilterOut(&filter, "*GenericCrypto*");
if (!cast_receiver) FilterOut(&filter, "*CastReceiver*");
if (!supports_cas) FilterOut(&filter, "*CasOnly*");
if (derive_key_method == NO_METHOD) FilterOut(&filter, "*SessionTest*");
if (provisioning_method
!= OEMCrypto_OEMCertificate) FilterOut(&filter, "*Prov30*");

View File

@@ -51,6 +51,7 @@ class DeviceFeatures {
uint32_t resource_rating; // Device's resource rating tier.
bool supports_crc; // Supported decrypt hash type CRC.
bool test_secure_buffers; // If we can create a secure buffer for testing.
bool supports_cas; // Device supports CAS (Condition Access System).
uint32_t api_version;
OEMCrypto_ProvisioningMethod provisioning_method;