tls_legacy.h
Go to the documentation of this file.
1 /**
2  * @file tls_legacy.h
3  * @brief Legacy definitions
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 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 2.4.4
29  **/
30 
31 #ifndef _TLS_LEGACY_H
32 #define _TLS_LEGACY_H
33 
34 //Deprecated definitions
35 #define TlsIoHandle TlsSocketHandle
36 
37 //Deprecated functions
38 #define tlsSetIoCallbacks(context, handle, sendCallback, receiveCallback) \
39  tlsSetSocketCallbacks(context, sendCallback, receiveCallback, handle);
40 
41 #ifdef TLS_RSA_SUPPORT
42  #if (TLS_RSA_SUPPORT == ENABLED)
43  #define TLS_RSA_KE_SUPPORT ENABLED
44  #else
45  #define TLS_RSA_KE_SUPPORT DISABLED
46  #endif
47  #undef TLS_RSA_SUPPORT
48 #endif
49 
50 #ifdef TLS_DHE_RSA_SUPPORT
51  #define TLS_DHE_RSA_KE_SUPPORT TLS_DHE_RSA_SUPPORT
52 #endif
53 
54 #ifdef TLS_DHE_DSS_SUPPORT
55  #define TLS_DHE_DSS_KE_SUPPORT TLS_DHE_DSS_SUPPORT
56 #endif
57 
58 #ifdef TLS_DH_ANON_SUPPORT
59  #define TLS_DH_ANON_KE_SUPPORT TLS_DH_ANON_SUPPORT
60 #endif
61 
62 #ifdef TLS_ECDHE_RSA_SUPPORT
63  #define TLS_ECDHE_RSA_KE_SUPPORT TLS_ECDHE_RSA_SUPPORT
64 #endif
65 
66 #ifdef TLS_ECDHE_ECDSA_SUPPORT
67  #define TLS_ECDHE_ECDSA_KE_SUPPORT TLS_ECDHE_ECDSA_SUPPORT
68 #endif
69 
70 #ifdef TLS_ECDH_ANON_SUPPORT
71  #define TLS_ECDH_ANON_KE_SUPPORT TLS_ECDH_ANON_SUPPORT
72 #endif
73 
74 #ifdef TLS_PSK_SUPPORT
75  #if (TLS_PSK_SUPPORT == ENABLED)
76  #define TLS_PSK_KE_SUPPORT ENABLED
77  #else
78  #define TLS_PSK_KE_SUPPORT DISABLED
79  #endif
80  #undef TLS_PSK_SUPPORT
81 #endif
82 
83 #ifdef TLS_RSA_PSK_SUPPORT
84  #define TLS_RSA_PSK_KE_SUPPORT TLS_RSA_PSK_SUPPORT
85 #endif
86 
87 #ifdef TLS_DHE_PSK_SUPPORT
88  #define TLS_DHE_PSK_KE_SUPPORT TLS_DHE_PSK_SUPPORT
89 #endif
90 
91 #ifdef TLS_ECDHE_PSK_SUPPORT
92  #define TLS_ECDHE_PSK_KE_SUPPORT TLS_ECDHE_PSK_SUPPORT
93 #endif
94 
95 #ifdef TLS_CURVE25519_SUPPORT
96  #define TLS_X25519_SUPPORT TLS_CURVE25519_SUPPORT
97 #endif
98 
99 #ifdef TLS_CURVE448_SUPPORT
100  #define TLS_X448_SUPPORT TLS_CURVE448_SUPPORT
101 #endif
102 
103 #define TlsSession TlsSessionState
104 #define tlsSaveSession tlsSaveSessionState
105 #define tlsRestoreSession tlsRestoreSessionState
106 
107 #ifdef TLS_AES_SUPPORT
108  #define TLS_AES_128_SUPPORT TLS_AES_SUPPORT
109  #define TLS_AES_256_SUPPORT TLS_AES_SUPPORT
110 #endif
111 
112 #ifdef TLS_CAMELLIA_SUPPORT
113  #define TLS_CAMELLIA_128_SUPPORT TLS_CAMELLIA_SUPPORT
114  #define TLS_CAMELLIA_256_SUPPORT TLS_CAMELLIA_SUPPORT
115 #endif
116 
117 #ifdef TLS_ARIA_SUPPORT
118  #define TLS_ARIA_128_SUPPORT TLS_ARIA_SUPPORT
119  #define TLS_ARIA_256_SUPPORT TLS_ARIA_SUPPORT
120 #endif
121 
122 #if defined(TLS_EDDSA_SIGN_SUPPORT) && defined(TLS_ED25519_SUPPORT)
123  #if (TLS_EDDSA_SIGN_SUPPORT == ENABLED && TLS_ED25519_SUPPORT == ENABLED)
124  #define TLS_ED25519_SIGN_SUPPORT ENABLED
125  #else
126  #define TLS_ED25519_SIGN SUPPORT DISABLED
127  #endif
128 #endif
129 
130 #if defined(TLS_EDDSA_SIGN_SUPPORT) && defined(TLS_ED448_SUPPORT)
131  #if (TLS_EDDSA_SIGN_SUPPORT == ENABLED && TLS_ED448_SUPPORT == ENABLED)
132  #define TLS_ED448_SIGN_SUPPORT ENABLED
133  #else
134  #define TLS_ED448_SIGN SUPPORT DISABLED
135  #endif
136 #endif
137 
138 #define TLS_GROUP_ECDH_X25519 TLS_GROUP_X25519
139 #define TLS_GROUP_ECDH_X448 TLS_GROUP_X448
140 
141 #endif