// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine // License Agreement. // // Test data for OEMCrypto unit tests. // #ifndef CDM_OEMCRYPTO_PROVISIONING_TEST_ #define CDM_OEMCRYPTO_PROVISIONING_TEST_ #include #include "oemcrypto_basic_test.h" #include "OEMCryptoCENC.h" #include "oec_session_util.h" #include "oemcrypto_session_tests_helper.h" namespace wvoec { // Tests using this class are only used for devices with a keybox. They are not // run for devices with an OEM Certificate. class OEMCryptoKeyboxTest : public OEMCryptoClientTest { void SetUp() override { OEMCryptoClientTest::SetUp(); OEMCryptoResult sts = OEMCrypto_IsKeyboxValid(); // If the production keybox is valid, use it for these tests. Most of the // other tests will use a test keybox anyway, but it's nice to check the // device ID for the real keybox if we can. if (sts == OEMCrypto_SUCCESS) return; printf("Production keybox is NOT valid. All tests use test keybox.\n"); ASSERT_EQ( OEMCrypto_SUCCESS, OEMCrypto_LoadTestKeybox(reinterpret_cast(&kTestKeybox), sizeof(kTestKeybox))); } }; // This class is for tests that have an OEM Certificate instead of a keybox. class OEMCryptoProv30Test : public OEMCryptoClientTest {}; // This class is for tests that have boot certificate chain instead of a keybox. class OEMCryptoProv40Test : public OEMCryptoClientTest {}; } // namespace wvoec #endif // CDM_OEMCRYPTO_PROVISIONING_TEST_