Allow Secure Stops to be queried and deleted by application ID
This CL changes the WVDrmPlugin so that an application can segregate its secure stops from those of other applications by setting an application ID. This CL is a merge of the following Widevine CLs: https://widevine-internal-review.googlesource.com/#/c/11565/ Add getSecureStop by ssid https://widevine-internal-review.googlesource.com/#/c/11572 Add getSecureStop by SSID and releaseAllSecureStops by app id. https://widevine-internal-review.googlesource.com/#/c/11564/ Store Usage Info by App Id (device_file stubs) https://widevine-internal-review.googlesource.com/#/c/11563/ Add application id to StoreUsageInfo. https://widevine-internal-review.googlesource.com/#/c/11561/ Added Application ID to PropertySet for secure stop. bug: 18053197 bug: 18076411 Change-Id: I5444baf67ba1b960dee2dc958bced8de82ab70a3
This commit is contained in:
@@ -1022,7 +1022,8 @@ TEST_P(WvCdmStreamingUsageReportTest, UsageTest) {
|
||||
uint32_t num_usage_info = 0;
|
||||
CdmUsageInfo usage_info;
|
||||
CdmUsageInfoReleaseMessage release_msg;
|
||||
CdmResponseType status = decryptor_.GetUsageInfo(&usage_info);
|
||||
std::string app_id;
|
||||
CdmResponseType status = decryptor_.GetUsageInfo(app_id, &usage_info);
|
||||
EXPECT_EQ(usage_info.empty() ? NO_ERROR : KEY_MESSAGE, status);
|
||||
while (usage_info.size() > 0) {
|
||||
for (size_t i = 0; i < usage_info.size(); ++i) {
|
||||
@@ -1034,7 +1035,7 @@ TEST_P(WvCdmStreamingUsageReportTest, UsageTest) {
|
||||
GetUsageInfoResponse(g_license_server, g_client_auth, usage_info[i]);
|
||||
EXPECT_EQ(NO_ERROR, decryptor_.ReleaseUsageInfo(release_msg));
|
||||
}
|
||||
status = decryptor_.GetUsageInfo(&usage_info);
|
||||
status = decryptor_.GetUsageInfo(app_id, &usage_info);
|
||||
switch (status) {
|
||||
case KEY_MESSAGE:
|
||||
EXPECT_FALSE(usage_info.empty());
|
||||
|
||||
@@ -393,6 +393,7 @@ class TestWvCdmClientPropertySet : public CdmClientPropertySet {
|
||||
session_sharing_id_(0) {}
|
||||
virtual ~TestWvCdmClientPropertySet() {}
|
||||
|
||||
virtual const std::string& app_id() const { return app_id_; }
|
||||
virtual const std::string& security_level() const { return security_level_; }
|
||||
virtual const std::string& service_certificate() const {
|
||||
return service_certificate_;
|
||||
@@ -403,6 +404,7 @@ class TestWvCdmClientPropertySet : public CdmClientPropertySet {
|
||||
}
|
||||
virtual uint32_t session_sharing_id() const { return session_sharing_id_; }
|
||||
|
||||
void set_app_id(const std::string& app_id) { app_id_ = app_id; }
|
||||
void set_security_level(const std::string& security_level) {
|
||||
if (!security_level.compare(QUERY_VALUE_SECURITY_LEVEL_L1) ||
|
||||
!security_level.compare(QUERY_VALUE_SECURITY_LEVEL_L3)) {
|
||||
@@ -421,6 +423,7 @@ class TestWvCdmClientPropertySet : public CdmClientPropertySet {
|
||||
void set_session_sharing_id(uint32_t id) { session_sharing_id_ = id; }
|
||||
|
||||
private:
|
||||
std::string app_id_;
|
||||
std::string security_level_;
|
||||
std::string service_certificate_;
|
||||
bool use_privacy_mode_;
|
||||
@@ -830,6 +833,14 @@ TEST_F(WvCdmRequestLicenseTest, PropertySetTest) {
|
||||
EXPECT_TRUE(security_level.empty() ||
|
||||
!security_level.compare(QUERY_VALUE_SECURITY_LEVEL_L3));
|
||||
|
||||
std::string app_id = "not empty";
|
||||
EXPECT_TRUE(Properties::GetApplicationId(session_id_Ln, &app_id));
|
||||
EXPECT_STREQ("", app_id.c_str());
|
||||
|
||||
property_set_Ln.set_app_id("com.unittest.mock.app.id");
|
||||
EXPECT_TRUE(Properties::GetApplicationId(session_id_Ln, &app_id));
|
||||
EXPECT_STREQ("com.unittest.mock.app.id", app_id.c_str());
|
||||
|
||||
decryptor_.CloseSession(session_id_L1);
|
||||
decryptor_.CloseSession(session_id_L3);
|
||||
decryptor_.CloseSession(session_id_Ln);
|
||||
@@ -1202,7 +1213,7 @@ TEST_P(WvCdmUsageInfoTest, UsageInfo) {
|
||||
EXPECT_TRUE(handle.Init(security_level));
|
||||
File file;
|
||||
handle.SetTestFile(&file);
|
||||
EXPECT_TRUE(handle.DeleteUsageInfo());
|
||||
EXPECT_TRUE(handle.DeleteAllUsageInfoForApp("")); // default app_id.
|
||||
|
||||
for (size_t i = 0; i < usage_info_data->usage_info; ++i) {
|
||||
SubSampleInfo* data = usage_info_data->sub_sample + i;
|
||||
@@ -1236,7 +1247,8 @@ TEST_P(WvCdmUsageInfoTest, UsageInfo) {
|
||||
uint32_t num_usage_info = 0;
|
||||
CdmUsageInfo usage_info;
|
||||
CdmUsageInfoReleaseMessage release_msg;
|
||||
CdmResponseType status = decryptor_.GetUsageInfo(&usage_info);
|
||||
CdmResponseType status =
|
||||
decryptor_.GetUsageInfo(property_set->app_id(), &usage_info);
|
||||
EXPECT_EQ(usage_info.empty() ? NO_ERROR : KEY_MESSAGE, status);
|
||||
while (usage_info.size() > 0) {
|
||||
for (size_t i = 0; i < usage_info.size(); ++i) {
|
||||
@@ -1244,7 +1256,7 @@ TEST_P(WvCdmUsageInfoTest, UsageInfo) {
|
||||
GetUsageInfoResponse(g_license_server, g_client_auth, usage_info[i]);
|
||||
EXPECT_EQ(NO_ERROR, decryptor_.ReleaseUsageInfo(release_msg));
|
||||
}
|
||||
status = decryptor_.GetUsageInfo(&usage_info);
|
||||
status = decryptor_.GetUsageInfo(property_set->app_id(), &usage_info);
|
||||
switch (status) {
|
||||
case KEY_MESSAGE: EXPECT_FALSE(usage_info.empty()); break;
|
||||
case NO_ERROR: EXPECT_TRUE(usage_info.empty()); break;
|
||||
|
||||
Reference in New Issue
Block a user