wolfssl_options.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) 1998 - 2020, 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.haxx.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 v3.11.0 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. -DTFM_TIMING_RESISTANT \
  35. -DWOLFSSL_STATIC_DH \
  36. -DWOLFSSL_STATIC_RSA \
  37. " \
  38. ./configure --prefix=/usr/local \
  39. --disable-jobserver \
  40. --enable-aesgcm \
  41. --enable-alpn \
  42. --enable-certgen \
  43. --enable-des3 \
  44. --enable-dh \
  45. --enable-dsa \
  46. --enable-ecc \
  47. --enable-eccshamir \
  48. --enable-fastmath \
  49. --enable-opensslextra \
  50. --enable-ripemd \
  51. --enable-sessioncerts \
  52. --enable-sha512 \
  53. --enable-sni \
  54. --enable-sslv3 \
  55. --enable-supportedcurves \
  56. --enable-testcert \
  57. > config.out 2>&1
  58. Two generated options HAVE_THREAD_LS and _POSIX_THREADS were removed since they
  59. are inapplicable for our Visual Studio build. Currently thread local storage is
  60. only used by the Fixed Point cache ECC which we're not enabling. However even
  61. if we later may decide to enable the cache it will fallback on mutexes when
  62. thread local storage is not available. wolfSSL is using __declspec(thread) to
  63. create the thread local storage and that could be a problem for LoadLibrary.
  64. Regarding the options that were added via C_EXTRA_FLAGS:
  65. FP_MAX_BITS=16384
  66. https://www.yassl.com/forums/topic423-cacertorgs-ca-cert-verify-failed-but-withdisablefastmath-it-works.html
  67. "Since root.crt uses a 4096-bit RSA key, you'll need to increase the fastmath
  68. buffer size. You can do this using the define:
  69. FP_MAX_BITS and setting it to 8192."
  70. TFM_TIMING_RESISTANT
  71. https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html
  72. From section 2.4.5 Increasing Performance, USE_FAST_MATH:
  73. "Because the stack memory usage can be larger when using fastmath, we recommend
  74. defining TFM_TIMING_RESISTANT as well when using this option."
  75. WOLFSSL_STATIC_DH: Allow TLS_ECDH_ ciphers
  76. WOLFSSL_STATIC_RSA: Allow TLS_RSA_ ciphers
  77. https://github.com/wolfSSL/wolfssl/blob/v3.6.6/README.md#note-1
  78. Static key cipher suites are deprecated and disabled by default since v3.6.6.
  79. */
  80. /* wolfssl options.h
  81. * generated from configure options
  82. *
  83. * Copyright (C) 2006-2015 wolfSSL Inc.
  84. *
  85. * This file is part of wolfSSL. (formerly known as CyaSSL)
  86. *
  87. */
  88. #ifndef WOLFSSL_OPTIONS_H
  89. #define WOLFSSL_OPTIONS_H
  90. #ifdef __cplusplus
  91. extern "C" {
  92. #endif
  93. #undef FP_MAX_BITS
  94. #define FP_MAX_BITS 16384
  95. #undef TFM_TIMING_RESISTANT
  96. #define TFM_TIMING_RESISTANT
  97. #undef WOLFSSL_STATIC_DH
  98. #define WOLFSSL_STATIC_DH
  99. #undef WOLFSSL_STATIC_RSA
  100. #define WOLFSSL_STATIC_RSA
  101. #undef OPENSSL_EXTRA
  102. #define OPENSSL_EXTRA
  103. /*
  104. The commented out defines below are the equivalent of --enable-tls13.
  105. Uncomment them to build wolfSSL with TLS 1.3 support as of v3.11.1-tls13-beta.
  106. This is for experimenting only, afaict TLS 1.3 support doesn't appear to be
  107. functioning correctly yet. https://github.com/wolfSSL/wolfssl/pull/943
  108. #undef WC_RSA_PSS
  109. #define WC_RSA_PSS
  110. #undef WOLFSSL_TLS13
  111. #define WOLFSSL_TLS13
  112. #undef HAVE_TLS_EXTENSIONS
  113. #define HAVE_TLS_EXTENSIONS
  114. #undef HAVE_FFDHE_2048
  115. #define HAVE_FFDHE_2048
  116. #undef HAVE_HKDF
  117. #define HAVE_HKDF
  118. */
  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 HAVE_AESGCM
  126. #define HAVE_AESGCM
  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 WOLFSSL_CERT_GEN
  136. #define WOLFSSL_CERT_GEN
  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_SSLV3
  144. #define WOLFSSL_ALLOW_SSLV3
  145. #undef NO_RC4
  146. #define NO_RC4
  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_EXTENDED_MASTER
  172. #define HAVE_EXTENDED_MASTER
  173. #undef WOLFSSL_TEST_CERT
  174. #define WOLFSSL_TEST_CERT
  175. #undef NO_PSK
  176. #define NO_PSK
  177. #undef NO_MD4
  178. #define NO_MD4
  179. #undef USE_FAST_MATH
  180. #define USE_FAST_MATH
  181. #undef WC_NO_ASYNC_THREADING
  182. #define WC_NO_ASYNC_THREADING
  183. #ifdef __cplusplus
  184. }
  185. #endif
  186. #endif /* WOLFSSL_OPTIONS_H */