Cdm to expose GetDeviceInformation() and GetDeviceSignedCsrPayload()

GetDeviceInformation() and GetDeviceSignedCsrPayload() are added to
cdm_engine and crypto_session, so that they can be queried by DRM
plugin. This is to allow the wv drm HAL to be able to extract BCC and
CSR payload to build CSR for prov 4 device registration, such that we
don't need a separate RKP HAL to do this job.

Changes to the DRM plugin to use the exposed methods will be in the
coming CL.

Bug: 286556950
Test: request_license_test
Merged from https://widevine-internal-review.googlesource.com/178890

Merged from https://widevine-internal-review.googlesource.com/179730

Change-Id: Ibafa3a58c99fbb8f1f25f8951d3749110bd32176
This commit is contained in:
Cong Lin
2023-07-19 11:17:12 -07:00
committed by Robert Shih
parent c600ccb741
commit 30669a7b67
9 changed files with 179 additions and 7 deletions

View File

@@ -5348,18 +5348,30 @@ TEST_F(WvCdmRequestLicenseTest, QueryStatus) {
value == wvcdm::QUERY_VALUE_OEM_CERTIFICATE ||
value == wvcdm::QUERY_VALUE_BOOT_CERTIFICATE_CHAIN);
const bool expect_bcc = (value == wvcdm::QUERY_VALUE_BOOT_CERTIFICATE_CHAIN);
const bool is_prov4 = (value == wvcdm::QUERY_VALUE_BOOT_CERTIFICATE_CHAIN);
EXPECT_EQ(wvcdm::NO_ERROR,
decryptor_->QueryStatus(
kLevelDefault, wvcdm::QUERY_KEY_DEBUG_BOOT_CERTIFICATE_CHAIN,
&value));
if (expect_bcc) {
// Expect that the BCC is returned; but do not validate the actual value.
if (is_prov4) {
// Expect that the BCC is returned for Prov 4; but do not validate the
// actual value.
EXPECT_FALSE(value.empty()) << "BCC is empty";
EXPECT_NE(value, wvcdm::QUERY_VALUE_NONE) << "BCC is none";
} else {
EXPECT_EQ(value, wvcdm::QUERY_VALUE_NONE);
}
EXPECT_EQ(wvcdm::NO_ERROR,
decryptor_->QueryStatus(
kLevelDefault, wvcdm::QUERY_KEY_DEVICE_INFORMATION, &value));
if (is_prov4) {
// Expect that the device info is returned for Prov 4; but do not validate
// the actual value.
EXPECT_FALSE(value.empty()) << "Device info is empty";
EXPECT_NE(value, wvcdm::QUERY_VALUE_NONE) << "Device info is none";
} else {
EXPECT_EQ(value, wvcdm::QUERY_VALUE_NONE);
}
EXPECT_EQ(
wvcdm::NO_ERROR,