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

Macros

#define LOG_CLASS   "DTLS_mbedtls"
#define DTLS_MBEDTLS_ERROR_STRING_BUFFER_SIZE   128

Functions

STATUS dtlsSessionCheckRemoteCertificateVerification (PDtlsSession pDtlsSession)
STATUS dtlsSessionGetCertificateVerificationFailureStatus (PDtlsSession pDtlsSession, INT32 sslRet)
STATUS createDtlsSession (PDtlsSessionCallbacks pDtlsSessionCallbacks, TIMER_QUEUE_HANDLE timerQueueHandle, INT32 certificateBits, BOOL generateRSACertificate, PRtcCertificate pRtcCertificates, PDtlsSession *ppDtlsSession)
STATUS createDtlsSessionWithOptions (PDtlsSessionCallbacks pDtlsSessionCallbacks, TIMER_QUEUE_HANDLE timerQueueHandle, INT32 certificateBits, BOOL generateRSACertificate, PRtcCertificate pRtcCertificates, PDtlsSessionOptions pDtlsSessionOptions, PDtlsSession *ppDtlsSession)
STATUS freeDtlsSession (PDtlsSession *ppDtlsSession)
INT32 dtlsSessionSendCallback (PVOID customData, const unsigned char *pBuf, ULONG len)
INT32 dtlsSessionReceiveCallback (PVOID customData, unsigned char *pBuf, ULONG len)
VOID dtlsSessionSetTimerCallback (PVOID customData, UINT32 intermediateDelayInMs, UINT32 finalDelayInMs)
INT32 dtlsSessionGetTimerCallback (PVOID customData)
STATUS dtlsTransmissionTimerCallback (UINT32 timerID, UINT64 currentTime, UINT64 customData)
VOID dtlsSessionKeyDerivationCallback (PVOID customData, mbedtls_ssl_key_export_type secret_type, const unsigned char *pMasterSecret, size_t pMasterSecretLen, const unsigned char clientRandom[32], const unsigned char serverRandom[32], mbedtls_tls_prf_types tlsProfile)
STATUS dtlsSessionHandshakeInThread (PDtlsSession pDtlsSession, BOOL isServer)
STATUS dtlsSessionStart (PDtlsSession pDtlsSession, BOOL isServer)
STATUS dtlsSessionIsInitFinished (PDtlsSession pDtlsSession, PBOOL pIsFinished)
STATUS dtlsSessionProcessPacket (PDtlsSession pDtlsSession, PBYTE pData, PINT32 pDataLen)
STATUS dtlsSessionPutApplicationData (PDtlsSession pDtlsSession, PBYTE pData, INT32 dataLen)
STATUS dtlsSessionGetLocalCertificateFingerprint (PDtlsSession pDtlsSession, PCHAR pBuff, UINT32 buffLen)
STATUS dtlsSessionVerifyRemoteCertificateFingerprint (PDtlsSession pDtlsSession, PCHAR pExpectedFingerprint)
STATUS dtlsSessionPopulateKeyingMaterial (PDtlsSession pDtlsSession, PDtlsKeyingMaterial pDtlsKeyingMaterial)
STATUS dtlsSessionShutdown (PDtlsSession pDtlsSession)
STATUS copyCertificateAndKey (mbedtls_x509_crt *pCert, mbedtls_pk_context *pKey, PDtlsSessionCertificateInfo pDst, mbedtls_ctr_drbg_context *pCtrDrbg)
int mbedtls_x509write_crt_set_serial (mbedtls_x509write_cert *ctx, const mbedtls_mpi *serial)
STATUS createCertificateAndKey (INT32 certificateBits, BOOL generateRSACertificate, mbedtls_x509_crt *pCert, mbedtls_pk_context *pKey)
STATUS freeCertificateAndKey (mbedtls_x509_crt *pCert, mbedtls_pk_context *pKey)
STATUS dtlsCertificateFingerprint (mbedtls_x509_crt *pCert, PCHAR pBuff)

Variables

mbedtls_ssl_srtp_profile DTLS_SRTP_SUPPORTED_PROFILES []

Macro Definition Documentation

◆ DTLS_MBEDTLS_ERROR_STRING_BUFFER_SIZE

#define DTLS_MBEDTLS_ERROR_STRING_BUFFER_SIZE   128

◆ LOG_CLASS

#define LOG_CLASS   "DTLS_mbedtls"

Function Documentation

◆ copyCertificateAndKey()

STATUS copyCertificateAndKey ( mbedtls_x509_crt * pCert,
mbedtls_pk_context * pKey,
PDtlsSessionCertificateInfo pDst,
mbedtls_ctr_drbg_context * pCtrDrbg )
Here is the caller graph for this function:

◆ createCertificateAndKey()

STATUS createCertificateAndKey ( INT32 certificateBits,
BOOL generateRSACertificate,
mbedtls_x509_crt * pCert,
mbedtls_pk_context * pKey )

createCertificateAndKey generates a new certificate and a key If generateRSACertificate is true, RSA is going to be used for the key generation. Otherwise, ECDSA is going to be used. certificateBits is only being used when generateRSACertificate is true.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDtlsSession()

STATUS createDtlsSession ( PDtlsSessionCallbacks pDtlsSessionCallbacks,
TIMER_QUEUE_HANDLE timerQueueHandle,
INT32 certificateBits,
BOOL generateRSACertificate,
PRtcCertificate pRtcCertificates,
PDtlsSession * ppDtlsSession )

Create DTLS session. Not thread safe.

Parameters
PDtlsSessionCallbacks- callbacks
TIMER_QUEUE_HANDLE- timer handle to schedule timer task with
INT32- size of generated certificate
BOOL- whether to generate certificate or not
PRtcCertificate- user provided certificate
PDtlsSession*- pointer to created DtlsSession object
Returns
STATUS - status of operation

◆ createDtlsSessionWithOptions()

STATUS createDtlsSessionWithOptions ( PDtlsSessionCallbacks pDtlsSessionCallbacks,
TIMER_QUEUE_HANDLE timerQueueHandle,
INT32 certificateBits,
BOOL generateRSACertificate,
PRtcCertificate pRtcCertificates,
PDtlsSessionOptions pDtlsSessionOptions,
PDtlsSession * ppDtlsSession )
Here is the caller graph for this function:

◆ dtlsCertificateFingerprint()

STATUS dtlsCertificateFingerprint ( mbedtls_x509_crt * pCert,
PCHAR pBuff )
Here is the caller graph for this function:

◆ dtlsSessionCheckRemoteCertificateVerification()

STATUS dtlsSessionCheckRemoteCertificateVerification ( PDtlsSession pDtlsSession)
Here is the caller graph for this function:

◆ dtlsSessionGetCertificateVerificationFailureStatus()

STATUS dtlsSessionGetCertificateVerificationFailureStatus ( PDtlsSession pDtlsSession,
INT32 sslRet )
Here is the caller graph for this function:

◆ dtlsSessionGetLocalCertificateFingerprint()

STATUS dtlsSessionGetLocalCertificateFingerprint ( PDtlsSession pDtlsSession,
PCHAR pBuff,
UINT32 buffLen )

◆ dtlsSessionGetTimerCallback()

INT32 dtlsSessionGetTimerCallback ( PVOID customData)
Here is the caller graph for this function:

◆ dtlsSessionHandshakeInThread()

STATUS dtlsSessionHandshakeInThread ( PDtlsSession pDtlsSession,
BOOL isServer )

◆ dtlsSessionIsInitFinished()

STATUS dtlsSessionIsInitFinished ( PDtlsSession pDtlsSession,
PBOOL pIsFinished )

◆ dtlsSessionKeyDerivationCallback()

VOID dtlsSessionKeyDerivationCallback ( PVOID customData,
mbedtls_ssl_key_export_type secret_type,
const unsigned char * pMasterSecret,
size_t pMasterSecretLen,
const unsigned char clientRandom[32],
const unsigned char serverRandom[32],
mbedtls_tls_prf_types tlsProfile )
Here is the caller graph for this function:

◆ dtlsSessionPopulateKeyingMaterial()

STATUS dtlsSessionPopulateKeyingMaterial ( PDtlsSession pDtlsSession,
PDtlsKeyingMaterial pDtlsKeyingMaterial )

◆ dtlsSessionProcessPacket()

STATUS dtlsSessionProcessPacket ( PDtlsSession pDtlsSession,
PBYTE pData,
PINT32 pDataLen )

◆ dtlsSessionPutApplicationData()

STATUS dtlsSessionPutApplicationData ( PDtlsSession pDtlsSession,
PBYTE pData,
INT32 dataLen )

◆ dtlsSessionReceiveCallback()

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

◆ dtlsSessionSendCallback()

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

◆ dtlsSessionSetTimerCallback()

VOID dtlsSessionSetTimerCallback ( PVOID customData,
UINT32 intermediateDelayInMs,
UINT32 finalDelayInMs )
Here is the caller graph for this function:

◆ dtlsSessionShutdown()

STATUS dtlsSessionShutdown ( PDtlsSession pDtlsSession)
Here is the caller graph for this function:

◆ dtlsSessionStart()

STATUS dtlsSessionStart ( PDtlsSession pDtlsSession,
BOOL isServer )

Start DTLS handshake. Not thread safe.

Parameters
PDtlsSession- DtlsSession object
BOOL- is server
Returns
STATUS - status of operation

◆ dtlsSessionVerifyRemoteCertificateFingerprint()

STATUS dtlsSessionVerifyRemoteCertificateFingerprint ( PDtlsSession pDtlsSession,
PCHAR pExpectedFingerprint )

◆ dtlsTransmissionTimerCallback()

STATUS dtlsTransmissionTimerCallback ( UINT32 timerID,
UINT64 currentTime,
UINT64 customData )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeCertificateAndKey()

STATUS freeCertificateAndKey ( mbedtls_x509_crt * pCert,
mbedtls_pk_context * pKey )
Here is the caller graph for this function:

◆ freeDtlsSession()

STATUS freeDtlsSession ( PDtlsSession * ppDtlsSession)

Free DTLS session. Not thread safe.

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

◆ mbedtls_x509write_crt_set_serial()

int mbedtls_x509write_crt_set_serial ( mbedtls_x509write_cert * ctx,
const mbedtls_mpi * serial )
Here is the caller graph for this function:

Variable Documentation

◆ DTLS_SRTP_SUPPORTED_PROFILES

mbedtls_ssl_srtp_profile DTLS_SRTP_SUPPORTED_PROFILES[]
Initial value:
= {
MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80,
MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32,
MBEDTLS_TLS_SRTP_UNSET,
}

https://tools.ietf.org/html/rfc5764#section-4.1.2