wolfssl_options.h 7.0 KB

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