Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(947)

Unified Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc

Issue 518643002: Add ability to pass decryption key id to CreateSecureMessage method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc
index 2e00f301eedb0f0e82056cf74326ee227ff3391b..1ffd7fc180b66dc36164fa2806a46c7ce3c3b3fa 100644
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api_chromeos_unittest.cc
@@ -163,6 +163,7 @@ TEST_F(EasyUnlockPrivateApiTest, CreateSecureMessage) {
"ASSOCIATED_DATA",
"PUBLIC_METADATA",
"VERIFICATION_KEY_ID",
+ "DECRYPTION_KEY_ID",
easy_unlock::kEncryptionTypeAES256CBC,
easy_unlock::kSignatureTypeHMACSHA256,
base::Bind(&CopyData, &expected_result));
@@ -177,6 +178,8 @@ TEST_F(EasyUnlockPrivateApiTest, CreateSecureMessage) {
options->Set("publicMetadata", StringToBinaryValue("PUBLIC_METADATA"));
options->Set("verificationKeyId",
StringToBinaryValue("VERIFICATION_KEY_ID"));
+ options->Set("decryptionKeyId",
+ StringToBinaryValue("DECRYPTION_KEY_ID"));
options->SetString(
"encryptType",
api::ToString(api::ENCRYPTION_TYPE_AES_256_CBC));
@@ -202,9 +205,10 @@ TEST_F(EasyUnlockPrivateApiTest, CreateSecureMessage_EmptyOptions) {
client_->CreateSecureMessage(
"PAYLOAD",
"KEY",
- "",
- "",
- "",
+ "", // associated data
+ "", // public metadata
+ "", // verification key id
+ "", // decryption key id
easy_unlock::kEncryptionTypeNone,
easy_unlock::kSignatureTypeHMACSHA256,
base::Bind(&CopyData, &expected_result));
@@ -235,8 +239,9 @@ TEST_F(EasyUnlockPrivateApiTest, CreateSecureMessage_AsymmetricSign) {
"PAYLOAD",
"KEY",
"ASSOCIATED_DATA",
- "",
+ "", // public metadata
"VERIFICATION_KEY_ID",
+ "", // decryption key id
easy_unlock::kEncryptionTypeNone,
easy_unlock::kSignatureTypeECDSAP256SHA256,
base::Bind(&CopyData, &expected_result));
@@ -310,7 +315,7 @@ TEST_F(EasyUnlockPrivateApiTest, UnwrapSecureMessage_EmptyOptions) {
client_->UnwrapSecureMessage(
"MESSAGE",
"KEY",
- "",
+ "", // associated data
easy_unlock::kEncryptionTypeNone,
easy_unlock::kSignatureTypeHMACSHA256,
base::Bind(&CopyData, &expected_result));

Powered by Google App Engine
This is Rietveld 408576698