Merge "Restrict CAS unit tests to devices that support CAS" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6e4cf1f1a9
@@ -63,6 +63,10 @@ void DeviceFeatures::Initialize() {
|
|||||||
OEMCrypto_Generic_Encrypt(session, buffer, 0, iv,
|
OEMCrypto_Generic_Encrypt(session, buffer, 0, iv,
|
||||||
OEMCrypto_AES_CBC_128_NO_PADDING, buffer));
|
OEMCrypto_AES_CBC_128_NO_PADDING, buffer));
|
||||||
printf("generic_crypto = %s.\n", generic_crypto ? "true" : "false");
|
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);
|
OEMCrypto_CloseSession(session);
|
||||||
api_version = OEMCrypto_APIVersion();
|
api_version = OEMCrypto_APIVersion();
|
||||||
printf("api_version = %u.\n", api_version);
|
printf("api_version = %u.\n", api_version);
|
||||||
@@ -137,6 +141,7 @@ std::string DeviceFeatures::RestrictFilter(const std::string& initial_filter) {
|
|||||||
FilterOut(&filter, "OEMCryptoLoadsCert*");
|
FilterOut(&filter, "OEMCryptoLoadsCert*");
|
||||||
if (!generic_crypto) FilterOut(&filter, "*GenericCrypto*");
|
if (!generic_crypto) FilterOut(&filter, "*GenericCrypto*");
|
||||||
if (!cast_receiver) FilterOut(&filter, "*CastReceiver*");
|
if (!cast_receiver) FilterOut(&filter, "*CastReceiver*");
|
||||||
|
if (!supports_cas) FilterOut(&filter, "*CasOnly*");
|
||||||
if (derive_key_method == NO_METHOD) FilterOut(&filter, "*SessionTest*");
|
if (derive_key_method == NO_METHOD) FilterOut(&filter, "*SessionTest*");
|
||||||
if (provisioning_method
|
if (provisioning_method
|
||||||
!= OEMCrypto_OEMCertificate) FilterOut(&filter, "*Prov30*");
|
!= OEMCrypto_OEMCertificate) FilterOut(&filter, "*Prov30*");
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class DeviceFeatures {
|
|||||||
uint32_t resource_rating; // Device's resource rating tier.
|
uint32_t resource_rating; // Device's resource rating tier.
|
||||||
bool supports_crc; // Supported decrypt hash type CRC.
|
bool supports_crc; // Supported decrypt hash type CRC.
|
||||||
bool test_secure_buffers; // If we can create a secure buffer for testing.
|
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;
|
uint32_t api_version;
|
||||||
OEMCrypto_ProvisioningMethod provisioning_method;
|
OEMCrypto_ProvisioningMethod provisioning_method;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user