Merge latest oemcrypto-v17 change

No-Typo-Check: Not related to this change.

Bug: 161477208
Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
This commit is contained in:
Kyle Zhang
2022-01-21 05:58:12 +00:00
committed by Fred Gylys-Colwell
parent c924960962
commit 642965c678
176 changed files with 301013 additions and 296749 deletions

View File

@@ -58,14 +58,22 @@ const int kHttpOk = 200;
// const int kHttpInternalServerError = 500;
const std::string kEmptyServiceCertificate;
wvcdm::KeyId kSrmHdKeyId1 = wvcdm::a2bs_hex("30303030303030303030303030303032");
wvcdm::KeyId kSrmHdKeyId2 = wvcdm::a2bs_hex("30303030303030303030303030303033");
wvcdm::KeyId kSrmHdKeyId3 = wvcdm::a2bs_hex("30303030303030303030303030303037");
wvcdm::KeyId kSrmSdKeyId1 = wvcdm::a2bs_hex("30303030303030303030303030303030");
wvcdm::KeyId kSrmSdKeyId2 = wvcdm::a2bs_hex("30303030303030303030303030303031");
wvcdm::KeyId kSrmSdKeyId3 = wvcdm::a2bs_hex("30303030303030303030303030303034");
wvcdm::KeyId kSrmSdKeyId4 = wvcdm::a2bs_hex("30303030303030303030303030303035");
wvcdm::KeyId kSrmSdKeyId5 = wvcdm::a2bs_hex("30303030303030303030303030303036");
wvcdm::KeyId kSrmHdKeyId1 =
wvutil::a2bs_hex("30303030303030303030303030303032");
wvcdm::KeyId kSrmHdKeyId2 =
wvutil::a2bs_hex("30303030303030303030303030303033");
wvcdm::KeyId kSrmHdKeyId3 =
wvutil::a2bs_hex("30303030303030303030303030303037");
wvcdm::KeyId kSrmSdKeyId1 =
wvutil::a2bs_hex("30303030303030303030303030303030");
wvcdm::KeyId kSrmSdKeyId2 =
wvutil::a2bs_hex("30303030303030303030303030303031");
wvcdm::KeyId kSrmSdKeyId3 =
wvutil::a2bs_hex("30303030303030303030303030303034");
wvcdm::KeyId kSrmSdKeyId4 =
wvutil::a2bs_hex("30303030303030303030303030303035");
wvcdm::KeyId kSrmSdKeyId5 =
wvutil::a2bs_hex("30303030303030303030303030303036");
std::set<wvcdm::KeyId> kSrmExpectedAllKeyIds = {
kSrmHdKeyId1, kSrmHdKeyId2, kSrmHdKeyId3, kSrmSdKeyId1,
@@ -76,7 +84,7 @@ std::set<wvcdm::KeyId> kSrmExpectedSdKeyIds = {
kSrmSdKeyId1, kSrmSdKeyId2, kSrmSdKeyId3, kSrmSdKeyId4, kSrmSdKeyId5,
};
std::vector<uint8_t> kEncryptData = wvcdm::a2b_hex(
std::vector<uint8_t> kEncryptData = wvutil::a2b_hex(
"64ab17b3e3dfab47245c7cce4543d4fc7a26dcf248f19f9b59f3c92601440b36"
"17c8ed0c96c656549e461f38708cd47a434066f8df28ccc28b79252eee3f9c2d"
"7f6c68ebe40141fe818fe082ca523c03d69ddaf183a93c022327fedc5582c5ab"
@@ -87,7 +95,7 @@ std::vector<uint8_t> kEncryptData = wvcdm::a2b_hex(
"c1d65537c6cbd7dde04aae338d68115a9f430afc100ab83cdadf45dca39db685");
std::vector<uint8_t> kEncryptDataIV =
wvcdm::a2b_hex("f6f4b1e600a5b67813ed2bded913ba9f");
wvutil::a2b_hex("f6f4b1e600a5b67813ed2bded913ba9f");
uint32_t kSrmOutdatedVersion = 1;
uint32_t kSrmCurrentVersion = 3;
@@ -245,7 +253,8 @@ class WvCdmFeatureTest : public WvCdmTestBase {
void LogResponseError(const std::string& message, int http_status_code) {
LOGD("HTTP Status code = %d", http_status_code);
LOGD("HTTP response(%zu): %s", message.size(), b2a_hex(message).c_str());
LOGD("HTTP response(%zu): %s", message.size(),
wvutil::b2a_hex(message).c_str());
}
// Post a request and extract the signed provisioning message from
@@ -280,7 +289,7 @@ class WvCdmFeatureTest : public WvCdmTestBase {
LOGW("ExtractTokenType: pad_size: %zu", pad_size);
std::vector<uint8_t> bin_provisioning_request =
Base64SafeDecode(b64_provisioning_request);
wvutil::Base64SafeDecode(b64_provisioning_request);
if (bin_provisioning_request.empty()) return false;
std::string prov_request(bin_provisioning_request.begin(),
bin_provisioning_request.end());
@@ -329,7 +338,7 @@ class WvCdmFeatureTest : public WvCdmTestBase {
CdmKeyRequest key_request;
std::string key_set_id;
license_type_ = license_type;
if (g_cutoff >= LOG_DEBUG) {
if (wvutil::g_cutoff >= wvutil::LOG_DEBUG) {
InitializationData parsed_init_data(init_data_type, init_data);
parsed_init_data.DumpToLogs();
}
@@ -538,8 +547,9 @@ TEST_P(WvCdmSrmTest, Srm) {
INSTANTIATE_TEST_CASE_P(
Cdm, WvCdmSrmTest,
::testing::Range(&kSrmTestConfiguration[0],
&kSrmTestConfiguration[ArraySize(kSrmTestConfiguration)]));
::testing::Range(
&kSrmTestConfiguration[0],
&kSrmTestConfiguration[wvutil::ArraySize(kSrmTestConfiguration)]));
// These parameterized tests validate SRM scenarios described in
// SRM End-to-End Test Plan doc
@@ -589,6 +599,6 @@ TEST_P(WvCdmSrmNotSupportedTest, Srm) {
INSTANTIATE_TEST_CASE_P(
Cdm, WvCdmSrmNotSupportedTest,
::testing::Range(&kSrmNotSupportedTestConfiguration[0],
&kSrmNotSupportedTestConfiguration[ArraySize(
&kSrmNotSupportedTestConfiguration[wvutil::ArraySize(
kSrmNotSupportedTestConfiguration)]));
} // namespace wvcdm