DTLS (Datagram Transport Layer Security) More...
#include "tls.h"#include "tls_handshake.h"#include "tls_common.h"#include "tls_misc.h"#include "dtls_misc.h"#include "debug.h"Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL TLS_TRACE_LEVEL |
Detailed Description
DTLS (Datagram Transport Layer Security)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSSL Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.5.4
Definition in file dtls_misc.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL TLS_TRACE_LEVEL |
Definition at line 32 of file dtls_misc.c.
Function Documentation
◆ dtlsCheckReplayWindow()
| error_t dtlsCheckReplayWindow | ( | TlsContext * | context, |
| DtlsSequenceNumber * | seqNum | ||
| ) |
Perform replay detection.
- Parameters
-
[in] context Pointer to the TLS context [in] seqNum Sequence number of the received DTLS record
- Returns
- Error code
Definition at line 473 of file dtls_misc.c.
◆ dtlsFormatCookie()
| error_t dtlsFormatCookie | ( | TlsContext * | context, |
| uint8_t * | p, | ||
| size_t * | written | ||
| ) |
Format Cookie field.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the Cookie field [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 144 of file dtls_misc.c.
◆ dtlsFormatHelloVerifyRequest()
| error_t dtlsFormatHelloVerifyRequest | ( | TlsContext * | context, |
| DtlsHelloVerifyRequest * | message, | ||
| size_t * | length | ||
| ) |
Format HelloVerifyRequest message.
- Parameters
-
[in] context Pointer to the TLS context [out] message Buffer where to format the HelloVerifyRequest message [out] length Length of the resulting HelloVerifyRequest message
- Returns
- Error code
Definition at line 291 of file dtls_misc.c.
◆ dtlsInitReplayWindow()
| void dtlsInitReplayWindow | ( | TlsContext * | context | ) |
Initialize sliding window.
- Parameters
-
[in] context Pointer to the TLS context
Definition at line 452 of file dtls_misc.c.
◆ dtlsParseClientSupportedVersionsExtension()
| error_t dtlsParseClientSupportedVersionsExtension | ( | TlsContext * | context, |
| const DtlsSupportedVersionList * | supportedVersionList | ||
| ) |
Parse SupportedVersions extension.
- Parameters
-
[in] context Pointer to the TLS context [in] supportedVersionList Pointer to the SupportedVersions extension
- Returns
- Error code
Definition at line 405 of file dtls_misc.c.
◆ dtlsParseHelloVerifyRequest()
| error_t dtlsParseHelloVerifyRequest | ( | TlsContext * | context, |
| const DtlsHelloVerifyRequest * | message, | ||
| size_t | length | ||
| ) |
Parse HelloVerifyRequest message.
When the client sends its ClientHello message to the server, the server may respond with a HelloVerifyRequest message
- Parameters
-
[in] context Pointer to the TLS context [in] message Incoming HelloVerifyRequest message to parse [in] length Message length
- Returns
- Error code
Definition at line 329 of file dtls_misc.c.
◆ dtlsSelectVersion()
| error_t dtlsSelectVersion | ( | TlsContext * | context, |
| uint16_t | version | ||
| ) |
Set the DTLS version to be used.
- Parameters
-
[in] context Pointer to the TLS context [in] version DTLS version
- Returns
- Error code
Definition at line 53 of file dtls_misc.c.
◆ dtlsSendHelloVerifyRequest()
| error_t dtlsSendHelloVerifyRequest | ( | TlsContext * | context | ) |
Send HelloVerifyRequest message.
When the client sends its ClientHello message to the server, the server may respond with a HelloVerifyRequest message. This message contains a stateless cookie
- Parameters
-
[in] context Pointer to the TLS context
- Returns
- Error code
Definition at line 247 of file dtls_misc.c.
◆ dtlsTranslateVersion()
| uint16_t dtlsTranslateVersion | ( | uint16_t | version | ) |
Translate TLS version into DTLS version.
- Parameters
-
[in] version TLS version
- Returns
- DTLS version
Definition at line 112 of file dtls_misc.c.
◆ dtlsUpdateReplayWindow()
| void dtlsUpdateReplayWindow | ( | TlsContext * | context, |
| DtlsSequenceNumber * | seqNum | ||
| ) |
Update sliding window.
- Parameters
-
[in] context Pointer to the TLS context [in] seqNum Sequence number of the received DTLS record
Definition at line 554 of file dtls_misc.c.
◆ dtlsVerifyCookie()
| error_t dtlsVerifyCookie | ( | TlsContext * | context, |
| const DtlsCookie * | cookie, | ||
| const DtlsClientParameters * | clientParams | ||
| ) |
Cookie verification.
- Parameters
-
[in] context Pointer to the TLS context [in] cookie Pointer to the client's cookie [in] clientParams Client's parameters
- Returns
- Error code
Definition at line 178 of file dtls_misc.c.
