MySQL 8.0.39
Source Code Documentation
Handshake_client Class Reference

Client-side context for authentication handshake. More...

Inheritance diagram for Handshake_client:
[legend]

Public Member Functions

 Handshake_client (Connection &con, const char *target, size_t len)
 Create authentication handshake context for client. More...
 
 ~Handshake_client () override
 
Blob first_packet ()
 
Blob process_data (const Blob &) override
 Process data sent by server. More...
 
Blob read_packet () override
 Read packet from the other end. More...
 
int write_packet (Blob &data) override
 Write packet to the other end. More...
 
- Public Member Functions inherited from Handshake
 Handshake (const char *ssp, side_t side)
 Handshake class implementation. More...
 
virtual ~Handshake ()
 
int packet_processing_loop ()
 Read and process data packets from the other end of a connection. More...
 
virtual bool is_complete () const
 
int error () const
 
const char * ssp_name ()
 Get name of the security package which was used in authentication. More...
 

Private Attributes

SEC_WCHAR * m_service_name
 Name of the server's service for which we authenticate. More...
 
SEC_WCHAR m_service_name_buf [MAX_SERVICE_NAME_LENGTH]
 Buffer for storing service name obtained from server. More...
 
Connectionm_con
 

Additional Inherited Members

- Public Types inherited from Handshake
enum  side_t { CLIENT , SERVER }
 
- Protected Member Functions inherited from Handshake
bool process_result (int)
 Process result of {Initialize,Accept}SecurityContext() function. More...
 
- Protected Attributes inherited from Handshake
CtxtHandle m_sctx
 Security context object created during the handshake. More...
 
CredHandle m_cred
 Credentials of the principal performing this handshake. More...
 
TimeStamp m_expire
 Stores expiry date of the created security context. More...
 
ULONG m_atts
 Stores attributes of the created security context. More...
 
unsigned int m_round
 Round of the handshake (starting from round 1). More...
 
int m_error
 If non-zero, stores error code of the last failed operation. More...
 
bool m_complete
 true when handshake is complete. More...
 
bool m_have_credentials
 true when the principal credentials has been determined. More...
 
bool m_have_sec_context
 true when the security context has been created. More...
 
Security_buffer m_output
 Buffer for data to be send to the other side. More...
 

Detailed Description

Client-side context for authentication handshake.

Constructor & Destructor Documentation

◆ Handshake_client()

Handshake_client::Handshake_client ( Connection con,
const char *  target,
size_t  len 
)

Create authentication handshake context for client.

Parameters
conconnection for communication with the peer
targetname of the target service with which we will authenticate (can be NULL if not used)
lenlength of target

Some security packages (like Kerberos) require providing explicit name of the service with which a client wants to authenticate. The server-side authentication plugin sends this name in the greeting packet (see win_auth_handshake_{server,client}() functions).

◆ ~Handshake_client()

Handshake_client::~Handshake_client ( )
override

Member Function Documentation

◆ first_packet()

Blob Handshake_client::first_packet ( )

◆ process_data()

Blob Handshake_client::process_data ( const Blob data)
overridevirtual

Process data sent by server.

Parameters
[in]datablob with data from server

This method analyses data sent by server during authentication handshake. If client should continue packet exchange, this method returns data to be sent to the server next. If no more data needs to be exchanged, an empty blob is returned and is_complete() is true. In case of error an empty blob is returned and error() gives non-zero error code.

When invoked for the first time (in the first round of the handshake) there is no data from the server (data blob is null) and the initial packet is generated without an input.

Returns
Data to be sent to the server next or null blob if no more data needs to be exchanged or in case of error.

Implements Handshake.

◆ read_packet()

Blob Handshake_client::read_packet ( )
overridevirtual

Read packet from the other end.

Implements Handshake.

◆ write_packet()

int Handshake_client::write_packet ( Blob data)
overridevirtual

Write packet to the other end.

Implements Handshake.

Member Data Documentation

◆ m_con

Connection& Handshake_client::m_con
private

◆ m_service_name

SEC_WCHAR* Handshake_client::m_service_name
private

Name of the server's service for which we authenticate.

The service name is sent by server in the initial packet. If no service name is used, this member is NULL.

◆ m_service_name_buf

SEC_WCHAR Handshake_client::m_service_name_buf[MAX_SERVICE_NAME_LENGTH]
private

Buffer for storing service name obtained from server.


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