#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/host/pam_authorization_factory_posix.h"
#include <security/pam_appl.h>
#include <utility>
#include "base/environment.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "remoting/base/logging.h"
#include "remoting/host/base/username.h"
#include "remoting/protocol/channel_authenticator.h"
#include "third_party/libjingle_xmpp/xmllite/xmlelement.h"
namespace remoting {
namespace {
class PamAuthorizer : public protocol::Authenticator { … };
}
PamAuthorizer::PamAuthorizer(
std::unique_ptr<protocol::Authenticator> underlying)
: … { … }
PamAuthorizer::~PamAuthorizer() { … }
protocol::CredentialsType PamAuthorizer::credentials_type() const { … }
const protocol::Authenticator& PamAuthorizer::implementing_authenticator()
const { … }
protocol::Authenticator::State PamAuthorizer::state() const { … }
bool PamAuthorizer::started() const { … }
protocol::Authenticator::RejectionReason PamAuthorizer::rejection_reason()
const { … }
void PamAuthorizer::ProcessMessage(const jingle_xmpp::XmlElement* message,
base::OnceClosure resume_callback) { … }
void PamAuthorizer::OnMessageProcessed(base::OnceClosure resume_callback) { … }
std::unique_ptr<jingle_xmpp::XmlElement> PamAuthorizer::GetNextMessage() { … }
const std::string& PamAuthorizer::GetAuthKey() const { … }
std::unique_ptr<protocol::ChannelAuthenticator>
PamAuthorizer::CreateChannelAuthenticator() const { … }
void PamAuthorizer::MaybeCheckLocalLogin() { … }
bool PamAuthorizer::IsLocalLoginAllowed() { … }
int PamAuthorizer::PamConversation(int num_messages,
const struct pam_message** messages,
struct pam_response** responses,
void* context) { … }
PamAuthorizationFactory::PamAuthorizationFactory(
std::unique_ptr<protocol::AuthenticatorFactory> underlying)
: … { … }
PamAuthorizationFactory::~PamAuthorizationFactory() { … }
std::unique_ptr<protocol::Authenticator>
PamAuthorizationFactory::CreateAuthenticator(const std::string& local_jid,
const std::string& remote_jid) { … }
}