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

Unified Diff: components/cryptauth/device_to_device_authenticator.cc

Issue 2899863002: Updating D2D protocol to v1 to support separate sequence numbers. (Closed)
Patch Set: Addressing comments Created 3 years, 7 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: components/cryptauth/device_to_device_authenticator.cc
diff --git a/components/cryptauth/device_to_device_authenticator.cc b/components/cryptauth/device_to_device_authenticator.cc
index d80449ffaa05d80d216e5663cea571e3bde28616..75e19f2f3046921aac2651587ef47d9edc903046 100644
--- a/components/cryptauth/device_to_device_authenticator.cc
+++ b/components/cryptauth/device_to_device_authenticator.cc
@@ -154,7 +154,7 @@ void DeviceToDeviceAuthenticator::OnResponderAuthTimedOut() {
void DeviceToDeviceAuthenticator::OnResponderAuthValidated(
bool validated,
- const std::string& session_symmetric_key) {
+ const SessionKeys& session_keys) {
if (!validated) {
Fail("Unable to validated [Responder Auth]");
return;
@@ -163,12 +163,11 @@ void DeviceToDeviceAuthenticator::OnResponderAuthValidated(
PA_LOG(INFO) << "Successfully validated [Responder Auth]! "
<< "Sending [Initiator Auth]...";
state_ = State::VALIDATED_RESPONDER_AUTH;
- session_symmetric_key_ = session_symmetric_key;
+ session_keys_ = session_keys;
// Create the [Initiator Auth] message to send to the remote device.
DeviceToDeviceInitiatorOperations::CreateInitiatorAuthMessage(
- session_symmetric_key,
- connection_->remote_device().persistent_symmetric_key,
+ session_keys_, connection_->remote_device().persistent_symmetric_key,
responder_auth_message_, secure_message_delegate_.get(),
base::Bind(&DeviceToDeviceAuthenticator::OnInitiatorAuthCreated,
weak_ptr_factory_.GetWeakPtr()));
@@ -204,7 +203,8 @@ void DeviceToDeviceAuthenticator::Fail(const std::string& error_message,
void DeviceToDeviceAuthenticator::Succeed() {
DCHECK(state_ == State::SENT_INITIATOR_AUTH);
- DCHECK(!session_symmetric_key_.empty());
+ DCHECK(!session_keys_.initiator_encode_key().empty());
+ DCHECK(!session_keys_.responder_encode_key().empty());
PA_LOG(INFO) << "Authentication succeeded!";
state_ = State::AUTHENTICATION_SUCCESS;
@@ -212,7 +212,7 @@ void DeviceToDeviceAuthenticator::Succeed() {
callback_.Run(
Result::SUCCESS,
base::MakeUnique<DeviceToDeviceSecureContext>(
- std::move(secure_message_delegate_), session_symmetric_key_,
+ std::move(secure_message_delegate_), session_keys_,
responder_auth_message_, SecureContext::PROTOCOL_VERSION_THREE_ONE));
}
« no previous file with comments | « components/cryptauth/device_to_device_authenticator.h ('k') | components/cryptauth/device_to_device_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698