Source release 19.5.0

This commit is contained in:
Cong Lin
2025-04-02 10:27:18 -07:00
parent 4407acee62
commit f7ec4fdeff
295 changed files with 32196 additions and 21748 deletions

View File

@@ -26,6 +26,8 @@
#include "test_sleep.h"
#include "wv_cdm_types.h"
const uint64_t kLargePstLength = 127;
namespace wvcdm {
// Core Policy Integration Test
class CorePIGTest : public WvCdmTestBaseWithEngine {
@@ -36,6 +38,47 @@ class CorePIGTest : public WvCdmTestBaseWithEngine {
}
};
/*
* Check the version of the response returned by the server.
*/
TEST_F(CorePIGTest, PrintClientAndServerVersionNumber) {
LicenseHolder holder("CDM_OfflineNoNonce", &cdm_engine_, config_);
holder.set_can_persist(true);
const KeyId key_id = "0000000000000000";
ASSERT_NO_FATAL_FAILURE(holder.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder.set_log_core_message(true));
ASSERT_NO_FATAL_FAILURE(holder.FetchLicense());
ASSERT_NO_FATAL_FAILURE(holder.LoadLicense());
EXPECT_EQ(NO_ERROR, holder.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
if (wvoec::global_features.provisioning_method == OEMCrypto_DrmCertificate) {
GTEST_SKIP() << "Test not for DRM certificate provisioning method.";
}
std::string level;
ASSERT_EQ(
NO_ERROR,
cdm_engine_.QueryStatus(kLevelDefault, QUERY_KEY_SECURITY_LEVEL, &level)
.code());
CdmSecurityLevel security_level = level == QUERY_VALUE_SECURITY_LEVEL_L1
? kSecurityLevelL1
: kSecurityLevelL3;
std::string prov_model;
ASSERT_EQ(NO_ERROR,
cdm_engine_.QueryStatus(kLevelDefault, QUERY_KEY_PROVISIONING_MODEL,
&prov_model));
ASSERT_NO_FATAL_FAILURE(cdm_engine_.Unprovision(security_level));
ASSERT_FALSE(cdm_engine_.IsProvisioned(security_level));
ProvisioningHolder provisioner(&cdm_engine_, config_);
ASSERT_NO_FATAL_FAILURE(provisioner.set_log_core_message(true));
if (prov_model == QUERY_VALUE_BOOT_CERTIFICATE_CHAIN) {
ASSERT_NO_FATAL_FAILURE(provisioner.Provision(binary_provisioning_));
}
ASSERT_NO_FATAL_FAILURE(provisioner.Provision(binary_provisioning_));
}
/**
* An offline license with nonce not required.
*/
@@ -78,6 +121,31 @@ TEST_F(CorePIGTest, OfflineWithPST) {
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
}
/**
* An offline license with nonce and large provider session token.
*/
TEST_F(CorePIGTest, OfflineWithLargePST) {
if (!wvoec::global_features.usage_table) {
GTEST_SKIP() << "Test for usage table devices only.";
}
LicenseHolder holder("CDM_OfflineWithPST_Length_127", &cdm_engine_, config_);
holder.set_can_persist(true);
const KeyId key_id = "0000000000000000";
ASSERT_NO_FATAL_FAILURE(holder.OpenSession());
holder.set_pst_length(kLargePstLength);
ASSERT_NO_FATAL_FAILURE(holder.FetchLicense());
ASSERT_NO_FATAL_FAILURE(holder.LoadLicense());
EXPECT_EQ(NO_ERROR, holder.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
// Should be able to close the previous session, open a new session,
// and reload the license.
ASSERT_NO_FATAL_FAILURE(holder.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder.ReloadLicense());
EXPECT_EQ(NO_ERROR, holder.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
}
TEST_F(CorePIGTest, OfflineMultipleLicensesWithDefrag) {
const KeyId key_id = "0000000000000000";