MySQL 8.0.39
Source Code Documentation
|
Client-side context for authentication handshake. More...
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... | |
Connection & | m_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... | |
Client-side context for authentication handshake.
Handshake_client::Handshake_client | ( | Connection & | con, |
const char * | target, | ||
size_t | len | ||
) |
Create authentication handshake context for client.
con | connection for communication with the peer |
target | name of the target service with which we will authenticate (can be NULL if not used) |
len | length 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).
|
override |
Blob Handshake_client::first_packet | ( | ) |
Process data sent by server.
[in] | data | blob 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.
Implements Handshake.
|
overridevirtual |
Read packet from the other end.
Implements Handshake.
|
overridevirtual |
Write packet to the other end.
Implements Handshake.
|
private |
|
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
.
|
private |
Buffer for storing service name obtained from server.