Provisioning 3.0: Changes to Provisioning and Service Certs.

[ Merge of http://go/wvgerrit/23360 ]

Service Certificates are used in two places, provisioning and
licensing. The service certificate code depended on a session_id
to get and set the service certificate properties, but the session_id
was not available in the provisioning path.

This patch pulls out the property lookup by session_id dependency,
and passes the CdmImpl's property_set into the provisioning code, so
the service certificate can be read and written there.

Bug: 62972441

Test: WV unit/integration tests. This introduces three test failures
  * WvCdmRequestLicenseTest.PrivacyModeWithServiceCertificateTest
  * Cdm/WvCdmStreamingLicenseRenewalTest.WithClientId/4
  * Cdm/WvCdmOfflineLicenseReleaseTest.WithClientId/3

Change-Id: I6e9d4e23a9e7e81a63a994db8ec0b443893449a6
This commit is contained in:
Rahul Frias
2018-01-04 08:56:29 -08:00
parent 22fdf6ae06
commit a483c18c59
28 changed files with 350 additions and 413 deletions

View File

@@ -894,13 +894,6 @@ class TestWvCdmClientPropertySet : public CdmClientPropertySet {
virtual void set_service_certificate(const std::string& cert) {
service_certificate_ = cert;
}
virtual const std::string& device_provisioning_service_certificate() const {
return device_provisioning_service_certificate_;
}
virtual void set_device_provisioning_service_certificate(
const std::string& cert) {
device_provisioning_service_certificate_ = cert;
}
virtual bool use_privacy_mode() const { return use_privacy_mode_; }
virtual bool is_session_sharing_enabled() const {
return is_session_sharing_enabled_;
@@ -926,7 +919,6 @@ class TestWvCdmClientPropertySet : public CdmClientPropertySet {
std::string app_id_;
std::string security_level_;
std::string service_certificate_;
std::string device_provisioning_service_certificate_;
bool use_privacy_mode_;
bool is_session_sharing_enabled_;
uint32_t session_sharing_id_;
@@ -1652,6 +1644,7 @@ TEST_F(WvCdmRequestLicenseTest, PrivacyModeWithServiceCertificateTest) {
property_set.set_use_privacy_mode(true);
property_set.set_service_certificate(a2bs_hex(g_service_certificate));
// TODO: pass g_service_certificate into CdmEngine::SetServiceCertificate()
decryptor_.OpenSession(g_key_system, &property_set, kDefaultCdmIdentifier,
NULL, &session_id_);
GenerateKeyRequest(g_key_id, kLicenseTypeStreaming);
@@ -2181,6 +2174,7 @@ TEST_P(WvCdmStreamingLicenseRenewalTest, WithClientId) {
if (config->specify_service_certificate)
property_set.set_service_certificate(a2bs_hex(g_service_certificate));
}
// TODO: pass g_service_certificate into CdmEngine::SetServiceCertificate()
decryptor_.OpenSession(g_key_system, &property_set, kDefaultCdmIdentifier,
NULL, &session_id_);
GenerateKeyRequest(key_id, app_parameters, kLicenseTypeStreaming,
@@ -2311,6 +2305,7 @@ TEST_P(WvCdmOfflineLicenseReleaseTest, WithClientId) {
if (config->specify_service_certificate)
property_set.set_service_certificate(a2bs_hex(g_service_certificate));
}
// TODO: pass g_service_certificate into CdmEngine::SetServiceCertificate()
decryptor_.OpenSession(g_key_system, &property_set, kDefaultCdmIdentifier,
NULL, &session_id_);
GenerateKeyRequest(key_id, app_parameters, kLicenseTypeOffline, NULL);