Formatting and parsing of extensions (TLS client) More...
#include "tls.h"
#include "tls_cipher_suites.h"
#include "tls_client_extensions.h"
#include "tls_client_misc.h"
#include "tls_extensions.h"
#include "tls_ffdhe.h"
#include "tls_misc.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL TLS_TRACE_LEVEL |
Functions | |
error_t | tlsFormatClientSupportedVersionsExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format SupportedVersions extension. More... | |
error_t | tlsFormatClientSniExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format SNI extension. More... | |
error_t | tlsFormatClientMaxFragLenExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format MaxFragmentLength extension. More... | |
error_t | tlsFormatClientRecordSizeLimitExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format RecordSizeLimit extension. More... | |
error_t | tlsFormatSupportedGroupsExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format SupportedGroups extension. More... | |
error_t | tlsFormatClientEcPointFormatsExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format EcPointFormats extension. More... | |
error_t | tlsFormatClientAlpnExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format ALPN extension. More... | |
error_t | tlsFormatClientCertTypeListExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format ClientCertType extension. More... | |
error_t | tlsFormatServerCertTypeListExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format ServerCertType extension. More... | |
error_t | tlsFormatClientEtmExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format EncryptThenMac extension. More... | |
error_t | tlsFormatClientEmsExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format ExtendedMasterSecret extension. More... | |
error_t | tlsFormatClientSessionTicketExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format SessionTicket extension. More... | |
error_t | tlsFormatClientRenegoInfoExtension (TlsContext *context, uint8_t *p, size_t *written) |
Format RenegotiationInfo extension. More... | |
error_t | tlsFormatClientHelloPaddingExtension (TlsContext *context, size_t clientHelloLen, uint8_t *p, size_t *written) |
Format ClientHello Padding extension. More... | |
error_t | tlsParseServerSniExtension (TlsContext *context, const TlsServerNameList *serverNameList) |
Parse SNI extension. More... | |
error_t | tlsParseServerMaxFragLenExtension (TlsContext *context, const TlsExtension *maxFragLen) |
Parse MaxFragmentLength extension. More... | |
error_t | tlsParseServerRecordSizeLimitExtension (TlsContext *context, const TlsExtension *recordSizeLimit) |
Parse RecordSizeLimit extension. More... | |
error_t | tlsParseServerEcPointFormatsExtension (TlsContext *context, const TlsEcPointFormatList *ecPointFormatList) |
Parse EcPointFormats extension. More... | |
error_t | tlsParseServerAlpnExtension (TlsContext *context, const TlsProtocolNameList *protocolNameList) |
Parse ALPN extension. More... | |
error_t | tlsParseClientCertTypeExtension (TlsContext *context, const TlsExtension *clientCertType) |
Parse ClientCertType extension. More... | |
error_t | tlsParseServerCertTypeExtension (TlsContext *context, const TlsExtension *serverCertType) |
Parse ServerCertType extension. More... | |
error_t | tlsParseServerEtmExtension (TlsContext *context, const TlsExtension *encryptThenMac) |
Parse EncryptThenMac extension. More... | |
error_t | tlsParseServerEmsExtension (TlsContext *context, const TlsExtension *extendedMasterSecret) |
Parse ExtendedMasterSecret extension. More... | |
error_t | tlsParseServerSessionTicketExtension (TlsContext *context, const TlsExtension *sessionTicket) |
Parse SessionTicket extension. More... | |
error_t | tlsParseServerRenegoInfoExtension (TlsContext *context, const TlsHelloExtensions *extensions) |
Parse RenegotiationInfo extension. More... | |
Variables | |
const uint16_t | tlsSupportedGroups [] |
Detailed Description
Formatting and parsing of extensions (TLS client)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 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.4.4
Definition in file tls_client_extensions.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL TLS_TRACE_LEVEL |
Definition at line 32 of file tls_client_extensions.c.
Function Documentation
◆ tlsFormatClientAlpnExtension()
error_t tlsFormatClientAlpnExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format ALPN extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the ALPN extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 588 of file tls_client_extensions.c.
◆ tlsFormatClientCertTypeListExtension()
error_t tlsFormatClientCertTypeListExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format ClientCertType extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the ClientCertType extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 674 of file tls_client_extensions.c.
◆ tlsFormatClientEcPointFormatsExtension()
error_t tlsFormatClientEcPointFormatsExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format EcPointFormats extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the EcPointFormats extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 526 of file tls_client_extensions.c.
◆ tlsFormatClientEmsExtension()
error_t tlsFormatClientEmsExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format ExtendedMasterSecret extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the ExtendedMasterSecret extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 835 of file tls_client_extensions.c.
◆ tlsFormatClientEtmExtension()
error_t tlsFormatClientEtmExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format EncryptThenMac extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the EncryptThenMac extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 790 of file tls_client_extensions.c.
◆ tlsFormatClientHelloPaddingExtension()
error_t tlsFormatClientHelloPaddingExtension | ( | TlsContext * | context, |
size_t | clientHelloLen, | ||
uint8_t * | p, | ||
size_t * | written | ||
) |
Format ClientHello Padding extension.
- Parameters
-
[in] context Pointer to the TLS context [in] clientHelloLen Actual length of the ClientHello message [in] p Output stream where to write the ClientHello Padding extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 1016 of file tls_client_extensions.c.
◆ tlsFormatClientMaxFragLenExtension()
error_t tlsFormatClientMaxFragLenExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format MaxFragmentLength extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the MaxFragmentLength extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 268 of file tls_client_extensions.c.
◆ tlsFormatClientRecordSizeLimitExtension()
error_t tlsFormatClientRecordSizeLimitExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format RecordSizeLimit extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the RecordSizeLimit extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 332 of file tls_client_extensions.c.
◆ tlsFormatClientRenegoInfoExtension()
error_t tlsFormatClientRenegoInfoExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format RenegotiationInfo extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the RenegotiationInfo extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 948 of file tls_client_extensions.c.
◆ tlsFormatClientSessionTicketExtension()
error_t tlsFormatClientSessionTicketExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format SessionTicket extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the SessionTicket extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 880 of file tls_client_extensions.c.
◆ tlsFormatClientSniExtension()
error_t tlsFormatClientSniExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format SNI extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the ServerName extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 195 of file tls_client_extensions.c.
◆ tlsFormatClientSupportedVersionsExtension()
error_t tlsFormatClientSupportedVersionsExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format SupportedVersions extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the SupportedVersions extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 87 of file tls_client_extensions.c.
◆ tlsFormatServerCertTypeListExtension()
error_t tlsFormatServerCertTypeListExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format ServerCertType extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the ServerCertType extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 730 of file tls_client_extensions.c.
◆ tlsFormatSupportedGroupsExtension()
error_t tlsFormatSupportedGroupsExtension | ( | TlsContext * | context, |
uint8_t * | p, | ||
size_t * | written | ||
) |
Format SupportedGroups extension.
- Parameters
-
[in] context Pointer to the TLS context [in] p Output stream where to write the SupportedGroups extension [out] written Total number of bytes that have been written
- Returns
- Error code
Definition at line 388 of file tls_client_extensions.c.
◆ tlsParseClientCertTypeExtension()
error_t tlsParseClientCertTypeExtension | ( | TlsContext * | context, |
const TlsExtension * | clientCertType | ||
) |
Parse ClientCertType extension.
- Parameters
-
[in] context Pointer to the TLS context [in] clientCertType Pointer to the ClientCertType extension
- Returns
- Error code
Definition at line 1346 of file tls_client_extensions.c.
◆ tlsParseServerAlpnExtension()
error_t tlsParseServerAlpnExtension | ( | TlsContext * | context, |
const TlsProtocolNameList * | protocolNameList | ||
) |
Parse ALPN extension.
- Parameters
-
[in] context Pointer to the TLS context [in] protocolNameList Pointer to the ALPN extension
- Returns
- Error code
Definition at line 1266 of file tls_client_extensions.c.
◆ tlsParseServerCertTypeExtension()
error_t tlsParseServerCertTypeExtension | ( | TlsContext * | context, |
const TlsExtension * | serverCertType | ||
) |
Parse ServerCertType extension.
- Parameters
-
[in] context Pointer to the TLS context [in] serverCertType Pointer to the ServerCertType extension
- Returns
- Error code
Definition at line 1380 of file tls_client_extensions.c.
◆ tlsParseServerEcPointFormatsExtension()
error_t tlsParseServerEcPointFormatsExtension | ( | TlsContext * | context, |
const TlsEcPointFormatList * | ecPointFormatList | ||
) |
Parse EcPointFormats extension.
- Parameters
-
[in] context Pointer to the TLS context [in] ecPointFormatList Pointer to the EcPointFormats extension
- Returns
- Error code
Definition at line 1218 of file tls_client_extensions.c.
◆ tlsParseServerEmsExtension()
error_t tlsParseServerEmsExtension | ( | TlsContext * | context, |
const TlsExtension * | extendedMasterSecret | ||
) |
Parse ExtendedMasterSecret extension.
- Parameters
-
[in] context Pointer to the TLS context [in] extendedMasterSecret Pointer to the ExtendedMasterSecret extension
- Returns
- Error code
Definition at line 1459 of file tls_client_extensions.c.
◆ tlsParseServerEtmExtension()
error_t tlsParseServerEtmExtension | ( | TlsContext * | context, |
const TlsExtension * | encryptThenMac | ||
) |
Parse EncryptThenMac extension.
- Parameters
-
[in] context Pointer to the TLS context [in] encryptThenMac Pointer to the EncryptThenMac extension
- Returns
- Error code
Definition at line 1422 of file tls_client_extensions.c.
◆ tlsParseServerMaxFragLenExtension()
error_t tlsParseServerMaxFragLenExtension | ( | TlsContext * | context, |
const TlsExtension * | maxFragLen | ||
) |
Parse MaxFragmentLength extension.
- Parameters
-
[in] context Pointer to the TLS context [in] maxFragLen Pointer to the MaxFragmentLength extension
- Returns
- Error code
Definition at line 1105 of file tls_client_extensions.c.
◆ tlsParseServerRecordSizeLimitExtension()
error_t tlsParseServerRecordSizeLimitExtension | ( | TlsContext * | context, |
const TlsExtension * | recordSizeLimit | ||
) |
Parse RecordSizeLimit extension.
- Parameters
-
[in] context Pointer to the TLS context [in] recordSizeLimit Pointer to the RecordSizeLimit extension
- Returns
- Error code
Definition at line 1158 of file tls_client_extensions.c.
◆ tlsParseServerRenegoInfoExtension()
error_t tlsParseServerRenegoInfoExtension | ( | TlsContext * | context, |
const TlsHelloExtensions * | extensions | ||
) |
Parse RenegotiationInfo extension.
- Parameters
-
[in] context Pointer to the TLS context [in] extensions ServerHello extensions offered by the server
- Returns
- Error code
Definition at line 1545 of file tls_client_extensions.c.
◆ tlsParseServerSessionTicketExtension()
error_t tlsParseServerSessionTicketExtension | ( | TlsContext * | context, |
const TlsExtension * | sessionTicket | ||
) |
Parse SessionTicket extension.
- Parameters
-
[in] context Pointer to the TLS context [in] sessionTicket Pointer to the SessionTicket extension
- Returns
- Error code
Definition at line 1508 of file tls_client_extensions.c.
◆ tlsParseServerSniExtension()
error_t tlsParseServerSniExtension | ( | TlsContext * | context, |
const TlsServerNameList * | serverNameList | ||
) |
Parse SNI extension.
- Parameters
-
[in] context Pointer to the TLS context [in] serverNameList Pointer to the ServerName extension
- Returns
- Error code
Definition at line 1078 of file tls_client_extensions.c.
Variable Documentation
◆ tlsSupportedGroups
const uint16_t tlsSupportedGroups[] |
Definition at line 48 of file tls_client_extensions.c.