user_settings.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2023 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. /* should be renamed to user_settings.h for customer use
  22. * generated from configure options ./configure --enable-all
  23. *
  24. * Cleaned up by David Garske
  25. */
  26. #ifndef WOLFSSL_USER_SETTINGS_H
  27. #define WOLFSSL_USER_SETTINGS_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /* Usually comes from configure -> config.h */
  32. #define HAVE_SYS_TIME_H
  33. /* Features */
  34. #define SINGLE_THREADED
  35. #define WOLFSSL_IGNORE_FILE_WARN /* Ignore *.c include warnings */
  36. #define WOLFSSL_PUBLIC_MP /* Make math API's public */
  37. #define WOLFSSL_ENCRYPTED_KEYS /* Support for encrypted keys PKCS8 */
  38. //#define WOLFSSL_SYS_CA_CERTS /* Enable ability to load CA certs from OS */
  39. #if 0 /* Not needed */
  40. #define KEEP_PEER_CERT /* Retain peer's certificate */
  41. #define KEEP_OUR_CERT /* Keep our certificate */
  42. #define WOLFSSL_ALWAYS_VERIFY_CB /* Always call verify callback (configured via wolfSSL_CTX_set_verify API) */
  43. #define WOLFSSL_VERIFY_CB_ALL_CERTS /* Call verify callback for all intermediate certs */
  44. #define WOLFSSL_ALWAYS_KEEP_SNI
  45. #define WOLFSSL_EXTRA_ALERTS /* Allow sending other TLS alerts */
  46. #define HAVE_EX_DATA /* Enable "extra" EX data API's for user information in CTX/WOLFSSL */
  47. #define HAVE_EXT_CACHE
  48. #define ATOMIC_USER /* Enable Atomic Record Layer callbacks */
  49. #define HAVE_PK_CALLBACKS /* Enable public key callbacks */
  50. #define WOLFSSL_ALT_NAMES /* Allow alternate cert chain validation to any trusted cert (not entire chain presented by peer) */
  51. #define HAVE_NULL_CIPHER /* Enable use of TLS cipher suites without cipher (clear text / no encryption) */
  52. #define WOLFSSL_HAVE_CERT_SERVICE
  53. #define WOLFSSL_JNI
  54. #define WOLFSSL_SEP /* certificate policy set extension */
  55. #define WOLFCRYPT_HAVE_SRP
  56. #define WOLFSSL_HAVE_WOLFSCEP
  57. #define HAVE_PKCS7
  58. #define WOLFSSL_SIGNER_DER_CERT
  59. #define WOLFSSL_TRUST_PEER_CERT
  60. #define WOLFSSL_WOLFSSH
  61. #define WC_NO_ASYNC_THREADING
  62. #endif
  63. /* TLS Features */
  64. #define WOLFSSL_TLS13
  65. #define WOLFSSL_EITHER_SIDE /* allow generic server/client method for WOLFSSL_CTX new */
  66. #define WOLFSSL_TLS13_NO_PEEK_HANDSHAKE_DONE
  67. /* DTLS */
  68. #define WOLFSSL_DTLS
  69. // #define WOLFSSL_MULTICAST
  70. #define WOLFSSL_DTLS13
  71. /* DG Disabled SSLv3 and TLSv1.0 - should avoid using */
  72. //#define WOLFSSL_ALLOW_SSLV3
  73. //#define WOLFSSL_ALLOW_TLSV10
  74. /* TLS Extensions */
  75. #define HAVE_TLS_EXTENSIONS
  76. #define HAVE_SUPPORTED_CURVES
  77. #define HAVE_ONE_TIME_AUTH
  78. #define HAVE_SNI
  79. #define HAVE_ALPN
  80. #define HAVE_MAX_FRAGMENT
  81. #define HAVE_TRUNCATED_HMAC
  82. #define HAVE_SESSION_TICKET
  83. #define WOLFSSL_TICKET_HAVE_ID
  84. #define WOLFSSL_FORCE_CACHE_ON_TICKET
  85. #define HAVE_EXTENDED_MASTER
  86. #define HAVE_TRUSTED_CA
  87. #define HAVE_ENCRYPT_THEN_MAC
  88. #define WOLFSSL_POST_HANDSHAKE_AUTH
  89. #define WOLFSSL_SEND_HRR_COOKIE /* Used by DTLS v1.3 */
  90. #define HAVE_ANON /* anon cipher suites */
  91. #define HAVE_FALLBACK_SCSV /* TLS_FALLBACK_SCSV */
  92. #define WOLFSSL_EARLY_DATA
  93. #define HAVE_SERVER_RENEGOTIATION_INFO
  94. /* TLS Session Cache */
  95. #define SESSION_CERTS
  96. #define PERSIST_SESSION_CACHE
  97. #define PERSIST_CERT_CACHE
  98. /* Key and Certificate Generation */
  99. #define WOLFSSL_KEY_GEN
  100. #define WOLFSSL_CERT_GEN
  101. #define WOLFSSL_CERT_REQ
  102. #define WOLFSSL_CERT_EXT
  103. #define WOLFSSL_MULTI_ATTRIB
  104. #define HAVE_SMIME
  105. #define WOLFSSL_DER_LOAD
  106. #define ASN_BER_TO_DER /* BER to DER support */
  107. #define WOLFSSL_HAVE_ISSUER_NAMES /* Store pointers to issuer name components and their lengths and encodings */
  108. #define WOLFSSL_SUBJ_DIR_ATTR /* Enable support for SubjectDirectoryAttributes extension */
  109. #define WOLFSSL_SUBJ_INFO_ACC /* Enable support for SubjectInfoAccess extension */
  110. #define WOLFSSL_CERT_NAME_ALL /* Adds more certificate name capability at the cost of taking up more memory. Adds initials, givenname, dnQualifer for example */
  111. #define WOLFSSL_FPKI /* Enable support for FPKI (Federal PKI) extensions */
  112. #define WOLFSSL_AKID_NAME /* Enable support for full AuthorityKeyIdentifier extension. Only supports copying full AKID from an existing certificate */
  113. #define HAVE_CTS /* Ciphertext stealing interface */
  114. #define WOLFSSL_PEM_TO_DER
  115. #define WOLFSSL_DER_TO_PEM
  116. #define WOLFSSL_CUSTOM_OID
  117. #define HAVE_OID_ENCODING
  118. #define WOLFSSL_ASN_TEMPLATE
  119. /* Certificate Revocation */
  120. #define HAVE_OCSP
  121. #define HAVE_CERTIFICATE_STATUS_REQUEST
  122. #define HAVE_CERTIFICATE_STATUS_REQUEST_V2
  123. #define HAVE_CRL
  124. #define HAVE_CRL_IO
  125. #define HAVE_IO_TIMEOUT
  126. //#define HAVE_CRL_MONITOR /* DG Disabled (Monitors CRL files on filesystem) - not portable feature */
  127. #if 1
  128. /* sp_int.c */
  129. #define WOLFSSL_SP_MATH_ALL
  130. #else
  131. /* Fast math key size 4096-bit max */
  132. #define USE_FAST_MATH
  133. #endif
  134. //#define HAVE___UINT128_T 1 /* DG commented: May not be portable */
  135. /* Max Sizes */
  136. #define RSA_MAX_SIZE 4096
  137. #define FP_MAX_BITS 8192
  138. #define SP_INT_BITS 4096
  139. /* Timing Resistance */
  140. #define TFM_TIMING_RESISTANT
  141. #define ECC_TIMING_RESISTANT
  142. #define WC_RSA_BLINDING
  143. /* DH Key Sizes */
  144. #define HAVE_FFDHE_2048
  145. #define HAVE_FFDHE_3072
  146. #define WOLFSSL_DH_EXTRA /* Enable additional DH key import/export */
  147. #define HAVE_DH_DEFAULT_PARAMS
  148. /* ECC Features */
  149. #define HAVE_ECC
  150. #define TFM_ECC256
  151. #define ECC_SHAMIR
  152. #define WOLFSSL_CUSTOM_CURVES /* enable other curves (not just prime) */
  153. #define HAVE_ECC_SECPR2
  154. #define HAVE_ECC_SECPR3
  155. #define HAVE_ECC_BRAINPOOL
  156. #define HAVE_ECC_KOBLITZ
  157. #define HAVE_ECC_CDH /* Co-factor */
  158. #define HAVE_COMP_KEY /* Compressed key support */
  159. #define FP_ECC /* Fixed point caching - speed repeated operations against same key */
  160. #define HAVE_ECC_ENCRYPT
  161. #define WOLFCRYPT_HAVE_ECCSI
  162. #define WOLFCRYPT_HAVE_SAKKE
  163. #define WOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT
  164. /* RSA */
  165. #define WC_RSA_PSS
  166. #define WOLFSSL_PSS_LONG_SALT
  167. #define WC_RSA_NO_PADDING
  168. /* AES */
  169. #define HAVE_AES_DECRYPT
  170. #define HAVE_AES_ECB
  171. #define WOLFSSL_AES_DIRECT
  172. #define WOLFSSL_AES_COUNTER
  173. #define HAVE_AESGCM
  174. #define GCM_TABLE_4BIT
  175. #define WOLFSSL_AESGCM_STREAM
  176. #define HAVE_AESCCM
  177. #define WOLFSSL_AES_OFB
  178. #define WOLFSSL_AES_CFB
  179. #define WOLFSSL_AES_XTS
  180. #define HAVE_AES_KEYWRAP
  181. #define WOLFSSL_AES_CBC_LENGTH_CHECKS
  182. #define WOLFSSL_USE_ALIGN
  183. #define WOLFSSL_AES_SIV
  184. /* Hashing */
  185. #define WOLFSSL_SHA224
  186. #define WOLFSSL_SHA512
  187. #define WOLFSSL_SHA384
  188. #define WOLFSSL_SHAKE256
  189. #define WOLFSSL_SHA3
  190. #define WOLFSSL_HASH_FLAGS /* enable hash flag API's */
  191. #define WOLFSSL_SHAKE256
  192. /* Additional Algorithms */
  193. #define HAVE_HASHDRBG
  194. #define HAVE_CURVE25519
  195. #define HAVE_ED25519
  196. #define WOLFSSL_ED25519_STREAMING_VERIFY
  197. #define CURVED25519_SMALL
  198. #define HAVE_ED448
  199. #define WOLFSSL_ED448_STREAMING_VERIFY
  200. #define HAVE_CURVE448
  201. #define HAVE_POLY1305
  202. #define HAVE_CHACHA
  203. #define HAVE_XCHACHA
  204. #define HAVE_HKDF
  205. #define HAVE_X963_KDF
  206. #define WOLFSSL_CMAC
  207. #define WOLFSSL_DES_ECB
  208. #define HAVE_BLAKE2
  209. #define HAVE_BLAKE2B
  210. #define HAVE_BLAKE2S
  211. #define WOLFSSL_SIPHASH
  212. #define HAVE_KEYING_MATERIAL
  213. #define WOLFSSL_HAVE_PRF
  214. /* Encrypted Client Hello */
  215. #define HAVE_HPKE
  216. #define HAVE_ECH
  217. /* Non-Standard Algorithms (DG disabled) */
  218. //#define HAVE_CAMELLIA
  219. //#define WOLFSSL_RIPEMD
  220. //#define HAVE_SCRYPT
  221. //#define WOLFSSL_MD2
  222. //#define WOLFSSL_ALLOW_RC4
  223. /* Encoding */
  224. #define WOLFSSL_BASE16
  225. #define WOLFSSL_BASE64_ENCODE
  226. /* Openssl compatibility */
  227. #if 0 /* DG Disabled */
  228. /* Openssl compatibility API's */
  229. #define OPENSSL_EXTRA
  230. #define OPENSSL_ALL
  231. #define HAVE_OPENSSL_CMD
  232. #define SSL_TXT_TLSV1_2
  233. #define SSL_TXT_TLSV1_1
  234. #define OPENSSL_NO_SSL2
  235. #define OPENSSL_NO_SSL3
  236. #define NO_OLD_RNGNAME
  237. #define NO_OLD_WC_NAMES
  238. #define NO_OLD_SSL_NAMES
  239. #define NO_OLD_SHA_NAMES
  240. #define NO_OLD_MD5_NAME
  241. #define OPENSSL_NO_EC /* macro to enable ECC in openssl */
  242. #define WOLFSSL_VERBOSE_ERRORS
  243. #define ERROR_QUEUE_PER_THREAD
  244. #define WOLFSSL_ERROR_CODE_OPENSSL
  245. #define HAVE_WOLFSSL_SSL_H 1
  246. #define OPENSSL_COMPATIBLE_DEFAULTS
  247. /* Openssl compatibility application specific */
  248. #define WOLFSSL_LIBWEBSOCKETS
  249. #define WOLFSSL_OPENSSH
  250. #define WOLFSSL_QT
  251. #define FORTRESS
  252. #define HAVE_WEBSERVER
  253. #define HAVE_LIGHTY
  254. #define WOLFSSL_NGINX
  255. #define WOLFSSL_HAPROXY
  256. #define HAVE_STUNNEL
  257. #define WOLFSSL_ASIO
  258. #define ASIO_USE_WOLFSSL
  259. #define BOOST_ASIO_USE_WOLFSSL
  260. #define WOLFSSL_OPENVPN
  261. #define NO_WOLFSSL_STUB
  262. #endif
  263. /* TLS static cipher support - off by default */
  264. #if 0
  265. #define WOLFSSL_STATIC_RSA
  266. #define WOLFSSL_STATIC_DH
  267. #define WOLFSSL_STATIC_PSK
  268. #endif
  269. /* TLS sniffer support - off by default */
  270. #if 0
  271. #define WOLFSSL_STATIC_EPHEMERAL
  272. #define WOLFSSL_SNIFFER
  273. #endif
  274. /* Deprecated */
  275. #define NO_DSA
  276. #define NO_MD4
  277. #define NO_MD5
  278. #define NO_OLD_TLS
  279. /* Used to manually test disable edge cases */
  280. #ifdef TEST_DISABLES
  281. #define NO_SESSION_CACHE
  282. //#define NO_ECC256
  283. //#define NO_ECC_KEY_EXPORT
  284. //#define NO_ECC_DHE
  285. //#define NO_ECC_SIGN
  286. //#define NO_ECC_VERIFY
  287. //#define NO_RSA
  288. #define NO_DH
  289. #define NO_SHA
  290. #define NO_SHA256
  291. #ifdef NO_SHA256
  292. #undef WOLFSSL_SHA224
  293. #endif
  294. #define NO_SHA512
  295. #ifdef NO_SHA512
  296. #undef WOLFSSL_SHA384
  297. #undef WOLFSSL_SHA512
  298. #undef HAVE_ED25519
  299. #endif
  300. //#define NO_KDF
  301. //#define NO_HMAC
  302. #define NO_RC4
  303. #define NO_DES3
  304. //#define NO_AES
  305. #define NO_AES_CBC
  306. #define WOLFSSL_NO_SHAKE128
  307. #define NO_PSK
  308. #define NO_PWDBASED
  309. //#define WOLFSSL_NO_TLS12
  310. //#define NO_64BIT
  311. #define WOLFSSL_SP_NO_MALLOC
  312. #define NO_FILESYSTEM
  313. #define NO_WRITEV
  314. #define NO_ERROR_STRINGS
  315. //#define NO_WOLFSSL_CLIENT
  316. //#define NO_WOLFSSL_SERVER
  317. #define NO_MULTIBYTE_PRINT
  318. //#define NO_ASN_TIME
  319. //#define NO_ASN_CRYPT
  320. //#define NO_CODING
  321. #define NO_SIG_WRAPPER
  322. //#define NO_HASH_WRAPPER
  323. //#define WC_NO_HARDEN
  324. //#define NO_CERTS
  325. //#define NO_ASN
  326. #endif
  327. #ifdef __cplusplus
  328. }
  329. #endif
  330. #endif /* WOLFSSL_USER_SETTINGS_H */