Migration from jb-mr2 to master for Widevine CDM
Android development of the widevine CDM has been done on the jb-mr2 branch of the cdm code base. This CL contains a merge of that jb-mr2 work to CDM master, and also reflects the evolution of the common Modular DRM code base since jb-mr2 branched. Change-Id: I1d7e1a12d092c00044a4298261146cb97808d4ef
This commit is contained in:
@@ -4,7 +4,8 @@ LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
oemcrypto_test.cpp
|
||||
oemcrypto_test.cpp \
|
||||
../../cdm/src/log.cpp \
|
||||
|
||||
LOCAL_MODULE_TAGS := tests
|
||||
|
||||
|
||||
@@ -30,11 +30,6 @@
|
||||
using namespace std;
|
||||
|
||||
namespace {
|
||||
// Use random generated or static test vectors
|
||||
bool g_random = true;
|
||||
// Enable/disable console output of test vectors
|
||||
bool g_verbose = false;
|
||||
|
||||
const size_t kNumKeys = 4;
|
||||
const size_t kDuration = 2;
|
||||
const size_t kLongDuration = 5;
|
||||
@@ -921,7 +916,6 @@ class Session {
|
||||
"e899b3e464189a14a87202fb02574e70640bd22ef44b2d7e3912250a230a1408"
|
||||
"0112100915007caa9b5931b76a3a85f046523e10011a09393837363534333231"
|
||||
"180120002a0c31383836373837343035000000000080");
|
||||
OEMCryptoResult sts;
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS,
|
||||
OEMCrypto_GenerateDerivedKeys(
|
||||
session_id(),
|
||||
@@ -1482,7 +1476,6 @@ Session OEMCryptoClientTest::badSession;
|
||||
// These two tests are first, becuase it might give an idea why other
|
||||
// tests are failing when the device has the wrong keybox installed.
|
||||
TEST_F(OEMCryptoClientTest, VersionNumber) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
|
||||
const char* level = OEMCrypto_SecurityLevel();
|
||||
@@ -1528,6 +1521,7 @@ TEST_F(OEMCryptoClientTest, DISABLED_CheckSystemID) {
|
||||
uint32_t req_len = 256;
|
||||
size_t key_data_len = req_len;
|
||||
sts = OEMCrypto_GetKeyData(key_data, &key_data_len);
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, sts);
|
||||
|
||||
uint32_t* data = reinterpret_cast<uint32_t*>(key_data);
|
||||
uint32_t system_id = htonl(data[1]);
|
||||
@@ -1741,8 +1735,6 @@ TEST_F(OEMCryptoClientTest, GenerateNonce) {
|
||||
uint32_t nonce;
|
||||
|
||||
s.GenerateNonce(&nonce);
|
||||
// std::cout << "GenerateNonce:: nonce=" << nonce << std::endl;
|
||||
|
||||
s.close();
|
||||
ASSERT_TRUE(s.successStatus());
|
||||
ASSERT_FALSE(s.isOpen());
|
||||
@@ -1758,9 +1750,6 @@ TEST_F(OEMCryptoClientTest, GenerateTwoNonces) {
|
||||
|
||||
s.GenerateNonce(&nonce1);
|
||||
s.GenerateNonce(&nonce2);
|
||||
// std::cout << "GenerateNonce:: nonce1=" << nonce1 << std::endl;
|
||||
// std::cout << "GenerateNonce:: nonce2=" << nonce2 << std::endl;
|
||||
|
||||
ASSERT_TRUE(nonce1 != nonce2);
|
||||
|
||||
s.close();
|
||||
@@ -1784,8 +1773,10 @@ TEST_F(OEMCryptoClientTest, GenerateDerivedKeys) {
|
||||
|
||||
// Define CAN_INSTALL_KEYBOX if you are compiling with the reference
|
||||
// implementation of OEMCrypto, or if your version of OEMCrypto supports
|
||||
// OEMCrypto_InstallKeybox and OEwith a clear keybox.
|
||||
// OEMCrypto_InstallKeybox with a clear keybox.
|
||||
// The Below tests are based on a specific keybox which is installed for testing.
|
||||
// They are disabled by default. Just because you can install a test keybox,
|
||||
// does not mean you want to install a test keybox.
|
||||
#if defined(CAN_INSTALL_KEYBOX)
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
@@ -2822,7 +2813,6 @@ TEST_F(DISABLED_TestKeybox, ValidateRSATestKeys) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, CertificateProvision) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
Session& s = createSession("ONE");
|
||||
@@ -2844,7 +2834,6 @@ TEST_F(DISABLED_TestKeybox, CertificateProvision) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange1) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
Session& s = createSession("ONE");
|
||||
@@ -2882,7 +2871,6 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange1) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange2) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
Session& s = createSession("ONE");
|
||||
@@ -2922,7 +2910,6 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange2) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange3) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
Session& s = createSession("ONE");
|
||||
@@ -2962,7 +2949,6 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange3) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, CertificateProvisionBadSignature) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
Session& s = createSession("ONE");
|
||||
@@ -3000,7 +2986,6 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadSignature) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, CertificateProvisionBadNonce) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
Session& s = createSession("ONE");
|
||||
@@ -3038,7 +3023,6 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadNonce) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRSAKey) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
Session& s = createSession("ONE");
|
||||
@@ -3141,7 +3125,6 @@ TEST_F(DISABLED_TestKeybox, RSASignature) {
|
||||
}
|
||||
|
||||
TEST_F(DISABLED_TestKeybox, LoadRSASessionKey) {
|
||||
OEMCryptoResult sts;
|
||||
testSetUp();
|
||||
|
||||
InstallKeybox(kDefaultKeybox, true);
|
||||
|
||||
Reference in New Issue
Block a user