288 # define TRUE ( (BOOL)1 ) 293 # define FALSE ( (BOOL)0 ) 326 typedef void* (*PointerToMalloc)(
UINT32 size);
332 typedef void* (*PointerToRealloc)(
void* pMemory,
UINT32 new_size);
339 typedef int (*
PointerToTRNG)(
void* out, uint32_t readSz,
const void* reseed);
447 const void** ppSession,
448 const char fqdn[],
const UINT8 len_fqdn,
456 UINT8 mode_of_operation,
457 BOOL bClientMode_Tolerate_FQDN_Mismatch,
458 BOOL bClientMode_Skip_Authorised_Root_CA_Check,
459 BOOL client_certificate_request,
460 const UINT8 server_cert[],
const UINT32 len_server_cert,
462 const UINT8 client_cert[],
const UINT32 len_client_cert,
463 const UINT8 server_rsa_private_key[],
const UINT32 len_server_rsa_private_key,
464 const UINT8 client_rsa_private_key[],
const UINT32 len_client_rsa_private_key);
477 UINT8 output_buffer[],
UINT32* len_output_buffer );
int TLSReadAppData(const void *const *ppCurrentSession, UINT8 output_buffer[], UINT32 *len_output_buffer)
Reads incoming encrypted application data according to the established (after engine success) session...
int(* PointerToSend)(SOCKET pSocket, const UINT8 *pBuffer, UINT32 len_buffer)
Pointer to function which sends TCP packets. As TLS operates on a higher ISO/OSI level, we need interface functions at this point that take care of processing incoming and outgoing data on a lower network layer, i.e. TCP. Hence, PointerToSend is expected to hold reference to TCPSend().
Definition: TLSLIB.h:307
int TLSShutdown(const void **ppSession)
Closes an existing TLS session and realeases dynamically allocated resources.
unsigned short UINT16
Definition: TLSLIB.h:273
unsigned char UINT8
Definition: TLSLIB.h:278
int TLSEngine(SOCKET pSocket, const void **ppSession, const char fqdn[], const UINT8 len_fqdn, PointerToSend Send, PointerToReceive Receive, PointerToCloseSocket CloseSocket, PointerToMalloc Malloc, PointerToFree Free, PointerToRealloc Realloc, PointerToTRNG pbTRNG, UINT8 mode_of_operation, BOOL bClientMode_Tolerate_FQDN_Mismatch, BOOL bClientMode_Skip_Authorised_Root_CA_Check, BOOL client_certificate_request, const UINT8 server_cert[], const UINT32 len_server_cert, const UINT8 ca_cert[], const UINT32 len_ca_cert, const UINT8 client_cert[], const UINT32 len_client_cert, const UINT8 server_rsa_private_key[], const UINT32 len_server_rsa_private_key, const UINT8 client_rsa_private_key[], const UINT32 len_client_rsa_private_key)
Creates a TLS server or client session.
UINT8 BOOL
Definition: TLSLIB.h:283
int TLSWriteAppData(const void *const *ppCurrentSession, const UINT8 data[], UINT32 len_data)
Writes outgoing encrypted app data according to the established TLS session parameters.
void(* PointerToCloseSocket)(SOCKET pSocket)
Pointer to TCPClose().
Definition: TLSLIB.h:313
void *(* PointerToRealloc)(void *pMemory, UINT32 new_size)
Pointer to realloc().
Definition: TLSLIB.h:332
void(* PointerToFree)(void *pMemory)
Pointer to free().
Definition: TLSLIB.h:329
unsigned long UINT32
Definition: TLSLIB.h:268
int(* PointerToReceive)(SOCKET pSocket, UINT8 *const pBuffer, UINT32 len_buffer)
Pointer to TCPRecv().
Definition: TLSLIB.h:310
UINT8 SOCKET
Specifies a socket that has already been opened by either TCPClientOpen() or TCPServerOpen().
Definition: TLSLIB.h:298
int(* PointerToTRNG)(UINT8 rng[32])
Definition: TLSLIB.h:341
void *(* PointerToMalloc)(UINT32 size)
Pointer to malloc(). As dicussed during the introduction of TLSLib, TLS implementations have to work ...
Definition: TLSLIB.h:326