Merge changes I5beacece,Iadb3cc57

* changes:
  Address request license test failures
  Support CE CDM in OEMCrypto Testbed
This commit is contained in:
Rahul Frias
2019-07-09 21:26:50 +00:00
committed by Android (Google) Code Review
6 changed files with 31 additions and 30 deletions

View File

@@ -52,6 +52,12 @@ class Properties {
static inline bool allow_service_certificate_requests() {
return allow_service_certificate_requests_;
}
static inline bool device_files_is_a_real_filesystem() {
return device_files_is_a_real_filesystem_;
}
static inline bool allow_restore_of_offline_licenses_with_release() {
return allow_restore_of_offline_licenses_with_release_;
}
static void set_provisioning_messages_are_binary(bool flag) {
provisioning_messages_are_binary_ = flag;
}
@@ -62,6 +68,9 @@ class Properties {
static bool GetProductName(std::string* product_name);
static bool GetBuildInfo(std::string* build_info);
static bool GetWVCdmVersion(std::string* version);
// Gets the base path for the device non-secure storage. Note that, depending
// on the value of device_files_is_a_real_filesystem, this may or may not be
// a real filesystem path.
static bool GetDeviceFilesBasePath(CdmSecurityLevel security_level,
std::string* base_path);
static bool GetFactoryKeyboxPath(std::string* keybox);
@@ -136,6 +145,8 @@ class Properties {
static bool use_certificates_as_identification_;
static bool provisioning_messages_are_binary_;
static bool allow_service_certificate_requests_;
static bool device_files_is_a_real_filesystem_;
static bool allow_restore_of_offline_licenses_with_release_;
static std::unique_ptr<CdmClientPropertySetMap> session_property_set_;
CORE_DISALLOW_COPY_AND_ASSIGN(Properties);

View File

@@ -243,8 +243,10 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id,
// Attempts to restore a released offline license are treated as a release
// retry.
if (license_state == DeviceFiles::kLicenseStateReleasing) {
license_type = kLicenseTypeRelease;
if (Properties::allow_restore_of_offline_licenses_with_release()) {
if (license_state == DeviceFiles::kLicenseStateReleasing) {
license_type = kLicenseTypeRelease;
}
}
// Only restore offline licenses if they are active or this is a release

View File

@@ -19,6 +19,8 @@ bool Properties::oem_crypto_use_fifo_;
bool Properties::oem_crypto_use_userspace_buffers_;
bool Properties::provisioning_messages_are_binary_;
bool Properties::allow_service_certificate_requests_;
bool Properties::device_files_is_a_real_filesystem_;
bool Properties::allow_restore_of_offline_licenses_with_release_;
std::unique_ptr<CdmClientPropertySetMap> Properties::session_property_set_;
bool Properties::AddSessionPropertySet(const CdmSessionId& session_id,

View File

@@ -29,6 +29,16 @@ const bool kPropertyProvisioningMessagesAreBinary = false;
// an error will be generated.
const bool kAllowServiceCertificateRequests = true;
// Indicates whether this platform's FileSystem abstraction maps directly to the
// device filesystem or whether there is a layer of indirection. If set to true,
// code may treat the DeviceFiles base path as a raw filesystem path.
const bool kDeviceFilesIsARealFileSystem = true;
// This controls the restoration of an offline license, on which a
// release attempt was previously made. If true, a restoration
// will be treated as a release request. If false, a restoration will fail.
const bool kAllowRestoreOfflineLicenseWithRelease = false;
} // namespace wvcdm
#endif // CDM_BASE_WV_PROPERTIES_CONFIGURATION_H_

View File

@@ -49,6 +49,9 @@ void Properties::InitOnce() {
oem_crypto_use_userspace_buffers_ = kPropertyOemCryptoUseUserSpaceBuffers;
provisioning_messages_are_binary_ = kPropertyProvisioningMessagesAreBinary;
allow_service_certificate_requests_ = kAllowServiceCertificateRequests;
device_files_is_a_real_filesystem_ = kDeviceFilesIsARealFileSystem;
allow_restore_of_offline_licenses_with_release_ =
kAllowRestoreOfflineLicenseWithRelease;
session_property_set_.reset(new CdmClientPropertySetMap());
}

View File

@@ -1529,33 +1529,6 @@ FourSampleDecryptionInfo kCenc30SwitchCipherData[8] = {
kCenc30Cbc1Key33Sample, kCenc30Cbc1Key32Sample, } },
};
// NOTE: Provider ID = staging.google.com
const std::string kGoogleStagingServiceCertificate = wvcdm::a2bs_hex(
"0ac102080312101705b917cc1204868b06333a2f772a8c1882b482920522"
"8e023082010a028201010099ed5b3b327dab5e24efc3b62a95b598520ad5"
"bccb37503e0645b814d876b8df40510441ad8ce3adb11bb88c4e725a5e4a"
"9e0795291d58584023a7e1af0e38a91279393008610b6f158c878c7e21bf"
"fbfeea77e1019e1e5781e8a45f46263d14e60e8058a8607adce04fac8457"
"b137a8d67ccdeb33705d983a21fb4eecbd4a10ca47490ca47eaa5d438218"
"ddbaf1cade3392f13d6ffb6442fd31e1bf40b0c604d1c4ba4c9520a4bf97"
"eebd60929afceef55bbaf564e2d0e76cd7c55c73a082b996120b8359edce"
"24707082680d6f67c6d82c4ac5f3134490a74eec37af4b2f010c59e82843"
"e2582f0b6b9f5db0fc5e6edf64fbd308b4711bcf1250019c9f5a09020301"
"00013a146c6963656e73652e7769646576696e652e636f6d128003ae3473"
"14b5a835297f271388fb7bb8cb5277d249823cddd1da30b93339511eb3cc"
"bdea04b944b927c121346efdbdeac9d413917e6ec176a10438460a503bc1"
"952b9ba4e4ce0fc4bfc20a9808aaaf4bfcd19c1dcfcdf574ccac28d1b410"
"416cf9de8804301cbdb334cafcd0d40978423a642e54613df0afcf96ca4a"
"9249d855e42b3a703ef1767f6a9bd36d6bf82be76bbf0cba4fde59d2abcc"
"76feb64247b85c431fbca52266b619fc36979543fca9cbbdbbfafa0e1a55"
"e755a3c7bce655f9646f582ab9cf70aa08b979f867f63a0b2b7fdb362c5b"
"c4ecd555d85bcaa9c593c383c857d49daab77e40b7851ddfd24998808e35"
"b258e75d78eac0ca16f7047304c20d93ede4e8ff1c6f17e6243e3f3da8fc"
"1709870ec45fba823a263f0cefa1f7093b1909928326333705043a29bda6"
"f9b4342cc8df543cb1a1182f7c5fff33f10490faca5b25360b76015e9c5a"
"06ab8ee02f00d2e8d5986104aacc4dd475fd96ee9ce4e326f21b83c70585"
"77b38732cddabc6a6bed13fb0d49d38a45eb87a5f4");
} // namespace
namespace wvcdm {
@@ -2114,7 +2087,7 @@ TEST_F(WvCdmRequestLicenseTest, ProvisioningTestWithServiceCertificate) {
EXPECT_EQ(wvcdm::NO_ERROR, decryptor_->GetProvisioningRequest(
cert_type, cert_authority,
kDefaultCdmIdentifier,
kGoogleStagingServiceCertificate,
config_.provisioning_service_certificate(),
&key_msg_, &provisioning_server));
EXPECT_EQ(provisioning_server, config_.provisioning_server());