Source release 19.1.0

This commit is contained in:
Matt Feddersen
2024-03-28 19:21:54 -07:00
parent 28ec8548c6
commit b8bdfccebe
182 changed files with 10645 additions and 2040 deletions

View File

@@ -22,6 +22,7 @@
#include "provisioning_holder.h"
#include "test_base.h"
#include "test_printers.h"
#include "test_sleep.h"
#include "wv_cdm_types.h"
namespace wvcdm {
@@ -76,10 +77,67 @@ TEST_F(CorePIGTest, OfflineWithPST) {
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
}
// This test verifies that the system can download and install license with a
// key that requires secure buffers. It also verifies that we cannot decrypt to
// a non-secure buffer using this key, but that we can decrypt to a secure
// buffer, if the test harness supports secure buffers.
TEST_F(CorePIGTest, OfflineMultipleLicensesWithDefrag) {
const KeyId key_id = "0000000000000000";
// 1. Open a session, load license, close session
LicenseHolder holder1("CDM_OfflineWithPST", &cdm_engine_, config_);
holder1.set_can_persist(true);
ASSERT_NO_FATAL_FAILURE(holder1.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder1.FetchLicense());
ASSERT_NO_FATAL_FAILURE(holder1.LoadLicense());
ASSERT_NO_FATAL_FAILURE(holder1.CloseSession());
// 2. Open a session, load license, keep session open
LicenseHolder holder2("CDM_OfflineWithPST", &cdm_engine_, config_);
holder2.set_can_persist(true);
ASSERT_NO_FATAL_FAILURE(holder2.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder2.FetchLicense());
ASSERT_NO_FATAL_FAILURE(holder2.LoadLicense());
// 3. Remove first license
ASSERT_NO_FATAL_FAILURE(holder1.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder1.ReloadLicense());
ASSERT_NO_FATAL_FAILURE(holder1.RemoveLicense());
ASSERT_NO_FATAL_FAILURE(holder1.CloseSession());
// 4. Open a session, load license
LicenseHolder holder3("CDM_OfflineWithPST", &cdm_engine_, config_);
holder3.set_can_persist(true);
ASSERT_NO_FATAL_FAILURE(holder3.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder3.FetchLicense());
ASSERT_NO_FATAL_FAILURE(holder3.LoadLicense());
EXPECT_EQ(NO_ERROR, holder3.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder3.CloseSession());
ASSERT_NO_FATAL_FAILURE(holder2.CloseSession());
// Ensure first offline license can no longer be used
ASSERT_NO_FATAL_FAILURE(holder1.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder1.FailReloadLicense());
EXPECT_NE(NO_ERROR, holder1.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder1.CloseSession());
// Ensure second and third offline licenses can be used
ASSERT_NO_FATAL_FAILURE(holder2.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder2.ReloadLicense());
EXPECT_EQ(NO_ERROR, holder2.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder2.RemoveLicense());
ASSERT_NO_FATAL_FAILURE(holder2.CloseSession());
ASSERT_NO_FATAL_FAILURE(holder3.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder3.ReloadLicense());
EXPECT_EQ(NO_ERROR, holder3.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder3.RemoveLicense());
ASSERT_NO_FATAL_FAILURE(holder3.CloseSession());
}
/**
* This test verifies that the system can download and install license with a
* key that requires secure buffers. It also verifies that we cannot decrypt to
* a non-secure buffer using this key, but that we can decrypt to a secure
* buffer, if the test harness supports secure buffers.
*/
TEST_F(CorePIGTest, OfflineHWSecureRequired) {
LicenseHolder holder("CDM_OfflineHWSecureRequired", &cdm_engine_, config_);
holder.set_can_persist(true);
@@ -118,6 +176,50 @@ TEST_F(CorePIGTest, OfflineHWSecureRequired) {
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
}
/**
* Should be able to request license, perform playback, generate a license
* release, and receive the release response.
*/
TEST_F(CorePIGTest, LicenseRelease1) {
LicenseHolder holder("CDM_UnlimitedStreaming_can_persist", &cdm_engine_,
config_);
holder.set_can_persist(true);
const KeyId key_id = "0000000000000000";
ASSERT_NO_FATAL_FAILURE(holder.OpenSession());
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.GenerateAndPostReleaseRequest(
"CDM_UnlimitedStreaming_can_persist"));
EXPECT_NE(NO_ERROR, holder.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder.FetchRelease());
ASSERT_NO_FATAL_FAILURE(holder.LoadRelease());
EXPECT_NE(NO_ERROR, holder.Decrypt(key_id));
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
}
/**
* Should be able to request license, wait some time, generate a license
* release, and receive the release response.
*/
TEST_F(CorePIGTest, LicenseRelease2) {
LicenseHolder holder("CDM_UnlimitedStreaming_can_persist", &cdm_engine_,
config_);
holder.set_can_persist(true);
const KeyId key_id = "0000000000000000";
ASSERT_NO_FATAL_FAILURE(holder.OpenSession());
ASSERT_NO_FATAL_FAILURE(holder.FetchLicense());
ASSERT_NO_FATAL_FAILURE(holder.LoadLicense());
wvutil::TestSleep::Sleep(10);
ASSERT_NO_FATAL_FAILURE(holder.GenerateAndPostReleaseRequest(
"CDM_UnlimitedStreaming_can_persist"));
ASSERT_NO_FATAL_FAILURE(holder.FetchRelease());
ASSERT_NO_FATAL_FAILURE(holder.LoadRelease());
ASSERT_NO_FATAL_FAILURE(holder.CloseSession());
}
TEST_F(CorePIGTest, CastReceiverProvisioningUsingCdm) {
const std::string digest_hex_str =
// digest info header