ssl.h 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  1. /* ssl.h
  2. *
  3. * Copyright (C) 2006-2020 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  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.
  11. *
  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.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. /* ssl.h defines wolfssl_openssl compatibility layer
  22. *
  23. */
  24. #ifndef WOLFSSL_OPENSSL_H_
  25. #define WOLFSSL_OPENSSL_H_
  26. /* wolfssl_openssl compatibility layer */
  27. #ifndef OPENSSL_EXTRA_SSL_GUARD
  28. #define OPENSSL_EXTRA_SSL_GUARD
  29. #include <wolfssl/ssl.h>
  30. #endif /* OPENSSL_EXTRA_SSL_GUARD */
  31. #include <wolfssl/openssl/tls1.h>
  32. #include <wolfssl/openssl/evp.h>
  33. #include <wolfssl/openssl/bio.h>
  34. #ifdef OPENSSL_EXTRA
  35. #include <wolfssl/openssl/crypto.h>
  36. #endif
  37. #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
  38. #include <wolfssl/openssl/dh.h>
  39. #include <wolfssl/openssl/objects.h>
  40. #endif
  41. /* need MIN_CODE_E to determine wolfSSL error range */
  42. #include <wolfssl/wolfcrypt/error-crypt.h>
  43. /* all NID_* values are in asn.h */
  44. #include <wolfssl/wolfcrypt/asn.h>
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. #ifdef _WIN32
  49. /* wincrypt.h clashes */
  50. #undef X509_NAME
  51. #endif
  52. #ifdef WOLFSSL_UTASKER
  53. /* tcpip.h clashes */
  54. #undef ASN1_INTEGER
  55. #endif
  56. typedef WOLFSSL SSL;
  57. typedef WOLFSSL_SESSION SSL_SESSION;
  58. typedef WOLFSSL_METHOD SSL_METHOD;
  59. typedef WOLFSSL_CTX SSL_CTX;
  60. typedef WOLFSSL_X509 X509;
  61. typedef WOLFSSL_X509 X509_REQ;
  62. typedef WOLFSSL_X509_NAME X509_NAME;
  63. typedef WOLFSSL_X509_INFO X509_INFO;
  64. typedef WOLFSSL_X509_CHAIN X509_CHAIN;
  65. /* STACK_OF(ASN1_OBJECT) */
  66. typedef WOLFSSL_STACK EXTENDED_KEY_USAGE;
  67. /* redeclare guard */
  68. #define WOLFSSL_TYPES_DEFINED
  69. typedef WOLFSSL_BIO BIO;
  70. typedef WOLFSSL_BIO_METHOD BIO_METHOD;
  71. typedef WOLFSSL_CIPHER SSL_CIPHER;
  72. typedef WOLFSSL_X509_LOOKUP X509_LOOKUP;
  73. typedef WOLFSSL_X509_LOOKUP_METHOD X509_LOOKUP_METHOD;
  74. typedef WOLFSSL_X509_CRL X509_CRL;
  75. typedef WOLFSSL_X509_EXTENSION X509_EXTENSION;
  76. typedef WOLFSSL_X509_PUBKEY X509_PUBKEY;
  77. typedef WOLFSSL_X509_ALGOR X509_ALGOR;
  78. typedef WOLFSSL_ASN1_TIME ASN1_TIME;
  79. typedef WOLFSSL_ASN1_INTEGER ASN1_INTEGER;
  80. typedef WOLFSSL_ASN1_OBJECT ASN1_OBJECT;
  81. typedef WOLFSSL_ASN1_STRING ASN1_STRING;
  82. typedef WOLFSSL_ASN1_TYPE ASN1_TYPE;
  83. typedef WOLFSSL_ASN1_BIT_STRING ASN1_BIT_STRING;
  84. typedef WOLFSSL_dynlock_value CRYPTO_dynlock_value;
  85. typedef WOLFSSL_BUF_MEM BUF_MEM;
  86. typedef WOLFSSL_GENERAL_NAMES GENERAL_NAMES;
  87. typedef WOLFSSL_GENERAL_NAME GENERAL_NAME;
  88. #define ASN1_UTCTIME WOLFSSL_ASN1_TIME
  89. #define ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TIME
  90. typedef WOLFSSL_COMP_METHOD COMP_METHOD;
  91. typedef WOLFSSL_COMP SSL_COMP;
  92. typedef WOLFSSL_X509_REVOKED X509_REVOKED;
  93. typedef WOLFSSL_X509_OBJECT X509_OBJECT;
  94. typedef WOLFSSL_X509_STORE X509_STORE;
  95. typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX;
  96. typedef WOLFSSL_X509_VERIFY_PARAM X509_VERIFY_PARAM;
  97. #define EVP_CIPHER_INFO EncryptedInfo
  98. #define STACK_OF(x) WOLFSSL_STACK
  99. #define OPENSSL_STACK WOLFSSL_STACK
  100. #define _STACK OPENSSL_STACK
  101. #define CONF_get1_default_config_file wolfSSL_CONF_get1_default_config_file
  102. typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
  103. #define CRYPTO_free(xp) XFREE(xp, NULL, DYNAMIC_TYPE_TMP_BUFFER)
  104. #define CRYPTO_malloc(sz) XMALLOC(sz, NULL, DYNAMIC_TYPE_TMP_BUFFER)
  105. #define CRYPTO_EX_new WOLFSSL_CRYPTO_EX_new
  106. #define CRYPTO_EX_dup WOLFSSL_CRYPTO_EX_dup
  107. #define CRYPTO_EX_free WOLFSSL_CRYPTO_EX_free
  108. #define CRYPTO_EX_DATA WOLFSSL_CRYPTO_EX_DATA
  109. /* depreciated */
  110. #define CRYPTO_thread_id wolfSSL_thread_id
  111. #define CRYPTO_set_id_callback wolfSSL_set_id_callback
  112. #define CRYPTO_LOCK 0x01
  113. #define CRYPTO_UNLOCK 0x02
  114. #define CRYPTO_READ 0x04
  115. #define CRYPTO_WRITE 0x08
  116. #define CRYPTO_set_locking_callback wolfSSL_set_locking_callback
  117. #define CRYPTO_set_dynlock_create_callback wolfSSL_set_dynlock_create_callback
  118. #define CRYPTO_set_dynlock_lock_callback wolfSSL_set_dynlock_lock_callback
  119. #define CRYPTO_set_dynlock_destroy_callback wolfSSL_set_dynlock_destroy_callback
  120. #define CRYPTO_num_locks wolfSSL_num_locks
  121. #define CRYPTO_dynlock_value WOLFSSL_dynlock_value
  122. #define CRYPTO_cleanup_all_ex_data wolfSSL_cleanup_all_ex_data
  123. #define set_ex_data wolfSSL_CRYPTO_set_ex_data
  124. #define get_ex_data wolfSSL_CRYPTO_get_ex_data
  125. #define CRYPTO_memcmp wolfSSL_CRYPTO_memcmp
  126. /* this function was used to set the default malloc, free, and realloc */
  127. #define CRYPTO_malloc_init() 0 /* CRYPTO_malloc_init is not needed */
  128. #define OPENSSL_malloc_init() 0 /* OPENSSL_malloc_init is not needed */
  129. #define SSL_get_client_random(ssl,out,outSz) \
  130. wolfSSL_get_client_random((ssl),(out),(outSz))
  131. #define SSL_get_cipher_list(ctx,i) wolfSSL_get_cipher_list_ex((ctx),(i))
  132. #define SSL_get_cipher_name(ctx) wolfSSL_get_cipher((ctx))
  133. #define SSL_get_shared_ciphers(ctx,buf,len) \
  134. wolfSSL_get_shared_ciphers((ctx),(buf),(len))
  135. /* at the moment only returns ok */
  136. #define SSL_get_verify_result wolfSSL_get_verify_result
  137. #define SSL_get_verify_mode wolfSSL_SSL_get_mode
  138. #define SSL_get_verify_depth wolfSSL_get_verify_depth
  139. #define SSL_CTX_get_verify_mode wolfSSL_CTX_get_verify_mode
  140. #define SSL_CTX_get_verify_depth wolfSSL_CTX_get_verify_depth
  141. #define SSL_get_certificate wolfSSL_get_certificate
  142. #define SSL_use_certificate wolfSSL_use_certificate
  143. #define SSL_use_certificate_ASN1 wolfSSL_use_certificate_ASN1
  144. #define d2i_PKCS8_PRIV_KEY_INFO_bio wolfSSL_d2i_PKCS8_PKEY_bio
  145. #define d2i_PKCS8PrivateKey_bio wolfSSL_d2i_PKCS8PrivateKey_bio
  146. #define i2d_PKCS8PrivateKey_bio wolfSSL_PEM_write_bio_PKCS8PrivateKey
  147. #define PKCS8_PRIV_KEY_INFO_free wolfSSL_EVP_PKEY_free
  148. #define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
  149. #define i2d_PUBKEY wolfSSL_i2d_PUBKEY
  150. #define d2i_PUBKEY wolfSSL_d2i_PUBKEY
  151. #define d2i_PUBKEY_bio wolfSSL_d2i_PUBKEY_bio
  152. #define d2i_PrivateKey wolfSSL_d2i_PrivateKey
  153. #define d2i_AutoPrivateKey wolfSSL_d2i_AutoPrivateKey
  154. #define SSL_use_PrivateKey wolfSSL_use_PrivateKey
  155. #define SSL_use_PrivateKey_ASN1 wolfSSL_use_PrivateKey_ASN1
  156. #define SSL_use_RSAPrivateKey_ASN1 wolfSSL_use_RSAPrivateKey_ASN1
  157. #define SSL_get_privatekey wolfSSL_get_privatekey
  158. #define SSL_CTX_use_PrivateKey_ASN1 wolfSSL_CTX_use_PrivateKey_ASN1
  159. #define SSLv23_method wolfSSLv23_method
  160. #define SSLv23_client_method wolfSSLv23_client_method
  161. #define SSLv2_client_method wolfSSLv2_client_method
  162. #define SSLv2_server_method wolfSSLv2_server_method
  163. #define SSLv3_server_method wolfSSLv3_server_method
  164. #define SSLv3_client_method wolfSSLv3_client_method
  165. #define TLS_client_method wolfTLS_client_method
  166. #define TLS_server_method wolfTLS_server_method
  167. #define TLSv1_method wolfTLSv1_method
  168. #define TLSv1_server_method wolfTLSv1_server_method
  169. #define TLSv1_client_method wolfTLSv1_client_method
  170. #define TLSv1_1_method wolfTLSv1_1_method
  171. #define TLSv1_1_server_method wolfTLSv1_1_server_method
  172. #define TLSv1_1_client_method wolfTLSv1_1_client_method
  173. #define TLSv1_2_method wolfTLSv1_2_method
  174. #define TLSv1_2_server_method wolfTLSv1_2_server_method
  175. #define TLSv1_2_client_method wolfTLSv1_2_client_method
  176. #define TLSv1_3_method wolfTLSv1_3_method
  177. #define TLSv1_3_server_method wolfTLSv1_3_server_method
  178. #define TLSv1_3_client_method wolfTLSv1_3_client_method
  179. #define TLS_method wolfSSLv23_method
  180. #define X509_FILETYPE_ASN1 SSL_FILETYPE_ASN1
  181. #define X509_F_X509_CHECK_PRIVATE_KEY 128
  182. #ifdef WOLFSSL_DTLS
  183. #define DTLSv1_client_method wolfDTLSv1_client_method
  184. #define DTLSv1_server_method wolfDTLSv1_server_method
  185. #define DTLSv1_2_client_method wolfDTLSv1_2_client_method
  186. #define DTLSv1_2_server_method wolfDTLSv1_2_server_method
  187. #define DTLS_method wolfDTLS_method
  188. #endif
  189. #ifndef NO_FILESYSTEM
  190. #define SSL_CTX_use_certificate_file wolfSSL_CTX_use_certificate_file
  191. #define SSL_CTX_use_PrivateKey_file wolfSSL_CTX_use_PrivateKey_file
  192. #ifdef WOLFSSL_APACHE_HTTPD
  193. #define SSL_CTX_load_verify_locations(ctx,file,path) \
  194. wolfSSL_CTX_load_verify_locations_ex(ctx,file,path,\
  195. WOLFSSL_LOAD_FLAG_IGNORE_ERR)
  196. #else
  197. #define SSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations
  198. #endif
  199. #define SSL_CTX_use_certificate_chain_file wolfSSL_CTX_use_certificate_chain_file
  200. #define SSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file
  201. #define SSL_use_certificate_file wolfSSL_use_certificate_file
  202. #define SSL_use_PrivateKey_file wolfSSL_use_PrivateKey_file
  203. #define SSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file
  204. #define SSL_use_RSAPrivateKey_file wolfSSL_use_RSAPrivateKey_file
  205. #endif
  206. #define SSL_CTX_new(method) wolfSSL_CTX_new((WOLFSSL_METHOD*)(method))
  207. #ifdef OPENSSL_EXTRA
  208. #define SSL_CTX_up_ref wolfSSL_CTX_up_ref
  209. #endif
  210. #define SSL_new wolfSSL_new
  211. #define SSL_set_fd wolfSSL_set_fd
  212. #define SSL_get_fd wolfSSL_get_fd
  213. #define SSL_connect wolfSSL_connect
  214. #define SSL_clear wolfSSL_clear
  215. #define SSL_state wolfSSL_state
  216. #define SSL_write wolfSSL_write
  217. #define SSL_read wolfSSL_read
  218. #define SSL_peek wolfSSL_peek
  219. #define SSL_accept wolfSSL_accept
  220. #define SSL_CTX_free wolfSSL_CTX_free
  221. #define SSL_free wolfSSL_free
  222. #define SSL_shutdown wolfSSL_shutdown
  223. #define SSL_set_timeout wolfSSL_set_timeout
  224. #define SSL_CTX_set_quiet_shutdown wolfSSL_CTX_set_quiet_shutdown
  225. #define SSL_set_quiet_shutdown wolfSSL_set_quiet_shutdown
  226. #define SSL_get_error wolfSSL_get_error
  227. #define SSL_set_session wolfSSL_set_session
  228. #define SSL_get_session(x) wolfSSL_get_session((WOLFSSL*) (x))
  229. #define SSL_SESSION_get0_peer wolfSSL_SESSION_get0_peer
  230. #define SSL_flush_sessions wolfSSL_flush_sessions
  231. /* assume unlimited temporarily */
  232. #define SSL_CTX_get_session_cache_mode(ctx) 0
  233. #define SSL_CTX_set_verify wolfSSL_CTX_set_verify
  234. #define SSL_CTX_set_cert_verify_callback wolfSSL_CTX_set_cert_verify_callback
  235. #define SSL_set_verify wolfSSL_set_verify
  236. #define SSL_set_verify_result wolfSSL_set_verify_result
  237. #define SSL_pending wolfSSL_pending
  238. #define SSL_load_error_strings wolfSSL_load_error_strings
  239. #define SSL_library_init wolfSSL_library_init
  240. #define OpenSSL_add_ssl_algorithms wolfSSL_library_init
  241. #define SSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode
  242. #define SSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list
  243. #define SSL_CTX_set_ciphersuites wolfSSL_CTX_set_cipher_list
  244. #define SSL_set_cipher_list wolfSSL_set_cipher_list
  245. /* wolfSSL does not support security levels */
  246. #define SSL_CTX_set_security_level(...)
  247. /* wolfSSL does not support exporting keying material */
  248. #define SSL_export_keying_material(...) 0
  249. #define SSL_CTX_set1_groups_list wolfSSL_CTX_set1_groups_list
  250. #define SSL_set1_groups_list wolfSSL_set1_groups_list
  251. #define SSL_set_ex_data wolfSSL_set_ex_data
  252. #define SSL_get_shutdown wolfSSL_get_shutdown
  253. #define SSL_set_rfd wolfSSL_set_rfd
  254. #define SSL_set_wfd wolfSSL_set_wfd
  255. #define SSL_set_shutdown wolfSSL_set_shutdown
  256. #define SSL_set_session_id_context wolfSSL_set_session_id_context
  257. #define SSL_set_connect_state wolfSSL_set_connect_state
  258. #define SSL_set_accept_state wolfSSL_set_accept_state
  259. #define SSL_session_reused wolfSSL_session_reused
  260. #define SSL_SESSION_up_ref wolfSSL_SESSION_up_ref
  261. #define SSL_SESSION_dup wolfSSL_SESSION_dup
  262. #define SSL_SESSION_free wolfSSL_SESSION_free
  263. #define SSL_is_init_finished wolfSSL_is_init_finished
  264. #define SSL_get_version wolfSSL_get_version
  265. #define SSL_get_current_cipher wolfSSL_get_current_cipher
  266. /* use wolfSSL_get_cipher_name for its return format */
  267. #define SSL_get_cipher wolfSSL_get_cipher_name
  268. #define SSL_CIPHER_description wolfSSL_CIPHER_description
  269. #define SSL_CIPHER_get_name wolfSSL_CIPHER_get_name
  270. #define SSL_CIPHER_get_version wolfSSL_CIPHER_get_version
  271. #define SSL_CIPHER_get_id wolfSSL_CIPHER_get_id
  272. #define SSL_CIPHER_get_rfc_name wolfSSL_CIPHER_get_name
  273. #define SSL_CIPHER_standard_name wolfSSL_CIPHER_get_name
  274. #define SSL_get_cipher_by_value wolfSSL_get_cipher_by_value
  275. #define SSL_get1_session wolfSSL_get1_session
  276. #define SSL_get_keyblock_size wolfSSL_get_keyblock_size
  277. #define SSL_get_keys wolfSSL_get_keys
  278. #define SSL_SESSION_get_master_key wolfSSL_SESSION_get_master_key
  279. #define SSL_SESSION_get_master_key_length wolfSSL_SESSION_get_master_key_length
  280. #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
  281. #define SSL_MODE_RELEASE_BUFFERS 0x00000010U
  282. #define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
  283. #define X509_get_ext wolfSSL_X509_get_ext
  284. #define X509_cmp wolfSSL_X509_cmp
  285. #define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
  286. #define X509_EXTENSION_get_critical wolfSSL_X509_EXTENSION_get_critical
  287. #define X509_EXTENSION_get_data wolfSSL_X509_EXTENSION_get_data
  288. #define X509_EXTENSION_new wolfSSL_X509_EXTENSION_new
  289. #define X509_EXTENSION_free wolfSSL_X509_EXTENSION_free
  290. #define X509_gmtime_adj wolfSSL_X509_gmtime_adj
  291. #endif
  292. #define DSA_dup_DH wolfSSL_DSA_dup_DH
  293. /* wolfSSL does not support DSA as the cert public key */
  294. #define EVP_PKEY_get0_DSA wolfSSL_EVP_PKEY_get0_DSA
  295. #define DSA_bits wolfSSL_DSA_bits
  296. #define i2d_X509_bio wolfSSL_i2d_X509_bio
  297. #define d2i_X509_bio wolfSSL_d2i_X509_bio
  298. #define d2i_X509_fp wolfSSL_d2i_X509_fp
  299. #define i2d_X509 wolfSSL_i2d_X509
  300. #define d2i_X509 wolfSSL_d2i_X509
  301. #define PEM_read_bio_X509 wolfSSL_PEM_read_bio_X509
  302. #define PEM_read_bio_X509_CRL wolfSSL_PEM_read_bio_X509_CRL
  303. #define PEM_read_bio_X509_AUX wolfSSL_PEM_read_bio_X509_AUX
  304. #define PEM_read_X509 wolfSSL_PEM_read_X509
  305. #define PEM_X509_INFO_read_bio wolfSSL_PEM_X509_INFO_read_bio
  306. #define PEM_write_bio_X509 wolfSSL_PEM_write_bio_X509
  307. #define PEM_write_bio_X509_AUX wolfSSL_PEM_write_bio_X509_AUX
  308. #define PEM_X509_INFO_read_bio wolfSSL_PEM_X509_INFO_read_bio
  309. #define i2d_PrivateKey wolfSSL_i2d_PrivateKey
  310. #define i2d_X509_REQ wolfSSL_i2d_X509_REQ
  311. #define X509_REQ_new wolfSSL_X509_REQ_new
  312. #define X509_REQ_free wolfSSL_X509_REQ_free
  313. #define X509_REQ_sign wolfSSL_X509_REQ_sign
  314. #define X509_REQ_add_extensions wolfSSL_X509_REQ_add_extensions
  315. #define X509_REQ_set_subject_name wolfSSL_X509_REQ_set_subject_name
  316. #define X509_REQ_set_pubkey wolfSSL_X509_REQ_set_pubkey
  317. #define PEM_write_bio_X509_REQ wolfSSL_PEM_write_bio_X509_REQ
  318. #define X509_new wolfSSL_X509_new
  319. #define X509_up_ref wolfSSL_X509_up_ref
  320. #define X509_free wolfSSL_X509_free
  321. #define X509_load_certificate_file wolfSSL_X509_load_certificate_file
  322. #define X509_digest wolfSSL_X509_digest
  323. #define X509_get_ext_count wolfSSL_X509_get_ext_count
  324. #define X509_get_ext_d2i wolfSSL_X509_get_ext_d2i
  325. #define X509V3_EXT_i2d wolfSSL_X509V3_EXT_i2d
  326. #define X509_get_ext wolfSSL_X509_get_ext
  327. #define X509_get_ext_by_NID wolfSSL_X509_get_ext_by_NID
  328. #define X509_get_issuer_name wolfSSL_X509_get_issuer_name
  329. #define X509_issuer_name_hash wolfSSL_X509_issuer_name_hash
  330. #define X509_get_subject_name wolfSSL_X509_get_subject_name
  331. #define X509_subject_name_hash wolfSSL_X509_subject_name_hash
  332. #define X509_get_pubkey wolfSSL_X509_get_pubkey
  333. #define X509_get0_pubkey wolfSSL_X509_get_pubkey
  334. #define X509_get_notBefore wolfSSL_X509_get_notBefore
  335. #define X509_get0_notBefore wolfSSL_X509_get_notBefore
  336. #define X509_get_notAfter wolfSSL_X509_get_notAfter
  337. #define X509_get0_notAfter wolfSSL_X509_get_notAfter
  338. #define X509_get_serialNumber wolfSSL_X509_get_serialNumber
  339. #define X509_get0_pubkey_bitstr wolfSSL_X509_get0_pubkey_bitstr
  340. #define X509_get_ex_new_index wolfSSL_X509_get_ex_new_index
  341. #define X509_get_ex_data wolfSSL_X509_get_ex_data
  342. #define X509_set_ex_data wolfSSL_X509_set_ex_data
  343. #define X509_get1_ocsp wolfSSL_X509_get1_ocsp
  344. #ifndef WOLFSSL_HAPROXY
  345. #define X509_get_version wolfSSL_X509_get_version
  346. #endif
  347. #define X509_get_signature_nid wolfSSL_X509_get_signature_nid
  348. #define X509_set_subject_name wolfSSL_X509_set_subject_name
  349. #define X509_set_issuer_name wolfSSL_X509_set_issuer_name
  350. #define X509_set_pubkey wolfSSL_X509_set_pubkey
  351. #define X509_set_notAfter wolfSSL_X509_set_notAfter
  352. #define X509_set_notBefore wolfSSL_X509_set_notBefore
  353. #define X509_set_serialNumber wolfSSL_X509_set_serialNumber
  354. #define X509_set_version wolfSSL_X509_set_version
  355. #define X509_sign wolfSSL_X509_sign
  356. #define X509_print wolfSSL_X509_print
  357. #define X509_print_ex wolfSSL_X509_print_ex
  358. #define X509_verify_cert_error_string wolfSSL_X509_verify_cert_error_string
  359. #define X509_verify_cert wolfSSL_X509_verify_cert
  360. #define X509_check_private_key wolfSSL_X509_check_private_key
  361. #define X509_check_ca wolfSSL_X509_check_ca
  362. #define X509_check_host wolfSSL_X509_check_host
  363. #define X509_check_ip_asc wolfSSL_X509_check_ip_asc
  364. #define X509_email_free wolfSSL_X509_email_free
  365. #define X509_check_issued wolfSSL_X509_check_issued
  366. #define X509_dup wolfSSL_X509_dup
  367. #define X509_add_ext wolfSSL_X509_add_ext
  368. #define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
  369. #define X509_EXTENSION_get_data wolfSSL_X509_EXTENSION_get_data
  370. #define sk_X509_new wolfSSL_sk_X509_new
  371. #define sk_X509_new_null wolfSSL_sk_X509_new
  372. #define sk_X509_num wolfSSL_sk_X509_num
  373. #define sk_X509_value wolfSSL_sk_X509_value
  374. #define sk_X509_shift wolfSSL_sk_X509_shift
  375. #define sk_X509_push wolfSSL_sk_X509_push
  376. #define sk_X509_pop wolfSSL_sk_X509_pop
  377. #define sk_X509_pop_free wolfSSL_sk_X509_pop_free
  378. #define sk_X509_dup wolfSSL_sk_dup
  379. #define sk_X509_free wolfSSL_sk_X509_free
  380. #define sk_X509_EXTENSION_num wolfSSL_sk_X509_EXTENSION_num
  381. #define sk_X509_EXTENSION_value wolfSSL_sk_X509_EXTENSION_value
  382. #define sk_X509_EXTENSION_new_null wolfSSL_sk_X509_EXTENSION_new_null
  383. #define sk_X509_EXTENSION_pop_free wolfSSL_sk_X509_EXTENSION_pop_free
  384. #define sk_X509_EXTENSION_push wolfSSL_sk_X509_EXTENSION_push
  385. #define X509_INFO_new wolfSSL_X509_INFO_new
  386. #define X509_INFO_free wolfSSL_X509_INFO_free
  387. #define sk_X509_INFO_new_null wolfSSL_sk_X509_INFO_new_null
  388. #define sk_X509_INFO_num wolfSSL_sk_X509_INFO_num
  389. #define sk_X509_INFO_value wolfSSL_sk_X509_INFO_value
  390. #define sk_X509_INFO_push wolfSSL_sk_X509_INFO_push
  391. #define sk_X509_INFO_pop wolfSSL_sk_X509_INFO_pop
  392. #define sk_X509_INFO_pop_free wolfSSL_sk_X509_INFO_pop_free
  393. #define sk_X509_INFO_free wolfSSL_sk_X509_INFO_free
  394. #define i2d_X509_NAME wolfSSL_i2d_X509_NAME
  395. #define d2i_X509_NAME wolfSSL_d2i_X509_NAME
  396. #define X509_NAME_new wolfSSL_X509_NAME_new
  397. #define X509_NAME_free wolfSSL_X509_NAME_free
  398. #define X509_NAME_dup wolfSSL_X509_NAME_dup
  399. #define X509_NAME_get_text_by_NID wolfSSL_X509_NAME_get_text_by_NID
  400. #define X509_NAME_get_index_by_OBJ wolfSSL_X509_NAME_get_index_by_OBJ
  401. #define X509_NAME_cmp wolfSSL_X509_NAME_cmp
  402. #define X509_NAME_ENTRY_new wolfSSL_X509_NAME_ENTRY_new
  403. #define X509_NAME_ENTRY_free wolfSSL_X509_NAME_ENTRY_free
  404. #define X509_NAME_ENTRY_create_by_NID wolfSSL_X509_NAME_ENTRY_create_by_NID
  405. #define X509_NAME_ENTRY_create_by_txt wolfSSL_X509_NAME_ENTRY_create_by_txt
  406. #define X509_NAME_add_entry wolfSSL_X509_NAME_add_entry
  407. #define X509_NAME_add_entry_by_txt wolfSSL_X509_NAME_add_entry_by_txt
  408. #define X509_NAME_add_entry_by_NID wolfSSL_X509_NAME_add_entry_by_NID
  409. #define X509_NAME_oneline wolfSSL_X509_NAME_oneline
  410. #define X509_NAME_get_index_by_NID wolfSSL_X509_NAME_get_index_by_NID
  411. #define X509_NAME_print_ex wolfSSL_X509_NAME_print_ex
  412. #define X509_NAME_digest wolfSSL_X509_NAME_digest
  413. #define X509_cmp_current_time wolfSSL_X509_cmp_current_time
  414. #define X509_cmp_time wolfSSL_X509_cmp_time
  415. #define X509_time_adj wolfSSL_X509_time_adj
  416. #define X509_time_adj_ex wolfSSL_X509_time_adj_ex
  417. #define sk_ACCESS_DESCRIPTION_num wolfSSL_sk_ACCESS_DESCRIPTION_num
  418. #define sk_ACCESS_DESCRIPTION_value wolfSSL_sk_ACCESS_DESCRIPTION_value
  419. #define sk_X509_NAME_new wolfSSL_sk_X509_NAME_new
  420. #define sk_X509_NAME_push wolfSSL_sk_X509_NAME_push
  421. #define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
  422. #define sk_X509_NAME_set_cmp_func wolfSSL_sk_X509_NAME_set_cmp_func
  423. #define sk_X509_NAME_num wolfSSL_sk_X509_NAME_num
  424. #define sk_X509_NAME_value wolfSSL_sk_X509_NAME_value
  425. #define sk_X509_NAME_pop wolfSSL_sk_X509_NAME_pop
  426. #define sk_X509_NAME_pop_free wolfSSL_sk_X509_NAME_pop_free
  427. #define sk_X509_NAME_free wolfSSL_sk_X509_NAME_free
  428. typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY;
  429. #define X509_NAME_entry_count wolfSSL_X509_NAME_entry_count
  430. #define X509_NAME_ENTRY_get_object wolfSSL_X509_NAME_ENTRY_get_object
  431. #define X509_NAME_get_entry wolfSSL_X509_NAME_get_entry
  432. #define X509_NAME_ENTRY_get_data wolfSSL_X509_NAME_ENTRY_get_data
  433. #define X509_NAME_ENTRY_get_object wolfSSL_X509_NAME_ENTRY_get_object
  434. #define X509_V_FLAG_CRL_CHECK WOLFSSL_CRL_CHECK
  435. #define X509_V_FLAG_CRL_CHECK_ALL WOLFSSL_CRL_CHECKALL
  436. #define X509_V_FLAG_USE_CHECK_TIME WOLFSSL_USE_CHECK_TIME
  437. #define X509_V_FLAG_NO_CHECK_TIME WOLFSSL_NO_CHECK_TIME
  438. #define X509_CHECK_FLAG_NO_WILDCARDS WOLFSSL_NO_WILDCARDS
  439. #define X509_STORE_CTX_get_current_cert wolfSSL_X509_STORE_CTX_get_current_cert
  440. #define X509_STORE_CTX_set_verify_cb wolfSSL_X509_STORE_CTX_set_verify_cb
  441. #define X509_STORE_CTX_new wolfSSL_X509_STORE_CTX_new
  442. #define X509_STORE_CTX_free wolfSSL_X509_STORE_CTX_free
  443. #define X509_STORE_CTX_get_chain wolfSSL_X509_STORE_CTX_get_chain
  444. #define X509_STORE_CTX_get1_chain wolfSSL_X509_STORE_CTX_get1_chain
  445. #define X509_STORE_CTX_get_error wolfSSL_X509_STORE_CTX_get_error
  446. #define X509_STORE_CTX_get_error_depth wolfSSL_X509_STORE_CTX_get_error_depth
  447. #define X509_STORE_CTX_init wolfSSL_X509_STORE_CTX_init
  448. #define X509_STORE_CTX_cleanup wolfSSL_X509_STORE_CTX_cleanup
  449. #define X509_STORE_CTX_set_error wolfSSL_X509_STORE_CTX_set_error
  450. #define X509_STORE_CTX_set_error_depth wolfSSL_X509_STORE_CTX_set_error_depth
  451. #define X509_STORE_CTX_get_ex_data wolfSSL_X509_STORE_CTX_get_ex_data
  452. #define X509_STORE_CTX_set_ex_data wolfSSL_X509_STORE_CTX_set_ex_data
  453. #define X509_STORE_CTX_set_depth wolfSSL_X509_STORE_CTX_set_depth
  454. #define X509_STORE_CTX_verify_cb WOLFSSL_X509_STORE_CTX_verify_cb
  455. #define X509_STORE_CTX_get0_current_issuer \
  456. wolfSSL_X509_STORE_CTX_get0_current_issuer
  457. #define X509_STORE_CTX_get0_store wolfSSL_X509_STORE_CTX_get0_store
  458. #define X509_STORE_CTX_get0_cert wolfSSL_X509_STORE_CTX_get0_cert
  459. #define X509_STORE_set_verify_cb(s, c) \
  460. wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_CTX_verify_cb)(c))
  461. #define X509_STORE_set_verify_cb_func(s, c) \
  462. wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_CTX_verify_cb)(c))
  463. #define X509_STORE_new wolfSSL_X509_STORE_new
  464. #define X509_STORE_free wolfSSL_X509_STORE_free
  465. #define X509_STORE_add_lookup wolfSSL_X509_STORE_add_lookup
  466. #define X509_STORE_add_cert wolfSSL_X509_STORE_add_cert
  467. #define X509_STORE_add_crl wolfSSL_X509_STORE_add_crl
  468. #define X509_STORE_set_flags wolfSSL_X509_STORE_set_flags
  469. #define X509_STORE_get1_certs wolfSSL_X509_STORE_get1_certs
  470. #define X509_STORE_get_by_subject wolfSSL_X509_STORE_get_by_subject
  471. #define X509_STORE_CTX_get1_issuer wolfSSL_X509_STORE_CTX_get1_issuer
  472. #define X509_STORE_CTX_set_time wolfSSL_X509_STORE_CTX_set_time
  473. #define X509_VERIFY_PARAM_set_hostflags wolfSSL_X509_VERIFY_PARAM_set_hostflags
  474. #define X509_VERIFY_PARAM_set1_host wolfSSL_X509_VERIFY_PARAM_set1_host
  475. #define X509_VERIFY_PARAM_set1_ip_asc wolfSSL_X509_VERIFY_PARAM_set1_ip_asc
  476. #define X509_STORE_load_locations wolfSSL_X509_STORE_load_locations
  477. #define X509_LOOKUP_add_dir wolfSSL_X509_LOOKUP_add_dir
  478. #define X509_LOOKUP_load_file wolfSSL_X509_LOOKUP_load_file
  479. #define X509_LOOKUP_hash_dir wolfSSL_X509_LOOKUP_hash_dir
  480. #define X509_LOOKUP_file wolfSSL_X509_LOOKUP_file
  481. #define d2i_X509_CRL wolfSSL_d2i_X509_CRL
  482. #define d2i_X509_CRL_fp wolfSSL_d2i_X509_CRL_fp
  483. #define PEM_read_X509_CRL wolfSSL_PEM_read_X509_CRL
  484. #define X509_CRL_free wolfSSL_X509_CRL_free
  485. #define X509_CRL_get_lastUpdate wolfSSL_X509_CRL_get_lastUpdate
  486. #define X509_CRL_get_nextUpdate wolfSSL_X509_CRL_get_nextUpdate
  487. #define X509_CRL_verify wolfSSL_X509_CRL_verify
  488. #define X509_CRL_get_REVOKED wolfSSL_X509_CRL_get_REVOKED
  489. #define X509_get_X509_PUBKEY wolfSSL_X509_get_X509_PUBKEY
  490. #define X509_get0_tbs_sigalg wolfSSL_X509_get0_tbs_sigalg
  491. #define X509_PUBKEY_get0_param wolfSSL_X509_PUBKEY_get0_param
  492. #define X509_PUBKEY_get wolfSSL_X509_PUBKEY_get
  493. #define X509_PUBKEY_set wolfSSL_X509_PUBKEY_set
  494. #define X509_ALGOR_get0 wolfSSL_X509_ALGOR_get0
  495. #define X509_ALGOR_set0 wolfSSL_X509_ALGOR_set0
  496. #define X509_ALGOR_new wolfSSL_X509_ALGOR_new
  497. #define X509_ALGOR_free wolfSSL_X509_ALGOR_free
  498. #define X509_PUBKEY_new wolfSSL_X509_PUBKEY_new
  499. #define X509_PUBKEY_free wolfSSL_X509_PUBKEY_free
  500. #define sk_X509_REVOKED_num wolfSSL_sk_X509_REVOKED_num
  501. #define sk_X509_REVOKED_value wolfSSL_sk_X509_REVOKED_value
  502. #define X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents
  503. #define X509_check_purpose(...) 0
  504. #define OCSP_parse_url wolfSSL_OCSP_parse_url
  505. #define MD4_Init wolfSSL_MD4_Init
  506. #define MD4_Update wolfSSL_MD4_Update
  507. #define MD4_Final wolfSSL_MD4_Final
  508. #define BIO_new wolfSSL_BIO_new
  509. #define BIO_free wolfSSL_BIO_free
  510. #define BIO_vfree wolfSSL_BIO_vfree
  511. #define BIO_free_all wolfSSL_BIO_free_all
  512. #define BIO_nread0 wolfSSL_BIO_nread0
  513. #define BIO_nread wolfSSL_BIO_nread
  514. #define BIO_read wolfSSL_BIO_read
  515. #define BIO_nwrite0 wolfSSL_BIO_nwrite0
  516. #define BIO_nwrite wolfSSL_BIO_nwrite
  517. #define BIO_write wolfSSL_BIO_write
  518. #define BIO_push wolfSSL_BIO_push
  519. #define BIO_pop wolfSSL_BIO_pop
  520. #define BIO_flush wolfSSL_BIO_flush
  521. #define BIO_pending wolfSSL_BIO_pending
  522. #define BIO_get_mem_data wolfSSL_BIO_get_mem_data
  523. #define BIO_new_mem_buf wolfSSL_BIO_new_mem_buf
  524. #define BIO_f_buffer wolfSSL_BIO_f_buffer
  525. #define BIO_set_write_buffer_size wolfSSL_BIO_set_write_buffer_size
  526. #define BIO_f_ssl wolfSSL_BIO_f_ssl
  527. #define BIO_new_socket wolfSSL_BIO_new_socket
  528. #define SSL_set_bio wolfSSL_set_bio
  529. #define BIO_set_ssl wolfSSL_BIO_set_ssl
  530. #define BIO_eof wolfSSL_BIO_eof
  531. #define BIO_set_ss wolfSSL_BIO_set_ss
  532. #define BIO_f_md wolfSSL_BIO_f_md
  533. #define BIO_get_md_ctx wolfSSL_BIO_get_md_ctx
  534. #define BIO_s_mem wolfSSL_BIO_s_mem
  535. #define BIO_f_base64 wolfSSL_BIO_f_base64
  536. #define BIO_set_flags wolfSSL_BIO_set_flags
  537. #define BIO_set_nbio wolfSSL_BIO_set_nbio
  538. #define SSLeay_add_ssl_algorithms wolfSSL_add_all_algorithms
  539. #define SSLeay_add_all_algorithms wolfSSL_add_all_algorithms
  540. #define RAND_screen wolfSSL_RAND_screen
  541. #define RAND_file_name wolfSSL_RAND_file_name
  542. #define RAND_write_file wolfSSL_RAND_write_file
  543. #define RAND_load_file wolfSSL_RAND_load_file
  544. #define RAND_egd wolfSSL_RAND_egd
  545. #define RAND_seed wolfSSL_RAND_seed
  546. #define RAND_cleanup wolfSSL_RAND_Cleanup
  547. #define RAND_add wolfSSL_RAND_add
  548. #define RAND_poll wolfSSL_RAND_poll
  549. #define RAND_status wolfSSL_RAND_status
  550. #define RAND_bytes wolfSSL_RAND_bytes
  551. #define RAND_pseudo_bytes wolfSSL_RAND_pseudo_bytes
  552. #define COMP_zlib wolfSSL_COMP_zlib
  553. #define COMP_rle wolfSSL_COMP_rle
  554. #define SSL_COMP_add_compression_method wolfSSL_COMP_add_compression_method
  555. #define SSL_get_ex_new_index wolfSSL_get_ex_new_index
  556. #define RSA_get_ex_new_index wolfSSL_get_ex_new_index
  557. #define ASN1_BIT_STRING_new wolfSSL_ASN1_BIT_STRING_new
  558. #define ASN1_BIT_STRING_free wolfSSL_ASN1_BIT_STRING_free
  559. #define ASN1_BIT_STRING_get_bit wolfSSL_ASN1_BIT_STRING_get_bit
  560. #define ASN1_BIT_STRING_set_bit wolfSSL_ASN1_BIT_STRING_set_bit
  561. #define sk_ASN1_OBJECT_free wolfSSL_sk_ASN1_OBJECT_free
  562. #define ASN1_TIME_free wolfSSL_ASN1_TIME_free
  563. #define ASN1_TIME_adj wolfSSL_ASN1_TIME_adj
  564. #define ASN1_TIME_print wolfSSL_ASN1_TIME_print
  565. #define ASN1_TIME_to_generalizedtime wolfSSL_ASN1_TIME_to_generalizedtime
  566. #define ASN1_GENERALIZEDTIME_print wolfSSL_ASN1_GENERALIZEDTIME_print
  567. #define ASN1_GENERALIZEDTIME_free wolfSSL_ASN1_GENERALIZEDTIME_free
  568. #define ASN1_tag2str wolfSSL_ASN1_tag2str
  569. #define i2a_ASN1_INTEGER wolfSSL_i2a_ASN1_INTEGER
  570. #define i2c_ASN1_INTEGER wolfSSL_i2c_ASN1_INTEGER
  571. #define ASN1_INTEGER_new wolfSSL_ASN1_INTEGER_new
  572. #define ASN1_INTEGER_free wolfSSL_ASN1_INTEGER_free
  573. #define ASN1_INTEGER_cmp wolfSSL_ASN1_INTEGER_cmp
  574. #define ASN1_INTEGER_get wolfSSL_ASN1_INTEGER_get
  575. #define ASN1_INTEGER_set wolfSSL_ASN1_INTEGER_set
  576. #define ASN1_INTEGER_to_BN wolfSSL_ASN1_INTEGER_to_BN
  577. #define i2a_ASN1_OBJECT wolfSSL_i2a_ASN1_OBJECT
  578. #define i2d_ASN1_OBJECT wolfSSL_i2d_ASN1_OBJECT
  579. #define ASN1_STRING_data wolfSSL_ASN1_STRING_data
  580. #define ASN1_STRING_get0_data wolfSSL_ASN1_STRING_data
  581. #define ASN1_STRING_length wolfSSL_ASN1_STRING_length
  582. #define ASN1_STRING_to_UTF8 wolfSSL_ASN1_STRING_to_UTF8
  583. #define ASN1_STRING_print_ex wolfSSL_ASN1_STRING_print_ex
  584. #define ASN1_STRING_print(x, y) wolfSSL_ASN1_STRING_print ((WOLFSSL_BIO*)(x), (WOLFSSL_ASN1_STRING*)(y))
  585. #define d2i_DISPLAYTEXT wolfSSL_d2i_DISPLAYTEXT
  586. #define ASN1_UTCTIME_pr wolfSSL_ASN1_UTCTIME_pr
  587. #define ASN1_IA5STRING WOLFSSL_ASN1_STRING
  588. #define ASN1_OCTET_STRING WOLFSSL_ASN1_STRING
  589. #define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
  590. #define SSL_load_client_CA_file wolfSSL_load_client_CA_file
  591. #define SSL_CTX_get_client_CA_list wolfSSL_CTX_get_client_CA_list
  592. #define SSL_CTX_set_client_CA_list wolfSSL_CTX_set_client_CA_list
  593. #define SSL_CTX_set_client_cert_cb wolfSSL_CTX_set_client_cert_cb
  594. #define SSL_CTX_set_cert_store wolfSSL_CTX_set_cert_store
  595. #define SSL_CTX_get_cert_store(x) wolfSSL_CTX_get_cert_store ((WOLFSSL_CTX*) (x))
  596. #define SSL_get_client_CA_list wolfSSL_get_client_CA_list
  597. #define SSL_get_ex_data_X509_STORE_CTX_idx wolfSSL_get_ex_data_X509_STORE_CTX_idx
  598. #define SSL_get_ex_data wolfSSL_get_ex_data
  599. #define SSL_CTX_set_default_passwd_cb_userdata wolfSSL_CTX_set_default_passwd_cb_userdata
  600. #define SSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
  601. #define SSL_CTX_set_timeout(ctx, to) \
  602. wolfSSL_CTX_set_timeout(ctx, (unsigned int) to)
  603. #define SSL_CTX_set_info_callback wolfSSL_CTX_set_info_callback
  604. #define SSL_CTX_set_alpn_protos wolfSSL_CTX_set_alpn_protos
  605. #define SSL_alert_type_string wolfSSL_alert_type_string
  606. #define SSL_alert_desc_string wolfSSL_alert_desc_string
  607. #define SSL_state_string wolfSSL_state_string
  608. #define RSA_free wolfSSL_RSA_free
  609. #define RSA_generate_key wolfSSL_RSA_generate_key
  610. #define SSL_CTX_set_tmp_rsa_callback wolfSSL_CTX_set_tmp_rsa_callback
  611. #define RSA_print wolfSSL_RSA_print
  612. #define RSA_bits wolfSSL_RSA_size
  613. #define RSA_up_ref wolfSSL_RSA_up_ref
  614. #define RSA_padding_add_PKCS1_PSS wolfSSL_RSA_padding_add_PKCS1_PSS
  615. #define RSA_verify_PKCS1_PSS wolfSSL_RSA_verify_PKCS1_PSS
  616. #define PEM_def_callback wolfSSL_PEM_def_callback
  617. #define SSL_CTX_sess_accept wolfSSL_CTX_sess_accept
  618. #define SSL_CTX_sess_connect wolfSSL_CTX_sess_connect
  619. #define SSL_CTX_sess_accept_good wolfSSL_CTX_sess_accept_good
  620. #define SSL_CTX_sess_connect_good wolfSSL_CTX_sess_connect_good
  621. #define SSL_CTX_sess_accept_renegotiate wolfSSL_CTX_sess_accept_renegotiate
  622. #define SSL_CTX_sess_connect_renegotiate wolfSSL_CTX_sess_connect_renegotiate
  623. #define SSL_CTX_sess_hits wolfSSL_CTX_sess_hits
  624. #define SSL_CTX_sess_cb_hits wolfSSL_CTX_sess_cb_hits
  625. #define SSL_CTX_sess_cache_full wolfSSL_CTX_sess_cache_full
  626. #define SSL_CTX_sess_misses wolfSSL_CTX_sess_misses
  627. #define SSL_CTX_sess_timeouts wolfSSL_CTX_sess_timeouts
  628. #define SSL_CTX_sess_number wolfSSL_CTX_sess_number
  629. #define SSL_CTX_sess_get_cache_size wolfSSL_CTX_sess_get_cache_size
  630. #define SSL_DEFAULT_CIPHER_LIST WOLFSSL_DEFAULT_CIPHER_LIST
  631. #define SSL_CTX_set_psk_client_callback wolfSSL_CTX_set_psk_client_callback
  632. #define SSL_set_psk_client_callback wolfSSL_set_psk_client_callback
  633. #define SSL_get_psk_identity_hint wolfSSL_get_psk_identity_hint
  634. #define SSL_get_psk_identity wolfSSL_get_psk_identity
  635. #define SSL_CTX_use_psk_identity_hint wolfSSL_CTX_use_psk_identity_hint
  636. #define SSL_use_psk_identity_hint wolfSSL_use_psk_identity_hint
  637. #define SSL_CTX_set_psk_server_callback wolfSSL_CTX_set_psk_server_callback
  638. #define SSL_set_psk_server_callback wolfSSL_set_psk_server_callback
  639. /* system file ints for ERR_put_error */
  640. #define SYS_F_ACCEPT WOLFSSL_SYS_ACCEPT
  641. #define SYS_F_BIND WOLFSSL_SYS_BIND
  642. #define SYS_F_CONNECT WOLFSSL_SYS_CONNECT
  643. #define SYS_F_FOPEN WOLFSSL_SYS_FOPEN
  644. #define SYS_F_FREAD WOLFSSL_SYS_FREAD
  645. #define SYS_F_GETADDRINFO WOLFSSL_SYS_GETADDRINFO
  646. #define SYS_F_GETSOCKOPT WOLFSSL_SYS_GETSOCKOPT
  647. #define SYS_F_GETSOCKNAME WOLFSSL_SYS_GETSOCKNAME
  648. #define SYS_F_OPENDIR WOLFSSL_SYS_OPENDIR
  649. #define SYS_F_SETSOCKOPT WOLFSSL_SYS_SETSOCKOPT
  650. #define SYS_F_SOCKET WOLFSSL_SYS_SOCKET
  651. #define SYS_F_GETHOSTBYNAME WOLFSSL_SYS_GETHOSTBYNAME
  652. #define SYS_F_GETNAMEINFO WOLFSSL_SYS_GETNAMEINFO
  653. #define SYS_F_GETSERVBYNAME WOLFSSL_SYS_GETSERVBYNAME
  654. #define SYS_F_IOCTLSOCKET WOLFSSL_SYS_IOCTLSOCKET
  655. #define SYS_F_LISTEN WOLFSSL_SYS_LISTEN
  656. #define ERR_GET_LIB wolfSSL_ERR_GET_LIB
  657. #define ERR_GET_REASON wolfSSL_ERR_GET_REASON
  658. #define ERR_put_error wolfSSL_ERR_put_error
  659. #define ERR_peek_error wolfSSL_ERR_peek_error
  660. #define ERR_peek_errors_fp wolfSSL_ERR_peek_errors_fp
  661. #define ERR_peek_error_line_data wolfSSL_ERR_peek_error_line_data
  662. #define ERR_peek_last_error wolfSSL_ERR_peek_last_error
  663. #define ERR_peek_last_error_line wolfSSL_ERR_peek_last_error_line
  664. #define ERR_get_error_line wolfSSL_ERR_get_error_line
  665. #define ERR_get_error_line_data wolfSSL_ERR_get_error_line_data
  666. #define ERR_get_error wolfSSL_ERR_get_error
  667. #define ERR_print_errors_fp(file) wolfSSL_ERR_dump_errors_fp((file))
  668. #define ERR_print_errors_cb wolfSSL_ERR_print_errors_cb
  669. #define ERR_print_errors wolfSSL_ERR_print_errors
  670. #define ERR_clear_error wolfSSL_ERR_clear_error
  671. #define ERR_free_strings wolfSSL_ERR_free_strings
  672. #define ERR_remove_state wolfSSL_ERR_remove_state
  673. #define ERR_remove_thread_state wolfSSL_ERR_remove_thread_state
  674. #define ERR_error_string wolfSSL_ERR_error_string
  675. #define ERR_error_string_n wolfSSL_ERR_error_string_n
  676. #define ERR_reason_error_string wolfSSL_ERR_reason_error_string
  677. #define ERR_load_BIO_strings wolfSSL_ERR_load_BIO_strings
  678. #ifndef WOLFCRYPT_ONLY
  679. #define PEMerr(func, reason) wolfSSL_ERR_put_error(ERR_LIB_PEM, \
  680. (func), (reason), __FILE__, __LINE__)
  681. #else
  682. #define PEMerr(func, reason) WOLFSSL_ERROR_LINE((reason), \
  683. NULL, __LINE__, __FILE__, NULL)
  684. #endif
  685. #define SSLv23_server_method wolfSSLv23_server_method
  686. #define SSL_CTX_set_options wolfSSL_CTX_set_options
  687. #define SSL_CTX_get_options wolfSSL_CTX_get_options
  688. #define SSL_CTX_clear_options wolfSSL_CTX_clear_options
  689. #define SSL_CTX_check_private_key wolfSSL_CTX_check_private_key
  690. #define SSL_check_private_key wolfSSL_check_private_key
  691. #define SSL_CTX_set_mode wolfSSL_CTX_set_mode
  692. #define SSL_CTX_get_mode wolfSSL_CTX_get_mode
  693. #define SSL_CTX_set_default_read_ahead wolfSSL_CTX_set_default_read_ahead
  694. #define SSL_CTX_sess_set_cache_size wolfSSL_CTX_sess_set_cache_size
  695. #define SSL_CTX_set_default_verify_paths wolfSSL_CTX_set_default_verify_paths
  696. #define SSL_CTX_set_session_id_context wolfSSL_CTX_set_session_id_context
  697. #define SSL_get_peer_certificate wolfSSL_get_peer_certificate
  698. #define SSL_get_peer_cert_chain wolfSSL_get_peer_cert_chain
  699. #define SSL_want wolfSSL_want
  700. #define SSL_want_read wolfSSL_want_read
  701. #define SSL_want_write wolfSSL_want_write
  702. #define BIO_prf wolfSSL_BIO_prf
  703. #define sk_num wolfSSL_sk_num
  704. #define sk_ASN1_OBJECT_num wolfSSL_sk_num
  705. #define sk_value wolfSSL_sk_value
  706. #define sk_ASN1_OBJECT_value wolfSSL_sk_value
  707. #define d2i_PKCS12_bio wolfSSL_d2i_PKCS12_bio
  708. #define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
  709. #define i2d_PKCS12_bio wolfSSL_i2d_PKCS12_bio
  710. #define d2i_RSAPublicKey wolfSSL_d2i_RSAPublicKey
  711. #define d2i_RSAPrivateKey wolfSSL_d2i_RSAPrivateKey
  712. #define i2d_RSAPrivateKey wolfSSL_i2d_RSAPrivateKey
  713. #define i2d_RSAPublicKey wolfSSL_i2d_RSAPublicKey
  714. #define SSL_CTX_get_ex_data wolfSSL_CTX_get_ex_data
  715. #define SSL_CTX_set_ex_data wolfSSL_CTX_set_ex_data
  716. #define SSL_CTX_sess_set_get_cb wolfSSL_CTX_sess_set_get_cb
  717. #define SSL_CTX_sess_set_new_cb wolfSSL_CTX_sess_set_new_cb
  718. #define SSL_CTX_sess_set_remove_cb wolfSSL_CTX_sess_set_remove_cb
  719. #define i2d_SSL_SESSION wolfSSL_i2d_SSL_SESSION
  720. #define d2i_SSL_SESSION wolfSSL_d2i_SSL_SESSION
  721. #define SSL_SESSION_set_timeout wolfSSL_SSL_SESSION_set_timeout
  722. #define SSL_SESSION_get_timeout wolfSSL_SESSION_get_timeout
  723. #define SSL_SESSION_get_time wolfSSL_SESSION_get_time
  724. #define SSL_CTX_get_ex_new_index wolfSSL_CTX_get_ex_new_index
  725. #define PEM_read wolfSSL_PEM_read
  726. #define PEM_write wolfSSL_PEM_write
  727. #define PEM_get_EVP_CIPHER_INFO wolfSSL_PEM_get_EVP_CIPHER_INFO
  728. #define PEM_do_header wolfSSL_PEM_do_header
  729. /*#if OPENSSL_API_COMPAT < 0x10100000L*/
  730. #define CONF_modules_free()
  731. #define ENGINE_cleanup()
  732. #define SSL_CTX_need_tmp_RSA(ctx) 0
  733. #define SSL_CTX_set_tmp_rsa(ctx,rsa) 1
  734. #define SSL_need_tmp_RSA(ssl) 0
  735. #define SSL_set_tmp_rsa(ssl,rsa) 1
  736. /*#endif*/
  737. #define CONF_modules_unload(a)
  738. #define CONF_get1_default_config_file wolfSSL_CONF_get1_default_config_file
  739. #define SSL_get_hit wolfSSL_session_reused
  740. /* yassl had set the default to be 500 */
  741. #define SSL_get_default_timeout(ctx) 500
  742. #define DTLSv1_get_timeout(ssl, timeleft) wolfSSL_DTLSv1_get_timeout((ssl), (WOLFSSL_TIMEVAL*)(timeleft))
  743. #define DTLSv1_handle_timeout wolfSSL_DTLSv1_handle_timeout
  744. #define DTLSv1_set_initial_timeout_duration wolfSSL_DTLSv1_set_initial_timeout_duration
  745. #ifndef NO_WOLFSSL_STUB
  746. #define SSL_CTX_set_current_time_cb(ssl, cb) ({ (void)ssl; (void)cb; })
  747. #endif
  748. #define SSL_CTX_use_certificate wolfSSL_CTX_use_certificate
  749. #define SSL_CTX_add1_chain_cert wolfSSL_CTX_add1_chain_cert
  750. #define SSL_CTX_use_PrivateKey wolfSSL_CTX_use_PrivateKey
  751. #define BIO_read_filename wolfSSL_BIO_read_filename
  752. #define SSL_CTX_set_verify_depth wolfSSL_CTX_set_verify_depth
  753. #define SSL_set_verify_depth wolfSSL_set_verify_depth
  754. #define SSL_get_app_data wolfSSL_get_app_data
  755. #define SSL_set_app_data wolfSSL_set_app_data
  756. #define SHA1 wolfSSL_SHA1
  757. #define SSL_dup_CA_list wolfSSL_dup_CA_list
  758. #define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
  759. #define PEM_read_bio_DHparams wolfSSL_PEM_read_bio_DHparams
  760. #define PEM_read_bio_DSAparams wolfSSL_PEM_read_bio_DSAparams
  761. #if defined(OPENSSL_ALL) || defined(WOLFSSL_HAPROXY)
  762. #define SSL_get_rbio wolfSSL_SSL_get_rbio
  763. #define SSL_get_wbio wolfSSL_SSL_get_wbio
  764. #define SSL_do_handshake wolfSSL_SSL_do_handshake
  765. #define SSL_get_ciphers(x) wolfSSL_get_ciphers_compat(x)
  766. #define SSL_SESSION_get_id wolfSSL_SESSION_get_id
  767. #define SSL_get_cipher_bits(s,np) \
  768. wolfSSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
  769. #define sk_SSL_CIPHER_num wolfSSL_sk_SSL_CIPHER_num
  770. #define sk_SSL_COMP_zero wolfSSL_sk_SSL_COMP_zero
  771. #define sk_SSL_CIPHER_value wolfSSL_sk_SSL_CIPHER_value
  772. #endif /* OPENSSL_ALL || WOLFSSL_HAPROXY */
  773. #define sk_SSL_CIPHER_dup wolfSSL_sk_dup
  774. #define sk_SSL_CIPHER_free wolfSSL_sk_SSL_CIPHER_free
  775. #define sk_SSL_CIPHER_find wolfSSL_sk_SSL_CIPHER_find
  776. #if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
  777. || defined(WOLFSSL_NGINX)
  778. #include <wolfssl/openssl/pem.h>
  779. #define SSL_CTRL_CHAIN 88
  780. #define ERR_LIB_SSL 20
  781. #define SSL_R_SHORT_READ 10
  782. #define ERR_R_PEM_LIB 9
  783. #define V_ASN1_IA5STRING 22
  784. #define V_ASN1_UTF8STRING 12
  785. #define SSL_CTRL_MODE 33
  786. #define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
  787. #define SSL_CTX_clear_chain_certs(ctx) SSL_CTX_set0_chain(ctx,NULL)
  788. #define d2i_RSAPrivateKey_bio wolfSSL_d2i_RSAPrivateKey_bio
  789. #define SSL_CTX_use_RSAPrivateKey wolfSSL_CTX_use_RSAPrivateKey
  790. #define d2i_PrivateKey_bio wolfSSL_d2i_PrivateKey_bio
  791. #define BIO_new_bio_pair wolfSSL_BIO_new_bio_pair
  792. #define SSL_get_verify_callback wolfSSL_get_verify_callback
  793. #define SSL_set_mode(ssl,op) wolfSSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
  794. #define SSL_CTX_use_certificate_ASN1 wolfSSL_CTX_use_certificate_ASN1
  795. #define SSL_CTX_set0_chain(ctx,sk) \
  796. wolfSSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)(sk))
  797. #define SSL_CTX_get_app_data(ctx) wolfSSL_CTX_get_ex_data(ctx,0)
  798. #define SSL_CTX_set_app_data(ctx,arg) wolfSSL_CTX_set_ex_data(ctx,0, \
  799. (char *)(arg))
  800. #endif /* OPENSSL_ALL || WOLFSSL_ASIO || WOLFSSL_HAPROXY */
  801. #define SSL_CTX_set_tmp_dh wolfSSL_CTX_set_tmp_dh
  802. #define TLSEXT_STATUSTYPE_ocsp 1
  803. #define SSL_set_options wolfSSL_set_options
  804. #define SSL_get_options wolfSSL_get_options
  805. #define SSL_clear_options wolfSSL_clear_options
  806. #define SSL_set_tmp_dh wolfSSL_set_tmp_dh
  807. #define SSL_clear_num_renegotiations wolfSSL_clear_num_renegotiations
  808. #define SSL_total_renegotiations wolfSSL_total_renegotiations
  809. #define SSL_num_renegotiations wolfSSL_num_renegotiations
  810. #define SSL_renegotiate wolfSSL_Rehandshake
  811. #define SSL_get_secure_renegotiation_support wolfSSL_SSL_get_secure_renegotiation_support
  812. #define SSL_renegotiate_pending wolfSSL_SSL_renegotiate_pending
  813. #define SSL_set_tlsext_debug_arg wolfSSL_set_tlsext_debug_arg
  814. #define SSL_set_tlsext_status_type wolfSSL_set_tlsext_status_type
  815. #define SSL_set_tlsext_status_exts wolfSSL_set_tlsext_status_exts
  816. #define SSL_get_tlsext_status_ids wolfSSL_get_tlsext_status_ids
  817. #define SSL_set_tlsext_status_ids wolfSSL_set_tlsext_status_ids
  818. #define SSL_get_tlsext_status_ocsp_res wolfSSL_get_tlsext_status_ocsp_resp
  819. #define SSL_set_tlsext_status_ocsp_res wolfSSL_set_tlsext_status_ocsp_resp
  820. #define SSL_set_tlsext_status_ocsp_resp wolfSSL_set_tlsext_status_ocsp_resp
  821. #define SSL_get_tlsext_status_ocsp_resp wolfSSL_get_tlsext_status_ocsp_resp
  822. #define SSL_CTX_add_extra_chain_cert wolfSSL_CTX_add_extra_chain_cert
  823. #define SSL_CTX_get_read_ahead wolfSSL_CTX_get_read_ahead
  824. #define SSL_CTX_set_read_ahead wolfSSL_CTX_set_read_ahead
  825. #define SSL_CTX_set_tlsext_status_arg wolfSSL_CTX_set_tlsext_status_arg
  826. #define SSL_CTX_set_tlsext_opaque_prf_input_callback_arg \
  827. wolfSSL_CTX_set_tlsext_opaque_prf_input_callback_arg
  828. #define SSL_get_server_random wolfSSL_get_server_random
  829. #define SSL_get_server_tmp_key wolfSSL_get_server_tmp_key
  830. #define SSL_CTX_set_min_proto_version wolfSSL_CTX_set_min_proto_version
  831. #define SSL_CTX_set_max_proto_version wolfSSL_CTX_set_max_proto_version
  832. #define SSL_get_tlsext_status_exts wolfSSL_get_tlsext_status_exts
  833. #define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
  834. #define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
  835. #define SSL_CTRL_SET_TMP_DH 3
  836. #define SSL_CTRL_SET_TMP_ECDH 4
  837. #define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
  838. #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
  839. #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
  840. #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67
  841. #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68
  842. #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
  843. #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
  844. #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
  845. #define SSL_CTRL_EXTRA_CHAIN_CERT 14
  846. #define SSL_CTRL_OPTIONS 32
  847. #define SSL_CTRL_SET_SESS_CACHE_SIZE 42
  848. #define SSL_CTRL_GET_READ_AHEAD 40
  849. #define SSL_CTRL_SET_READ_AHEAD 41
  850. #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63
  851. #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64
  852. #define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
  853. #define SSL_CTRL_GET_SESSION_REUSED 0
  854. #define SSL_ctrl wolfSSL_ctrl
  855. #define SSL_CTX_ctrl wolfSSL_CTX_ctrl
  856. #define SSL_CTX_callback_ctrl wolfSSL_CTX_callback_ctrl
  857. #define SSL3_RANDOM_SIZE 32 /* same as RAN_LEN in internal.h */
  858. #define SSL2_VERSION 0x0002
  859. #define SSL3_VERSION 0x0300
  860. #define TLS1_VERSION 0x0301
  861. #define TLS1_1_VERSION 0x0302
  862. #define TLS1_2_VERSION 0x0303
  863. #define TLS1_3_VERSION 0x0304
  864. #define DTLS1_VERSION 0xFEFF
  865. #define DTLS1_2_VERSION 0xFEFD
  866. #if defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || defined(OPENSSL_EXTRA) \
  867. || defined(OPENSSL_ALL)
  868. #include <wolfssl/openssl/asn1.h>
  869. #define SSL23_ST_SR_CLNT_HELLO_A (0x210|0x2000)
  870. #define SSL3_ST_SR_CLNT_HELLO_A (0x110|0x2000)
  871. #define SSL3_AD_BAD_CERTIFICATE bad_certificate
  872. #define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
  873. #define ASN1_STRFLGS_ESC_MSB 4
  874. #define SSL_MAX_MASTER_KEY_LENGTH WOLFSSL_MAX_MASTER_KEY_LENGTH
  875. #define SSL_alert_desc_string_long wolfSSL_alert_desc_string_long
  876. #define SSL_alert_type_string_long wolfSSL_alert_type_string_long
  877. #define SSL_CIPHER_get_bits wolfSSL_CIPHER_get_bits
  878. #define sk_GENERAL_NAME_num wolfSSL_sk_GENERAL_NAME_num
  879. #define SSL_CTX_get_options wolfSSL_CTX_get_options
  880. #define SSL_CTX_flush_sessions wolfSSL_flush_sessions
  881. #define SSL_CTX_add_session wolfSSL_CTX_add_session
  882. #define SSL_version(x) wolfSSL_version ((WOLFSSL*) (x))
  883. #define SSL_get_state wolfSSL_get_state
  884. #define SSL_state_string_long wolfSSL_state_string_long
  885. #define GENERAL_NAME_new wolfSSL_GENERAL_NAME_new
  886. #define GENERAL_NAME_free wolfSSL_GENERAL_NAME_free
  887. #define sk_GENERAL_NAME_push wolfSSL_sk_GENERAL_NAME_push
  888. #define sk_GENERAL_NAME_value wolfSSL_sk_GENERAL_NAME_value
  889. #define SSL_SESSION_get_ex_data wolfSSL_SESSION_get_ex_data
  890. #define SSL_SESSION_set_ex_data wolfSSL_SESSION_set_ex_data
  891. #define SSL_SESSION_get_ex_new_index wolfSSL_SESSION_get_ex_new_index
  892. #define SSL_SESSION_get_id wolfSSL_SESSION_get_id
  893. #define SSL_SESSION_print wolfSSL_SESSION_print
  894. #define sk_GENERAL_NAME_pop_free wolfSSL_sk_GENERAL_NAME_pop_free
  895. #define sk_GENERAL_NAME_free wolfSSL_sk_GENERAL_NAME_free
  896. #define sk_ASN1_OBJECT_pop_free wolfSSL_sk_ASN1_OBJECT_pop_free
  897. #define GENERAL_NAME_free wolfSSL_GENERAL_NAME_free
  898. #define GENERAL_NAMES_free wolfSSL_GENERAL_NAMES_free
  899. #define AUTHORITY_INFO_ACCESS_free wolfSSL_AUTHORITY_INFO_ACCESS_free
  900. #define sk_ACCESS_DESCRIPTION_pop_free wolfSSL_sk_ACCESS_DESCRIPTION_pop_free
  901. #define sk_ACCESS_DESCRIPTION_free wolfSSL_sk_ACCESS_DESCRIPTION_free
  902. #define ACCESS_DESCRIPTION_free wolfSSL_ACCESS_DESCRIPTION_free
  903. #define SSL3_AL_FATAL 2
  904. #define SSL_TLSEXT_ERR_OK 0
  905. #define SSL_TLSEXT_ERR_ALERT_FATAL alert_fatal
  906. #define SSL_TLSEXT_ERR_NOACK alert_warning
  907. #define TLSEXT_NAMETYPE_host_name WOLFSSL_SNI_HOST_NAME
  908. #define SSL_set_tlsext_host_name wolfSSL_set_tlsext_host_name
  909. #define SSL_get_servername wolfSSL_get_servername
  910. #define SSL_set_SSL_CTX wolfSSL_set_SSL_CTX
  911. #define SSL_CTX_get_verify_callback wolfSSL_CTX_get_verify_callback
  912. #define SSL_CTX_set_tlsext_servername_callback wolfSSL_CTX_set_tlsext_servername_callback
  913. #define SSL_CTX_set_tlsext_servername_arg wolfSSL_CTX_set_servername_arg
  914. #define PSK_MAX_PSK_LEN 256
  915. #define PSK_MAX_IDENTITY_LEN 128
  916. #define SSL_CTX_clear_options wolfSSL_CTX_clear_options
  917. #endif /* HAVE_STUNNEL || WOLFSSL_NGINX */
  918. #define SSL_CTX_get_default_passwd_cb wolfSSL_CTX_get_default_passwd_cb
  919. #define SSL_CTX_get_default_passwd_cb_userdata wolfSSL_CTX_get_default_passwd_cb_userdata
  920. #define SSL_CTX_set_msg_callback wolfSSL_CTX_set_msg_callback
  921. #define SSL_set_msg_callback wolfSSL_set_msg_callback
  922. #define SSL_CTX_set_msg_callback_arg wolfSSL_CTX_set_msg_callback_arg
  923. #define SSL_set_msg_callback_arg wolfSSL_set_msg_callback_arg
  924. #define SSL_CTX_clear_extra_chain_certs wolfSSL_CTX_clear_extra_chain_certs
  925. /* Nginx uses this to determine if reached end of certs in file.
  926. * PEM_read_bio_X509 is called and the return error is lost.
  927. * The error that needs to be detected is: SSL_NO_PEM_HEADER.
  928. */
  929. #define ERR_GET_FUNC(l) (int)((((unsigned long)l) >> 12L) & 0xfffL)
  930. #define PEM_F_PEM_DEF_CALLBACK 100
  931. /* Avoid wolfSSL error code range */
  932. #define PEM_R_NO_START_LINE (-MIN_CODE_E + 1)
  933. #define PEM_R_PROBLEMS_GETTING_PASSWORD (-MIN_CODE_E + 2)
  934. #define PEM_R_BAD_PASSWORD_READ (-MIN_CODE_E + 3)
  935. #define PEM_R_BAD_DECRYPT (-MIN_CODE_E + 4)
  936. #define ERR_LIB_PEM 9
  937. #define ERR_LIB_X509 10
  938. #define ERR_LIB_EVP 11
  939. #define ERR_LIB_ASN1 12
  940. #if defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
  941. defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(OPENSSL_ALL) || \
  942. defined(HAVE_LIGHTY)
  943. #include <wolfssl/error-ssl.h>
  944. #define OPENSSL_STRING WOLFSSL_STRING
  945. #define TLSEXT_TYPE_application_layer_protocol_negotiation 16
  946. #define OPENSSL_NPN_UNSUPPORTED 0
  947. #define OPENSSL_NPN_NEGOTIATED 1
  948. #define OPENSSL_NPN_NO_OVERLAP 2
  949. /* Nginx checks these to see if the error was a handshake error. */
  950. #define SSL_R_BAD_CHANGE_CIPHER_SPEC LENGTH_ERROR
  951. #define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG BUFFER_E
  952. #define SSL_R_DIGEST_CHECK_FAILED VERIFY_MAC_ERROR
  953. #define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST SUITES_ERROR
  954. #define SSL_R_EXCESSIVE_MESSAGE_SIZE BUFFER_ERROR
  955. #define SSL_R_LENGTH_MISMATCH LENGTH_ERROR
  956. #define SSL_R_NO_CIPHERS_SPECIFIED SUITES_ERROR
  957. #define SSL_R_NO_COMPRESSION_SPECIFIED COMPRESSION_ERROR
  958. #define SSL_R_NO_SHARED_CIPHER MATCH_SUITE_ERROR
  959. #define SSL_R_RECORD_LENGTH_MISMATCH HANDSHAKE_SIZE_ERROR
  960. #define SSL_R_UNEXPECTED_MESSAGE OUT_OF_ORDER_E
  961. #define SSL_R_UNEXPECTED_RECORD SANITY_MSG_E
  962. #define SSL_R_UNKNOWN_ALERT_TYPE BUFFER_ERROR
  963. #define SSL_R_UNKNOWN_PROTOCOL VERSION_ERROR
  964. #define SSL_R_WRONG_VERSION_NUMBER VERSION_ERROR
  965. #define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC ENCRYPT_ERROR
  966. #define SSL_R_HTTPS_PROXY_REQUEST PARSE_ERROR
  967. #define SSL_R_HTTP_REQUEST PARSE_ERROR
  968. #define SSL_R_UNSUPPORTED_PROTOCOL VERSION_ERROR
  969. #ifdef HAVE_SESSION_TICKET
  970. #define SSL_OP_NO_TICKET SSL_OP_NO_TICKET
  971. #define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72
  972. #endif
  973. #define OPENSSL_config wolfSSL_OPENSSL_config
  974. #define OPENSSL_memdup wolfSSL_OPENSSL_memdup
  975. #define SSL_CTX_get_timeout wolfSSL_SSL_CTX_get_timeout
  976. #define SSL_CTX_set_tmp_ecdh wolfSSL_SSL_CTX_set_tmp_ecdh
  977. #define SSL_CTX_remove_session wolfSSL_SSL_CTX_remove_session
  978. #define SSL_get_rbio wolfSSL_SSL_get_rbio
  979. #define SSL_get_wbio wolfSSL_SSL_get_wbio
  980. #define SSL_do_handshake wolfSSL_SSL_do_handshake
  981. #define SSL_in_init wolfSSL_SSL_in_init
  982. #define SSL_in_connect_init wolfSSL_SSL_in_connect_init
  983. #define SSL_get0_session wolfSSL_SSL_get0_session
  984. #define SSL_CTX_set_tlsext_ticket_key_cb wolfSSL_CTX_set_tlsext_ticket_key_cb
  985. #define SSL_CTX_set_tlsext_status_cb wolfSSL_CTX_set_tlsext_status_cb
  986. #define SSL_CTX_get_extra_chain_certs wolfSSL_CTX_get_extra_chain_certs
  987. #define sk_OPENSSL_STRING_value wolfSSL_sk_WOLFSSL_STRING_value
  988. #define SSL_get0_alpn_selected wolfSSL_get0_alpn_selected
  989. #define SSL_select_next_proto wolfSSL_select_next_proto
  990. #define SSL_CTX_set_alpn_select_cb wolfSSL_CTX_set_alpn_select_cb
  991. #define SSL_CTX_set_next_protos_advertised_cb wolfSSL_CTX_set_next_protos_advertised_cb
  992. #define SSL_CTX_set_next_proto_select_cb wolfSSL_CTX_set_next_proto_select_cb
  993. #define SSL_set_alpn_protos wolfSSL_set_alpn_protos
  994. #define SSL_get0_next_proto_negotiated wolfSSL_get0_next_proto_negotiated
  995. #define SSL_is_server wolfSSL_is_server
  996. #endif /* WOLFSSL_NGINX || WOLFSSL_HAPROXY || WOLFSSL_MYSQL_COMPATIBLE ||
  997. OPENSSL_ALL || HAVE_LIGHTY */
  998. #if defined(OPENSSL_EXTRA) && defined(HAVE_ECC)
  999. #define SSL_CTX_set1_curves_list wolfSSL_CTX_set1_curves_list
  1000. #define SSL_set1_curves_list wolfSSL_set1_curves_list
  1001. #endif
  1002. #ifdef OPENSSL_EXTRA
  1003. #define SSL_CTX_add_client_CA wolfSSL_CTX_add_client_CA
  1004. #define SSL_CTX_set_srp_password wolfSSL_CTX_set_srp_password
  1005. #define SSL_CTX_set_srp_username wolfSSL_CTX_set_srp_username
  1006. #define SSL_get_SSL_CTX wolfSSL_get_SSL_CTX
  1007. #define SSL_get0_param wolfSSL_get0_param
  1008. #define ERR_NUM_ERRORS 16
  1009. #define SN_pkcs9_emailAddress "Email"
  1010. #define LN_pkcs9_emailAddress "emailAddress"
  1011. #define NID_pkcs9_emailAddress 48
  1012. #define OBJ_pkcs9_emailAddress 1L,2L,840L,113539L,1L,9L,1L
  1013. #define SSL_get_rbio wolfSSL_SSL_get_rbio
  1014. #define SSL_get_wbio wolfSSL_SSL_get_wbio
  1015. #define SSL_do_handshake wolfSSL_SSL_do_handshake
  1016. #endif /* OPENSSL_EXTRA */
  1017. /* cipher suites for compatibility */
  1018. #define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013)
  1019. #define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)
  1020. #define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)
  1021. #define TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca8)
  1022. #define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009)
  1023. #define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)
  1024. #define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)
  1025. #define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca9)
  1026. #define X509_STORE_get0_objects wolfSSL_X509_STORE_get0_objects
  1027. #define sk_X509_OBJECT_num wolfSSL_sk_X509_OBJECT_num
  1028. #define sk_X509_OBJECT_value wolfSSL_sk_X509_OBJECT_value
  1029. #define sk_X509_OBJECT_delete wolfSSL_sk_X509_OBJECT_delete
  1030. #define X509_OBJECT_free wolfSSL_X509_OBJECT_free
  1031. #define X509_OBJECT_get_type(x) 0
  1032. #define OpenSSL_version(x) wolfSSL_OpenSSL_version()
  1033. #ifdef __cplusplus
  1034. } /* extern "C" */
  1035. #endif
  1036. #endif /* wolfSSL_openssl_h__ */