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