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

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 affbb3121a605ab7e8cc4bf5dafe31334f0858a8..25d9b0db3c1c2dafafe327f28fbeb7fff9457a5a 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
@@ -173,6 +173,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));
@@ -187,6 +188,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));
@@ -212,9 +215,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));
@@ -245,8 +249,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));
@@ -320,7 +325,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