| 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 61fadc8619a644fac06e1dc57f57e1cc7512ff68..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
|
| @@ -166,19 +166,16 @@
|
| new EasyUnlockPrivateCreateSecureMessageFunction());
|
| function->set_has_callback(true);
|
|
|
| - chromeos::EasyUnlockClient::CreateSecureMessageOptions create_options;
|
| - create_options.key = "KEY";
|
| - create_options.associated_data = "ASSOCIATED_DATA";
|
| - create_options.public_metadata = "PUBLIC_METADATA";
|
| - create_options.verification_key_id = "VERIFICATION_KEY_ID";
|
| - create_options.decryption_key_id = "DECRYPTION_KEY_ID";
|
| - create_options.encryption_type = easy_unlock::kEncryptionTypeAES256CBC;
|
| - create_options.signature_type = easy_unlock::kSignatureTypeHMACSHA256;
|
| -
|
| std::string expected_result;
|
| client_->CreateSecureMessage(
|
| "PAYLOAD",
|
| - create_options,
|
| + "KEY",
|
| + "ASSOCIATED_DATA",
|
| + "PUBLIC_METADATA",
|
| + "VERIFICATION_KEY_ID",
|
| + "DECRYPTION_KEY_ID",
|
| + easy_unlock::kEncryptionTypeAES256CBC,
|
| + easy_unlock::kSignatureTypeHMACSHA256,
|
| base::Bind(&CopyData, &expected_result));
|
| ASSERT_GT(expected_result.length(), 0u);
|
|
|
| @@ -214,15 +211,16 @@
|
| new EasyUnlockPrivateCreateSecureMessageFunction());
|
| function->set_has_callback(true);
|
|
|
| - chromeos::EasyUnlockClient::CreateSecureMessageOptions create_options;
|
| - create_options.key = "KEY";
|
| - create_options.encryption_type = easy_unlock::kEncryptionTypeNone;
|
| - create_options.signature_type = easy_unlock::kSignatureTypeHMACSHA256;
|
| -
|
| std::string expected_result;
|
| client_->CreateSecureMessage(
|
| "PAYLOAD",
|
| - create_options,
|
| + "KEY",
|
| + "", // associated data
|
| + "", // public metadata
|
| + "", // verification key id
|
| + "", // decryption key id
|
| + easy_unlock::kEncryptionTypeNone,
|
| + easy_unlock::kSignatureTypeHMACSHA256,
|
| base::Bind(&CopyData, &expected_result));
|
| ASSERT_GT(expected_result.length(), 0u);
|
|
|
| @@ -246,17 +244,16 @@
|
| new EasyUnlockPrivateCreateSecureMessageFunction());
|
| function->set_has_callback(true);
|
|
|
| - chromeos::EasyUnlockClient::CreateSecureMessageOptions create_options;
|
| - create_options.key = "KEY";
|
| - create_options.associated_data = "ASSOCIATED_DATA";
|
| - create_options.verification_key_id = "VERIFICATION_KEY_ID";
|
| - create_options.encryption_type = easy_unlock::kEncryptionTypeNone;
|
| - create_options.signature_type = easy_unlock::kSignatureTypeECDSAP256SHA256;
|
| -
|
| std::string expected_result;
|
| client_->CreateSecureMessage(
|
| "PAYLOAD",
|
| - create_options,
|
| + "KEY",
|
| + "ASSOCIATED_DATA",
|
| + "", // public metadata
|
| + "VERIFICATION_KEY_ID",
|
| + "", // decryption key id
|
| + easy_unlock::kEncryptionTypeNone,
|
| + easy_unlock::kSignatureTypeECDSAP256SHA256,
|
| base::Bind(&CopyData, &expected_result));
|
| ASSERT_GT(expected_result.length(), 0u);
|
|
|
| @@ -287,21 +284,18 @@
|
| new EasyUnlockPrivateUnwrapSecureMessageFunction());
|
| function->set_has_callback(true);
|
|
|
| - chromeos::EasyUnlockClient::UnwrapSecureMessageOptions unwrap_options;
|
| - unwrap_options.key = "KEY";
|
| - unwrap_options.associated_data = "ASSOCIATED_DATA";
|
| - unwrap_options.encryption_type = easy_unlock::kEncryptionTypeAES256CBC;
|
| - unwrap_options.signature_type = easy_unlock::kSignatureTypeHMACSHA256;
|
| -
|
| std::string expected_result;
|
| client_->UnwrapSecureMessage(
|
| - "MESSAGE",
|
| - unwrap_options,
|
| - base::Bind(&CopyData, &expected_result));
|
| - ASSERT_GT(expected_result.length(), 0u);
|
| -
|
| - scoped_ptr<base::ListValue> args(new base::ListValue);
|
| - args->Append(StringToBinaryValue("MESSAGE"));
|
| + "PAYLOAD",
|
| + "KEY",
|
| + "ASSOCIATED_DATA",
|
| + easy_unlock::kEncryptionTypeAES256CBC,
|
| + easy_unlock::kSignatureTypeHMACSHA256,
|
| + base::Bind(&CopyData, &expected_result));
|
| + ASSERT_GT(expected_result.length(), 0u);
|
| +
|
| + scoped_ptr<base::ListValue> args(new base::ListValue);
|
| + args->Append(StringToBinaryValue("PAYLOAD"));
|
| args->Append(StringToBinaryValue("KEY"));
|
| base::DictionaryValue* options = new base::DictionaryValue();
|
| args->Append(options);
|
| @@ -327,15 +321,13 @@
|
| new EasyUnlockPrivateUnwrapSecureMessageFunction());
|
| function->set_has_callback(true);
|
|
|
| - chromeos::EasyUnlockClient::UnwrapSecureMessageOptions unwrap_options;
|
| - unwrap_options.key = "KEY";
|
| - unwrap_options.encryption_type = easy_unlock::kEncryptionTypeNone;
|
| - unwrap_options.signature_type = easy_unlock::kSignatureTypeHMACSHA256;
|
| -
|
| std::string expected_result;
|
| client_->UnwrapSecureMessage(
|
| "MESSAGE",
|
| - unwrap_options,
|
| + "KEY",
|
| + "", // associated data
|
| + easy_unlock::kEncryptionTypeNone,
|
| + easy_unlock::kSignatureTypeHMACSHA256,
|
| base::Bind(&CopyData, &expected_result));
|
| ASSERT_GT(expected_result.length(), 0u);
|
|
|
| @@ -359,16 +351,13 @@
|
| new EasyUnlockPrivateUnwrapSecureMessageFunction());
|
| function->set_has_callback(true);
|
|
|
| - chromeos::EasyUnlockClient::UnwrapSecureMessageOptions unwrap_options;
|
| - unwrap_options.key = "KEY";
|
| - unwrap_options.associated_data = "ASSOCIATED_DATA";
|
| - unwrap_options.encryption_type = easy_unlock::kEncryptionTypeNone;
|
| - unwrap_options.signature_type = easy_unlock::kSignatureTypeECDSAP256SHA256;
|
| -
|
| std::string expected_result;
|
| client_->UnwrapSecureMessage(
|
| "MESSAGE",
|
| - unwrap_options,
|
| + "KEY",
|
| + "ASSOCIATED_DATA",
|
| + easy_unlock::kEncryptionTypeNone,
|
| + easy_unlock::kSignatureTypeECDSAP256SHA256,
|
| base::Bind(&CopyData, &expected_result));
|
| ASSERT_GT(expected_result.length(), 0u);
|
|
|
|
|