tls_server_misc.h
Go to the documentation of this file.
1 /**
2  * @file tls_server_misc.h
3  * @brief Helper functions for TLS server
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneSSL Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 1.9.6
29  **/
30 
31 #ifndef _TLS_SERVER_MISC_H
32 #define _TLS_SERVER_MISC_H
33 
34 //Dependencies
35 #include "tls.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 //TLS server specific functions
44  uint8_t *p, size_t *written);
45 
47  uint8_t *p, size_t *written);
48 
50  TlsDigitalSignature *signature, const uint8_t *params,
51  size_t paramsLen, size_t *written);
52 
54  Tls12DigitalSignature *signature, const uint8_t *params,
55  size_t paramsLen, size_t *written);
56 
58  const TlsCipherSuites *cipherSuites);
59 
60 error_t tlsResumeServerSession(TlsContext *context, const uint8_t *sessionId,
61  size_t sessionIdLen, const TlsCipherSuites *cipherSuites,
63 
65  const TlsSupportedVersionList *supportedVersionList);
66 
67 error_t tlsNegotiateCipherSuite(TlsContext *context, const HashAlgo *hashAlgo,
68  const TlsCipherSuites *cipherSuites, TlsHelloExtensions *extensions);
69 
71  const TlsSupportedGroupList *groupList);
72 
74  const TlsSupportedGroupList *groupList);
75 
78 
80  const TlsCompressMethods *compressMethods);
81 
83  const uint8_t *p, size_t length, size_t *consumed);
84 
86  const uint8_t *p, size_t length, size_t *consumed);
87 
88 //C++ guard
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif
uint8_t length
Definition: dtls_misc.h:149
error_t tls12GenerateServerKeySignature(TlsContext *context, Tls12DigitalSignature *signature, const uint8_t *params, size_t paramsLen, size_t *written)
Sign server's key exchange parameters (TLS 1.2)
__start_packed struct @82 Tls12DigitalSignature
Digitally-signed element (TLS 1.2)
error_t tlsResumeServerSession(TlsContext *context, const uint8_t *sessionId, size_t sessionIdLen, const TlsCipherSuites *cipherSuites, const TlsHelloExtensions *extensions)
Resume TLS session via session ID.
uint8_t p
Definition: ndp.h:298
error_t tlsNegotiateVersion(TlsContext *context, uint16_t clientVersion, const TlsSupportedVersionList *supportedVersionList)
Version negotiation.
__start_packed struct @81 TlsDigitalSignature
Digitally-signed element (SSL 3.0, TLS 1.0 and TLS 1.1)
uint8_t signature
Definition: tls.h:1370
error_t tlsParseCompressMethods(TlsContext *context, const TlsCompressMethods *compressMethods)
Parse the list of compression methods supported by the client.
error_t tlsSelectGroup(TlsContext *context, const TlsSupportedGroupList *groupList)
Select the group to be used when performing (EC)DHE key exchange.
uint8_t sessionIdLen
Definition: tls.h:1615
uint16_t clientVersion
Definition: tls.h:1613
__start_packed struct @62 TlsCipherSuites
Cipher suites.
error_t tlsParseClientKeyParams(TlsContext *context, const uint8_t *p, size_t length, size_t *consumed)
Parse client's key exchange parameters.
#define TlsContext
Definition: tls.h:36
error_t
Error codes.
Definition: error.h:42
error_t tlsCheckSignalingCipherSuiteValues(TlsContext *context, const TlsCipherSuites *cipherSuites)
Check whether the ClientHello includes any SCSV cipher suites.
error_t tlsNegotiateCipherSuite(TlsContext *context, const HashAlgo *hashAlgo, const TlsCipherSuites *cipherSuites, TlsHelloExtensions *extensions)
Cipher suite negotiation.
error_t tlsParsePskIdentity(TlsContext *context, const uint8_t *p, size_t length, size_t *consumed)
Parse PSK identity.
error_t tlsFormatPskIdentityHint(TlsContext *context, uint8_t *p, size_t *written)
Format PSK identity hint.
error_t tlsSelectCertificate(TlsContext *context, const TlsHelloExtensions *extensions)
Certificate selection process.
Hello extensions.
Definition: tls.h:1894
error_t tlsSelectEcdheGroup(TlsContext *context, const TlsSupportedGroupList *groupList)
Select the named curve to be used when performing ECDHE key exchange.
uint8_t extensions[]
Definition: tls13_misc.h:327
__start_packed struct @70 TlsSupportedVersionList
List of supported versions.
uint8_t sessionId[]
Definition: tls.h:1616
__start_packed struct @75 TlsSupportedGroupList
List of supported groups.
TLS (Transport Layer Security)
__start_packed struct @63 TlsCompressMethods
Compression methods.
Common interface for hash algorithms.
Definition: crypto.h:1128
error_t tlsGenerateServerKeySignature(TlsContext *context, TlsDigitalSignature *signature, const uint8_t *params, size_t paramsLen, size_t *written)
Sign server's key exchange parameters (SSL 3.0, TLS 1.0 and TLS 1.1)
error_t tlsFormatServerKeyParams(TlsContext *context, uint8_t *p, size_t *written)
Format server's key exchange parameters.