44 #if defined(__ENABLE_MOCANA_DTLS_SERVER__) || defined(__ENABLE_MOCANA_DTLS_CLIENT__) 52 #ifndef DTLS_MAX_MUTEX 53 #define DTLS_MAX_MUTEX (10) 56 #ifndef TIMEOUT_DTLS_HELLO_VERIFY_COOKIE 57 #define TIMEOUT_DTLS_HELLO_VERIFY_COOKIE (10000) 199 MOC_EXTERN sbyte4
DTLS_getCookie(sbyte4 connectionInstance,
void** pCookie);
238 MOC_EXTERN sbyte4
DTLS_setCookie(sbyte4 connectionInstance,
void* cookie);
469 MOC_EXTERN sbyte4
DTLS_ioctl(sbyte4 connectionInstance, ubyte4 setting,
void *value);
507 MOC_EXTERN sbyte4
DTLS_lookupAlert(sbyte4 connectionInstance, sbyte4 lookupError, sbyte4 *pRetAlertId, sbyte4 *pAlertClass);
543 MOC_EXTERN sbyte4
DTLS_sendAlert(sbyte4 connectionInstance, sbyte4 alertId, sbyte4 alertClass);
593 MOC_EXTERN sbyte4
DTLS_enableCiphers(sbyte4 connectionInstance, ubyte2 *pCipherSuiteList, ubyte4 listLength);
595 #if (defined( __ENABLE_MOCANA_SSL_ECDH_SUPPORT__) || \ 596 defined(__ENABLE_MOCANA_SSL_ECDHE_SUPPORT__)|| \ 597 defined(__ENABLE_MOCANA_SSL_ECDH_ANON_SUPPORT__) ) 680 MOC_EXTERN sbyte4
DTLS_getCipherInfo( sbyte4 connectionInstance, ubyte2* pCipherId, ubyte4* pPeerEcCurves);
757 #if (defined (__ENABLE_MOCANA_DTLS_SRTP__) && defined (__ENABLE_MOCANA_SRTP_PROFILES_SELECT__)) 797 MOC_EXTERN sbyte4
DTLS_enableSrtpProfiles(sbyte4 connectionInstance, ubyte2 *pSrtpProfileList, ubyte4 listLength);
800 #if defined(__ENABLE_MOCANA_DTLS_CLIENT__) 837 MOC_EXTERN sbyte4
DTLS_getClientSessionInfo(sbyte4 connectionInstance, ubyte* sessionIdLen, ubyte sessionId[32], ubyte masterSecret[48]);
872 const char* serverName);
874 #if defined(__ENABLE_MOCANA_MULTIPLE_COMMON_NAMES__) 910 MOC_EXTERN sbyte4
DTLS_setDNSNames( sbyte4 connectionInstance,
const CNMatchInfo* cnMatchInfo);
951 MOC_EXTERN sbyte4
DTLS_init(sbyte4 numServerConnections, sbyte4 numClientConnections);
953 #if defined(__ENABLE_MOCANA_SSL_CUSTOM_RNG__) 997 MOC_EXTERN sbyte4
DTLS_initEx(sbyte4 numServerConnections, sbyte4 numClientConnections,
998 RNGFun rngFun,
void* arg);
1043 MOC_EXTERN sbyte4
DTLS_recvMessage(sbyte4 connectionInstance, ubyte *pBytesReceived, ubyte4 numBytesReceived,
1044 ubyte **ppRetBytesReceived, ubyte4 *pRetNumRxBytesRemaining);
1095 MOC_EXTERN sbyte4
DTLS_sendMessage(sbyte4 connectionInstance, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent);
1164 MOC_EXTERN sbyte4
DTLS_getSendBuffer(sbyte4 connectionInstance, ubyte *data, ubyte4 *len);
1202 MOC_EXTERN sbyte4
DTLS_getRecvBuffer(sbyte4 connectionInstance, ubyte **data, ubyte4 *len, ubyte4 *pRetProtocol);
1204 #if defined(__ENABLE_MOCANA_TLS13__) 1206 #if defined(__ENABLE_MOCANA_SSL_MUTUAL_AUTH_SUPPORT__) && defined(__ENABLE_MOCANA_DTLS_SERVER__) 1269 #if (defined(__ENABLE_MOCANA_TLS13_PSK__) && defined(__ENABLE_MOCANA_TLS13_0RTT__)) 1304 sbyte4 recvEarlyDataSize);
1337 sbyte4 earlyDataSize);
1371 ubyte* pEarlyData, ubyte4 earlyDataSize);
1407 ubyte *pData, ubyte4 dataLen,
1413 #ifdef __ENABLE_MOCANA_DTLS_CLIENT__ 1451 MOC_EXTERN sbyte4
DTLS_connect(
peerDescr *pPeerDescr, ubyte sessionIdLen, ubyte * sessionId, ubyte * masterSecret,
1452 const sbyte* dnsName,
struct certStore* pCertStore);
1482 MOC_EXTERN sbyte4
DTLS_start(sbyte4 connectionInstance);
1485 #if defined(__ENABLE_MOCANA_DTLS_SERVER__) 1518 struct certStore* pCertStore);
1552 MOC_EXTERN sbyte4
DTLS_getConnectionInstance(MOC_IP_ADDRESS srcAddr, ubyte2 srcPort, MOC_IP_ADDRESS peerAddr, ubyte2 peerPort);
1639 MOC_EXTERN sbyte4
DTLS_verifyClientHelloCookie(MOC_IP_ADDRESS peerAddr, ubyte *pReceived, ubyte4 length, ubyte *pToSend, ubyte4 *pToSendLen);
tlsExtNamedCurves
Definition: ssl.h:506
MOC_EXTERN sbyte4 DTLS_sendMessage(sbyte4 connectionInstance, sbyte *pBuffer, sbyte4 bufferSize, sbyte4 *pBytesSent)
Send data to a connected server/client.
MOC_EXTERN sbyte4 DTLS_ioctl(sbyte4 connectionInstance, ubyte4 setting, void *value)
Enable dynamic management of a connection's features.
MOC_EXTERN sbyte4 DTLS_setCookie(sbyte4 connectionInstance, void *cookie)
Store custom information for a connection instance.
MOC_EXTERN sbyte4 DTLS_init(sbyte4 numServerConnections, sbyte4 numClientConnections)
Initialize NanoDTLS client or server internal structures.
MOC_EXTERN sbyte4 DTLS_enableSrtpProfiles(sbyte4 connectionInstance, ubyte2 *pSrtpProfileList, ubyte4 listLength)
Enable specified SRTP profiles.
MOC_EXTERN MSTATUS DTLS_sendKeyUpdateRequest(sbyte4 connectionInstance, ubyte updateRequest)
Sends a key update request.
MOC_EXTERN sbyte4 DTLS_setDNSNames(sbyte4 connectionInstance, const CNMatchInfo *cnMatchInfo)
Specify a list of DNS names acceptable to the client.
MOC_EXTERN sbyte4 DTLS_enableECCCurves(sbyte4 connectionInstance, enum tlsExtNamedCurves *pECCCurvesList, ubyte4 listLength)
Enable ECC curves.
Configuration settings and callback function pointers for NanoSSL SSL/TLS clients and NanoDTLS DTLS c...
Definition: ssl.h:810
MOC_EXTERN sbyte4 DTLS_connect(peerDescr *pPeerDescr, ubyte sessionIdLen, ubyte *sessionId, ubyte *masterSecret, const sbyte *dnsName, struct certStore *pCertStore)
Create a NanoDTLS client connection descriptor.
MOC_EXTERN sbyte4 DTLS_getSessionStatus(sbyte4 connectionInstance, ubyte4 *pRetStatusSSL)
Get a connection's status.
MOC_EXTERN sbyte4 DTLS_sendAlert(sbyte4 connectionInstance, sbyte4 alertId, sbyte4 alertClass)
Send an SSL alert message to a DTLS peer.
MOC_EXTERN sbyte4 DTLS_recvMessage(sbyte4 connectionInstance, ubyte *pBytesReceived, ubyte4 numBytesReceived, ubyte **ppRetBytesReceived, ubyte4 *pRetNumRxBytesRemaining)
Get a pointer to the connection's most recently receiveed message.
MOC_EXTERN sbyte4 DTLS_initiateRehandshake(sbyte4 connectionInstance)
Renegotiate a NanoDTLS session.
MOC_EXTERN sbyte4 DTLS_getCookie(sbyte4 connectionInstance, void **pCookie)
Get custom information for a connection instance.
MOC_EXTERN sbyte4 DTLS_getCipherInfo(sbyte4 connectionInstance, ubyte2 *pCipherId, ubyte4 *pPeerEcCurves)
Get a connection's ciphers and ecCurves.
MOC_EXTERN sbyte4 DTLS_enableCiphers(sbyte4 connectionInstance, ubyte2 *pCipherSuiteList, ubyte4 listLength)
Enable specified ciphers.
MOC_EXTERN sbyte4 DTLS_setSessionFlags(sbyte4 connectionInstance, ubyte4 flagsSSL)
Store a connection's context (its flags).
MOC_EXTERN sbyte4 DTLS_setRecvEarlyDataSize(sbyte4 connectionInstance, sbyte4 recvEarlyDataSize)
Set the recv early data size.
MOC_EXTERN sbyte4 DTLS_shutdown(void)
Clean up memory and mutexes and shut down the NanoDTLS stack.
MOC_EXTERN MSTATUS DTLS_sendPosthandshakeAuthCertificateRequest(sbyte4 connectionInstance)
Sends a post-handshake authentication request to client.
MOC_EXTERN sbyte4 DTLS_getSessionFlags(sbyte4 connectionInstance, ubyte4 *pRetFlagsSSL)
Get a connection's context (its flags).
MOC_EXTERN sbyte4 DTLS_getClientSessionInfo(sbyte4 connectionInstance, ubyte *sessionIdLen, ubyte sessionId[32], ubyte masterSecret[48])
Get connection instance's identifying information.
MOC_EXTERN sbyte4 DTLS_verifyClientHelloCookie(MOC_IP_ADDRESS peerAddr, ubyte *pReceived, ubyte4 length, ubyte *pToSend, ubyte4 *pToSendLen)
Verify a client's legitimacy by using the provided cookie.
MOC_EXTERN sbyte4 DTLS_getSendBuffer(sbyte4 connectionInstance, ubyte *data, ubyte4 *len)
Get a copy of the connection's send data buffer.
MOC_EXTERN sbyte4 DTLS_isSessionDTLS(sbyte4 connectionInstance)
Determine whether a connection instance represents a DTLS server, a DTLS client, or an unrecognized c...
MOC_EXTERN sbyte4 DTLS_lookupAlert(sbyte4 connectionInstance, sbyte4 lookupError, sbyte4 *pRetAlertId, sbyte4 *pAlertClass)
Get the SSL alert code for a Digicert SoT Platform error.
MOC_EXTERN sbyte4 DTLS_getRecvBuffer(sbyte4 connectionInstance, ubyte **data, ubyte4 *len, ubyte4 *pRetProtocol)
Get a pointer to the connection's receive data buffer (the socket buffer itself). ...
MOC_EXTERN sbyte4 DTLS_closeConnection(sbyte4 connectionInstance)
Close a NanoDTLS session and release resources.
MOC_EXTERN sbyte4 DTLS_acceptConnection(peerDescr *pPeerDescr, struct certStore *pCertStore)
Register a secure NanoDTLS connection.
MOC_EXTERN sbyte4 DTLS_getPeerDescr(sbyte4 connectionInstance, const peerDescr **ppRetPeerDescr)
Get a NanoDTLS connection descriptor.
MOC_EXTERN sbyte4 DTLS_setServerNameIndication(sbyte4 connectionInstance, const char *serverName)
Specify the server name required by the client.
MOC_EXTERN sbyte4 DTLS_setReceiveApplicationDataCallback(sbyte4(*funcPtrTLS13ApplicationDataCallback)(sbyte4 connectionInstance, ubyte *pData, ubyte4 dataLen, dataState state))
Function to set the callback to pass data to the application received during the SSL handshake...
MOC_EXTERN sbyte4 DTLS_checkHandshakeTimer(sbyte4 connectionInstance)
Check a NanoDTLS client's or server's timer to provide time to the NanoDTLS stack.
MOC_EXTERN sbyte4 DTLS_initEx(sbyte4 numServerConnections, sbyte4 numClientConnections, RNGFun rngFun, void *arg)
Initialize NanoDTLS client or server internal structures with custom RNG.
MOC_EXTERN sbyte4 DTLS_getConnectionInstance(MOC_IP_ADDRESS srcAddr, ubyte2 srcPort, MOC_IP_ADDRESS peerAddr, ubyte2 peerPort)
Get a DTLS connection instance for the specified src-dst connection.
MOC_EXTERN sbyte4 DTLS_setEarlyData(sbyte4 connectionInstance, ubyte *pEarlyData, ubyte4 earlyDataSize)
Set the max early data.
MOC_EXTERN sbyte4 DTLS_releaseTables(void)
Release memory used by internal NanoDTLS memory tables.
MOC_EXTERN sbyte4 DTLS_start(sbyte4 connectionInstance)
Start establishing a secure client-server connection.
MOC_EXTERN sbyte4 DTLS_getNextConnectionInstance(ubyte4 *pCookie, sbyte4 *pConnectionInstance, const peerDescr **ppRetPeerDescr)
Get a server's next open client connection instance.
MOC_EXTERN sbyte4 DTLS_setMaxEarlyDataSize(sbyte4 connectionInstance, sbyte4 earlyDataSize)
Set the max early data size.
MOC_EXTERN struct sslSettings * DTLS_dtlsSettings(void)
Get a pointer to current context's configuration settings.