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

Unified Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc

Issue 581463002: Reland: Minor cleanup in EasyUnlockClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
index 9a74ed801f3a5cc2f4f4b865a1f0a85c23b6b921..ee898ce61255cf565ddc1fd67123b91386470c0c 100644
--- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc
@@ -153,15 +153,16 @@ void EasyUnlockCreateKeysOperation::ChallengeCreator::OnEskGenerated(
void EasyUnlockCreateKeysOperation::ChallengeCreator::GeneratePayload() {
// Work around to get HeaderAndBody bytes to use as challenge payload.
+ EasyUnlockClient::CreateSecureMessageOptions options;
+ options.key = esk_;
+ // TODO(xiyuan, tbarzic): Wrap in a GenericPublicKey proto.
+ options.verification_key_id = tpm_pub_key_;
+ options.encryption_type = easy_unlock::kEncryptionTypeAES256CBC;
+ options.signature_type = easy_unlock::kSignatureTypeHMACSHA256;
+
easy_unlock_client_->CreateSecureMessage(
session_key_,
- esk_,
- std::string(), // associated data
- std::string(), // public meta
- tpm_pub_key_, // TODO(xiyuan): Wrap in a GenericPublicKey proto.
- std::string(), // decryption key id
- easy_unlock::kEncryptionTypeAES256CBC,
- easy_unlock::kSignatureTypeHMACSHA256,
+ options,
base::Bind(&ChallengeCreator::OnPayloadMessageGenerated,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -169,12 +170,14 @@ void EasyUnlockCreateKeysOperation::ChallengeCreator::GeneratePayload() {
void
EasyUnlockCreateKeysOperation::ChallengeCreator::OnPayloadMessageGenerated(
const std::string& payload_message) {
+ EasyUnlockClient::UnwrapSecureMessageOptions options;
+ options.key = esk_;
+ options.encryption_type = easy_unlock::kEncryptionTypeAES256CBC;
+ options.signature_type = easy_unlock::kSignatureTypeHMACSHA256;
+
easy_unlock_client_->UnwrapSecureMessage(
payload_message,
- esk_,
- std::string(), // associated data
- easy_unlock::kEncryptionTypeAES256CBC,
- easy_unlock::kSignatureTypeHMACSHA256,
+ options,
base::Bind(&ChallengeCreator::OnPayloadGenerated,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -187,15 +190,15 @@ void EasyUnlockCreateKeysOperation::ChallengeCreator::OnPayloadGenerated(
return;
}
+ EasyUnlockClient::CreateSecureMessageOptions options;
+ options.key = esk_;
+ options.decryption_key_id = ec_public_key_;
+ options.encryption_type = easy_unlock::kEncryptionTypeAES256CBC;
+ options.signature_type = easy_unlock::kSignatureTypeHMACSHA256;
+
easy_unlock_client_->CreateSecureMessage(
payload,
- esk_,
- std::string(), // associated data
- std::string(), // public meta
- std::string(), // verification key id
- ec_public_key_, // decryption key id
- easy_unlock::kEncryptionTypeAES256CBC,
- easy_unlock::kSignatureTypeHMACSHA256,
+ options,
base::Bind(&ChallengeCreator::OnChallengeGenerated,
weak_ptr_factory_.GetWeakPtr()));
}
« no previous file with comments | « no previous file | chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698