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

Side by Side Diff: remoting/host/pam_authorization_factory_posix.cc

Issue 1277093006: Enable QUIC support in chromoting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quic_adapters
Patch Set: Created 5 years, 4 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/host/host_status_logger.cc ('k') | remoting/protocol/authenticator.h » ('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 #include "remoting/host/pam_authorization_factory_posix.h" 5 #include "remoting/host/pam_authorization_factory_posix.h"
6 6
7 #include <security/pam_appl.h> 7 #include <security/pam_appl.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 11 matching lines...) Expand all
22 PamAuthorizer(scoped_ptr<protocol::Authenticator> underlying); 22 PamAuthorizer(scoped_ptr<protocol::Authenticator> underlying);
23 ~PamAuthorizer() override; 23 ~PamAuthorizer() override;
24 24
25 // protocol::Authenticator interface. 25 // protocol::Authenticator interface.
26 State state() const override; 26 State state() const override;
27 bool started() const override; 27 bool started() const override;
28 RejectionReason rejection_reason() const override; 28 RejectionReason rejection_reason() const override;
29 void ProcessMessage(const buzz::XmlElement* message, 29 void ProcessMessage(const buzz::XmlElement* message,
30 const base::Closure& resume_callback) override; 30 const base::Closure& resume_callback) override;
31 scoped_ptr<buzz::XmlElement> GetNextMessage() override; 31 scoped_ptr<buzz::XmlElement> GetNextMessage() override;
32 const std::string& GetAuthKey() const override;
32 scoped_ptr<protocol::ChannelAuthenticator> CreateChannelAuthenticator() 33 scoped_ptr<protocol::ChannelAuthenticator> CreateChannelAuthenticator()
33 const override; 34 const override;
34 35
35 private: 36 private:
36 void MaybeCheckLocalLogin(); 37 void MaybeCheckLocalLogin();
37 bool IsLocalLoginAllowed(); 38 bool IsLocalLoginAllowed();
38 void OnMessageProcessed(const base::Closure& resume_callback); 39 void OnMessageProcessed(const base::Closure& resume_callback);
39 40
40 static int PamConversation(int num_messages, 41 static int PamConversation(int num_messages,
41 const struct pam_message** messages, 42 const struct pam_message** messages,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 MaybeCheckLocalLogin(); 89 MaybeCheckLocalLogin();
89 resume_callback.Run(); 90 resume_callback.Run();
90 } 91 }
91 92
92 scoped_ptr<buzz::XmlElement> PamAuthorizer::GetNextMessage() { 93 scoped_ptr<buzz::XmlElement> PamAuthorizer::GetNextMessage() {
93 scoped_ptr<buzz::XmlElement> result(underlying_->GetNextMessage()); 94 scoped_ptr<buzz::XmlElement> result(underlying_->GetNextMessage());
94 MaybeCheckLocalLogin(); 95 MaybeCheckLocalLogin();
95 return result.Pass(); 96 return result.Pass();
96 } 97 }
97 98
99 const std::string& PamAuthorizer::GetAuthKey() const {
100 return underlying_->GetAuthKey();
101 }
102
98 scoped_ptr<protocol::ChannelAuthenticator> 103 scoped_ptr<protocol::ChannelAuthenticator>
99 PamAuthorizer::CreateChannelAuthenticator() const { 104 PamAuthorizer::CreateChannelAuthenticator() const {
100 return underlying_->CreateChannelAuthenticator(); 105 return underlying_->CreateChannelAuthenticator();
101 } 106 }
102 107
103 void PamAuthorizer::MaybeCheckLocalLogin() { 108 void PamAuthorizer::MaybeCheckLocalLogin() {
104 if (local_login_status_ == NOT_CHECKED && state() == ACCEPTED) { 109 if (local_login_status_ == NOT_CHECKED && state() == ACCEPTED) {
105 local_login_status_ = IsLocalLoginAllowed() ? ALLOWED : DISALLOWED; 110 local_login_status_ = IsLocalLoginAllowed() ? ALLOWED : DISALLOWED;
106 } 111 }
107 } 112 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const std::string& local_jid, 174 const std::string& local_jid,
170 const std::string& remote_jid, 175 const std::string& remote_jid,
171 const buzz::XmlElement* first_message) { 176 const buzz::XmlElement* first_message) {
172 scoped_ptr<protocol::Authenticator> authenticator( 177 scoped_ptr<protocol::Authenticator> authenticator(
173 underlying_->CreateAuthenticator(local_jid, remote_jid, first_message)); 178 underlying_->CreateAuthenticator(local_jid, remote_jid, first_message));
174 return make_scoped_ptr(new PamAuthorizer(authenticator.Pass())); 179 return make_scoped_ptr(new PamAuthorizer(authenticator.Pass()));
175 } 180 }
176 181
177 182
178 } // namespace remoting 183 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_status_logger.cc ('k') | remoting/protocol/authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698