This is a merge of the following CLs: Style clean up in oemcrypto/mock https://widevine-internal-review.googlesource.com/#/c/10660 Split off default keybox. https://widevine-internal-review.googlesource.com/#/c/10661/ Split off several properties from CryptoEngine. https://widevine-internal-review.googlesource.com/#/c/10662/ Split off Keybox installation. https://widevine-internal-review.googlesource.com/#/c/10680/ Wii-U build compatibility fixes. https://widevine-internal-review.googlesource.com/#/c/10720/ Fix style issues in oemcrypto_logging_test. https://widevine-internal-review.googlesource.com/#/c/10824/ Correct OEMCrypto error codes in the mock. https://widevine-internal-review.googlesource.com/#/c/10821/ Enable logging during OEMCrypto unit tests. https://widevine-internal-review.googlesource.com/#/c/10833/ Wait to create usage table path until needed. https://widevine-internal-review.googlesource.com/#/c/10831/ Allow keybox installation to be unimplemented. https://widevine-internal-review.googlesource.com/#/c/10850/ Minor clean up in the OEMCrypto header. https://widevine-internal-review.googlesource.com/#/c/10921/ Add usage table device property to the mock oemcrypto https://widevine-internal-review.googlesource.com/#/c/11092/ Change-Id: I02a818a620bcd4bd2291f1b3c0ac9308ae444319
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
// Copyright 2014 Google Inc. All Rights Reserved.
|
|
//
|
|
// Test keybox.
|
|
|
|
#include "oemcrypto_keybox_mock.h"
|
|
#include "wv_keybox.h"
|
|
|
|
namespace wvoec_mock {
|
|
|
|
namespace {
|
|
|
|
const WidevineKeybox kKeybox = {
|
|
// Sample keybox used for test vectors
|
|
{
|
|
// deviceID
|
|
0x54, 0x65, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x30, // TestKey01
|
|
0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........
|
|
}, {
|
|
// key
|
|
0xfb, 0xda, 0x04, 0x89, 0xa1, 0x58, 0x16, 0x0e,
|
|
0xa4, 0x02, 0xe9, 0x29, 0xe3, 0xb6, 0x8f, 0x04,
|
|
}, {
|
|
// data
|
|
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x10, 0x19,
|
|
0x07, 0xd9, 0xff, 0xde, 0x13, 0xaa, 0x95, 0xc1,
|
|
0x22, 0x67, 0x80, 0x53, 0x36, 0x21, 0x36, 0xbd,
|
|
0xf8, 0x40, 0x8f, 0x82, 0x76, 0xe4, 0xc2, 0xd8,
|
|
0x7e, 0xc5, 0x2b, 0x61, 0xaa, 0x1b, 0x9f, 0x64,
|
|
0x6e, 0x58, 0x73, 0x49, 0x30, 0xac, 0xeb, 0xe8,
|
|
0x99, 0xb3, 0xe4, 0x64, 0x18, 0x9a, 0x14, 0xa8,
|
|
0x72, 0x02, 0xfb, 0x02, 0x57, 0x4e, 0x70, 0x64,
|
|
0x0b, 0xd2, 0x2e, 0xf4, 0x4b, 0x2d, 0x7e, 0x39,
|
|
}, {
|
|
// magic
|
|
0x6b, 0x62, 0x6f, 0x78,
|
|
}, {
|
|
// Crc
|
|
0x0a, 0x7a, 0x2c, 0x35,
|
|
}
|
|
};
|
|
|
|
} // namespace
|
|
|
|
bool WvKeybox::Prepare() {
|
|
InstallKeybox(reinterpret_cast<const uint8_t*>(&kKeybox),
|
|
sizeof(kKeybox));
|
|
return true;
|
|
}
|
|
|
|
} // namespace wvoec_mock
|