DBus::priv::SASL Class Reference

Implements the authentication routines for connection to the bus. More...

#include <sasl.h>

Public Member Functions

 SASL (int fd, bool negotiateFDPassing)
 Create a new SASL authenticator. More...
 
 ~SASL ()
 
std::tuple< bool, bool, std::vector< uint8_t > > authenticate ()
 Perform the authentication with the server. More...
 

Private Member Functions

int write_data_with_newline (std::string data)
 
std::string read_data ()
 
std::string encode_as_hex (int num)
 
std::vector< uint8_t > hex_to_vector (std::string hexData)
 
 DBUS_CXX_PROPAGATE_CONST (std::unique_ptr< priv_data >) m_priv
 

Detailed Description

Implements the authentication routines for connection to the bus.

Constructor & Destructor Documentation

◆ SASL()

SASL::SASL ( int  fd,
bool  negotiateFDPassing 
)

Create a new SASL authenticator.

Parameters
fdThe FD to authenticate on
negotiateFDPassingTrue if we should try to negotiate FD passing, false otherwise

◆ ~SASL()

SASL::~SASL ( )

Member Function Documentation

◆ authenticate()

std::tuple< bool, bool, std::vector< uint8_t > > SASL::authenticate ( )

Perform the authentication with the server.

Returns
A tuple containing the following:
  • bool Success of authentication
  • bool If this supports FD passing
  • vector The GUID of the server

References AGREE_UNIX_FD_REGEX(), encode_as_hex(), ERROR_REGEX(), hex_to_vector(), OK_REGEX(), read_data(), REJECTED_REGEX(), SIMPLELOGGER_DEBUG, and write_data_with_newline().

Referenced by DBus::priv::Transport::open_transport().

◆ DBUS_CXX_PROPAGATE_CONST()

DBus::priv::SASL::DBUS_CXX_PROPAGATE_CONST ( std::unique_ptr< priv_data >  )
private

◆ encode_as_hex()

std::string SASL::encode_as_hex ( int  num)
private

Referenced by authenticate().

◆ hex_to_vector()

std::vector< uint8_t > SASL::hex_to_vector ( std::string  hexData)
private

References hexchar2int().

Referenced by authenticate().

◆ read_data()

std::string SASL::read_data ( )
private

◆ write_data_with_newline()

int SASL::write_data_with_newline ( std::string  data)
private

References LOGGER_NAME, and SIMPLELOGGER_DEBUG.

Referenced by authenticate().


The documentation for this class was generated from the following files: