36#define SSP_NAME "Negotiate"
44#define MAX_HANDSHAKE_ROUNDS 50
56 m_buf.BufferType = SECBUFFER_TOKEN;
75 byte *
ptr()
const {
return (
byte *)
m_buf.pvBuffer; }
Class representing a region of memory (e.g., a string or binary buffer).
Definition: common.h:160
Common base for Handshake_{server,client}.
Definition: handshake.h:86
side_t
Definition: handshake.h:88
@ SERVER
Definition: handshake.h:88
@ CLIENT
Definition: handshake.h:88
Security_buffer m_output
Buffer for data to be send to the other side.
Definition: handshake.h:132
bool m_have_credentials
true when the principal credentials has been determined.
Definition: handshake.h:126
CredHandle m_cred
Credentials of the principal performing this handshake.
Definition: handshake.h:104
bool m_have_sec_context
true when the security context has been created.
Definition: handshake.h:129
bool process_result(int)
Process result of {Initialize,Accept}SecurityContext() function.
Definition: handshake.cc:210
Handshake(const char *ssp, side_t side)
Handshake class implementation.
Definition: handshake.cc:42
int m_error
If non-zero, stores error code of the last failed operation.
Definition: handshake.h:120
TimeStamp m_expire
Stores expiry date of the created security context.
Definition: handshake.h:107
int error() const
Definition: handshake.h:97
ULONG m_atts
Stores attributes of the created security context.
Definition: handshake.h:110
virtual Blob read_packet()=0
Read packet from the other end.
int packet_processing_loop()
Read and process data packets from the other end of a connection.
Definition: handshake.cc:97
SecPkgInfo * m_ssp_info
Definition: handshake.h:156
bool m_complete
true when handshake is complete.
Definition: handshake.h:123
const char * ssp_name()
Get name of the security package which was used in authentication.
Definition: handshake.cc:174
CtxtHandle m_sctx
Security context object created during the handshake.
Definition: handshake.h:101
virtual int write_packet(Blob &data)=0
Write packet to the other end.
virtual bool is_complete() const
Definition: handshake.h:95
virtual Blob process_data(const Blob &data)=0
This method is used inside packet_processing_loop to process data packets received from the other end...
virtual ~Handshake()
Definition: handshake.cc:74
unsigned int m_round
Round of the handshake (starting from round 1).
Definition: handshake.h:117
Convenience wrapper around SecBufferDesc.
Definition: handshake.h:48
void init(byte *ptr, size_t len)
Definition: handshake.h:51
void mem_free(void)
Definition: handshake.cc:263
const Blob as_blob() const
Definition: handshake.h:79
~Security_buffer()
Definition: handshake.h:73
Security_buffer(const Security_buffer &)
byte * ptr() const
Definition: handshake.h:75
const bool m_allocated
If false, no deallocation will be done in the destructor.
Definition: handshake.h:62
size_t len() const
Definition: handshake.h:77
SecBuffer m_buf
A SecBuffer instance.
Definition: handshake.h:49
const Security_buffer & operator=(const Security_buffer &)
Security_buffer()
Definition: handshake.cc:261
Some integer typedefs for easier portability.
borrowable::binary::Blob< true > Blob
Definition: classic_protocol_binary.h:327