wolfssl_options.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. *
  10. * This software is licensed as described in the file COPYING, which
  11. * you should have received as part of this distribution. The terms
  12. * are also available at https://curl.se/docs/copyright.html.
  13. *
  14. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. * copies of the Software, and permit persons to whom the Software is
  16. * furnished to do so, under the terms of the COPYING file.
  17. *
  18. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. * KIND, either express or implied.
  20. *
  21. * SPDX-License-Identifier: curl
  22. *
  23. ***************************************************************************/
  24. /*
  25. By default wolfSSL has a very conservative configuration that can result in
  26. connections to servers failing due to certificate or algorithm problems.
  27. To remedy this issue for libcurl I've generated this options file that
  28. build-wolfssl will copy to the wolfSSL include directories and will result in
  29. maximum compatibility.
  30. These are the configure options that were used to build wolfSSL v5.1.1 in
  31. mingw and generate the options in this file:
  32. C_EXTRA_FLAGS="\
  33. -Wno-attributes \
  34. -Wno-unused-but-set-variable \
  35. -DFP_MAX_BITS=16384 \
  36. -DHAVE_SECRET_CALLBACK \
  37. -DTFM_TIMING_RESISTANT \
  38. -DUSE_WOLF_STRTOK \
  39. -DWOLFSSL_DES_ECB \
  40. -DWOLFSSL_STATIC_DH \
  41. -DWOLFSSL_STATIC_RSA \
  42. " \
  43. ./configure --prefix=/usr/local \
  44. --disable-jobserver \
  45. --enable-aesgcm \
  46. --enable-alpn \
  47. --enable-altcertchains \
  48. --enable-certgen \
  49. --enable-des3 \
  50. --enable-dh \
  51. --enable-dsa \
  52. --enable-ecc \
  53. --enable-eccshamir \
  54. --enable-fastmath \
  55. --enable-opensslextra \
  56. --enable-ripemd \
  57. --enable-sessioncerts \
  58. --enable-sha512 \
  59. --enable-sni \
  60. --enable-tlsv10 \
  61. --enable-supportedcurves \
  62. --enable-tls13 \
  63. --enable-testcert \
  64. > config.out 2>&1
  65. Two generated options HAVE_THREAD_LS and _POSIX_THREADS were removed since they
  66. are inapplicable for our Visual Studio build. Currently thread local storage is
  67. only used by the Fixed Point cache ECC which we're not enabling. However even
  68. if we later may decide to enable the cache it will fallback on mutexes when
  69. thread local storage is not available. wolfSSL is using __declspec(thread) to
  70. create the thread local storage and that could be a problem for LoadLibrary.
  71. Regarding the options that were added via C_EXTRA_FLAGS:
  72. FP_MAX_BITS=16384
  73. https://www.yassl.com/forums/topic423-cacertorgs-ca-cert-verify-failed-but-withdisablefastmath-it-works.html
  74. "Since root.crt uses a 4096-bit RSA key, you'll need to increase the fastmath
  75. buffer size. You can do this using the define:
  76. FP_MAX_BITS and setting it to 8192."
  77. HAVE_SECRET_CALLBACK
  78. Build wolfSSL with wolfSSL_set_tls13_secret_cb which allows saving TLS 1.3
  79. secrets to SSLKEYLOGFILE.
  80. TFM_TIMING_RESISTANT
  81. https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html
  82. From section 2.4.5 Increasing Performance, USE_FAST_MATH:
  83. "Because the stack memory usage can be larger when using fastmath, we recommend
  84. defining TFM_TIMING_RESISTANT as well when using this option."
  85. USE_WOLF_STRTOK
  86. Build wolfSSL to always use its internal strtok instead of C runtime strtok.
  87. WOLFSSL_DES_ECB
  88. Build wolfSSL with wolfSSL_DES_ecb_encrypt which is needed by libcurl for NTLM.
  89. WOLFSSL_STATIC_DH: Allow TLS_ECDH_ ciphers
  90. WOLFSSL_STATIC_RSA: Allow TLS_RSA_ ciphers
  91. https://github.com/wolfSSL/wolfssl/blob/v3.6.6/README.md#note-1
  92. Static key cipher suites are deprecated and disabled by default since v3.6.6.
  93. */
  94. /* wolfssl options.h
  95. * generated from configure options
  96. *
  97. * Copyright (C) 2006-2022 wolfSSL Inc.
  98. *
  99. * This file is part of wolfSSL. (formerly known as CyaSSL)
  100. *
  101. */
  102. #ifndef WOLFSSL_OPTIONS_H
  103. #define WOLFSSL_OPTIONS_H
  104. #ifdef __cplusplus
  105. extern "C" {
  106. #endif
  107. #undef FP_MAX_BITS
  108. #define FP_MAX_BITS 16384
  109. #undef HAVE_SECRET_CALLBACK
  110. #define HAVE_SECRET_CALLBACK
  111. #undef TFM_TIMING_RESISTANT
  112. #define TFM_TIMING_RESISTANT
  113. #undef USE_WOLF_STRTOK
  114. #define USE_WOLF_STRTOK
  115. #undef WOLFSSL_DES_ECB
  116. #define WOLFSSL_DES_ECB
  117. #undef WOLFSSL_STATIC_DH
  118. #define WOLFSSL_STATIC_DH
  119. #undef WOLFSSL_STATIC_RSA
  120. #define WOLFSSL_STATIC_RSA
  121. #undef TFM_TIMING_RESISTANT
  122. #define TFM_TIMING_RESISTANT
  123. #undef ECC_TIMING_RESISTANT
  124. #define ECC_TIMING_RESISTANT
  125. #undef WC_RSA_BLINDING
  126. #define WC_RSA_BLINDING
  127. #undef WOLFSSL_USE_ALIGN
  128. #define WOLFSSL_USE_ALIGN
  129. #undef WOLFSSL_RIPEMD
  130. #define WOLFSSL_RIPEMD
  131. #undef WOLFSSL_SHA512
  132. #define WOLFSSL_SHA512
  133. #undef WOLFSSL_SHA384
  134. #define WOLFSSL_SHA384
  135. #undef SESSION_CERTS
  136. #define SESSION_CERTS
  137. #undef HAVE_HKDF
  138. #define HAVE_HKDF
  139. #undef HAVE_ECC
  140. #define HAVE_ECC
  141. #undef TFM_ECC256
  142. #define TFM_ECC256
  143. #undef ECC_SHAMIR
  144. #define ECC_SHAMIR
  145. #undef WOLFSSL_ALLOW_TLSV10
  146. #define WOLFSSL_ALLOW_TLSV10
  147. #undef WC_RSA_PSS
  148. #define WC_RSA_PSS
  149. #undef NO_HC128
  150. #define NO_HC128
  151. #undef NO_RABBIT
  152. #define NO_RABBIT
  153. #undef HAVE_POLY1305
  154. #define HAVE_POLY1305
  155. #undef HAVE_ONE_TIME_AUTH
  156. #define HAVE_ONE_TIME_AUTH
  157. #undef HAVE_CHACHA
  158. #define HAVE_CHACHA
  159. #undef HAVE_HASHDRBG
  160. #define HAVE_HASHDRBG
  161. #undef HAVE_TLS_EXTENSIONS
  162. #define HAVE_TLS_EXTENSIONS
  163. #undef HAVE_SNI
  164. #define HAVE_SNI
  165. #undef HAVE_TLS_EXTENSIONS
  166. #define HAVE_TLS_EXTENSIONS
  167. #undef HAVE_ALPN
  168. #define HAVE_ALPN
  169. #undef HAVE_TLS_EXTENSIONS
  170. #define HAVE_TLS_EXTENSIONS
  171. #undef HAVE_SUPPORTED_CURVES
  172. #define HAVE_SUPPORTED_CURVES
  173. #undef HAVE_FFDHE_2048
  174. #define HAVE_FFDHE_2048
  175. #undef HAVE_SUPPORTED_CURVES
  176. #define HAVE_SUPPORTED_CURVES
  177. #undef WOLFSSL_TLS13
  178. #define WOLFSSL_TLS13
  179. #undef HAVE_TLS_EXTENSIONS
  180. #define HAVE_TLS_EXTENSIONS
  181. #undef HAVE_EXTENDED_MASTER
  182. #define HAVE_EXTENDED_MASTER
  183. #undef WOLFSSL_ALT_CERT_CHAINS
  184. #define WOLFSSL_ALT_CERT_CHAINS
  185. #undef WOLFSSL_TEST_CERT
  186. #define WOLFSSL_TEST_CERT
  187. #undef NO_RC4
  188. #define NO_RC4
  189. #undef HAVE_ENCRYPT_THEN_MAC
  190. #define HAVE_ENCRYPT_THEN_MAC
  191. #undef NO_PSK
  192. #define NO_PSK
  193. #undef NO_MD4
  194. #define NO_MD4
  195. #undef WOLFSSL_ENCRYPTED_KEYS
  196. #define WOLFSSL_ENCRYPTED_KEYS
  197. #undef USE_FAST_MATH
  198. #define USE_FAST_MATH
  199. #undef WC_NO_ASYNC_THREADING
  200. #define WC_NO_ASYNC_THREADING
  201. #undef HAVE_DH_DEFAULT_PARAMS
  202. #define HAVE_DH_DEFAULT_PARAMS
  203. #undef WOLFSSL_CERT_GEN
  204. #define WOLFSSL_CERT_GEN
  205. #undef OPENSSL_EXTRA
  206. #define OPENSSL_EXTRA
  207. #undef WOLFSSL_ALWAYS_VERIFY_CB
  208. #define WOLFSSL_ALWAYS_VERIFY_CB
  209. #undef WOLFSSL_VERIFY_CB_ALL_CERTS
  210. #define WOLFSSL_VERIFY_CB_ALL_CERTS
  211. #undef WOLFSSL_EXTRA_ALERTS
  212. #define WOLFSSL_EXTRA_ALERTS
  213. #undef HAVE_EXT_CACHE
  214. #define HAVE_EXT_CACHE
  215. #undef WOLFSSL_FORCE_CACHE_ON_TICKET
  216. #define WOLFSSL_FORCE_CACHE_ON_TICKET
  217. #undef WOLFSSL_AKID_NAME
  218. #define WOLFSSL_AKID_NAME
  219. #undef HAVE_CTS
  220. #define HAVE_CTS
  221. #undef GCM_TABLE_4BIT
  222. #define GCM_TABLE_4BIT
  223. #undef HAVE_AESGCM
  224. #define HAVE_AESGCM
  225. #undef HAVE_WC_INTROSPECTION
  226. #define HAVE_WC_INTROSPECTION
  227. #ifdef __cplusplus
  228. }
  229. #endif
  230. #endif /* WOLFSSL_OPTIONS_H */