OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/v2_authenticator.h" | 5 #include "remoting/protocol/v2_authenticator.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 const buzz::StaticQName kEkeTag = { kChromotingXmlNamespace, | 25 const buzz::StaticQName kEkeTag = { kChromotingXmlNamespace, |
26 "eke-message" }; | 26 "eke-message" }; |
27 const buzz::StaticQName kCertificateTag = { kChromotingXmlNamespace, | 27 const buzz::StaticQName kCertificateTag = { kChromotingXmlNamespace, |
28 "certificate" }; | 28 "certificate" }; |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 // static | 32 // static |
33 bool V2Authenticator::IsEkeMessage(const buzz::XmlElement* message) { | 33 bool V2Authenticator::IsEkeMessage(const buzz::XmlElement* message) { |
34 return message->FirstNamed(kEkeTag) != NULL; | 34 return message->FirstNamed(kEkeTag) != nullptr; |
35 } | 35 } |
36 | 36 |
37 // static | 37 // static |
38 scoped_ptr<Authenticator> V2Authenticator::CreateForClient( | 38 scoped_ptr<Authenticator> V2Authenticator::CreateForClient( |
39 const std::string& shared_secret, | 39 const std::string& shared_secret, |
40 Authenticator::State initial_state) { | 40 Authenticator::State initial_state) { |
41 return make_scoped_ptr(new V2Authenticator( | 41 return make_scoped_ptr(new V2Authenticator( |
42 P224EncryptedKeyExchange::kPeerTypeClient, shared_secret, initial_state)); | 42 P224EncryptedKeyExchange::kPeerTypeClient, shared_secret, initial_state)); |
43 } | 43 } |
44 | 44 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 if (is_host_side()) { | 193 if (is_host_side()) { |
194 return SslHmacChannelAuthenticator::CreateForHost( | 194 return SslHmacChannelAuthenticator::CreateForHost( |
195 local_cert_, local_key_pair_, auth_key_); | 195 local_cert_, local_key_pair_, auth_key_); |
196 } else { | 196 } else { |
197 return SslHmacChannelAuthenticator::CreateForClient( | 197 return SslHmacChannelAuthenticator::CreateForClient( |
198 remote_cert_, auth_key_); | 198 remote_cert_, auth_key_); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 bool V2Authenticator::is_host_side() const { | 202 bool V2Authenticator::is_host_side() const { |
203 return local_key_pair_.get() != NULL; | 203 return local_key_pair_.get() != nullptr; |
204 } | 204 } |
205 | 205 |
206 } // namespace protocol | 206 } // namespace protocol |
207 } // namespace remoting | 207 } // namespace remoting |
OLD | NEW |