MySQL 5.6.14 Source Code Document
|
Common base for Handshake_{server,client}. More...
#include <handshake.h>
Public Types | |
enum | side_t { CLIENT, SERVER } |
Public Member Functions | |
Handshake (const char *ssp, side_t side) | |
int | packet_processing_loop () |
virtual bool | is_complete () const |
int | error () const |
const char * | ssp_name () |
Protected Member Functions | |
bool | process_result (int) |
virtual Blob | process_data (const Blob &data)=0 |
virtual Blob | read_packet ()=0 |
Read packet from the other end. | |
virtual int | write_packet (Blob &data)=0 |
Write packet to the other end. |
Protected Attributes | |
CtxtHandle | m_sctx |
Security context object created during the handshake. | |
CredHandle | m_cred |
Credentials of the principal performing this handshake. | |
TimeStamp | m_expire |
Stores expiry date of the created security context. | |
ULONG | m_atts |
Stores attributes of the created security context. | |
unsigned int | m_round |
int | m_error |
If non-zero, stores error code of the last failed operation. | |
bool | m_complete |
true when handshake is complete. | |
bool | m_have_credentials |
true when the principal credentials has been determined. | |
bool | m_have_sec_context |
true when the security context has been created. | |
Security_buffer | m_output |
Buffer for data to be send to the other side. |
Common base for Handshake_{server,client}.
Definition at line 94 of file handshake.h.
Handshake::Handshake | ( | const char * | ssp, |
side_t | side | ||
) |
Handshake class implementation Create common part of handshake context.
[in] | ssp | name of the SSP (Security Service Provider) to be used for authentication |
[in] | side | is this handshake object used for server- or client-side handshake |
Prepare for handshake using the ssp
security module. We use "Negotiate" which picks best available module. Parameter side
tells if this is preparing for server or client side authentication and is used to prepare appropriate credentials.
Definition at line 35 of file handshake.cc.
int Handshake::packet_processing_loop | ( | ) |
Read and process data packets from the other end of a connection.
IN] | con a connection to read packets from |
Packets are read and processed until authentication handshake is complete. It is assumed that the peer will send at least one packet. Packets are processed with process_data()
method. If new data is generated during packet processing, this data is sent to the peer and another round of packet exchange starts.
Definition at line 93 of file handshake.cc.
This method is used inside packet_processing_loop
to process data packets received from the other end.
IN] | data data to be processed |
Implemented in Handshake_client.
|
protected |
Process result of {Initialize
,Accept}SecurityContext() function.
[in] | ret | return code from {Initialize ,Accept}SecurityContext() function |
This function analyses return value of Windows {Initialize
,Accept}SecurityContext() function. A call to CompleteAuthToken()
is done if requested. If authentication is complete, this fact is marked in the internal state of the Handshake object. If errors are detected the object is moved to error state.
Definition at line 216 of file handshake.cc.
const char * Handshake::ssp_name | ( | ) |
Get name of the security package which was used in authentication.
This method should be called only after handshake was completed. It is available only in debug builds.
Definition at line 177 of file handshake.cc.
|
protected |
Round of the handshake (starting from round 1). One round consist of reading packet from the other side, processing it and optionally sending a reply (see packet_processing_loop()
).
Definition at line 134 of file handshake.h.