diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_mock.cpp b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_mock.cpp index 1ea5e86b..764ae37a 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_mock.cpp +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_mock.cpp @@ -96,7 +96,7 @@ extern "C" OEMCryptoResult OEMCrypto_OpenSession(OEMCrypto_SESSION* session) { "(OEMCrypto_SESSION *session)\n"); } if (!crypto_engine) { - LOGE("OEMCrypto_OpenSession: OEMCrypto Not Initialized."); + LOGE("OEMCrypto_OpenSession: OEMCrypto not initialized."); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } if (crypto_engine->GetNumberOfOpenSessions() >= @@ -118,7 +118,7 @@ extern "C" OEMCryptoResult OEMCrypto_CloseSession(OEMCrypto_SESSION session) { "(OEMCrypto_SESSION session)\n"); } if (!crypto_engine) { - LOGE("OEMCrypto_CloseSession: OEMCrypto Not Initialized."); + LOGE("OEMCrypto_CloseSession: OEMCrypto not initialized."); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } if (!crypto_engine->DestroySession((SessionId)session)) { @@ -148,7 +148,7 @@ extern "C" OEMCryptoResult OEMCrypto_GenerateDerivedKeys( } } if (!crypto_engine) { - LOGE("OEMCrypto_GenerateDerivedKeys: OEMCrypto Not Initialized."); + LOGE("OEMCrypto_GenerateDerivedKeys: OEMCrypto not initialized."); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } if (!crypto_engine->config_supports_keybox()) { @@ -195,7 +195,7 @@ extern "C" OEMCryptoResult OEMCrypto_GenerateNonce(OEMCrypto_SESSION session, "(OEMCrypto_SESSION session,\n"); } if (!crypto_engine) { - LOGE("OEMCrypto_GenerateNonce: OEMCrypto Not Initialized."); + LOGE("OEMCrypto_GenerateNonce: OEMCrypto not initialized."); return OEMCrypto_ERROR_UNKNOWN_FAILURE; } SessionContext* session_ctx = crypto_engine->FindSession(session); @@ -1575,6 +1575,7 @@ extern "C" OEMCryptoResult OEMCrypto_Generic_Verify( signature, signature_length); } +// TODO(fredgc): remove this. extern "C" OEMCryptoResult OEMCrypto_UpdateUsageTable() { if (LogCategoryEnabled(kLoggingTraceOEMCryptoCalls)) { LOGI("-- OEMCryptoResult OEMCrypto_UpdateUsageTable();\n"); diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.cpp b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.cpp index e7f5e911..0945e169 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.cpp +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All Rights Reserved. +// Copyright 2017 Google Inc. All Rights Reserved. // // Mock implementation of OEMCrypto APIs // diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.h b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.h index 493c1a83..293c02b6 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.h +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_nonce_table.h @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All Rights Reserved. +// Copyright 2017 Google Inc. All Rights Reserved. // // Mock implementation of OEMCrypto APIs // diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_old_usage_table_mock.cpp b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_old_usage_table_mock.cpp index fb22af49..cbeb7501 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_old_usage_table_mock.cpp +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_old_usage_table_mock.cpp @@ -2,6 +2,9 @@ // // Mock implementation of OEMCrypto APIs // +// This is from the v12 version of oemcrypto usage tables. It is used for +// devices that upgrade from v12 to v13 in the field, and need to convert from +// the old type of usage table to the new. #include "oemcrypto_old_usage_table_mock.h" #include diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.cpp b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.cpp index 0551f9cb..fba20b50 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.cpp +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All Rights Reserved. +// Copyright 2017 Google Inc. All Rights Reserved. // // Mock implementation of OEMCrypto APIs // @@ -172,7 +172,7 @@ bool SessionContext::RSADeriveKeys( } session_key_.resize(decrypted_size); if (decrypted_size != static_cast(wvcdm::KEY_SIZE)) { - LOGE("[RSADeriveKeys(): error. session key is wrong size: %d.]", + LOGE("[RSADeriveKeys(): error. Session key is wrong size: %d.]", decrypted_size); dump_openssl_error(); session_key_.clear(); @@ -575,7 +575,7 @@ bool SessionContext::InstallRSAEncryptedKey( } encryption_key_.resize(decrypted_size); if (decrypted_size != static_cast(wvcdm::KEY_SIZE)) { - LOGE("[RSADeriveKeys(): error. session key is wrong size: %d.]", + LOGE("[RSADeriveKeys(): error. Session key is wrong size: %d.]", decrypted_size); dump_openssl_error(); encryption_key_.clear(); diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.h b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.h index 768d0165..b5af29ee 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.h +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session.h @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All Rights Reserved. +// Copyright 2017 Google Inc. All Rights Reserved. // // Mock implementation of OEMCrypto APIs // diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.cpp b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.cpp index c313f133..35cee58c 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.cpp +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All Rights Reserved. +// Copyright 2017 Google Inc. All Rights Reserved. // // Mock implementation of OEMCrypto APIs // diff --git a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.h b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.h index f3567bdb..5fb6b371 100644 --- a/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.h +++ b/libwvdrmengine/oemcrypto/mock/src/oemcrypto_session_key_table.h @@ -1,4 +1,4 @@ -// Copyright 2013 Google Inc. All Rights Reserved. +// Copyright 2017 Google Inc. All Rights Reserved. // // Mock implementation of OEMCrypto APIs // diff --git a/libwvdrmengine/oemcrypto/test/oec_session_util.h b/libwvdrmengine/oemcrypto/test/oec_session_util.h index af8a2581..5b63732a 100644 --- a/libwvdrmengine/oemcrypto/test/oec_session_util.h +++ b/libwvdrmengine/oemcrypto/test/oec_session_util.h @@ -276,7 +276,7 @@ class Session { void ReloadUsageEntry() { LoadUsageEntry(*this); } // Update the usage entry and save the header to the specified buffer. void UpdateUsageEntry(std::vector* header_buffer); - // Deactivate this sessions usage entry. + // Deactivate this session's usage entry. void DeactivateUsageEntry(const std::string& pst, OEMCryptoResult expect_result = OEMCrypto_SUCCESS); // The usage entry number for this session's usage entry. diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index fec4cc9c..c8e5e0f4 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -2419,7 +2419,7 @@ TEST_F(OEMCryptoLoadsCertificate, TestLargeRSAKey3072) { ASSERT_NO_FATAL_FAILURE(s.TestDecryptCTR()); } -// Deivces that load certificates, should at least support RSA 2048 keys. +// Devices that load certificates, should at least support RSA 2048 keys. TEST_F(OEMCryptoLoadsCertificate, SupportsCertificatesAPI13) { ASSERT_NE(0, OEMCrypto_Supports_RSA_2048bit & OEMCrypto_SupportedCertificates()) @@ -5473,9 +5473,10 @@ TEST_F(UsageTableTest, VerifyUsageTimes) { s.TestDecryptCTR(false, OEMCrypto_ERROR_UNKNOWN_FAILURE)); } -// This is a special case where a collection of licenses can be shared with -// multiple devices. In order for this to work, a single session must first -// load a device specific license, and then a shared content license. +// This is a special case where a group of assets can be licensed with a master +// key. In order for this to work, a single session must first load a device +// specific license, and then a shared content license. This shared license is +// sometimes called an embedded license. TEST_F(UsageTableTest, LoadSharedLicense) { std::string pst = "my_pst"; Session s; @@ -5490,7 +5491,7 @@ TEST_F(UsageTableTest, LoadSharedLicense) { // The second set of keys are in the shared license. They will have the // same mac keys as the original license, so we leave that alone. - // We given them different key ids so we can test that they were loaded. + // They are given different key ids so we can test that they were loaded. // For this test, we leave the key content the same -- in real life it // will be different. for (unsigned int i = 0; i < s.num_keys(); i++) {