Update copyright notice and fix entitlement key sizes

This change updates the copyright notice to make it more clear that
the code is distribued under the Widevine Master License Agreement.

It also updates the unit tests and sample code to correct the useage
of AES 256.  AES 256 is used to decrypt entitled content keys, but it
is not used to decrypt key control blocks.
This commit is contained in:
Fred Gylys-Colwell
2018-04-18 11:43:47 -07:00
parent 44e206898d
commit 16d9abca4c
45 changed files with 186 additions and 90 deletions

View File

@@ -1,4 +1,6 @@
// Copyright 2016 Google Inc. All Rights Reserved.
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine Master
// License Agreement.
//
// OEMCrypto device features for unit tests
//
@@ -186,8 +188,8 @@ bool DeviceFeatures::IsTestKeyboxInstalled() {
size_t key_data_len = sizeof(key_data);
if (OEMCrypto_GetKeyData(key_data, &key_data_len) != OEMCrypto_SUCCESS)
return false;
if (key_data_len != sizeof(kTestKeybox.data_)) return false;
if (memcmp(key_data, kTestKeybox.data_, key_data_len)) return false;
if (key_data_len != sizeof(kValidKeybox01.data_)) return false;
if (memcmp(key_data, kValidKeybox01.data_, key_data_len)) return false;
uint8_t dev_id[128] = {0};
size_t dev_id_len = 128;
if (OEMCrypto_GetDeviceID(dev_id, &dev_id_len) != OEMCrypto_SUCCESS)
@@ -195,8 +197,8 @@ bool DeviceFeatures::IsTestKeyboxInstalled() {
// We use strncmp instead of memcmp because we don't really care about the
// multiple '\0' characters at the end of the device id.
return 0 == strncmp(reinterpret_cast<const char*>(dev_id),
reinterpret_cast<const char*>(kTestKeybox.device_id_),
sizeof(kTestKeybox.device_id_));
reinterpret_cast<const char*>(kValidKeybox01.device_id_),
sizeof(kValidKeybox01.device_id_));
}
void DeviceFeatures::FilterOut(std::string* current_filter,