I have to implement an TLS handshake process using the SSPI interface.
My app implements the client side, and as I saw from here the general flow is:
The MSDN explanation about these buffers:
"On calls to this function after the initial call, there must be two buffers. The first has type SECBUFFER_TOKEN and contains the token received from the server. The second buffer has type SECBUFFER_EMPTY; set both the pvBuffer and cbBuffer members to zero."
My questions:
I will realy appreciate any help.
Thanks!.
1.
SChannel gives you a layer of abstraction to be able to transfer data buffers over secure channels. The API is designed in the way that when you send a piece of data, you supply two data buffers - the actual data (payload) and the second buffer which holds secure channel token/context. It is assumed that you will be attaching this buffer to every payload buffer you are pushing through, e.g. because the API is not designed keep and manage this data internally e.g. with a handle.
2.
InitializeSecurityContext
applies not only to SChannel package, in other scenarios this parameter is used and perhaps sample code you had a chance to see what related to a different package, or copied from there or applies to both.