Go to the documentation of this file.
35 #define DTLS_VERSION_1_0 0xFEFF
36 #define DTLS_VERSION_1_2 0xFEFD
37 #define DTLS_VERSION_1_3 0xFEFC
41 #define DTLS_SUPPORT DISABLED
42 #elif (DTLS_SUPPORT != ENABLED && DTLS_SUPPORT != DISABLED)
43 #error DTLS_SUPPORT parameter is not valid
47 #ifndef DTLS_DEFAULT_PMTU
48 #define DTLS_DEFAULT_PMTU 1452
49 #elif (DTLS_DEFAULT_PMTU < 64)
50 #error DTLS_DEFAULT_PMTU parameter is not valid
55 #define DTLS_MIN_PMTU 528
56 #elif (DTLS_MIN_PMTU < 64)
57 #error DTLS_MIN_PMTU parameter is not valid
61 #ifndef DTLS_REPLAY_DETECTION_SUPPORT
62 #define DTLS_REPLAY_DETECTION_SUPPORT ENABLED
63 #elif (DTLS_REPLAY_DETECTION_SUPPORT != ENABLED && DTLS_REPLAY_DETECTION_SUPPORT != DISABLED)
64 #error DTLS_REPLAY_DETECTION_SUPPORT parameter is not valid
68 #ifndef DTLS_REPLAY_WINDOW_SIZE
69 #define DTLS_REPLAY_WINDOW_SIZE 64
70 #elif (DTLS_REPLAY_WINDOW_SIZE < 1)
71 #error DTLS_REPLAY_WINDOW_SIZE parameter is not valid
75 #ifndef DTLS_MAX_COOKIE_SIZE
76 #define DTLS_MAX_COOKIE_SIZE 32
77 #elif (DTLS_MAX_COOKIE_SIZE < 32)
78 #error DTLS_MAX_COOKIE_SIZE parameter is not valid
82 #ifndef DTLS_MAX_RETRIES
83 #define DTLS_MAX_RETRIES 5
84 #elif (DTLS_MAX_RETRIES < 1)
85 #error DTLS_MAX_RETRIES parameter is not valid
89 #ifndef DTLS_INIT_TIMEOUT
90 #define DTLS_INIT_TIMEOUT 1000
91 #elif (DTLS_INIT_TIMEOUT < 100)
92 #error DTLS_INIT_TIMEOUT parameter is not valid
96 #ifndef DTLS_MIN_TIMEOUT
97 #define DTLS_MIN_TIMEOUT 500
98 #elif (DTLS_MIN_TIMEOUT < 100)
99 #error DTLS_MIN_TIMEOUT parameter is not valid
103 #ifndef DTLS_MAX_TIMEOUT
104 #define DTLS_MAX_TIMEOUT 60000
105 #elif (DTLS_MAX_TIMEOUT < 1000)
106 #error DTLS_MAX_TIMEOUT parameter is not valid
129 #if defined(__CCRX__)
131 #elif defined(__CWCC__) || defined(_WIN32)
132 #pragma pack(push, 1)
204 uint16_t serverVersion;
211 #if defined(__CCRX__)
213 #elif defined(__CWCC__) || defined(_WIN32)
242 size_t *
length,
void *param);
251 size_t length,
void *param);
@ DTLS_RETRANSMIT_STATE_WAITING
error_t dtlsFormatCookie(TlsContext *context, uint8_t *p, size_t *written)
Format Cookie field.
error_t(* DtlsCookieGenerateCallback)(TlsContext *context, const DtlsClientParameters *clientParams, uint8_t *cookie, size_t *length, void *param)
DTLS cookie generation callback function.
@ DTLS_RETRANSMIT_STATE_FINISHED
error_t dtlsSelectVersion(TlsContext *context, uint16_t version)
Set the DTLS version to be used.
const uint8_t * cipherSuites
@ DTLS_RETRANSMIT_STATE_SENDING
error_t dtlsParseClientSupportedVersionsExtension(TlsContext *context, const DtlsSupportedVersionList *supportedVersionList)
Parse SupportedVersions extension.
uint16_t dtlsTranslateVersion(uint16_t version)
Translate TLS version into DTLS version.
error_t dtlsVerifyCookie(TlsContext *context, const DtlsCookie *cookie, const DtlsClientParameters *clientParams)
Cookie verification.
error_t(* DtlsCookieVerifyCallback)(TlsContext *context, const DtlsClientParameters *clientParams, const uint8_t *cookie, size_t length, void *param)
DTLS cookie verification callback function.
const uint8_t * sessionId
error_t dtlsSendHelloVerifyRequest(TlsContext *context)
Send HelloVerifyRequest message.
void dtlsUpdateReplayWindow(TlsContext *context, DtlsSequenceNumber *seqNum)
Update sliding window.
typedef __packed_struct
Sequence number.
error_t dtlsCheckReplayWindow(TlsContext *context, DtlsSequenceNumber *seqNum)
Perform replay detection.
const uint8_t * compressMethods
void dtlsInitReplayWindow(TlsContext *context)
Initialize sliding window.
error_t dtlsFormatHelloVerifyRequest(TlsContext *context, DtlsHelloVerifyRequest *message, size_t *length)
Format HelloVerifyRequest message.
DtlsSequenceNumber seqNum
size_t compressMethodsLen
DtlsRetransmitState
DTLS retransmission states.
error_t dtlsParseHelloVerifyRequest(TlsContext *context, const DtlsHelloVerifyRequest *message, size_t length)
Parse HelloVerifyRequest message.
@ DTLS_RETRANSMIT_STATE_PREPARING