From 8977119d05cf6a94ea45fbcadb16d119d111aaca Mon Sep 17 00:00:00 2001 From: Alex Dale Date: Wed, 5 Feb 2020 14:21:50 -0800 Subject: [PATCH] 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 --- libwvdrmengine/cdm/core/include/certificate_provisioning.h | 4 ++-- libwvdrmengine/cdm/core/src/cdm_engine.cpp | 1 - libwvdrmengine/cdm/core/src/license.cpp | 2 +- libwvdrmengine/cdm/util/test/test_clock.cpp | 2 +- libwvdrmengine/cdm/util/test/test_sleep.h | 2 +- libwvdrmengine/oemcrypto/odk/README | 2 +- .../oemcrypto/ref/src/oemcrypto_usage_table_ref.h | 6 +++--- libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 4 ++-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/libwvdrmengine/cdm/core/include/certificate_provisioning.h b/libwvdrmengine/cdm/core/include/certificate_provisioning.h index 6f00c5f8..5d75c6a4 100644 --- a/libwvdrmengine/cdm/core/include/certificate_provisioning.h +++ b/libwvdrmengine/cdm/core/include/certificate_provisioning.h @@ -76,8 +76,8 @@ class CertificateProvisioning { std::unique_ptr service_certificate_; // Indicates whether OEMCrypto supports core messages, and whether the - // CDM should expect a core message in the response. This is primarly - // used to distinguish between v16+ OEMCrypto or and earlier version. + // CDM should expect a core message in the response. This is primarily + // used to distinguish between v16+ OEMCrypto or an earlier version. // Assume core messages are supported, and check if OEMCrypto populates // the core message field when calling PrepAndSignProvisioningRequest(). bool supports_core_messages_ = true; diff --git a/libwvdrmengine/cdm/core/src/cdm_engine.cpp b/libwvdrmengine/cdm/core/src/cdm_engine.cpp index bab060ec..558a2a1d 100644 --- a/libwvdrmengine/cdm/core/src/cdm_engine.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_engine.cpp @@ -1475,7 +1475,6 @@ CdmResponseType CdmEngine::ReleaseUsageInfo( } CdmResponseType status = usage_session_->ReleaseKey(message); - // Q: Should this only be reset if release key was successful? usage_session_.reset(); if (NO_ERROR != status) { LOGE("ReleaseKey failed: status = %d", status); diff --git a/libwvdrmengine/cdm/core/src/license.cpp b/libwvdrmengine/cdm/core/src/license.cpp index 6dbc3e82..e6211938 100644 --- a/libwvdrmengine/cdm/core/src/license.cpp +++ b/libwvdrmengine/cdm/core/src/license.cpp @@ -558,7 +558,7 @@ CdmResponseType CdmLicense::HandleKeyResponse( // Check that the server returned a |core_message|. If missing, then // 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. if (!signed_response.has_oemcrypto_core_message()) { supports_core_messages_ = false; diff --git a/libwvdrmengine/cdm/util/test/test_clock.cpp b/libwvdrmengine/cdm/util/test/test_clock.cpp index 86e90179..151bb28d 100644 --- a/libwvdrmengine/cdm/util/test/test_clock.cpp +++ b/libwvdrmengine/cdm/util/test/test_clock.cpp @@ -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. diff --git a/libwvdrmengine/cdm/util/test/test_sleep.h b/libwvdrmengine/cdm/util/test/test_sleep.h index 4f2dcf52..832f1ade 100644 --- a/libwvdrmengine/cdm/util/test/test_sleep.h +++ b/libwvdrmengine/cdm/util/test/test_sleep.h @@ -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 // License Agreement. // diff --git a/libwvdrmengine/oemcrypto/odk/README b/libwvdrmengine/oemcrypto/odk/README index b92f5d72..6bd1f544 100644 --- a/libwvdrmengine/oemcrypto/odk/README +++ b/libwvdrmengine/oemcrypto/odk/README @@ -1,6 +1,6 @@ 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. The source of truth for these files is in the server code base on piper. Do not diff --git a/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h b/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h index 661ba3ab..e8d4360b 100644 --- a/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h +++ b/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h @@ -56,7 +56,7 @@ class UsageTableEntry { virtual OEMCryptoResult ReportUsage(const std::vector& pst, uint8_t* buffer, size_t* buffer_length); 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. OEMCryptoResult SaveData(CryptoEngine* ce, SessionContext* session, uint8_t* signed_buffer, size_t buffer_size); @@ -72,8 +72,8 @@ class UsageTableEntry { recent_decrypt_ = recent_decrypt; } static size_t SignedEntrySize(); - const uint8_t* mac_key_server() { return data_.mac_key_server; } - const uint8_t* mac_key_client() { return data_.mac_key_client; } + const uint8_t* mac_key_server() const { return data_.mac_key_server; } + const uint8_t* mac_key_client() const { return data_.mac_key_client; } protected: UsageTable* usage_table_; // Owner of this object. diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index 9e559c5f..066e8311 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -214,7 +214,7 @@ TEST_F(OEMCryptoClientTest, VersionNumber) { } // 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) { ASSERT_GE(OEMCrypto_ResourceRatingTier(), 1u); ASSERT_LE(OEMCrypto_ResourceRatingTier(), 4u); @@ -298,7 +298,7 @@ TEST_F(OEMCryptoClientTest, CheckMaxNumberOfSessionsAPI10) { TEST_F(OEMCryptoClientTest, CheckUsageTableSizeAPI16) { const size_t maximum = OEMCrypto_MaximumUsageTableHeaderSize(); 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()); }