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

Side by Side Diff: remoting/protocol/v2_authenticator.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « remoting/protocol/transport_context.cc ('k') | remoting/protocol/v2_authenticator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ 5 #ifndef REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ 6 #define REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_
7 7
8 #include <memory>
8 #include <queue> 9 #include <queue>
9 #include <string> 10 #include <string>
10 11
11 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "crypto/p224_spake.h" 16 #include "crypto/p224_spake.h"
17 #include "remoting/protocol/authenticator.h" 17 #include "remoting/protocol/authenticator.h"
18 18
19 namespace remoting { 19 namespace remoting {
20 20
21 class RsaKeyPair; 21 class RsaKeyPair;
22 22
23 namespace protocol { 23 namespace protocol {
24 24
25 class V2Authenticator : public Authenticator { 25 class V2Authenticator : public Authenticator {
26 public: 26 public:
27 static bool IsEkeMessage(const buzz::XmlElement* message); 27 static bool IsEkeMessage(const buzz::XmlElement* message);
28 28
29 static scoped_ptr<Authenticator> CreateForClient( 29 static std::unique_ptr<Authenticator> CreateForClient(
30 const std::string& shared_secret, 30 const std::string& shared_secret,
31 State initial_state); 31 State initial_state);
32 32
33 static scoped_ptr<Authenticator> CreateForHost( 33 static std::unique_ptr<Authenticator> CreateForHost(
34 const std::string& local_cert, 34 const std::string& local_cert,
35 scoped_refptr<RsaKeyPair> key_pair, 35 scoped_refptr<RsaKeyPair> key_pair,
36 const std::string& shared_secret, 36 const std::string& shared_secret,
37 State initial_state); 37 State initial_state);
38 38
39 ~V2Authenticator() override; 39 ~V2Authenticator() override;
40 40
41 // Authenticator interface. 41 // Authenticator interface.
42 State state() const override; 42 State state() const override;
43 bool started() const override; 43 bool started() const override;
44 RejectionReason rejection_reason() const override; 44 RejectionReason rejection_reason() const override;
45 void ProcessMessage(const buzz::XmlElement* message, 45 void ProcessMessage(const buzz::XmlElement* message,
46 const base::Closure& resume_callback) override; 46 const base::Closure& resume_callback) override;
47 scoped_ptr<buzz::XmlElement> GetNextMessage() override; 47 std::unique_ptr<buzz::XmlElement> GetNextMessage() override;
48 const std::string& GetAuthKey() const override; 48 const std::string& GetAuthKey() const override;
49 scoped_ptr<ChannelAuthenticator> CreateChannelAuthenticator() const override; 49 std::unique_ptr<ChannelAuthenticator> CreateChannelAuthenticator()
50 const override;
50 51
51 private: 52 private:
52 FRIEND_TEST_ALL_PREFIXES(V2AuthenticatorTest, InvalidSecret); 53 FRIEND_TEST_ALL_PREFIXES(V2AuthenticatorTest, InvalidSecret);
53 54
54 V2Authenticator(crypto::P224EncryptedKeyExchange::PeerType type, 55 V2Authenticator(crypto::P224EncryptedKeyExchange::PeerType type,
55 const std::string& shared_secret, 56 const std::string& shared_secret,
56 State initial_state); 57 State initial_state);
57 58
58 virtual void ProcessMessageInternal(const buzz::XmlElement* message); 59 virtual void ProcessMessageInternal(const buzz::XmlElement* message);
59 60
(...skipping 15 matching lines...) Expand all
75 std::queue<std::string> pending_messages_; 76 std::queue<std::string> pending_messages_;
76 std::string auth_key_; 77 std::string auth_key_;
77 78
78 DISALLOW_COPY_AND_ASSIGN(V2Authenticator); 79 DISALLOW_COPY_AND_ASSIGN(V2Authenticator);
79 }; 80 };
80 81
81 } // namespace protocol 82 } // namespace protocol
82 } // namespace remoting 83 } // namespace remoting
83 84
84 #endif // REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ 85 #endif // REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_
OLDNEW
« no previous file with comments | « remoting/protocol/transport_context.cc ('k') | remoting/protocol/v2_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698