OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/pairing_host_authenticator.h" | 5 #include "remoting/protocol/pairing_host_authenticator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/base/rsa_key_pair.h" | 10 #include "remoting/base/rsa_key_pair.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 void PairingHostAuthenticator::AddPairingElements(buzz::XmlElement* message) { | 91 void PairingHostAuthenticator::AddPairingElements(buzz::XmlElement* message) { |
92 // Nothing to do here | 92 // Nothing to do here |
93 } | 93 } |
94 | 94 |
95 void PairingHostAuthenticator::ProcessMessageWithPairing( | 95 void PairingHostAuthenticator::ProcessMessageWithPairing( |
96 const buzz::XmlElement* message, | 96 const buzz::XmlElement* message, |
97 const base::Closure& resume_callback, | 97 const base::Closure& resume_callback, |
98 PairingRegistry::Pairing pairing) { | 98 PairingRegistry::Pairing pairing) { |
99 waiting_for_paired_secret_ = false; | 99 waiting_for_paired_secret_ = false; |
100 std::string paired_secret = pairing.shared_secret; | 100 std::string paired_secret = pairing.shared_secret(); |
101 if (paired_secret.empty()) { | 101 if (paired_secret.empty()) { |
102 LOG(INFO) << "Unknown client id"; | 102 LOG(INFO) << "Unknown client id"; |
103 error_message_ = "unknown-client-id"; | 103 error_message_ = "unknown-client-id"; |
104 } | 104 } |
105 | 105 |
106 using_paired_secret_ = !paired_secret.empty(); | 106 using_paired_secret_ = !paired_secret.empty(); |
107 if (using_paired_secret_) { | 107 if (using_paired_secret_) { |
108 v2_authenticator_ = V2Authenticator::CreateForHost( | 108 v2_authenticator_ = V2Authenticator::CreateForHost( |
109 local_cert_, key_pair_, paired_secret, WAITING_MESSAGE); | 109 local_cert_, key_pair_, paired_secret, WAITING_MESSAGE); |
110 PairingAuthenticatorBase::ProcessMessage(message, resume_callback); | 110 PairingAuthenticatorBase::ProcessMessage(message, resume_callback); |
111 } else { | 111 } else { |
112 v2_authenticator_ = V2Authenticator::CreateForHost( | 112 v2_authenticator_ = V2Authenticator::CreateForHost( |
113 local_cert_, key_pair_, pin_, MESSAGE_READY); | 113 local_cert_, key_pair_, pin_, MESSAGE_READY); |
114 // The client's optimistic SPAKE message is using a Paired Secret to | 114 // The client's optimistic SPAKE message is using a Paired Secret to |
115 // which the host doesn't have access, so don't bother processing it. | 115 // which the host doesn't have access, so don't bother processing it. |
116 resume_callback.Run(); | 116 resume_callback.Run(); |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 } // namespace protocol | 120 } // namespace protocol |
121 } // namespace remoting | 121 } // namespace remoting |
OLD | NEW |