wolfssl_options.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. /*
  2. By default wolfSSL has a very conservative configuration that can result in
  3. connections to servers failing due to certificate or algorithm problems.
  4. To remedy this issue for libcurl I've generated this options file that
  5. build-wolfssl will copy to the wolfSSL include directories and will result in
  6. maximum compatibility.
  7. These are the configure options that were used to build wolfSSL v3.11.0 in
  8. mingw and generate the options in this file:
  9. C_EXTRA_FLAGS="\
  10. -Wno-attributes \
  11. -Wno-unused-but-set-variable \
  12. -DFP_MAX_BITS=16384 \
  13. -DTFM_TIMING_RESISTANT \
  14. -DWOLFSSL_STATIC_DH \
  15. -DWOLFSSL_STATIC_RSA \
  16. " \
  17. ./configure --prefix=/usr/local \
  18. --disable-jobserver \
  19. --enable-aesgcm \
  20. --enable-alpn \
  21. --enable-certgen \
  22. --enable-des3 \
  23. --enable-dh \
  24. --enable-dsa \
  25. --enable-ecc \
  26. --enable-eccshamir \
  27. --enable-fastmath \
  28. --enable-opensslextra \
  29. --enable-ripemd \
  30. --enable-sessioncerts \
  31. --enable-sha512 \
  32. --enable-sni \
  33. --enable-sslv3 \
  34. --enable-supportedcurves \
  35. --enable-testcert \
  36. > config.out 2>&1
  37. Two generated options HAVE_THREAD_LS and _POSIX_THREADS were removed since they
  38. are inapplicable for our Visual Studio build. Currently thread local storage is
  39. only used by the Fixed Point cache ECC which we're not enabling. However even
  40. if we later may decide to enable the cache it will fallback on mutexes when
  41. thread local storage is not available. wolfSSL is using __declspec(thread) to
  42. create the thread local storage and that could be a problem for LoadLibrary.
  43. Regarding the options that were added via C_EXTRA_FLAGS:
  44. FP_MAX_BITS=16384
  45. https://www.yassl.com/forums/topic423-cacertorgs-ca-cert-verify-failed-but-withdisablefastmath-it-works.html
  46. "Since root.crt uses a 4096-bit RSA key, you'll need to increase the fastmath
  47. buffer size. You can do this using the define:
  48. FP_MAX_BITS and setting it to 8192."
  49. TFM_TIMING_RESISTANT
  50. https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html
  51. From section 2.4.5 Increasing Performance, USE_FAST_MATH:
  52. "Because the stack memory usage can be larger when using fastmath, we recommend
  53. defining TFM_TIMING_RESISTANT as well when using this option."
  54. WOLFSSL_STATIC_DH: Allow TLS_ECDH_ ciphers
  55. WOLFSSL_STATIC_RSA: Allow TLS_RSA_ ciphers
  56. https://github.com/wolfSSL/wolfssl/blob/v3.6.6/README.md#note-1
  57. Static key cipher suites are deprecated and disabled by default since v3.6.6.
  58. */
  59. /* wolfssl options.h
  60. * generated from configure options
  61. *
  62. * Copyright (C) 2006-2015 wolfSSL Inc.
  63. *
  64. * This file is part of wolfSSL. (formerly known as CyaSSL)
  65. *
  66. */
  67. #ifndef WOLFSSL_OPTIONS_H
  68. #define WOLFSSL_OPTIONS_H
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72. #undef FP_MAX_BITS
  73. #define FP_MAX_BITS 16384
  74. #undef TFM_TIMING_RESISTANT
  75. #define TFM_TIMING_RESISTANT
  76. #undef WOLFSSL_STATIC_DH
  77. #define WOLFSSL_STATIC_DH
  78. #undef WOLFSSL_STATIC_RSA
  79. #define WOLFSSL_STATIC_RSA
  80. #undef OPENSSL_EXTRA
  81. #define OPENSSL_EXTRA
  82. /*
  83. The commented out defines below are the equivalent of --enable-tls13.
  84. Uncomment them to build wolfSSL with TLS 1.3 support as of v3.11.1-tls13-beta.
  85. This is for experimenting only, afaict TLS 1.3 support doesn't appear to be
  86. functioning correctly yet. https://github.com/wolfSSL/wolfssl/pull/943
  87. #undef WC_RSA_PSS
  88. #define WC_RSA_PSS
  89. #undef WOLFSSL_TLS13
  90. #define WOLFSSL_TLS13
  91. #undef HAVE_TLS_EXTENSIONS
  92. #define HAVE_TLS_EXTENSIONS
  93. #undef HAVE_FFDHE_2048
  94. #define HAVE_FFDHE_2048
  95. #undef HAVE_HKDF
  96. #define HAVE_HKDF
  97. */
  98. #undef TFM_TIMING_RESISTANT
  99. #define TFM_TIMING_RESISTANT
  100. #undef ECC_TIMING_RESISTANT
  101. #define ECC_TIMING_RESISTANT
  102. #undef WC_RSA_BLINDING
  103. #define WC_RSA_BLINDING
  104. #undef HAVE_AESGCM
  105. #define HAVE_AESGCM
  106. #undef WOLFSSL_RIPEMD
  107. #define WOLFSSL_RIPEMD
  108. #undef WOLFSSL_SHA512
  109. #define WOLFSSL_SHA512
  110. #undef WOLFSSL_SHA384
  111. #define WOLFSSL_SHA384
  112. #undef SESSION_CERTS
  113. #define SESSION_CERTS
  114. #undef WOLFSSL_CERT_GEN
  115. #define WOLFSSL_CERT_GEN
  116. #undef HAVE_ECC
  117. #define HAVE_ECC
  118. #undef TFM_ECC256
  119. #define TFM_ECC256
  120. #undef ECC_SHAMIR
  121. #define ECC_SHAMIR
  122. #undef WOLFSSL_ALLOW_SSLV3
  123. #define WOLFSSL_ALLOW_SSLV3
  124. #undef NO_RC4
  125. #define NO_RC4
  126. #undef NO_HC128
  127. #define NO_HC128
  128. #undef NO_RABBIT
  129. #define NO_RABBIT
  130. #undef HAVE_POLY1305
  131. #define HAVE_POLY1305
  132. #undef HAVE_ONE_TIME_AUTH
  133. #define HAVE_ONE_TIME_AUTH
  134. #undef HAVE_CHACHA
  135. #define HAVE_CHACHA
  136. #undef HAVE_HASHDRBG
  137. #define HAVE_HASHDRBG
  138. #undef HAVE_TLS_EXTENSIONS
  139. #define HAVE_TLS_EXTENSIONS
  140. #undef HAVE_SNI
  141. #define HAVE_SNI
  142. #undef HAVE_TLS_EXTENSIONS
  143. #define HAVE_TLS_EXTENSIONS
  144. #undef HAVE_ALPN
  145. #define HAVE_ALPN
  146. #undef HAVE_TLS_EXTENSIONS
  147. #define HAVE_TLS_EXTENSIONS
  148. #undef HAVE_SUPPORTED_CURVES
  149. #define HAVE_SUPPORTED_CURVES
  150. #undef HAVE_EXTENDED_MASTER
  151. #define HAVE_EXTENDED_MASTER
  152. #undef WOLFSSL_TEST_CERT
  153. #define WOLFSSL_TEST_CERT
  154. #undef NO_PSK
  155. #define NO_PSK
  156. #undef NO_MD4
  157. #define NO_MD4
  158. #undef USE_FAST_MATH
  159. #define USE_FAST_MATH
  160. #undef WC_NO_ASYNC_THREADING
  161. #define WC_NO_ASYNC_THREADING
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165. #endif /* WOLFSSL_OPTIONS_H */