Source release v2.1.1-0-738 + third_party libs
Change-Id: I76e298f8092951d4214c776d6bbcad6b763eb5b2
This commit is contained in:
@@ -95,8 +95,9 @@ class TestHostFile {
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(TestHostFile);
|
||||
};
|
||||
|
||||
bool::TestHostFile::Init(const std::string& name) {
|
||||
bool TestHostFile::Init(const std::string& name) {
|
||||
fname_ = name;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TestHostFile::Exists() {
|
||||
@@ -732,13 +733,12 @@ class WvCdmApiTest : public testing::Test {
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(host_, &TestHost::GetCurrentTestTime));
|
||||
|
||||
//emulate pulling a certificate out of persistent storage.
|
||||
// emulate pulling a certificate out of persistent storage.
|
||||
static const size_t kPrivacyCertSize = 256;
|
||||
uint8_t privacyCertRaw[kPrivacyCertSize];
|
||||
memset(privacyCertRaw, kPrivacyCertSize, 0);
|
||||
for (int i = 0; i < 256; i++) {privacyCertRaw[i] = i;}
|
||||
kVectorBytes cert(kPrivacyCertSize);
|
||||
memcpy(&cert[0], privacyCertRaw, kPrivacyCertSize);
|
||||
for (size_t i = 0; i < cert.size(); i++) {
|
||||
cert[i] = i;
|
||||
}
|
||||
|
||||
host_->SetPlatformByteArray("ServiceCertificate", cert);
|
||||
INITIALIZE_CDM_MODULE();
|
||||
@@ -749,11 +749,8 @@ class WvCdmApiTest : public testing::Test {
|
||||
|
||||
std::string init_data = key_id;
|
||||
|
||||
char type = 0; // unused but as published
|
||||
int type_size; // unused but as published
|
||||
|
||||
cdm::Status status = cdm_->GenerateKeyRequest(
|
||||
&type, type_size, (const uint8_t*)init_data.data(), init_data.length());
|
||||
NULL, 0, (const uint8_t*)init_data.data(), init_data.length());
|
||||
|
||||
// cdm::Host must handle the certificate provisioning request.
|
||||
if (status == cdm::kNeedsDeviceCertificate) {
|
||||
@@ -771,7 +768,7 @@ class WvCdmApiTest : public testing::Test {
|
||||
|
||||
if (resp_bytes) {
|
||||
if (cdm_->HandleProvisioningResponse(message) == cdm::kSuccess) {
|
||||
status = cdm_->GenerateKeyRequest(&type, type_size,
|
||||
status = cdm_->GenerateKeyRequest(NULL, 0,
|
||||
(const uint8_t*)init_data.data(), init_data.length());
|
||||
}
|
||||
}
|
||||
@@ -848,11 +845,11 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.is_encrypted = true;
|
||||
data.is_secure = false;
|
||||
|
||||
// WHAT: Key ID of key used to encrypt the test content.
|
||||
// WHY: This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("92D20D250D425ABD992AF42E4CD64165");
|
||||
// Key ID of key used to encrypt the test content.
|
||||
// This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("E02562E04CD55351B14B3D748D36ED8E");
|
||||
|
||||
// WHAT: Dummy encrypted data.
|
||||
// Dummy encrypted data.
|
||||
data.encrypt_data = wvcdm::a2b_hex(
|
||||
"3b2cbde084973539329bd5656da22d20396249bf4a18a51c38c4743360cc9fea"
|
||||
"a1c78d53de1bd7e14dc5d256fd20a57178a98b83804258c239acd7aa38f2d7d2"
|
||||
@@ -864,16 +861,17 @@ class WvCdmApiTest : public testing::Test {
|
||||
"d95a133bff5f57614dda5e4446cd8837901d074149dadf4b775b5b07bb88ca20");
|
||||
data.iv = wvcdm::a2b_hex("4cca615fc013102892f91efee936639b");
|
||||
data.block_offset = 0;
|
||||
// WHAT: Expected decrypted data.
|
||||
|
||||
// Expected decrypted data.
|
||||
data.decrypt_data = wvcdm::a2b_hex(
|
||||
"FAE501E845FD5F83583F45B6D011A4A0EFC7190AF2A7314985B436BA7A946428"
|
||||
"74FD5578FA0A32FAC3DC2ACB3088315A4CBE8013A2C18C0774B117E00554EBE7"
|
||||
"508E5EF43276F77F57E19ADF3B8177F2E8132AABE61B08D801E47653393F5E34"
|
||||
"D66B45909C527D36B19FB5D8B996040211AA8A492B34BE9A5B0EBBC66EE253F4"
|
||||
"7AB0EDE457FDB5F3855C96572EBA1C8F474DE0A46F8A4D0D498902332F0C92D3"
|
||||
"FD981301BC705A6748C88B20C82F9C4E9FC574372A6EE5EFD6C1A70D9D9C1E6C"
|
||||
"202FF87D59EBEB29EF3D494B297BAF3AB6D9656CEC1C2E263E8262D6BC260F94"
|
||||
"B0F1CC98A1882D142F068DA90E6594D40716F01541F10247B8D12EAE3A8998B2");
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"eff34b8d9b7b6352e7d72de991b599662aa475da355033620152e2356ebfadee"
|
||||
"06172be9e1058fa177e223b9fdd191380cff53c3ea810c6fd852a1df4967b799"
|
||||
"415179a2276ec388ef763bab89605b9c6952c28dc8d6bf86b03fabbb46b392a3"
|
||||
"1dad15be602eeeeabb45070b3e25d6bb0217073b1fc44c9fe848594121fd6a91"
|
||||
"304d605e21f69615e1b57db18312b6b948725724b74e91d8aea7371e99532469"
|
||||
"1b358bdee873f1936b63efe83d190a53c2d21754d302d63ff285174023473755"
|
||||
"58b938c2e3ca4c2ce48942da97f9e45797f2c074ac6004734e93784a48af6160");
|
||||
|
||||
cdm::InputBuffer buf;
|
||||
|
||||
@@ -921,12 +919,12 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.is_encrypted = true;
|
||||
data.is_secure = false;
|
||||
|
||||
// WHAT: Key ID of key used to encrypt the test content.
|
||||
// WHY: This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("92D20D250D425ABD992AF42E4CD64165");
|
||||
// Key ID of key used to encrypt the test content.
|
||||
// This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("E02562E04CD55351B14B3D748D36ED8E");
|
||||
|
||||
// WHAT: Dummy encrypted data. This is a combination of clear and
|
||||
// encrypted data.
|
||||
// Dummy encrypted data. This is a combination of clear and
|
||||
// encrypted data.
|
||||
data.encrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"3b2cbde084973539329bd5656da22d20396249bf4a18a51c38c4743360cc9fea"
|
||||
@@ -944,20 +942,20 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.iv = wvcdm::a2b_hex("4cca615fc013102892f91efee936639b");
|
||||
data.block_offset = 0;
|
||||
|
||||
// WHAT: Expected decrypted data.
|
||||
// Expected decrypted data.
|
||||
data.decrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"FAE501E845FD5F83583F45B6D011A4A0EFC7190AF2A7314985B436BA7A946428"
|
||||
"74FD5578FA0A32FAC3DC2ACB3088315A4CBE8013A2C18C0774B117E00554EBE7"
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"eff34b8d9b7b6352e7d72de991b599662aa475da355033620152e2356ebfadee"
|
||||
"5a36c0"
|
||||
"508E5EF432"
|
||||
"06172be9e1"
|
||||
"58b938c2e3ca4c2ce4"
|
||||
"76F77F57E19ADF3B8177F2E8132AABE61B08D801E47653393F5E34"
|
||||
"D66B45909C527D36B19FB5D8B996040211AA8A492B34BE9A5B0EBBC66EE253F4"
|
||||
"7AB0EDE457FDB5F3855C96572EBA1C8F474DE0A46F8A4D0D498902332F0C92D3"
|
||||
"FD981301BC705A6748C88B20C82F9C4E9FC574372A6EE5EFD6C1A70D9D9C1E6C"
|
||||
"202FF87D59EBEB29EF3D494B297BAF3AB6D9656CEC1C2E263E8262D6BC260F94"
|
||||
"B0F1CC98A1882D142F068DA90E6594D40716F01541F10247B8D12EAE3A8998B2");
|
||||
"058fa177e223b9fdd191380cff53c3ea810c6fd852a1df4967b799"
|
||||
"415179a2276ec388ef763bab89605b9c6952c28dc8d6bf86b03fabbb46b392a3"
|
||||
"1dad15be602eeeeabb45070b3e25d6bb0217073b1fc44c9fe848594121fd6a91"
|
||||
"304d605e21f69615e1b57db18312b6b948725724b74e91d8aea7371e99532469"
|
||||
"1b358bdee873f1936b63efe83d190a53c2d21754d302d63ff285174023473755"
|
||||
"58b938c2e3ca4c2ce48942da97f9e45797f2c074ac6004734e93784a48af6160");
|
||||
|
||||
cdm::InputBuffer buf;
|
||||
|
||||
@@ -996,7 +994,6 @@ class WvCdmApiTest : public testing::Test {
|
||||
LOGI("Verbose Acknowledgement of Test Pass!!!\n");
|
||||
}
|
||||
|
||||
// Level 1 / Level 2 payload comes back in the cpu memory as cleartext.
|
||||
void DecryptClearSubsampleTestWithMissingSubsampleInfo() {
|
||||
typedef struct DecryptionData {
|
||||
bool is_encrypted;
|
||||
@@ -1012,12 +1009,12 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.is_encrypted = true;
|
||||
data.is_secure = false;
|
||||
|
||||
// WHAT: Key ID of key used to encrypt the test content.
|
||||
// WHY: This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("92D20D250D425ABD992AF42E4CD64165");
|
||||
// Key ID of key used to encrypt the test content.
|
||||
// This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("E02562E04CD55351B14B3D748D36ED8E");
|
||||
|
||||
// WHAT: Dummy encrypted data.
|
||||
// This is a combination of clear and encrypted data.
|
||||
// Dummy encrypted data. This is a combination of clear and
|
||||
// encrypted data.
|
||||
data.encrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"3b2cbde084973539329bd5656da22d20396249bf4a18a51c38c4743360cc9fea"
|
||||
@@ -1034,20 +1031,20 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.iv = wvcdm::a2b_hex("4cca615fc013102892f91efee936639b");
|
||||
data.block_offset = 0;
|
||||
|
||||
// WHAT: Expected decrypted data.
|
||||
// Expected decrypted data.
|
||||
data.decrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"FAE501E845FD5F83583F45B6D011A4A0EFC7190AF2A7314985B436BA7A946428"
|
||||
"74FD5578FA0A32FAC3DC2ACB3088315A4CBE8013A2C18C0774B117E00554EBE7"
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"eff34b8d9b7b6352e7d72de991b599662aa475da355033620152e2356ebfadee"
|
||||
"5a36c0"
|
||||
"508E5EF432"
|
||||
"06172be9e1"
|
||||
"58b938c2e3ca4c2ce4"
|
||||
"76F77F57E19ADF3B8177F2E8132AABE61B08D801E47653393F5E34"
|
||||
"D66B45909C527D36B19FB5D8B996040211AA8A492B34BE9A5B0EBBC66EE253F4"
|
||||
"7AB0EDE457FDB5F3855C96572EBA1C8F474DE0A46F8A4D0D498902332F0C92D3"
|
||||
"FD981301BC705A6748C88B20C82F9C4E9FC574372A6EE5EFD6C1A70D9D9C1E6C"
|
||||
"202FF87D59EBEB29EF3D494B297BAF3AB6D9656CEC1C2E263E8262D6BC260F94"
|
||||
"B0F1CC98A1882D142F068DA90E6594D40716F01541F10247B8D12EAE3A8998B2");
|
||||
"058fa177e223b9fdd191380cff53c3ea810c6fd852a1df4967b799"
|
||||
"415179a2276ec388ef763bab89605b9c6952c28dc8d6bf86b03fabbb46b392a3"
|
||||
"1dad15be602eeeeabb45070b3e25d6bb0217073b1fc44c9fe848594121fd6a91"
|
||||
"304d605e21f69615e1b57db18312b6b948725724b74e91d8aea7371e99532469"
|
||||
"1b358bdee873f1936b63efe83d190a53c2d21754d302d63ff285174023473755"
|
||||
"58b938c2e3ca4c2ce48942da97f9e45797f2c074ac6004734e93784a48af6160");
|
||||
|
||||
cdm::InputBuffer buf;
|
||||
|
||||
@@ -1112,11 +1109,11 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.is_encrypted = true;
|
||||
data.is_secure = false;
|
||||
|
||||
// WHAT: Key ID of key used to encrypt the test content.
|
||||
// WHY: This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("92D20D250D425ABD992AF42E4CD64165");
|
||||
// Key ID of key used to encrypt the test content.
|
||||
// This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("E02562E04CD55351B14B3D748D36ED8E");
|
||||
|
||||
// WHAT: Dummy encrypted data.
|
||||
// Dummy encrypted data.
|
||||
data.encrypt_data = wvcdm::a2b_hex(
|
||||
"3b2cbde084973539329bd5656da22d20396249bf4a18a51c38c4743360cc9fea"
|
||||
"a1c78d53de1bd7e14dc5d256fd20a57178a98b83804258c239acd7aa38f2d7d2"
|
||||
@@ -1128,7 +1125,8 @@ class WvCdmApiTest : public testing::Test {
|
||||
"d95a133bff5f57614dda5e4446cd8837901d074149dadf4b775b5b07bb88ca20");
|
||||
data.iv = wvcdm::a2b_hex("4cca615fc013102892f91efee936639b");
|
||||
data.block_offset = 0;
|
||||
// WHAT: Expected decrypted data.
|
||||
|
||||
// Expected decrypted data.
|
||||
data.decrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"eff34b8d9b7b6352e7d72de991b599662aa475da355033620152e2356ebfadee"
|
||||
@@ -1181,11 +1179,12 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.is_encrypted = true;
|
||||
data.is_secure = false;
|
||||
|
||||
// WHAT: Key ID of key used to encrypt the test content.
|
||||
// WHY: This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("92D20D250D425ABD992AF42E4CD64165");
|
||||
// Key ID of key used to encrypt the test content.
|
||||
// This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("E02562E04CD55351B14B3D748D36ED8E");
|
||||
|
||||
// WHAT: Dummy encrypted data.
|
||||
// Dummy encrypted data. This is a combination of clear and
|
||||
// encrypted data.
|
||||
data.encrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"3b2cbde084973539329bd5656da22d20396249bf4a18a51c38c4743360cc9fea"
|
||||
@@ -1201,7 +1200,8 @@ class WvCdmApiTest : public testing::Test {
|
||||
"d95a133bff5f57614dda5e4446cd8837901d074149dadf4b775b5b07bb88ca20");
|
||||
data.iv = wvcdm::a2b_hex("4cca615fc013102892f91efee936639b");
|
||||
data.block_offset = 0;
|
||||
// WHAT: Expected decrypted data.
|
||||
|
||||
// Expected decrypted data.
|
||||
data.decrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
@@ -1259,11 +1259,11 @@ class WvCdmApiTest : public testing::Test {
|
||||
data.is_encrypted = true;
|
||||
data.is_secure = false;
|
||||
|
||||
// WHAT: Key ID of key used to encrypt the test content.
|
||||
// WHY: This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("92D20D250D425ABD992AF42E4CD64165");
|
||||
// Key ID of key used to encrypt the test content.
|
||||
// This is used by the secure layer to look up the content key
|
||||
data.key_id = wvcdm::a2bs_hex("E02562E04CD55351B14B3D748D36ED8E");
|
||||
|
||||
// WHAT: Dummy encrypted data.
|
||||
// Dummy encrypted data.
|
||||
data.encrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"3b2cbde084973539329bd5656da22d20396249bf4a18a51c38c4743360cc9fea"
|
||||
@@ -1279,7 +1279,8 @@ class WvCdmApiTest : public testing::Test {
|
||||
"d95a133bff5f57614dda5e4446cd8837901d074149dadf4b775b5b07bb88ca20");
|
||||
data.iv = wvcdm::a2b_hex("4cca615fc013102892f91efee936639b");
|
||||
data.block_offset = 0;
|
||||
// WHAT: Expected decrypted data.
|
||||
|
||||
// Expected decrypted data.
|
||||
data.decrypt_data = wvcdm::a2b_hex(
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
"5a36c0b633b58faf22156d78fdfb608e54a8095788b2b0463ef78d030b4abf82"
|
||||
@@ -1395,7 +1396,7 @@ TEST_F(WvCdmApiTest, BaseTimerTest) {
|
||||
LOGI("Tick count is %ld\n", host_->GetTickCount());
|
||||
// We should have close to, maybe slightly less than sleep_period ticks.
|
||||
// If it ticked at all then we pass as the timer must be expriring.
|
||||
EXPECT_GE(host_->GetTickCount(), 1);
|
||||
EXPECT_GE(host_->GetTickCount(), 1U);
|
||||
CancelKeyRequest(session_id_);
|
||||
}
|
||||
|
||||
@@ -1496,7 +1497,7 @@ int main(int argc, char** argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
wvcdm::InitLogging(argc, argv);
|
||||
|
||||
wvcdm::ConfigTestEnv config(wvcdm::kGoogleLicenseServerTest);
|
||||
wvcdm::ConfigTestEnv config(wvcdm::kGooglePlayServer);
|
||||
g_client_auth.assign(config.client_auth());
|
||||
g_key_system.assign(config.key_system());
|
||||
g_wrong_key_id.assign(config.wrong_key_id());
|
||||
|
||||
Reference in New Issue
Block a user