Common base for Handshake_{server,client}.
More...
#include <handshake.h>
Common base for Handshake_{server,client}.
◆ side_t
◆ Handshake()
Handshake::Handshake |
( |
const char * |
ssp, |
|
|
side_t |
side |
|
) |
| |
Handshake class implementation.
Create common part of handshake context.
- Parameters
-
[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.
◆ ~Handshake()
Handshake::~Handshake |
( |
| ) |
|
|
virtual |
◆ error()
int Handshake::error |
( |
| ) |
const |
|
inline |
◆ is_complete()
virtual bool Handshake::is_complete |
( |
| ) |
const |
|
inlinevirtual |
◆ packet_processing_loop()
int Handshake::packet_processing_loop |
( |
| ) |
|
Read and process data packets from the other end of a connection.
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.
- Return values
-
- Note
- In case of error, appropriate error message is logged.
◆ process_data()
virtual Blob Handshake::process_data |
( |
const Blob & |
data | ) |
|
|
protectedpure virtual |
This method is used inside packet_processing_loop
to process data packets received from the other end.
- Parameters
-
- Returns
- A blob with data to be sent to the other end or null blob if no more data needs to be exchanged.
Implemented in Handshake_client.
◆ process_result()
bool Handshake::process_result |
( |
int |
ret | ) |
|
|
protected |
Process result of {Initialize
,Accept}SecurityContext() function.
- Parameters
-
[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.
- Returns
- True if error has been detected.
◆ read_packet()
virtual Blob Handshake::read_packet |
( |
| ) |
|
|
protectedpure virtual |
◆ ssp_name()
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.
- Returns
- Name of security package or NULL if it can not be obtained.
◆ write_packet()
virtual int Handshake::write_packet |
( |
Blob & |
data | ) |
|
|
protectedpure virtual |
◆ m_atts
Stores attributes of the created security context.
◆ m_complete
bool Handshake::m_complete |
|
protected |
true
when handshake is complete.
◆ m_cred
CredHandle Handshake::m_cred |
|
protected |
Credentials of the principal performing this handshake.
◆ m_error
If non-zero, stores error code of the last failed operation.
◆ m_expire
TimeStamp Handshake::m_expire |
|
protected |
Stores expiry date of the created security context.
◆ m_have_credentials
bool Handshake::m_have_credentials |
|
protected |
true
when the principal credentials has been determined.
◆ m_have_sec_context
bool Handshake::m_have_sec_context |
|
protected |
true
when the security context has been created.
◆ m_output
Buffer for data to be send to the other side.
◆ m_round
unsigned int Handshake::m_round |
|
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()
).
◆ m_sctx
CtxtHandle Handshake::m_sctx |
|
protected |
Security context object created during the handshake.
◆ m_ssp_info
SecPkgInfo* Handshake::m_ssp_info |
|
private |
The documentation for this class was generated from the following files: