tls_extensions.h File Reference

Parsing and checking of TLS extensions. More...

#include "tls.h"

Go to the source code of this file.

Functions

error_t tlsParseHelloExtensions (TlsMessageType msgType, const uint8_t *p, size_t length, TlsHelloExtensions *extensions)
 Parse Hello extensions. More...
 
error_t tlsCheckHelloExtensions (TlsMessageType msgType, uint16_t version, TlsHelloExtensions *extensions)
 Check Hello extensions. More...
 
error_t tlsCheckDuplicateExtension (uint16_t type, const uint8_t *p, size_t length)
 Check whether the specified extension type is a duplicate. More...
 
bool_t tlsIsAlpnProtocolSupported (TlsContext *context, const char_t *protocol, size_t length)
 Check whether the specified ALPN protocol is supported. More...
 

Detailed Description

Parsing and checking of TLS extensions.

License

Copyright (C) 2010-2018 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file tls_extensions.h.

Function Documentation

◆ tlsCheckDuplicateExtension()

error_t tlsCheckDuplicateExtension ( uint16_t  type,
const uint8_t *  p,
size_t  length 
)

Check whether the specified extension type is a duplicate.

Parameters
[in]typeExtension type
[in]pInput stream where to read the list of extensions
[in]lengthNumber of bytes available in the input stream
Returns
Error code

Definition at line 965 of file tls_extensions.c.

◆ tlsCheckHelloExtensions()

error_t tlsCheckHelloExtensions ( TlsMessageType  msgType,
uint16_t  version,
TlsHelloExtensions extensions 
)

Check Hello extensions.

Parameters
[in]msgTypeHandshake message type
[in]versionTLS version
[in]extensionsList of Hello extensions offered by the peer
Returns
Error code

Definition at line 661 of file tls_extensions.c.

◆ tlsIsAlpnProtocolSupported()

bool_t tlsIsAlpnProtocolSupported ( TlsContext context,
const char_t protocol,
size_t  length 
)

Check whether the specified ALPN protocol is supported.

Parameters
[in]contextPointer to the TLS context
[in]protocolPointer to the protocol name
[in]lengthLength of the protocol name, in bytes
Returns
TRUE if the specified protocol is supported, else FALSE

Definition at line 1015 of file tls_extensions.c.

◆ tlsParseHelloExtensions()

error_t tlsParseHelloExtensions ( TlsMessageType  msgType,
const uint8_t *  p,
size_t  length,
TlsHelloExtensions extensions 
)

Parse Hello extensions.

Parameters
[in]msgTypeHandshake message type
[in]pInput stream where to read the list of extensions
[in]lengthNumber of bytes available in the input stream
[out]extensionsList of Hello extensions resulting from the parsing process
Returns
Error code

Definition at line 55 of file tls_extensions.c.