Small fixes leftover from V16 merge.
[ Merge of http://go/wvgerrit/93505 ] During the merge process there were a few CL comments (ag/10122083) that were not able to be addressed. Most changes in the CL are spelling / grammar corrections. Bug: 148907684 Bug: 141247171 Test: CDM unit tests Change-Id: I9a8648525bbe5ed319521ebf01741a958ab69ae2
This commit is contained in:
@@ -76,8 +76,8 @@ class CertificateProvisioning {
|
|||||||
std::unique_ptr<ServiceCertificate> service_certificate_;
|
std::unique_ptr<ServiceCertificate> service_certificate_;
|
||||||
|
|
||||||
// Indicates whether OEMCrypto supports core messages, and whether the
|
// Indicates whether OEMCrypto supports core messages, and whether the
|
||||||
// CDM should expect a core message in the response. This is primarly
|
// CDM should expect a core message in the response. This is primarily
|
||||||
// used to distinguish between v16+ OEMCrypto or and earlier version.
|
// used to distinguish between v16+ OEMCrypto or an earlier version.
|
||||||
// Assume core messages are supported, and check if OEMCrypto populates
|
// Assume core messages are supported, and check if OEMCrypto populates
|
||||||
// the core message field when calling PrepAndSignProvisioningRequest().
|
// the core message field when calling PrepAndSignProvisioningRequest().
|
||||||
bool supports_core_messages_ = true;
|
bool supports_core_messages_ = true;
|
||||||
|
|||||||
@@ -1475,7 +1475,6 @@ CdmResponseType CdmEngine::ReleaseUsageInfo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType status = usage_session_->ReleaseKey(message);
|
CdmResponseType status = usage_session_->ReleaseKey(message);
|
||||||
// Q: Should this only be reset if release key was successful?
|
|
||||||
usage_session_.reset();
|
usage_session_.reset();
|
||||||
if (NO_ERROR != status) {
|
if (NO_ERROR != status) {
|
||||||
LOGE("ReleaseKey failed: status = %d", status);
|
LOGE("ReleaseKey failed: status = %d", status);
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ CdmResponseType CdmLicense::HandleKeyResponse(
|
|||||||
|
|
||||||
// Check that the server returned a |core_message|. If missing, then
|
// Check that the server returned a |core_message|. If missing, then
|
||||||
// the server is assumed to operate as V15. This will imply that the
|
// the server is assumed to operate as V15. This will imply that the
|
||||||
// |signature| field in the respones does not include a core message
|
// |signature| field in the response does not include a core message
|
||||||
// either.
|
// either.
|
||||||
if (!signed_response.has_oemcrypto_core_message()) {
|
if (!signed_response.has_oemcrypto_core_message()) {
|
||||||
supports_core_messages_ = false;
|
supports_core_messages_ = false;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2013 Google Inc. All Rights Reserved.
|
// Copyright 2019 Google Inc. All Rights Reserved.
|
||||||
//
|
//
|
||||||
// Clock - A fake clock just for running tests.
|
// Clock - A fake clock just for running tests.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
// Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary
|
||||||
// source code may only be used and distributed under the Widevine Master
|
// source code may only be used and distributed under the Widevine Master
|
||||||
// License Agreement.
|
// License Agreement.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The ODK Library is used to generate and parse core OEMCrypto messages.
|
The ODK Library is used to generate and parse core OEMCrypto messages.
|
||||||
|
|
||||||
This library is used by both OEMcrypto on a device, and by Widvine license and
|
This library is used by both OEMCrypto on a device, and by Widvine license and
|
||||||
provisioning servers.
|
provisioning servers.
|
||||||
|
|
||||||
The source of truth for these files is in the server code base on piper. Do not
|
The source of truth for these files is in the server code base on piper. Do not
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class UsageTableEntry {
|
|||||||
virtual OEMCryptoResult ReportUsage(const std::vector<uint8_t>& pst,
|
virtual OEMCryptoResult ReportUsage(const std::vector<uint8_t>& pst,
|
||||||
uint8_t* buffer, size_t* buffer_length);
|
uint8_t* buffer, size_t* buffer_length);
|
||||||
virtual void UpdateAndIncrement(ODK_ClockValues* clock_values);
|
virtual void UpdateAndIncrement(ODK_ClockValues* clock_values);
|
||||||
// Save all data to the give buffer. This should be called after updating the
|
// Save all data to the given buffer. This should be called after updating the
|
||||||
// data.
|
// data.
|
||||||
OEMCryptoResult SaveData(CryptoEngine* ce, SessionContext* session,
|
OEMCryptoResult SaveData(CryptoEngine* ce, SessionContext* session,
|
||||||
uint8_t* signed_buffer, size_t buffer_size);
|
uint8_t* signed_buffer, size_t buffer_size);
|
||||||
@@ -72,8 +72,8 @@ class UsageTableEntry {
|
|||||||
recent_decrypt_ = recent_decrypt;
|
recent_decrypt_ = recent_decrypt;
|
||||||
}
|
}
|
||||||
static size_t SignedEntrySize();
|
static size_t SignedEntrySize();
|
||||||
const uint8_t* mac_key_server() { return data_.mac_key_server; }
|
const uint8_t* mac_key_server() const { return data_.mac_key_server; }
|
||||||
const uint8_t* mac_key_client() { return data_.mac_key_client; }
|
const uint8_t* mac_key_client() const { return data_.mac_key_client; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UsageTable* usage_table_; // Owner of this object.
|
UsageTable* usage_table_; // Owner of this object.
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ TEST_F(OEMCryptoClientTest, VersionNumber) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The resource rating is a number from 1 to 4. The first three levels were
|
// The resource rating is a number from 1 to 4. The first three levels were
|
||||||
// initiallly defined in API 15 and they were expaneded in API 16.
|
// initially defined in API 15 and they were expanded in API 16.
|
||||||
TEST_F(OEMCryptoClientTest, ResourceRatingAPI15) {
|
TEST_F(OEMCryptoClientTest, ResourceRatingAPI15) {
|
||||||
ASSERT_GE(OEMCrypto_ResourceRatingTier(), 1u);
|
ASSERT_GE(OEMCrypto_ResourceRatingTier(), 1u);
|
||||||
ASSERT_LE(OEMCrypto_ResourceRatingTier(), 4u);
|
ASSERT_LE(OEMCrypto_ResourceRatingTier(), 4u);
|
||||||
@@ -298,7 +298,7 @@ TEST_F(OEMCryptoClientTest, CheckMaxNumberOfSessionsAPI10) {
|
|||||||
TEST_F(OEMCryptoClientTest, CheckUsageTableSizeAPI16) {
|
TEST_F(OEMCryptoClientTest, CheckUsageTableSizeAPI16) {
|
||||||
const size_t maximum = OEMCrypto_MaximumUsageTableHeaderSize();
|
const size_t maximum = OEMCrypto_MaximumUsageTableHeaderSize();
|
||||||
printf(" Max Usage Table Size: %zu.\n", maximum);
|
printf(" Max Usage Table Size: %zu.\n", maximum);
|
||||||
// A maximum of 0 means the table is constrained my dynamic memory allocation.
|
// A maximum of 0 means the table is constrained by dynamic memory allocation.
|
||||||
if (maximum > 0) ASSERT_GE(maximum, RequiredUsageSize());
|
if (maximum > 0) ASSERT_GE(maximum, RequiredUsageSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user