Changes included in this CL: 166806: Update OEMCrypto_GetDeviceInformation() | https://widevine-internal-review.googlesource.com/c/cdm/+/166806 166808: Update Android L3 after OEMCrypto_GetDeviceInformation() signature changes | https://widevine-internal-review.googlesource.com/c/cdm/+/166808 166809: Decode device info and write it to CSR payload | https://widevine-internal-review.googlesource.com/c/cdm/+/166809 167158: Fix Android include path and copy_files | https://widevine-internal-review.googlesource.com/c/cdm/+/167158 167159: Fix common typos and use inclusive language suggested by Android linter | https://widevine-internal-review.googlesource.com/c/cdm/+/167159 165618: Explicitly state python3 where needed. | https://widevine-internal-review.googlesource.com/c/cdm/+/165618 166757: Update Android.bp for Android | https://widevine-internal-review.googlesource.com/c/cdm/+/166757 164993: Refactor basic oemcrypto unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/164993 164978: Update OEMCrypto Unit Test Docs | https://widevine-internal-review.googlesource.com/c/cdm/+/164978 166941: Update make files for OEMCrypto | https://widevine-internal-review.googlesource.com/c/cdm/+/166941 165279: Refactor license unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165279 165318: Refactor provisioning unit tests | https://widevine-internal-review.googlesource.com/c/cdm/+/165318 164800: Add extra check for renew on license load unit test | https://widevine-internal-review.googlesource.com/c/cdm/+/164800 165860: Remove duplicate definition of MaybeHex() | https://widevine-internal-review.googlesource.com/c/cdm/+/165860 164889: Updated CoreCommonRequestFromMessage and fix test | https://widevine-internal-review.googlesource.com/c/cdm/+/164889 164967: Add OPK pre-hook and post-hook error codes | https://widevine-internal-review.googlesource.com/c/cdm/+/164967 165140: Add hidden device_id_length to v18 provisioning message | https://widevine-internal-review.googlesource.com/c/cdm/+/165140 165204: Fix memory leak in oemcrypto test | https://widevine-internal-review.googlesource.com/c/cdm/+/165204 165958: Fix oemcrypto_generic_verify_fuzz mutator signature offset | https://widevine-internal-review.googlesource.com/c/cdm/+/165958 166037: Support SHA-256 in OEMCrypto Session Util | https://widevine-internal-review.googlesource.com/c/cdm/+/166037 Test: Run GtsMediaTests on Pixel 7 Bug: 270612144 Change-Id: Iff0820a2de7d043a820470a130af65b0dcadb759
44 lines
1.6 KiB
C++
44 lines
1.6 KiB
C++
// 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 <gtest/gtest.h>
|
|
#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<const uint8_t*>(&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_
|