Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_HOST_AUTHENTICATOR_H_ | |
| 6 #define REMOTING_PROTOCOL_PAIRING_HOST_AUTHENTICATOR_H_ | |
| 7 | |
| 8 #include "remoting/protocol/authenticator.h" | |
| 9 | |
| 10 namespace remoting { | |
| 11 | |
| 12 class RsaKeyPair; | |
| 13 | |
| 14 namespace protocol { | |
| 15 | |
| 16 class V2Authenticator; | |
| 17 class PairingRegistry; | |
| 18 | |
| 19 // PairingAuthenticator builds on top of V2Authenticator to add support for | |
| 20 // PIN-less authentication via device pairing. If a client device is already | |
| 21 // paired, it includes a client id in the initial authentication message. | |
| 22 // If the host recognizes the id, it looks up the corresponding shared secret | |
| 23 // to authenticate the client. If it does not recognize the id, it sends an | |
| 24 // error message to the client, which will prompt the user for a PIN to use | |
| 25 // for authentication instead. In either case, the V2Authenticator is used | |
|
rmsousa
2013/05/15 01:25:16
Please elaborate on how the V2Authenticator is use
rmsousa
2013/05/15 01:25:16
V2Authenticator with HMAC_SHA256 hashing.
Jamie
2013/05/15 23:41:08
I've spelled out the protocol in more detail. LMKW
Jamie
2013/05/15 23:41:08
Done.
| |
| 26 // for authentication. | |
| 27 class PairingHostAuthenticator : public Authenticator { | |
| 28 public: | |
| 29 PairingHostAuthenticator( | |
| 30 scoped_refptr<PairingRegistry> pairing_registry, | |
| 31 const std::string& local_cert, | |
| 32 scoped_refptr<RsaKeyPair> key_pair, | |
| 33 const std::string& shared_secret, | |
| 34 State initial_state); | |
| 35 virtual ~PairingHostAuthenticator() {} | |
| 36 | |
| 37 // Authenticator interface. | |
| 38 virtual State state() const OVERRIDE; | |
| 39 virtual RejectionReason rejection_reason() const OVERRIDE; | |
| 40 virtual void ProcessMessage(const buzz::XmlElement* message, | |
| 41 const base::Closure& resume_callback) OVERRIDE; | |
| 42 virtual scoped_ptr<buzz::XmlElement> GetNextMessage() OVERRIDE; | |
| 43 virtual scoped_ptr<ChannelAuthenticator> | |
| 44 CreateChannelAuthenticator() const OVERRIDE; | |
| 45 | |
| 46 private: | |
| 47 void CreateV2AuthenticatorWithPIN(); | |
| 48 | |
| 49 scoped_refptr<PairingRegistry> pairing_registry_; | |
| 50 std::string local_cert_; | |
| 51 scoped_refptr<RsaKeyPair> key_pair_; | |
| 52 const std::string& shared_secret_; | |
| 53 State initial_state_; | |
| 54 scoped_ptr<Authenticator> v2_authenticator_; | |
| 55 std::string error_message_; | |
| 56 | |
| 57 DISALLOW_COPY_AND_ASSIGN(PairingHostAuthenticator); | |
| 58 }; | |
| 59 | |
| 60 } // namespace protocol | |
| 61 } // namespace remoting | |
| 62 | |
| 63 #endif // REMOTING_PROTOCOL_PAIRING_AUTHENTICATOR_H_ | |
| OLD | NEW |