Merge changes Ia70e3fd7,I601c332e,I1513f869 into udc-widevine-dev
* changes: Fix clear lead integration tests Skip RenewOnLicenseLoad test when not viable Fix LicenseRenewalSpecifiedServer for SDK servers
This commit is contained in:
committed by
Android (Google) Code Review
commit
6246eb6b24
@@ -191,7 +191,6 @@ class WvCdmEngineTest : public WvCdmEnginePreProvTest {
|
|||||||
EXPECT_EQ(KEY_MESSAGE, result);
|
EXPECT_EQ(KEY_MESSAGE, result);
|
||||||
|
|
||||||
key_msg_ = request.message;
|
key_msg_ = request.message;
|
||||||
server_url_ = request.url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetKeyRequestResponse(const std::string& server_url,
|
std::string GetKeyRequestResponse(const std::string& server_url,
|
||||||
@@ -295,8 +294,6 @@ class WvCdmEngineTest : public WvCdmEnginePreProvTest {
|
|||||||
<< "Expected request type " << key_request_type << " was not found. "
|
<< "Expected request type " << key_request_type << " was not found. "
|
||||||
<< "metrics: " << wvutil::b2a_hex(serialized_metrics);
|
<< "metrics: " << wvutil::b2a_hex(serialized_metrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string server_url_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tests to validate service certificate
|
// Tests to validate service certificate
|
||||||
@@ -403,22 +400,15 @@ TEST_F(WvCdmEngineTest, LoadKey) {
|
|||||||
// command line.
|
// command line.
|
||||||
TEST_F(WvCdmEngineTest, LicenseRenewalSpecifiedServer) {
|
TEST_F(WvCdmEngineTest, LicenseRenewalSpecifiedServer) {
|
||||||
EnsureProvisioned();
|
EnsureProvisioned();
|
||||||
GenerateKeyRequest(binary_key_id(), kCencMimeType);
|
LicenseHolder holder("CDM_SpecifyRenewalUrl", &cdm_engine_, config_);
|
||||||
VerifyNewKeyResponse(config_.license_server(), config_.client_auth());
|
ASSERT_NO_FATAL_FAILURE(holder.OpenSession());
|
||||||
|
ASSERT_NO_FATAL_FAILURE(holder.FetchLicense());
|
||||||
GenerateRenewalRequest();
|
ASSERT_NO_FATAL_FAILURE(holder.LoadLicense());
|
||||||
if (!server_url_.empty()) {
|
CdmKeyRequest request;
|
||||||
// If the license server put a URL for the renewal in the license, we should
|
const CdmResponseType result =
|
||||||
// be able to verify the renewal against that server.
|
cdm_engine_.GenerateRenewalRequest(holder.session_id(), &request);
|
||||||
VerifyRenewalKeyResponse(server_url_, config_.client_auth());
|
ASSERT_EQ(KEY_MESSAGE, result);
|
||||||
} else {
|
EXPECT_EQ(request.url, "url_as_specified_in_integration_console");
|
||||||
// If the license server did not give us a URL, we won't verify it.
|
|
||||||
LOGE("License server did not set renewal URL. license_url=%s.",
|
|
||||||
config_.license_server().c_str());
|
|
||||||
// This is OK when you are using a local, debug, license server, but it
|
|
||||||
// should NOT happen if using UAT or UAT nightly.
|
|
||||||
EXPECT_EQ(std::string::npos, config_.license_server().find("proxy.uat"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This test generates a renewal and then requests it from the server specified
|
// This test generates a renewal and then requests it from the server specified
|
||||||
|
|||||||
@@ -1576,6 +1576,9 @@ class CdmUseCase_RenewOnLicenseLoad : public RenewalTest {
|
|||||||
GTEST_SKIP() << "Renew on License Load supported on v18+ servers and "
|
GTEST_SKIP() << "Renew on License Load supported on v18+ servers and "
|
||||||
"devices only.";
|
"devices only.";
|
||||||
}
|
}
|
||||||
|
if (license_holder_.can_persist() && !wvoec::global_features.usage_table) {
|
||||||
|
GTEST_SKIP() << "Renew on License Load requires a usage table for offline licenses.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t renewal_cutoff_;
|
uint64_t renewal_cutoff_;
|
||||||
|
|||||||
@@ -121,10 +121,13 @@ CdmResponseType LicenseHolder::DecryptClearLead(const std::string& key_id) {
|
|||||||
const std::vector<uint8_t> iv(KEY_IV_SIZE, 0);
|
const std::vector<uint8_t> iv(KEY_IV_SIZE, 0);
|
||||||
CdmDecryptionParametersV16 params(key_id);
|
CdmDecryptionParametersV16 params(key_id);
|
||||||
params.is_secure = false;
|
params.is_secure = false;
|
||||||
CdmDecryptionSample sample(input.data(), output.data(), 0, input.size(), iv);
|
CdmDecryptionSample sample1(input.data(), output.data(), 0, input.size(), iv);
|
||||||
|
CdmDecryptionSample sample2(input.data(), output.data(), 0, input.size(), iv);
|
||||||
CdmDecryptionSubsample subsample(input.size(), 0);
|
CdmDecryptionSubsample subsample(input.size(), 0);
|
||||||
sample.subsamples.push_back(subsample);
|
sample1.subsamples.push_back(subsample);
|
||||||
params.samples.push_back(sample);
|
sample2.subsamples.push_back(subsample);
|
||||||
|
params.samples.push_back(sample1);
|
||||||
|
params.samples.push_back(sample2);
|
||||||
return cdm_engine_->DecryptV16(session_id_, params);
|
return cdm_engine_->DecryptV16(session_id_, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user