Ensure provisioned in unit tests

Merge from Widevine repo of http://go/wvgerrit/61262

This CL helps the CE CDM unit tests provision by providing a helper code to
determine if OEMCrypto is L1 or L3.

Test: unit tests
Test: tested as part of http://go/ag/5501993
Bug: 37286053
Change-Id: Ibe358e0eb628b4051f2db3406eaa6fcfc07f07ff
This commit is contained in:
Fred Gylys-Colwell
2018-11-09 15:51:14 -08:00
parent 218aa76560
commit c3772ebd0c
2 changed files with 6 additions and 0 deletions

View File

@@ -120,6 +120,11 @@ void DeviceFeatures::Initialize(bool is_cast_receiver,
printf("TEST_PROVISION_30: Device provisioed with OEM Cert.\n");
break;
}
std::string security_level = OEMCrypto_SecurityLevel();
supports_level_1 = (security_level == "L1");
printf("SecurityLevel is %s (%s)",
supports_level_1 ? "Level 1" : "Not Level 1",
security_level.c_str());
OEMCrypto_Terminate();
}

View File

@@ -27,6 +27,7 @@ class DeviceFeatures {
bool cast_receiver; // Device supports alternate rsa signature padding.
bool usage_table; // Device saves usage information.
bool supports_rsa_3072; // Device supports 3072 bit RSA keys.
bool supports_level_1; // Device supports Level 1 security.
uint32_t api_version;
OEMCrypto_ProvisioningMethod provisioning_method;