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

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

Issue 14793021: PairingAuthenticator implementation and plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored common host- and client-side code into common base. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_PROTOCOL_PAIRING_CLIENT_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_PAIRING_CLIENT_AUTHENTICATOR_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "remoting/protocol/pairing_authenticator_base.h"
10
11 namespace remoting {
12 namespace protocol {
13
14 class PairingClientAuthenticator : public PairingAuthenticatorBase {
15 public:
16 PairingClientAuthenticator(
17 const std::string& client_id,
18 const std::string& paired_secret,
19 const FetchSecretCallback& fetch_pin_callback,
20 const std::string& authentication_tag);
21 virtual ~PairingClientAuthenticator() {}
22
23 private:
24 // PairingAuthenticatorBase interface.
25 virtual void CreateV2AuthenticatorWithPIN(
26 State initial_state,
27 const SetAuthenticatorCallback& callback) OVERRIDE;
28 virtual scoped_ptr<Authenticator> CreateV2AuthenticatorFromInitialMessage(
29 const buzz::XmlElement* message) OVERRIDE;
30 virtual void AmendProtocolMessage(buzz::XmlElement* message) OVERRIDE;
31
32 void OnPinFetched(State initial_state,
33 const SetAuthenticatorCallback& callback,
34 const std::string& pin);
35
36 // Protocol state.
37 bool sent_client_id_;
38 std::string client_id_;
39 const std::string& paired_secret_;
40 FetchSecretCallback fetch_pin_callback_;
41 std::string authentication_tag_;
42
43 base::WeakPtrFactory<PairingClientAuthenticator> weak_factory_;
44
45 DISALLOW_COPY_AND_ASSIGN(PairingClientAuthenticator);
46 };
47
48 } // namespace protocol
49 } // namespace remoting
50
51 #endif // REMOTING_PROTOCOL_PAIRING_AUTHENTICATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698