3 * Copyright (C) 2006-2015 wolfSSL Inc.
5 * This file is part of wolfSSL. (formerly known as CyaSSL)
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * a with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 * ssl.h makes wolfssl backwards compatibile with cyassl
26 #ifndef WOLFSSL_CYASSL_H_
27 #define WOLFSSL_CYASSL_H_
30 * include the new ssl.h
32 #include <wolfssl/ssl.h>
33 #include <cyassl/ctaocrypt/types.h>
34 #include <cyassl/ctaocrypt/settings.h>
41 /* wincrypt.h clashes */
47 #define CYASSL_TIRTOS WOLFSSL_TIRTOS
50 #define CYASSL WOLFSSL
51 #define DEBUG_CYASSL DEBUG_WOLFSSL
52 #define CYASSL_CTX WOLFSSL_CTX
53 #define CYASSL_METHOD WOLFSSL_METHOD
54 #define CYASSL_SESSION WOLFSSL_SESSION
56 #define CYASSL_X509 WOLFSSL_X509
57 #define CYASSL_X509_NAME WOLFSSL_X509_NAME
58 #define CYASSL_X509_CHAIN WOLFSSL_X509_CHAIN
59 #ifdef WOLFSSL_SNIFFER
60 #define CYASSL_SNIFFER WOLFSSL_SNIFFER
64 #define CYASSL_TYPES_DEFINED WOLFSSL_TYPES_DEFINED
67 #define yasslIP wolfSSLIP /**/
68 #define yasslPort wolfSSLPort /**/
70 /* cyassl/ssl.h (structs) */
71 #define CYASSL_RSA WOLFSSL_RSA
72 #define CYASSL_DSA WOLFSSL_DSA
73 #define CYASSL_BIO WOLFSSL_BIO
74 #define CYASSL_CIPHER WOLFSSL_CIPHER
75 #define CYASSL_MD4_CTX WOLFSSL_MD4_CTX
76 #define CYASSL_MFL_2_9 WOLFSSL_MFL_2_9 /**/
77 #define CYASSL_MFL_2_13 WOLFSSL_MFL_2_13 /**/
78 #define CYASSL_EVP_PKEY WOLFSSL_EVP_PKEY
79 #define CYASSL_X509_CRL WOLFSSL_X509_CRL
80 #define CYASSL_ASN1_TIME WOLFSSL_ASN1_TIME
81 #define CYASSL_BIO_METHOD WOLFSSL_BIO_METHOD
82 #define CYASSL_X509_STORE WOLFSSL_X509_STORE
83 #define CYASSL_X509_OBJECT WOLFSSL_X509_OBJECT
84 #define CYASSL_X509_LOOKUP WOLFSSL_X509_LOOKUP
85 #define CYASSL_ASN1_OBJECT WOLFSSL_ASN1_OBJECT
86 #define CYASSL_ASN1_STRING WOLFSSL_ASN1_STRING
87 #define CYASSL_COMP_METHOD WOLFSSL_COMP_METHOD
88 #define CYASSL_CRL_CHECKALL WOLFSSL_CRL_CHECKALL
89 #define CYASSL_ASN1_INTEGER WOLFSSL_ASN1_INTEGER
90 #define CYASSL_X509_REVOKED WOLFSSL_X509_REVOKED
91 #define CYASSL_dynlock_value WOLFSSL_dynlock_value
92 #define CYASSL_X509_EXTENSION WOLFSSL_X509_EXTENSION
93 #define CYASSL_X509_STORE_CTX WOLFSSL_X509_STORE_CTX
94 #define CYASSL_X509_LOOKUP_METHOD WOLFSSL_X509_LOOKUP_METHOD
96 #define CyaSSL_LoadCRL wolfSSL_LoadCRL
97 #define CyaSSL_EnableCRL wolfSSL_EnableCRL
98 #define CyaSSL_SetCRL_Cb wolfSSL_SetCRL_Cb
102 #define CYASSL_THREAD WOLFSSL_THREAD
106 #define CYASSL_CRL WOLFSSL_CRL
107 #define CYASSL_SSLV3 WOLFSSL_SSLV3
108 #define CYASSL_TLSV1 WOLFSSL_TLSV1
109 #define CYASSL_TLSV1_1 WOLFSSL_TLSV1_1
110 #define CYASSL_TLSV1_2 WOLFSSL_TLSV1_2
111 #define CYASSL_USER_CA WOLFSSL_USER_CA
112 #define CYASSL_CLIENT_END WOLFSSL_CLIENT_END
113 #define CYASSL_CERT_MANAGER WOLFSSL_CERT_MANAGER
114 #define MAX_CYASSL_FILE_SIZE MAX_WOLFSSL_FILE_SIZE
116 #define CyaSSL_get_cipher wolfSSL_get_cipher
117 #define CyaSSL_get_ciphers wolfSSL_get_ciphers
118 #define CyaSSL_KeyPemToDer wolfSSL_KeyPemToDer
119 #define CyaSSL_get_version wolfSSL_get_version
120 #define CyaSSL_SetServerID wolfSSL_SetServerID
121 #define CyaSSL_use_old_poly wolfSSL_use_old_poly
122 #define CyaSSL_SetCertCbCtx wolfSSL_SetCertCbCtx
123 #define CyaSSL_CertPemToDer wolfSSL_CertPemToDer
124 #define CyaSSL_get_shutdown wolfSSL_get_shutdown
125 #define CyaSSL_SetMinVersion wolfSSL_SetMinVersion
126 #define CyaSSL_CTX_UnloadCAs wolfSSL_CTX_UnloadCAs
127 #define CyaSSL_session_reused wolfSSL_session_reused
128 #define CyaSSL_UnloadCertsKeys wolfSSL_UnloadCertsKeys
129 #define CyaSSL_CIPHER_get_name wolfSSL_CIPHER_get_name
130 #define CyaSSL_is_init_finished wolfSSL_is_init_finished
131 #define CyaSSL_get_alert_history wolfSSL_get_alert_history
132 #define CyaSSL_get_current_cipher wolfSSL_get_current_cipher
133 #define CyaSSL_CertManagerUnloadCAs wolfSSL_CertManagerUnloadCAs
134 #define CyaSSL_CertManagerEnableOCSP wolfSSL_CertManagerEnableOCSP
135 #define CyaSSL_CTX_check_private_key wolfSSL_CTX_check_private_key
136 #define CyaSSL_CertManagerDisableOCSP wolfSSL_CertManagerDisableOCSP
137 #define CyaSSL_get_current_cipher_suite wolfSSL_get_current_cipher_suite
138 #define CyaSSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations
139 #define CyaSSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
141 #define CyaSSL_save_session_cache wolfSSL_save_session_cache
142 #define CyaSSL_restore_session_cache wolfSSL_restore_session_cache
143 #define CyaSSL_memsave_session_cache wolfSSL_memsave_session_cache
144 #define CyaSSL_memrestore_session_cache wolfSSL_memrestore_session_cache
145 #define CyaSSL_get_session_cache_memsize wolfSSL_get_session_cache_memsize
147 /* certificate cache persistence, uses ctx since certs are per ctx */
148 #define CyaSSL_CTX_save_cert_cache wolfSSL_CTX_save_cert_cache
149 #define CyaSSL_CTX_restore_cert_cache wolfSSL_CTX_restore_cert_cache
150 #define CyaSSL_CTX_memsave_cert_cache wolfSSL_CTX_memsave_cert_cache
151 #define CyaSSL_CTX_memrestore_cert_cache wolfSSL_CTX_memrestore_cert_cache
152 #define CyaSSL_CTX_get_cert_cache_memsize wolfSSL_CTX_get_cert_cache_memsize
154 /* wolfSSL extensions */
155 /* get wolfSSL peer X509_CHAIN */
156 #define CyaSSL_get_chain_count wolfSSL_get_chain_count
157 /* index cert length */
158 #define CyaSSL_get_chain_length wolfSSL_get_chain_length
159 /* index cert in X509 */
160 #define CyaSSL_get_chain_X509 wolfSSL_get_chain_X509
162 #define CyaSSL_FreeX509 wolfSSL_FreeX509
163 /* get index cert in PEM */
164 #define CyaSSL_X509_get_subjectCN wolfSSL_X509_get_subjectCN
165 #define CyaSSL_X509_get_der wolfSSL_X509_get_der
166 #define CyaSSL_X509_notBefore wolfSSL_X509_notBefore
167 #define CyaSSL_X509_notAfter wolfSSL_X509_notAfter
168 #define CyaSSL_X509_version wolfSSL_X509_version
170 #define CyaSSL_cmp_peer_cert_to_file wolfSSL_cmp_peer_cert_to_file
172 #define CyaSSL_X509_get_next_altname wolfSSL_X509_get_next_altname
174 #define CyaSSL_X509_d2i wolfSSL_X509_d2i
175 #ifndef NO_FILESYSTEM
176 #ifndef NO_STDIO_FILESYSTEM
177 #define CyaSSL_X509_d2i_fp wolfSSL_X509_d2i_fp
179 #define CyaSSL_X509_load_certificate_file wolfSSL_X509_load_certificate_file
183 #define CyaSSL_X509_get_device_type wolfSSL_X509_get_device_type
184 #define CyaSSL_X509_get_hw_type wolfSSL_X509_get_hw_type
185 #define CyaSSL_X509_get_hw_serial_number wolfSSL_X509_get_hw_serial_number
188 #define CyaSSL_CTX_SetGenCookie wolfSSL_CTX_SetGenCookie
189 #define CyaSSL_SetCookieCtx wolfSSL_SetCookieCtx
190 #define CyaSSL_GetCookieCtx wolfSSL_GetCookieCtx
191 #define CyaSSL_ERR_get_error_line_data wolfSSL_ERR_get_error_line_data
192 #define CyaSSL_ERR_get_error wolfSSL_ERR_get_error
193 #define CyaSSL_ERR_clear_error wolfSSL_ERR_clear_error
194 #define CyaSSL_RAND_status wolfSSL_RAND_status
195 #define CyaSSL_RAND_bytes wolfSSL_RAND_bytes
196 #define CyaSSL_CTX_set_options wolfSSL_CTX_set_options
197 #define CyaSSL_ERR_free_strings wolfSSL_ERR_free_strings
198 #define CyaSSL_ERR_remove_state wolfSSL_ERR_remove_state
199 #define CyaSSL_EVP_cleanup wolfSSL_EVP_cleanup
200 #define CyaSSL_cleanup_all_ex_data wolfSSL_cleanup_all_ex_data
201 #define CyaSSL_CTX_set_mode wolfSSL_CTX_set_mode
202 #define CyaSSL_CTX_get_mode wolfSSL_CTX_get_mode
203 #define CyaSSL_CTX_set_default_read_ahead wolfSSL_CTX_set_default_read_ahead
204 #define CyaSSL_CTX_sess_set_cache_size wolfSSL_CTX_sess_set_cache_size
205 #define CyaSSL_CTX_set_default_verify_paths wolfSSL_CTX_set_default_verify_paths
206 #define CyaSSL_CTX_set_session_id_context wolfSSL_CTX_set_session_id_context
207 #define CyaSSL_get_peer_certificate wolfSSL_get_peer_certificate
208 #define CyaSSL_BIO_printf wolfSSL_BIO_printf
209 #define CyaSSL_ASN1_UTCTIME_print wolfSSL_ASN1_UTCTIME_print
210 #define CyaSSL_sk_num wolfSSL_sk_num
211 #define CyaSSL_sk_value wolfSSL_sk_value
213 /* stunnel 4.28 needs */
214 #define CyaSSL_CTX_get_ex_data wolfSSL_CTX_get_ex_data
215 #define CyaSSL_CTX_set_ex_data wolfSSL_CTX_set_ex_data
216 #define CyaSSL_CTX_sess_set_get_cb wolfSSL_CTX_sess_set_get_cb
217 #define CyaSSL_CTX_sess_set_new_cb wolfSSL_CTX_sess_set_new_cb
218 #define CyaSSL_CTX_sess_set_remove_cb wolfSSL_CTX_sess_set_remove_cb
220 #define CyaSSL_i2d_SSL_SESSION wolfSSL_i2d_SSL_SESSION
221 #define CyaSSL_d2i_SSL_SESSION wolfSSL_d2i_SSL_SESSION
223 #define CyaSSL_SESSION_get_timeout wolfSSL_SESSION_get_timeout
224 #define CyaSSL_SESSION_get_time wolfSSL_SESSION_get_time
225 #define CyaSSL_CTX_get_ex_new_index wolfSSL_CTX_get_ex_new_index
229 #define CYASSL_CBIO_ERR_ISR WOLFSSL_CBIO_ERR_ISR
230 #define CYASSL_CBIO_ERR_TIMEOUT WOLFSSL_CBIO_ERR_TIMEOUT
231 #define CYASSL_CBIO_ERR_GENERAL WOLFSSL_CBIO_ERR_GENERAL
232 #define CYASSL_CBIO_ERR_CONN_RST WOLFSSL_CBIO_ERR_CONN_RST
233 #define CYASSL_CBIO_ERR_WANT_READ WOLFSSL_CBIO_ERR_WANT_READ
234 #define CYASSL_CBIO_ERR_WANT_WRITE WOLFSSL_CBIO_ERR_WANT_WRITE
235 #define CYASSL_CBIO_ERR_CONN_CLOSE WOLFSSL_CBIO_ERR_CONN_CLOSE
237 #define CyaSSL_GetIOReadCtx wolfSSL_GetIOReadCtx
238 #define CyaSSL_GetIOWriteCtx wolfSSL_GetIOWriteCtx
241 #define CYASSL_SERVER_END WOLFSSL_SERVER_END
242 #define CYASSL_TLS_HMAC_INNER_SZ WOLFSSL_TLS_HMAC_INNER_SZ
244 #define CyaSSL_DeriveTlsKeys wolfSSL_DeriveTlsKeys
245 #define CyaSSL_make_eap_keys wolfSSL_make_eap_keys
246 #define CyaSSL_MakeTlsMasterSecret wolfSSL_MakeTlsMasterSecret
249 #define CYASSL_CHAIN_CA WOLFSSL_CHAIN_CA
250 #define CYASSL_ALERT_HISTORY WOLFSSL_ALERT_HISTORY
251 #define CYASSL_SESSION_TIMEOUT WOLFSSL_SESSION_TIMEOUT
252 #define CYASSL_CBIO_ERR_CONN_RST WOLFSSL_CBIO_ERR_CONN_RST
254 #define cyassl_rc4 wolfssl_rc4
255 #define cyassl_aes wolfssl_aes
256 #define cyassl_chacha wolfssl_chacha
257 #define CyaSSL_ERR_reason_error_string wolfSSL_ERR_reason_error_string
259 #define CyaSSL_set_ex_data wolfSSL_set_ex_data
260 #define CyaSSL_get_shutdown wolfSSL_get_shutdown
261 #define CyaSSL_set_rfd wolfSSL_set_rfd
262 #define CyaSSL_set_wfd wolfSSL_set_wfd
263 #define CyaSSL_set_shutdown wolfSSL_set_shutdown
264 #define CyaSSL_set_session_id_context wolfSSL_set_session_id_context
265 #define CyaSSL_set_connect_state wolfSSL_set_connect_state
266 #define CyaSSL_set_accept_state wolfSSL_set_accept_state
267 #define CyaSSL_session_reused wolfSSL_session_reused
268 #define CyaSSL_SESSION_free wolfSSL_SESSION_free
269 #define CyaSSL_is_init_finished wolfSSL_is_init_finished
271 #define CyaSSL_get_version wolfSSL_get_version
272 #define CyaSSL_get_current_cipher_suite wolfSSL_get_current_cipher_suite
273 #define CyaSSL_get_current_cipher wolfSSL_get_current_cipher
274 #define CyaSSL_CIPHER_description wolfSSL_CIPHER_description
275 #define CyaSSL_CIPHER_get_name wolfSSL_CIPHER_get_name
276 #define CyaSSL_get_cipher wolfSSL_get_cipher
277 #define CyaSSL_get1_session wolfSSL_get1_session
279 #define CyaSSL_X509_free wolfSSL_X509_free
280 #define CyaSSL_OPENSSL_free wolfSSL_OPENSSL_free
281 #define CyaSSL_OCSP_parse_url wolfSSL_OCSP_parse_url
283 #define CyaSSLv23_client_method wolfSSLv23_client_method
284 #define CyaSSLv2_client_method wolfSSLv2_client_method
285 #define CyaSSLv2_server_method wolfSSLv2_server_method
287 #define CyaSSL_MD4_Init wolfSSL_MD4_Init
288 #define CyaSSL_MD4_Update wolfSSL_MD4_Update
289 #define CyaSSL_MD4_Final wolfSSL_MD4_Final
292 #define CyaSSL_BIO_new wolfSSL_BIO_new
293 #define CyaSSL_BIO_free wolfSSL_BIO_free
294 #define CyaSSL_BIO_free_all wolfSSL_BIO_free_all
295 #define CyaSSL_BIO_read wolfSSL_BIO_read
296 #define CyaSSL_BIO_write wolfSSL_BIO_write
297 #define CyaSSL_BIO_push wolfSSL_BIO_push
298 #define CyaSSL_BIO_pop wolfSSL_BIO_pop
299 #define CyaSSL_BIO_flush wolfSSL_BIO_flush
300 #define CyaSSL_BIO_pending wolfSSL_BIO_pending
302 #define CyaSSL_BIO_f_buffer wolfSSL_BIO_f_buffer
303 #define CyaSSL_BIO_set_write_buffer_size wolfSSL_BIO_set_write_buffer_size
304 #define CyaSSL_BIO_f_ssl wolfSSL_BIO_f_ssl
305 #define CyaSSL_BIO_new_socket wolfSSL_BIO_new_socket
306 #define CyaSSL_BIO_eof wolfSSL_BIO_eof
308 #define CyaSSL_BIO_s_mem wolfSSL_BIO_s_mem
309 #define CyaSSL_BIO_f_base64 wolfSSL_BIO_f_base64
310 #define CyaSSL_BIO_set_flags wolfSSL_BIO_set_flags
311 #define CyaSSL_BIO_get_mem_data wolfSSL_BIO_get_mem_data
312 #define CyaSSL_BIO_new_mem_buf wolfSSL_BIO_new_mem_buf
315 #define CyaSSL_BIO_set_ssl wolfSSL_BIO_set_ssl
316 #define CyaSSL_set_bio wolfSSL_set_bio
318 #define CyaSSL_add_all_algorithms wolfSSL_add_all_algorithms
319 #define CyaSSL_RAND_screen wolfSSL_RAND_screen
320 #define CyaSSL_RAND_file_name wolfSSL_RAND_file_name
321 #define CyaSSL_RAND_write_file wolfSSL_RAND_write_file
322 #define CyaSSL_RAND_load_file wolfSSL_RAND_load_file
323 #define CyaSSL_RAND_egd wolfSSL_RAND_egd
324 #define CyaSSL_RAND_seed wolfSSL_RAND_seed
325 #define CyaSSL_RAND_add wolfSSL_RAND_add
327 #define CyaSSL_COMP_zlib wolfSSL_COMP_zlib
328 #define CyaSSL_COMP_rle wolfSSL_COMP_rle
329 #define CyaSSL_COMP_add_compression_method wolfSSL_COMP_add_compression_method
330 #define CyaSSL_set_dynlock_create_callback wolfSSL_set_dynlock_create_callback
331 #define CyaSSL_set_dynlock_lock_callback wolfSSL_set_dynlock_lock_callback
332 #define CyaSSL_set_dynlock_destroy_callback wolfSSL_set_dynlock_destroy_callback
333 #define CyaSSL_get_ex_new_index wolfSSL_get_ex_new_index
334 #define CyaSSL_set_id_callback wolfSSL_set_id_callback
335 #define CyaSSL_set_locking_callback wolfSSL_set_locking_callback
336 #define CyaSSL_num_locks wolfSSL_num_locks
338 #define CyaSSL_X509_STORE_CTX_get_current_cert wolfSSL_X509_STORE_CTX_get_current_cert
339 #define CyaSSL_X509_STORE_CTX_get_error wolfSSL_X509_STORE_CTX_get_error
340 #define CyaSSL_X509_STORE_CTX_get_error_depth wolfSSL_X509_STORE_CTX_get_error_depth
342 #define CyaSSL_X509_NAME_oneline wolfSSL_X509_NAME_oneline
343 #define CyaSSL_X509_get_issuer_name wolfSSL_X509_get_issuer_name
344 #define CyaSSL_X509_get_subject_name wolfSSL_X509_get_subject_name
345 #define CyaSSL_X509_ext_isSet_by_NID wolfSSL_X509_ext_isSet_by_NID
346 #define CyaSSL_X509_ext_get_critical_by_NID wolfSSL_X509_ext_get_critical_by_NID
347 #define CyaSSL_X509_get_isCA wolfSSL_X509_get_isCA
348 #define CyaSSL_X509_get_isSet_pathLength wolfSSL_X509_get_isSet_pathLength
349 #define CyaSSL_X509_get_pathLength wolfSSL_X509_get_pathLength
350 #define CyaSSL_X509_get_keyUsage wolfSSL_X509_get_keyUsage
351 #define CyaSSL_X509_get_authorityKeyID wolfSSL_X509_get_authorityKeyID
352 #define CyaSSL_X509_get_subjectKeyID wolfSSL_X509_get_subjectKeyID
353 #define CyaSSL_X509_NAME_entry_count wolfSSL_X509_NAME_entry_count
354 #define CyaSSL_X509_NAME_get_text_by_NID wolfSSL_X509_NAME_get_text_by_NID
355 #define CyaSSL_X509_verify_cert wolfSSL_X509_verify_cert
356 #define CyaSSL_X509_verify_cert_error_string wolfSSL_X509_verify_cert_error_string
357 #define CyaSSL_X509_get_signature_type wolfSSL_X509_get_signature_type
358 #define CyaSSL_X509_get_signature wolfSSL_X509_get_signature
360 #define CyaSSL_X509_LOOKUP_add_dir wolfSSL_X509_LOOKUP_add_dir
361 #define CyaSSL_X509_LOOKUP_load_file wolfSSL_X509_LOOKUP_load_file
362 #define CyaSSL_X509_LOOKUP_hash_dir wolfSSL_X509_LOOKUP_hash_dir
363 #define CyaSSL_X509_LOOKUP_file wolfSSL_X509_LOOKUP_file
365 #define CyaSSL_X509_STORE_add_lookup wolfSSL_X509_STORE_add_lookup
366 #define CyaSSL_X509_STORE_new wolfSSL_X509_STORE_new
367 #define CyaSSL_X509_STORE_free wolfSSL_X509_STORE_free
368 #define CyaSSL_X509_STORE_add_cert wolfSSL_X509_STORE_add_cert
369 #define CyaSSL_X509_STORE_set_default_paths wolfSSL_X509_STORE_set_default_paths
370 #define CyaSSL_X509_STORE_get_by_subject wolfSSL_X509_STORE_get_by_subject
371 #define CyaSSL_X509_STORE_CTX_new wolfSSL_X509_STORE_CTX_new
372 #define CyaSSL_X509_STORE_CTX_init wolfSSL_X509_STORE_CTX_init
373 #define CyaSSL_X509_STORE_CTX_free wolfSSL_X509_STORE_CTX_free
374 #define CyaSSL_X509_STORE_CTX_cleanup wolfSSL_X509_STORE_CTX_cleanup
376 #define CyaSSL_X509_CRL_get_lastUpdate wolfSSL_X509_CRL_get_lastUpdate
377 #define CyaSSL_X509_CRL_get_nextUpdate wolfSSL_X509_CRL_get_nextUpdate
379 #define CyaSSL_X509_get_pubkey wolfSSL_X509_get_pubkey
380 #define CyaSSL_X509_CRL_verify wolfSSL_X509_CRL_verify
381 #define CyaSSL_X509_STORE_CTX_set_error wolfSSL_X509_STORE_CTX_set_error
382 #define CyaSSL_X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents
383 #define CyaSSL_EVP_PKEY_free wolfSSL_EVP_PKEY_free
384 #define CyaSSL_X509_cmp_current_time wolfSSL_X509_cmp_current_time
385 #define CyaSSL_sk_X509_REVOKED_num wolfSSL_sk_X509_REVOKED_num
387 #define CyaSSL_X509_CRL_get_REVOKED wolfSSL_X509_CRL_get_REVOKED
388 #define CyaSSL_sk_X509_REVOKED_value wolfSSL_sk_X509_REVOKED_value
389 #define CyaSSL_X509_get_serialNumber wolfSSL_X509_get_serialNumber
390 #define CyaSSL_ASN1_TIME_print wolfSSL_ASN1_TIME_print
391 #define CyaSSL_ASN1_INTEGER_cmp wolfSSL_ASN1_INTEGER_cmp
392 #define CyaSSL_ASN1_INTEGER_get wolfSSL_ASN1_INTEGER_get
393 #define CyaSSL_load_client_CA_file wolfSSL_load_client_CA_file
394 #define CyaSSL_CTX_set_client_CA_list wolfSSL_CTX_set_client_CA_list
395 #define CyaSSL_X509_STORE_CTX_get_ex_data wolfSSL_X509_STORE_CTX_get_ex_data
396 #define CyaSSL_get_ex_data_X509_STORE_CTX_idx wolfSSL_get_ex_data_X509_STORE_CTX_idx
397 #define CyaSSL_get_ex_data wolfSSL_get_ex_data
399 #define CyaSSL_CTX_set_default_passwd_cb_userdata wolfSSL_CTX_set_default_passwd_cb_userdata
400 #define CyaSSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
401 #define CyaSSL_CTX_set_info_callback wolfSSL_CTX_set_info_callback
402 #define CyaSSL_ERR_peek_error wolfSSL_ERR_peek_error
403 #define CyaSSL_GET_REASON wolfSSL_GET_REASON
404 #define CyaSSL_alert_type_string_long wolfSSL_alert_type_string_long
405 #define CyaSSL_alert_desc_string_long wolfSSL_alert_desc_string_long
406 #define CyaSSL_state_string_long wolfSSL_state_string_long
408 #define CyaSSL_RSA_generate_key wolfSSL_RSA_generate_key
409 #define CyaSSL_CTX_set_tmp_rsa_callback wolfSSL_CTX_set_tmp_rsa_callback
410 #define CyaSSL_PEM_def_callback wolfSSL_PEM_def_callback
411 #define CyaSSL_CTX_sess_accept wolfSSL_CTX_sess_accept
412 #define CyaSSL_CTX_sess_connect wolfSSL_CTX_sess_connect
413 #define CyaSSL_CTX_sess_accept_good wolfSSL_CTX_sess_accept_good
414 #define CyaSSL_CTX_sess_connect_good wolfSSL_CTX_sess_connect_good
415 #define CyaSSL_CTX_sess_accept_renegotiate wolfSSL_CTX_sess_accept_renegotiate
416 #define CyaSSL_CTX_sess_connect_renegotiate wolfSSL_CTX_sess_connect_renegotiate
417 #define CyaSSL_CTX_sess_hits wolfSSL_CTX_sess_hits
418 #define CyaSSL_CTX_sess_cb_hits wolfSSL_CTX_sess_cb_hits
419 #define CyaSSL_CTX_sess_cache_full wolfSSL_CTX_sess_cache_full
420 #define CyaSSL_CTX_sess_misses wolfSSL_CTX_sess_misses
421 #define CyaSSL_CTX_sess_timeouts wolfSSL_CTX_sess_timeouts
422 #define CyaSSL_CTX_sess_number wolfSSL_CTX_sess_number
423 #define CyaSSL_CTX_sess_get_cache_size wolfSSL_CTX_sess_get_cache_size
428 #define cyassl_triple_des wolfssl_triple_des
430 /* Initialization and Shutdown */
431 #define CyaSSL_Init wolfSSL_Init
432 #define CyaSSL_library_init wolfSSL_library_init
433 #define CyaSSL_Cleanup wolfSSL_Cleanup
434 #define CyaSSL_shutdown wolfSSL_shutdown
437 #define CyaSSL_SetTmpDH wolfSSL_SetTmpDH
438 #define CyaSSL_KeepArrays wolfSSL_KeepArrays
439 #define CyaSSL_FreeArrays wolfSSL_FreeArrays
440 #define CyaSSL_SetTmpDH_file wolfSSL_SetTmpDH_file
441 #define CyaSSL_use_PrivateKey_buffer wolfSSL_use_PrivateKey_buffer
442 #define CyaSSL_use_certificate_buffer wolfSSL_use_certificate_buffer
443 #define CyaSSL_CTX_load_verify_buffer wolfSSL_CTX_load_verify_buffer
444 #define CyaSSL_CTX_use_PrivateKey_file wolfSSL_CTX_use_PrivateKey_file
445 #define CyaSSL_CTX_use_certificate_file wolfSSL_CTX_use_certificate_file
446 #define CyaSSL_CTX_use_PrivateKey_buffer wolfSSL_CTX_use_PrivateKey_buffer
447 #define CyaSSL_CTX_use_PrivateKey_buffer wolfSSL_CTX_use_PrivateKey_buffer
448 #define CyaSSL_CTX_use_certificate_buffer wolfSSL_CTX_use_certificate_buffer
449 #define CyaSSL_CTX_use_NTRUPrivateKey_file wolfSSL_CTX_use_NTRUPrivateKey_file
450 #define CyaSSL_use_certificate_chain_buffer wolfSSL_use_certificate_chain_buffer
451 #define CyaSSL_CTX_der_load_verify_locations \
452 wolfSSL_CTX_der_load_verify_locations
453 #define CyaSSL_CTX_use_certificate_chain_file \
454 wolfSSL_CTX_use_certificate_chain_file
455 #define CyaSSL_CTX_use_certificate_chain_buffer \
456 wolfSSL_CTX_use_certificate_chain_buffer
458 /* Context and Session Setup*/
459 #define CyaSSL_new wolfSSL_new
460 #define CyaSSL_free wolfSSL_free
461 #define CyaSSL_set_fd wolfSSL_set_fd
462 #define CyaSSL_CTX_new wolfSSL_CTX_new
463 #define CyaSSL_CTX_free wolfSSL_CTX_free
464 #define CyaSSL_SetVersion wolfSSL_SetVersion
465 #define CyaSSL_set_verify wolfSSL_set_verify
466 #define CyaSSL_set_session wolfSSL_set_session
467 #define CyaSSL_set_timeout wolfSSL_set_timeout
468 #define CyaSSL_CTX_set_verify wolfSSL_CTX_set_verify
469 #define CyaSSL_CTX_set_timeout wolfSSL_CTX_set_timeout
470 #define CyaSSL_set_cipher_list wolfSSL_set_cipher_list
471 #define CyaSSL_set_compression wolfSSL_set_compression
472 #define CyaTLSv1_client_method wolfTLSv1_client_method
473 #define CyaTLSv1_server_method wolfTLSv1_server_method
474 #define CyaSSLv3_client_method wolfSSLv3_client_method
475 #define CyaSSLv3_server_method wolfSSLv3_server_method
476 #define CyaSSLv23_client_method wolfSSLv23_client_method
477 #define CyaSSLv23_server_method wolfSSLv23_server_method
478 #define CyaDTLSv1_client_method wolfDTLSv1_client_method
479 #define CyaDTLSv1_server_method wolfDTLSv1_server_method
480 #define CyaSSL_check_domain_name wolfSSL_check_domain_name
481 #define CyaTLSv1_1_client_method wolfTLSv1_1_client_method
482 #define CyaTLSv1_1_server_method wolfTLSv1_1_server_method
483 #define CyaTLSv1_2_client_method wolfTLSv1_2_client_method
484 #define CyaTLSv1_2_server_method wolfTLSv1_2_server_method
485 #define CyaDTLSv1_2_client_method wolfDTLSv1_2_client_method
486 #define CyaDTLSv1_2_server_method wolfDTLSv1_2_server_method
487 #define CyaSSL_set_group_messages wolfSSL_set_group_messages
488 #define CyaSSL_set_using_nonblock wolfSSL_set_using_nonblock
489 #define CyaSSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list
490 #define CyaSSL_CTX_set_group_messages wolfSSL_CTX_set_group_messages
491 #define CyaSSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode
496 * Empty commment denotes not listed in CyaSSL Manual
497 * (soon to be wolfSSL Manual)
500 #define CyaSSL_accept_ex wolfSSL_accept_ex
501 #define CyaSSL_SetIORecv wolfSSL_SetIORecv
502 #define CyaSSL_SetIOSend wolfSSL_SetIOSend
503 #define CyaSSL_connect_ex wolfSSL_connect_ex
504 #define CyaSSL_CTX_SetCACb wolfSSL_CTX_SetCACb
505 #define CyaSSL_SetIOReadCtx wolfSSL_SetIOReadCtx
506 #define CyaSSL_SetRsaEncCtx wolfSSL_SetRsaEncCtx
507 #define CyaSSL_GetRsaEncCtx wolfSSL_GetRsaEncCtx
508 #define CyaSSL_SetRsaDecCtx wolfSSL_SetRsaDecCtx
509 #define CyaSSL_GetRsaDecCtx wolfSSL_GetRsaDecCtx
510 #define CyaSSL_SetLoggingCb wolfSSL_SetLoggingCb
511 #define CyaSSL_SetEccSignCtx wolfSSL_SetEccSignCtx
512 #define CyaSSL_GetEccSignCtx wolfSSL_GetEccSignCtx
513 #define CyaSSL_SetRsaSignCtx wolfSSL_SetRsaSignCtx
514 #define CyaSSL_GetRsaSignCtx wolfSSL_GetRsaSignCtx
515 #define CyaSSL_SetIOWriteCtx wolfSSL_SetIOWriteCtx
516 #define CyaSSL_SetIOReadFlags wolfSSL_SetIOReadFlags
517 #define CyaSSL_SetEccVerifyCtx wolfSSL_SetEccVerifyCtx
518 #define CyaSSL_GetEccVerifyCtx wolfSSL_GetEccVerifyCtx
519 #define CyaSSL_SetRsaVerifyCtx wolfSSL_SetRsaVerifyCtx
520 #define CyaSSL_GetRsaVerifyCtx wolfSSL_GetRsaVerifyCtx
521 #define CyaSSL_CTX_SetRsaEncCb wolfSSL_CTX_SetRsaEncCb
522 #define CyaSSL_CTX_SetRsaDecCb wolfSSL_CTX_SetRsaDecCb
523 #define CyaSSL_SetIOWriteFlags wolfSSL_SetIOWriteFlags
524 #define CyaSSL_SetTlsHmacInner wolfSSL_SetTlsHmacInner
525 #define CyaSSL_SetMacEncryptCtx wolfSSL_SetMacEncryptCtx
526 #define CyaSSL_GetMacEncryptCtx wolfSSL_GetMacEncryptCtx
527 #define CyaSSL_CTX_SetEccSignCb wolfSSL_CTX_SetEccSignCb
528 #define CyaSSL_CTX_SetRsaSignCb wolfSSL_CTX_SetRsaSignCb
529 #define CyaSSL_CTX_SetEccVerifyCb wolfSSL_CTX_SetEccVerifyCb
530 #define CyaSSL_CTX_SetRsaVerifyCb wolfSSL_CTX_SetRsaVerifyCb
531 #define CyaSSL_CTX_SetMacEncryptCb wolfSSL_CTX_SetMacEncryptCb
532 #define CyaSSL_SetDecryptVerifyCtx wolfSSL_SetDecryptVerifyCtx
533 #define CyaSSL_GetDecryptVerifyCtx wolfSSL_GetDecryptVerifyCtx
534 #define CyaSSL_CTX_SetDecryptVerifyCb wolfSSL_CTX_SetDecryptVerifyCb
539 #define CyaSSL_get_psk_identity wolfSSL_get_psk_identity /**/
540 #define CyaSSL_get_psk_identity_hint wolfSSL_get_psk_identity_hint /**/
541 #define CyaSSL_use_psk_identity_hint wolfSSL_use_psk_identity_hint /**/
542 #define CyaSSL_set_psk_client_callback wolfSSL_set_psk_client_callback /**/
543 #define CyaSSL_set_psk_server_callback wolfSSL_set_psk_server_callback /**/
544 #define CyaSSL_CTX_use_psk_identity_hint wolfSSL_CTX_use_psk_identity_hint /**/
545 #define CyaSSL_CTX_set_psk_client_callback \
546 wolfSSL_CTX_set_psk_client_callback /**/
547 #define CyaSSL_CTX_set_psk_server_callback \
548 wolfSSL_CTX_set_psk_server_callback /**/
551 /* end psk specific */
554 #define CyaSSL_CTX_allow_anon_cipher wolfSSL_CTX_allow_anon_cipher /**/
556 /* Error Handling and Debugging*/
557 #define CyaSSL_get_error wolfSSL_get_error
558 #define CyaSSL_want_read wolfSSL_want_read
559 #define CyaSSL_want_write wolfSSL_want_write
560 #define CyaSSL_Debugging_ON wolfSSL_Debugging_ON
561 #define CyaSSL_Debugging_OFF wolfSSL_Debugging_OFF
562 #define CyaSSL_ERR_error_string wolfSSL_ERR_error_string
563 #define CyaSSL_load_error_strings wolfSSL_load_error_strings
564 #define CyaSSL_ERR_error_string_n wolfSSL_ERR_error_string_n
565 #define CyaSSL_ERR_print_errors_fp wolfSSL_ERR_print_errors_fp
570 * Empty commment denotes not listed in CyaSSL Manual
571 * (soon to be wolfSSL Manual)
574 #define CYASSL_CRL_MONITOR WOLFSSL_CRL_MONITOR /**/
575 #define CYASSL_CRL_START_MON WOLFSSL_CRL_START_MON /**/
576 #define CYASSL_OCSP_NO_NONCE WOLFSSL_OCSP_NO_NONCE /**/
577 #define CYASSL_OCSP_URL_OVERRIDE WOLFSSL_OCSP_URL_OVERRIDE
578 #define CYASSL_OCSP_CHECKALL WOLFSSL_OCSP_CHECKALL
580 #define CyaSSL_CTX_EnableOCSP wolfSSL_CTX_EnableOCSP
581 #define CyaSSL_CTX_OCSP_set_options wolfSSL_CTX_OCSP_set_options /**/
582 #define CyaSSL_CTX_SetOCSP_OverrideURL wolfSSL_CTX_SetOCSP_OverrideURL /**/
583 #define CyaSSL_CTX_OCSP_set_override_url wolfSSL_CTX_OCSP_set_override_url /**/
586 #define CyaSSL_GetSide wolfSSL_GetSide
587 #define CyaSSL_IsTLSv1_1 wolfSSL_IsTLSv1_1
588 #define CyaSSL_GetKeySize wolfSSL_GetKeySize
589 #define CyaSSL_GetHmacSize wolfSSL_GetHmacSize
590 #define CyaSSL_GetHmacType wolfSSL_GetHmacType
591 #define CyaSSL_GetMacSecret wolfSSL_GetMacSecret
592 #define CyaSSL_GetObjectSize wolfSSL_GetObjectSize
593 #define CyaSSL_GetBulkCipher wolfSSL_GetBulkCipher
594 #define CyaSSL_GetCipherType wolfSSL_GetCipherType
595 #define CyaSSL_GetAeadMacSize wolfSSL_GetAeadMacSize
596 #define CyaSSL_GetClientWriteIV wolfSSL_GetClientWriteIV
597 #define CyaSSL_GetServerWriteIV wolfSSL_GetServerWriteIV
598 #define CyaSSL_GetClientWriteKey wolfSSL_GetClientWriteKey
599 #define CyaSSL_GetServerWriteKey wolfSSL_GetServerWriteKey
600 #define CyaSSL_GetCipherBlockSize wolfSSL_GetCipherBlockSize
602 /* Connection, Session, and I/O */
603 #define CyaSSL_peek wolfSSL_peek
604 #define CyaSSL_read wolfSSL_read
605 #define CyaSSL_recv wolfSSL_recv
606 #define CyaSSL_send wolfSSL_send
607 #define CyaSSL_write wolfSSL_write
608 #define CyaSSL_writev wolfSSL_writev
609 #define CyaSSL_accept wolfSSL_accept
610 #define CyaSSL_get_fd wolfSSL_get_fd
611 #define CyaSSL_connect wolfSSL_connect
612 #define CyaSSL_pending wolfSSL_pending
613 #define CyaSSL_negotiate wolfSSL_negotiate
614 #define CyaSSL_get_session wolfSSL_get_session
615 #define CyaSSL_connect_cert wolfSSL_connect_cert
616 #define CyaSSL_flush_sessions wolfSSL_flush_sessions
617 #define CyaSSL_get_using_nonblock wolfSSL_get_using_nonblock
618 #define CyaSSL_PrintSessionStats wolfSSL_PrintSessionStats
621 #define CyaSSL_dtls wolfSSL_dtls
622 #define CyaSSL_dtls_set_peer wolfSSL_dtls_set_peer
623 #define CyaSSL_dtls_get_peer wolfSSL_dtls_get_peer
624 #define CyaSSL_dtls_got_timeout wolfSSL_dtls_got_timeout
625 #define CyaSSL_dtls_get_current_timeout wolfSSL_dtls_get_current_timeout
627 /* Certificate Manager */
628 #define CyaSSL_CertManagerNew wolfSSL_CertManagerNew
629 #define CyaSSL_CertManagerFree wolfSSL_CertManagerFree
630 #define CyaSSL_CertManagerLoadCA wolfSSL_CertManagerLoadCA
631 #define CyaSSL_CertManagerVerify wolfSSL_CertManagerVerify
632 #define CyaSSL_CertManagerEnableCRL wolfSSL_CertManagerEnableCRL
633 #define CyaSSL_CertManagerDisableCRL wolfSSL_CertManagerDisableCRL
634 #define CyaSSL_CertManagerVerifyBuffer wolfSSL_CertManagerVerifyBuffer
636 #define CyaSSL_CertManagerCheckCRL wolfSSL_CertManagerCheckCRL
637 #define CyaSSL_CertManagerLoadCRL wolfSSL_CertManagerLoadCRL
638 #define CyaSSL_CertManagerSetCRL_Cb wolfSSL_CertManagerSetCRL_Cb
639 #define CyaSSL_CertManagerCheckOCSP wolfSSL_CertManagerCheckOCSP
640 #define CyaSSL_CertManagerSetOCSP_Cb wolfSSL_CertManagerSetOCSP_Cb
641 #define CyaSSL_CertManagerSetOCSPOverrideURL \
642 wolfSSL_CertManagerSetOCSPOverrideURL
644 #define CyaSSL_DisableCRL wolfSSL_DisableCRL
645 #define CyaSSL_EnableOCSP wolfSSL_EnableOCSP
646 #define CyaSSL_DisableOCSP wolfSSL_DisableOCSP
647 #define CyaSSL_SetOCSP_OverrideURL wolfSSL_SetOCSP_OverrideURL
648 #define CyaSSL_SetOCSP_Cb wolfSSL_SetOCSP_Cb
650 #define CyaSSL_CTX_EnableCRL wolfSSL_CTX_EnableCRL
651 #define CyaSSL_CTX_DisableCRL wolfSSL_CTX_DisableCRL
652 #define CyaSSL_CTX_LoadCRL wolfSSL_CTX_LoadCRL
653 #define CyaSSL_CTX_SetCRL_Cb wolfSSL_CTX_SetCRL_Cb
654 #define CyaSSL_CTX_DisableOCSP wolfSSL_CTX_DisableOCSP
655 #define CyaSSL_CTX_SetOCSP_Cb wolfSSL_CTX_SetOCSP_Cb
656 #endif /* !NO_CERTS */
659 /* OpenSSL Compatibility Layer */
660 #define CyaSSL_PemCertToDer wolfSSL_PemCertToDer
661 #define CyaSSL_get_sessionID wolfSSL_get_sessionID
662 #define CyaSSL_get_peer_count wolfSSL_get_peer_count
663 #define CyaSSL_get_chain_cert wolfSSL_get_chain_cert
664 #define CyaSSL_get_peer_chain wolfSSL_get_peer_chain
665 #define CyaSSL_get_peer_length wolfSSL_get_peer_length
666 #define CyaSSL_get_chain_cert_pem wolfSSL_get_chain_cert_pem
667 #define CyaSSL_use_PrivateKey_file wolfSSL_use_PrivateKey_file
668 #define CyaSSL_use_certificate_file wolfSSL_use_certificate_file
669 #define CyaSSL_use_RSAPrivateKey_file wolfSSL_use_RSAPrivateKey_file
670 #define CyaSSL_X509_get_serial_number wolfSSL_X509_get_serial_number
671 #define CyaSSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file
672 #define CyaSSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file
675 #define CYASSL_SNI_HOST_NAME WOLFSSL_SNI_HOST_NAME
677 #define CyaSSL_UseSNI wolfSSL_UseSNI
678 #define CyaSSL_CTX_UseSNI wolfSSL_CTX_UseSNI
679 #define CyaSSL_SNI_SetOptions wolfSSL_SNI_SetOptions
680 #define CyaSSL_SNI_GetRequest wolfSSL_SNI_GetRequest
681 #define CyaSSL_UseMaxFragment wolfSSL_UseMaxFragment
682 #define CyaSSL_UseTruncatedHMAC wolfSSL_UseTruncatedHMAC
683 #define CyaSSL_UseSupportedCurve wolfSSL_UseSupportedCurve
684 #define CyaSSL_SNI_GetFromBuffer wolfSSL_SNI_GetFromBuffer
685 #define CyaSSL_CTX_SNI_SetOptions wolfSSL_CTX_SNI_SetOptions
686 #define CyaSSL_CTX_UseMaxFragment wolfSSL_CTX_UseMaxFragment
687 #define CyaSSL_CTX_UseTruncatedHMAC wolfSSL_CTX_UseTruncatedHMAC
688 #define CyaSSL_CTX_UseSupportedCurve wolfSSL_CTX_UseSupportedCurve
690 /* End wolfssl -> cyassl -> openssl compatibility */
692 /* JRB macro redefinitions and api calls for cryptography for reverse compat. */
694 #ifdef WOLFSSL_SMALL_STACK
695 #define CYASSL_SMALL_STACK
700 * wrapper around macros until they are changed in cyassl code
701 * needs investigation in regards to macros in fips
703 #define NO_WOLFSSL_ALLOC_ALIGN NO_CYASSL_ALLOC_ALIGN /* @TODO */
706 /* examples/client/client.h */
707 #define CYASSL_THREAD WOLFSSL_THREAD
709 #define CYASSL_DTLS WOLFSSL_DTLS
712 /* examples/client/client.c */
713 #define LIBCYASSL_VERSION_STRING LIBWOLFSSL_VERSION_STRING
720 #endif /* CyaSSL_openssl_h__ */