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

Unified Diff: remoting/protocol/v1_authenticator.cc

Issue 8774031: Multi-step authentication support in JingleSession. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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: remoting/protocol/v1_authenticator.cc
diff --git a/remoting/protocol/v1_authenticator.cc b/remoting/protocol/v1_authenticator.cc
index 2daf246f26705b523319a42d58a1cf96e2c7cc4a..13bed8e42f96eaf4df9bc73a07a39448dbc1ba57 100644
--- a/remoting/protocol/v1_authenticator.cc
+++ b/remoting/protocol/v1_authenticator.cc
@@ -20,7 +20,6 @@ namespace remoting {
namespace protocol {
namespace {
-const char kAuthenticationTag[] = "authentication";
const char kAuthTokenTag[] = "auth-token";
const char kCertificateTag[] = "certificate";
} // namespace
@@ -64,19 +63,16 @@ void V1ClientAuthenticator::ProcessMessage(const XmlElement* message) {
XmlElement* V1ClientAuthenticator::GetNextMessage() {
DCHECK_EQ(state_, MESSAGE_READY);
- XmlElement* authentication_tag = new XmlElement(
- QName(kChromotingXmlNamespace, kAuthenticationTag));
-
+ XmlElement* message = CreateEmptyAuthenticatorMessage();
std::string token =
protocol::GenerateSupportAuthToken(local_jid_, shared_secret_);
-
XmlElement* auth_token_tag = new XmlElement(
QName(kChromotingXmlNamespace, kAuthTokenTag));
auth_token_tag->SetBodyText(token);
- authentication_tag->AddElement(auth_token_tag);
+ message->AddElement(auth_token_tag);
state_ = WAITING_MESSAGE;
- return authentication_tag;
+ return message;
}
ChannelAuthenticator*
@@ -121,9 +117,7 @@ void V1HostAuthenticator::ProcessMessage(const XmlElement* message) {
XmlElement* V1HostAuthenticator::GetNextMessage() {
DCHECK_EQ(state_, MESSAGE_READY);
- XmlElement* message = new XmlElement(
- QName(kChromotingXmlNamespace, kAuthenticationTag));
-
+ XmlElement* message = CreateEmptyAuthenticatorMessage();
buzz::XmlElement* certificate_tag = new XmlElement(
buzz::QName(kChromotingXmlNamespace, kCertificateTag));
std::string base64_cert;

Powered by Google App Engine
This is Rietveld 408576698