[英]TLS Handshake process by InitializeSecurityContext (Schannel)
I have to implement an TLS handshake process using the SSPI interface. 我必须使用SSPI接口实现TLS握手过程。
My app implements the client side, and as I saw from here the general flow is: 我的应用程序实现了客户端,正如我从这里看到的一般流程是:
The MSDN explanation about these buffers: 有关这些缓冲区的MSDN说明:
"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."
“在初始调用后调用此函数时,必须有两个缓冲区。第一个类型为SECBUFFER_TOKEN,包含从服务器接收的令牌。第二个缓冲区的类型为SECBUFFER_EMPTY;将pvBuffer和cbBuffer成员都设置为零。”
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. 1.
SChannel为您提供了一层抽象,以便能够通过安全通道传输数据缓冲区。 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. API的设计方式是,当您发送一个数据时,您提供两个数据缓冲区 - 实际数据(有效负载)和保存安全通道令牌/上下文的第二个缓冲区。 It is assumed that you will be attaching this buffer to every payload buffer you are pushing through, eg because the API is not designed keep and manage this data internally eg with a handle.
假设您将此缓冲区附加到您正在推送的每个有效负载缓冲区,例如,因为API未设计保留并在内部管理此数据,例如使用句柄。
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. 2.
InitializeSecurityContext
不仅适用于SChannel包,在其他情况下也使用此参数,也许您可以使用示例代码查看与不同包相关的内容,或从那里复制或适用于两者。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.