Unit SChannel.SyncHandshake
Description
Helper function that implements synchronous TLS handshake by means of Windows SChannel. The function is transport-agnostic so it could be applied to any socket implementation or even other transport.
Inspired by TLS-Sample
Uses JEDI API units
(c) Fr0sT-Brutal
License MIT
Overview
Classes, Interfaces, Objects and Records
Name | Description |
---|---|
Class EHandshakeCommError |
Specific exception class raised by PerformClientHandshake on communication failures. |
Functions and Procedures
procedure PerformClientHandshake(var SessionData: TSessionData; const ServerName: string; DebugLogFn: TDebugFn; SendFn: TSendFn; RecvFn: TRecvFn; out hContext: CtxtHandle; out ExtraData: TBytes); |
Types
TSendFn = function (Buf: Pointer; BufLen: Integer): Integer of object; |
TRecvFn = function (Buf: Pointer; BufLen: Integer): Integer of object; |
Description
Functions and Procedures
procedure PerformClientHandshake(var SessionData: TSessionData; const ServerName: string; DebugLogFn: TDebugFn; SendFn: TSendFn; RecvFn: TRecvFn; out hContext: CtxtHandle; out ExtraData: TBytes); |
Synchronously perform full handshake process including communication with server. Communication is done via two callback functions. EHandshakeCommError on communication failure Parameters
Exceptions raised
|
Types
TSendFn = function (Buf: Pointer; BufLen: Integer): Integer of object; |
Synchronous communication method. Parameters
Returnsamount of data sent if >= 0 or error code if < 0. Error code is used to log and create exception. FormatMessage is used to generate a string from error code. Must try to send all data in full, as no retries or repeated sends is done. Exceptions raised
|
TRecvFn = function (Buf: Pointer; BufLen: Integer): Integer of object; |
Synchronous communication method. Parameters
Returnsamount of data received if >= 0 or error code if < 0. Error code is used to log and create exception. FormatMessage is used to generate a string from error code. Could receive only some of the data available as incomplete packet is read in loop Exceptions raised
|
Generated by PasDoc 0.16.0.