Amazon Kinesis Webrtc C SDK
Loading...
Searching...
No Matches
Tls_mbedtls.c File Reference
#include "../Include_i.h"
Include dependency graph for Tls_mbedtls.c:

Macros

#define LOG_CLASS   "TLS_mbedtls"

Functions

PRIVATE_API STATUS readAndParseCACertificate (PTlsSession pTlsSession)
STATUS createTlsSession (PTlsSessionCallbacks pCallbacks, PTlsSession *ppTlsSession)
STATUS freeTlsSession (PTlsSession *ppTlsSession)
INT32 tlsSessionSendCallback (PVOID customData, const unsigned char *buf, ULONG len)
INT32 tlsSessionReceiveCallback (PVOID customData, unsigned char *buf, ULONG len)
STATUS tlsSessionStartWithHostname (PTlsSession pTlsSession, BOOL isServer, PCHAR hostname)
STATUS tlsSessionStart (PTlsSession pTlsSession, BOOL isServer)
STATUS tlsSessionProcessPacket (PTlsSession pTlsSession, PBYTE pData, UINT32 bufferLen, PUINT32 pDataLen)
STATUS tlsSessionPutApplicationData (PTlsSession pTlsSession, PBYTE pData, UINT32 dataLen)
STATUS tlsSessionShutdown (PTlsSession pTlsSession)

Macro Definition Documentation

◆ LOG_CLASS

#define LOG_CLASS   "TLS_mbedtls"

Kinesis Video TLS

Function Documentation

◆ createTlsSession()

STATUS createTlsSession ( PTlsSessionCallbacks pCallbacks,
PTlsSession * ppTlsSession )

Create TLS session. NOT THREAD SAFE.

Parameters
PTlsSessionCallbacks- callbacks
PTlsSession*- pointer to created TlsSession object
Returns
STATUS - status of operation

◆ freeTlsSession()

STATUS freeTlsSession ( PTlsSession * ppTlsSession)

Free TLS session. Not thread safe.

Parameters
PTlsSession- TlsSession object to free
Returns
STATUS - status of operation
Here is the caller graph for this function:

◆ readAndParseCACertificate()

PRIVATE_API STATUS readAndParseCACertificate ( PTlsSession pTlsSession)
Here is the caller graph for this function:

◆ tlsSessionProcessPacket()

STATUS tlsSessionProcessPacket ( PTlsSession pTlsSession,
PBYTE pData,
UINT32 bufferLen,
PUINT32 pDataLen )

Decrypt application data up to specified bytes. The decrypted data will be copied back to the original buffer. During handshaking, the return data size should be always 0 since there's no application data yet. NOT THREAD SAFE.

Parameters
PTlsSession- TlsSession object
PBYTE- encrypted data
UINT32- the size of buffer that PBYTE is pointing to
PUINT32- pointer to the size of encrypted data and will be used to store the size of application data

◆ tlsSessionPutApplicationData()

STATUS tlsSessionPutApplicationData ( PTlsSession pTlsSession,
PBYTE pData,
UINT32 dataLen )

Encrypt application data up to specified bytes. The encrypted data will be sent through specified callback during initialization. If NULL is specified, it'll only check for pending handshake buffer. NOT THREAD SAFE.

Parameters
PTlsSession- TlsSession object
PBYTE- plain data
UINT32- the size of encrypted data

◆ tlsSessionReceiveCallback()

INT32 tlsSessionReceiveCallback ( PVOID customData,
unsigned char * buf,
ULONG len )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tlsSessionSendCallback()

INT32 tlsSessionSendCallback ( PVOID customData,
const unsigned char * buf,
ULONG len )
Here is the caller graph for this function:

◆ tlsSessionShutdown()

STATUS tlsSessionShutdown ( PTlsSession pTlsSession)

Mark Tls session to be closed NOT THREAD SAFE.

Here is the caller graph for this function:

◆ tlsSessionStart()

STATUS tlsSessionStart ( PTlsSession pTlsSession,
BOOL isServer )

Start TLS handshake. NOT THREAD SAFE.

Parameters
PTlsSession- TlsSession object
BOOL- is server
Returns
STATUS - status of operation

◆ tlsSessionStartWithHostname()

STATUS tlsSessionStartWithHostname ( PTlsSession pTlsSession,
BOOL isServer,
PCHAR hostname )

Start TLS handshake with an optional hostname parameter. NOT THREAD SAFE.

Parameters
PTlsSession- TlsSession object
BOOL- is server
PCHAR- hostname hint for TLS backends that support hostname verification or SNI, or NULL when no hostname is available. The current OpenSSL backend ignores this parameter and preserves the existing behavior.
Returns
STATUS - status of operation
Here is the caller graph for this function: