user_settings.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2024 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. /* Custom wolfSSL user settings for GCC ARM */
  22. #ifndef WOLFSSL_USER_SETTINGS_H
  23. #define WOLFSSL_USER_SETTINGS_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* ------------------------------------------------------------------------- */
  28. /* Platform */
  29. /* ------------------------------------------------------------------------- */
  30. #undef WOLFSSL_GENERAL_ALIGNMENT
  31. #define WOLFSSL_GENERAL_ALIGNMENT 4
  32. /* Multi-threaded support */
  33. #undef SINGLE_THREADED
  34. #if 0
  35. #define SINGLE_THREADED
  36. #else
  37. #define ERROR_QUEUE_PER_THREAD /* if applicable otherwise comment out */
  38. #endif
  39. #ifdef SINGLE_THREADED
  40. #undef NO_THREAD_LS
  41. #define NO_THREAD_LS
  42. #endif
  43. #undef WOLFSSL_USER_IO
  44. //#define WOLFSSL_USER_IO
  45. #undef NO_WRITE_TEMP_FILES
  46. #define NO_WRITE_TEMP_FILES
  47. /* FIPS 140-3 OE specific section(s) */
  48. /* Uncomment for Android devices */
  49. #undef ANDROID_V454
  50. /* #define ANDROID_V454 */
  51. #ifdef ANDROID_V454
  52. #if 1
  53. /* To have all printouts go to the app view on the device use: */
  54. extern int appendToTextView(const char* fmt, ...);
  55. #undef printf
  56. #define printf(format, ...) appendToTextView(format, ## __VA_ARGS__)
  57. #else
  58. #include <android/log.h>
  59. #define WOLFLOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "wolfCrypt_android", __VA_ARGS__)
  60. #undef printf
  61. #define printf WOLFLOGV
  62. #endif
  63. #endif
  64. /* Uncomment for WINCE 6.0 devices. NOTE: _WIN32_WCE defined by system */
  65. #if 0
  66. #define NO_WOLFSSL_DIR
  67. #define WOLFSSL_NO_ATOMICS
  68. #define WC_NO_ASYNC_THREADING
  69. #define USE_WINDOWS_API
  70. #define WOLFSSL_SMALL_STACK
  71. #endif
  72. /* Uncomment for iOS devices with PAA */
  73. #undef IPHONE
  74. /* #define IPHONE */
  75. #ifdef IPHONE
  76. #define YES_WPAA
  77. #endif
  78. /* ------------------------------------------------------------------------- */
  79. /* Math Configuration */
  80. /* ------------------------------------------------------------------------- */
  81. #undef SIZEOF_LONG_LONG
  82. #define SIZEOF_LONG_LONG 8
  83. #undef USE_FAST_MATH
  84. #if 0
  85. #define USE_FAST_MATH
  86. #undef TFM_TIMING_RESISTANT
  87. #define TFM_TIMING_RESISTANT
  88. #undef TFM_NO_ASM
  89. //#define TFM_NO_ASM
  90. /* Optimizations */
  91. //#define TFM_ARM
  92. /* Maximum math bits (Max RSA key bits * 2) */
  93. #undef FP_MAX_BITS
  94. #define FP_MAX_BITS 16384
  95. #else
  96. #define WOLFSSL_SP_MATH_ALL
  97. #define WOLFSSL_SP_INT_NEGATIVE
  98. /* Maximum math bits (largest supported key bits) */
  99. #undef SP_INT_BITS
  100. #define SP_INT_BITS 8192
  101. #endif
  102. /* Wolf Single Precision Math */
  103. #undef WOLFSSL_SP
  104. #if 1 /* SP Assembly Speedups (wPAA) */
  105. #define WOLFSSL_SP
  106. //#define WOLFSSL_SP_SMALL /* use smaller version of code */
  107. #define WOLFSSL_SP_1024
  108. #define WOLFSSL_SP_4096 /* Explicitly enable 4096-bit support (2048/3072 on by default) */
  109. #define WOLFSSL_SP_384 /* Explicitly enable 384-bit support (others on by default) */
  110. #define WOLFSSL_SP_521 /* Explicitly enable 521-bit support (others on by default) */
  111. #define WOLFSSL_HAVE_SP_RSA
  112. #define WOLFSSL_HAVE_SP_DH
  113. #define WOLFSSL_HAVE_SP_ECC
  114. /* If no PAA, leave out */
  115. #if defined(IPHONE) && defined(YES_WPAA)
  116. #define WOLFSSL_SP_ASM
  117. #define WOLFSSL_ARMASM
  118. #define WOLFSSL_SP_ARM64
  119. #define WOLFSSL_SP_ARM64_ASM
  120. #endif
  121. #endif
  122. /* ------------------------------------------------------------------------- */
  123. /* FIPS - Requires eval or license from wolfSSL */
  124. /* ------------------------------------------------------------------------- */
  125. #undef HAVE_FIPS
  126. #if 1
  127. #define WOLFCRYPT_FIPS_CORE_HASH_VALUE E10668763A70618419DF0D90190AE23B47D07BBF613F4CD73A54339B0F672203
  128. #define HAVE_FIPS
  129. #undef HAVE_FIPS_VERSION
  130. #define HAVE_FIPS_VERSION 5
  131. #undef HAVE_FIPS_VERSION_MINOR
  132. #define HAVE_FIPS_VERSION_MINOR 2
  133. #undef WOLFSSL_WOLFSSH
  134. #define WOLFSSL_WOLFSSH
  135. #undef WC_RNG_SEED_CB
  136. #define WC_RNG_SEED_CB
  137. #if 0
  138. #undef NO_ATTRIBUTE_CONSTRUCTOR
  139. #define NO_ATTRIBUTE_CONSTRUCTOR
  140. #endif
  141. #endif
  142. /* ------------------------------------------------------------------------- */
  143. /* Crypto */
  144. /* ------------------------------------------------------------------------- */
  145. /* RSA */
  146. #undef NO_RSA
  147. #if 1
  148. /* half as much memory but twice as slow */
  149. #undef RSA_LOW_MEM
  150. //#define RSA_LOW_MEM
  151. /* Enables blinding mode, to prevent timing attacks */
  152. #if 1
  153. #undef WC_RSA_BLINDING
  154. #define WC_RSA_BLINDING
  155. #else
  156. #undef WC_NO_HARDEN
  157. #define WC_NO_HARDEN
  158. #endif
  159. /* RSA PSS Support */
  160. #if 1
  161. #undef WC_RSA_PSS
  162. #define WC_RSA_PSS
  163. #undef WOLFSSL_PSS_LONG_SALT
  164. #define WOLFSSL_PSS_LONG_SALT
  165. #undef WOLFSSL_PSS_SALT_LEN_DISCOVER
  166. #define WOLFSSL_PSS_SALT_LEN_DISCOVER
  167. #endif
  168. #if 1
  169. #define WC_RSA_NO_PADDING
  170. #endif
  171. #else
  172. #define NO_RSA
  173. #endif
  174. /* ECC */
  175. #undef HAVE_ECC
  176. #if 1
  177. #define HAVE_ECC
  178. /* Manually define enabled curves */
  179. #undef ECC_USER_CURVES
  180. #define ECC_USER_CURVES
  181. #ifdef ECC_USER_CURVES
  182. /* Manual Curve Selection */
  183. #define HAVE_ECC192
  184. #define HAVE_ECC224
  185. #undef NO_ECC256
  186. #define HAVE_ECC256
  187. #define HAVE_ECC384
  188. #define HAVE_ECC521
  189. #endif
  190. /* Fixed point cache (speeds repeated operations against same private key) */
  191. #undef FP_ECC
  192. //#define FP_ECC
  193. #ifdef FP_ECC
  194. /* Bits / Entries */
  195. #undef FP_ENTRIES
  196. #define FP_ENTRIES 2
  197. #undef FP_LUT
  198. #define FP_LUT 4
  199. #endif
  200. /* Optional ECC calculation method */
  201. /* Note: doubles heap usage, but slightly faster */
  202. #undef ECC_SHAMIR
  203. #define ECC_SHAMIR
  204. /* Reduces heap usage, but slower */
  205. #undef ECC_TIMING_RESISTANT
  206. #define ECC_TIMING_RESISTANT
  207. #ifdef HAVE_FIPS
  208. #undef HAVE_ECC_CDH
  209. #define HAVE_ECC_CDH /* Enable cofactor support */
  210. #undef NO_STRICT_ECDSA_LEN
  211. #define NO_STRICT_ECDSA_LEN /* Do not force fixed len w/ FIPS */
  212. #undef WOLFSSL_VALIDATE_ECC_IMPORT
  213. #define WOLFSSL_VALIDATE_ECC_IMPORT /* Validate import */
  214. #undef WOLFSSL_VALIDATE_ECC_KEYGEN
  215. #define WOLFSSL_VALIDATE_ECC_KEYGEN /* Validate generated keys */
  216. #undef WOLFSSL_ECDSA_SET_K
  217. #define WOLFSSL_ECDSA_SET_K
  218. #endif
  219. /* Compressed Key Support */
  220. #undef HAVE_COMP_KEY
  221. #define HAVE_COMP_KEY
  222. /* Use alternate ECC size for ECC math */
  223. #ifdef USE_FAST_MATH
  224. /* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
  225. #ifdef NO_RSA
  226. /* Custom fastmath size if not using RSA */
  227. #undef FP_MAX_BITS
  228. #define FP_MAX_BITS (256 * 2)
  229. #else
  230. #undef ALT_ECC_SIZE
  231. #define ALT_ECC_SIZE
  232. /* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overridden */
  233. //#undef FP_MAX_BITS_ECC
  234. //#define FP_MAX_BITS_ECC (256 * 2)
  235. #endif
  236. /* Speedups specific to curve */
  237. #ifndef NO_ECC256
  238. #undef TFM_ECC256
  239. #define TFM_ECC256
  240. #endif
  241. #endif
  242. #endif
  243. /* DH */
  244. #undef NO_DH
  245. #if 1
  246. /* Use table for DH instead of -lm (math) lib dependency */
  247. #if 1
  248. #define HAVE_DH_DEFAULT_PARAMS
  249. #define WOLFSSL_DH_CONST
  250. #define HAVE_FFDHE_2048
  251. #define HAVE_FFDHE_3072
  252. #define HAVE_FFDHE_4096
  253. #define HAVE_FFDHE_6144
  254. #define HAVE_FFDHE_8192
  255. #endif
  256. #ifdef HAVE_FIPS
  257. #define WOLFSSL_VALIDATE_FFC_IMPORT
  258. #define HAVE_FFDHE_Q
  259. #endif
  260. #else
  261. #define NO_DH
  262. #endif
  263. /* AES */
  264. #undef NO_AES
  265. #if 1
  266. #undef HAVE_AES_CBC
  267. #define HAVE_AES_CBC
  268. #undef HAVE_AESGCM
  269. #define HAVE_AESGCM
  270. /* GCM Method (slowest to fastest): GCM_SMALL, GCM_WORD32, GCM_TABLE or
  271. * GCM_TABLE_4BIT */
  272. #define GCM_TABLE_4BIT
  273. #undef WOLFSSL_AES_DIRECT
  274. #define WOLFSSL_AES_DIRECT
  275. #undef HAVE_AES_ECB
  276. #define HAVE_AES_ECB
  277. #undef WOLFSSL_AES_COUNTER
  278. #define WOLFSSL_AES_COUNTER
  279. #undef HAVE_AESCCM
  280. #define HAVE_AESCCM
  281. #undef WOLFSSL_AES_OFB
  282. #define WOLFSSL_AES_OFB
  283. #else
  284. #define NO_AES
  285. #endif
  286. /* DES3 */
  287. #undef NO_DES3
  288. #if 0
  289. #if 1
  290. #undef WOLFSSL_DES_ECB
  291. #define WOLFSSL_DES_ECB
  292. #endif
  293. #else
  294. #define NO_DES3
  295. #endif
  296. /* ChaCha20 / Poly1305 */
  297. #undef HAVE_CHACHA
  298. #undef HAVE_POLY1305
  299. #if 0
  300. #define HAVE_CHACHA
  301. #define HAVE_POLY1305
  302. /* Needed for Poly1305 */
  303. #undef HAVE_ONE_TIME_AUTH
  304. #define HAVE_ONE_TIME_AUTH
  305. #endif
  306. /* Ed25519 / Curve25519 */
  307. #undef HAVE_CURVE25519
  308. #undef HAVE_ED25519
  309. #if 0
  310. #define HAVE_CURVE25519
  311. #define HAVE_ED25519 /* ED25519 Requires SHA512 */
  312. /* Optionally use small math (less flash usage, but much slower) */
  313. #if 1
  314. #define CURVED25519_SMALL
  315. #endif
  316. #endif
  317. /* ------------------------------------------------------------------------- */
  318. /* Hashing */
  319. /* ------------------------------------------------------------------------- */
  320. /* Sha */
  321. #undef NO_SHA
  322. #if 1
  323. /* 1k smaller, but 25% slower */
  324. //#define USE_SLOW_SHA
  325. #else
  326. #define NO_SHA
  327. #endif
  328. /* Sha256 */
  329. #undef NO_SHA256
  330. #if 1
  331. /* not unrolled - ~2k smaller and ~25% slower */
  332. //#define USE_SLOW_SHA256
  333. /* Sha224 */
  334. #if 1
  335. #define WOLFSSL_SHA224
  336. #endif
  337. #else
  338. #define NO_SHA256
  339. #endif
  340. /* Sha512 */
  341. #undef WOLFSSL_SHA512
  342. #if 1
  343. #define WOLFSSL_SHA512
  344. #undef WOLFSSL_NOSHA512_224 /* Not in FIPS mode */
  345. #undef WOLFSSL_NOSHA512_256 /* Not in FIPS mode */
  346. /* Sha384 */
  347. #undef WOLFSSL_SHA384
  348. #if 1
  349. #define WOLFSSL_SHA384
  350. #endif
  351. /* over twice as small, but 50% slower */
  352. //#define USE_SLOW_SHA512
  353. #endif
  354. /* Sha3 */
  355. #undef WOLFSSL_SHA3
  356. #if 1
  357. #define WOLFSSL_SHA3
  358. #define NO_OLD_WC_NAMES
  359. #endif
  360. /* MD5 */
  361. #undef NO_MD5
  362. #if 0
  363. #else
  364. #define NO_MD5
  365. #endif
  366. /* HKDF / PRF */
  367. #undef HAVE_HKDF
  368. #if 1
  369. #define HAVE_HKDF
  370. #define WOLFSSL_HAVE_PRF
  371. #endif
  372. /* CMAC */
  373. #undef WOLFSSL_CMAC
  374. #if 1
  375. #define WOLFSSL_CMAC
  376. #endif
  377. /* ------------------------------------------------------------------------- */
  378. /* Benchmark / Test */
  379. /* ------------------------------------------------------------------------- */
  380. /* Use reduced benchmark / test sizes */
  381. #undef BENCH_EMBEDDED
  382. #define BENCH_EMBEDDED
  383. #undef USE_CERT_BUFFERS_2048
  384. #define USE_CERT_BUFFERS_2048
  385. #undef USE_CERT_BUFFERS_1024
  386. //#define USE_CERT_BUFFERS_1024
  387. #undef USE_CERT_BUFFERS_256
  388. #define USE_CERT_BUFFERS_256
  389. /* ------------------------------------------------------------------------- */
  390. /* Debugging */
  391. /* ------------------------------------------------------------------------- */
  392. #undef DEBUG_WOLFSSL
  393. #undef NO_ERROR_STRINGS
  394. #if 0
  395. #define DEBUG_WOLFSSL
  396. #else
  397. #if 0
  398. #define NO_ERROR_STRINGS
  399. #endif
  400. #endif
  401. /* ------------------------------------------------------------------------- */
  402. /* Memory */
  403. /* ------------------------------------------------------------------------- */
  404. /* Override Memory API's */
  405. #if 0
  406. #undef XMALLOC_OVERRIDE
  407. #define XMALLOC_OVERRIDE
  408. /* prototypes for user heap override functions */
  409. /* Note: Realloc only required for normal math */
  410. #include <stddef.h> /* for size_t */
  411. extern void *myMalloc(size_t n, void* heap, int type);
  412. extern void myFree(void *p, void* heap, int type);
  413. extern void *myRealloc(void *p, size_t n, void* heap, int type);
  414. #define XMALLOC(n, h, t) myMalloc(n, h, t)
  415. #define XFREE(p, h, t) myFree(p, h, t)
  416. #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
  417. #endif
  418. #if 0
  419. /* Static memory requires fast math */
  420. #define WOLFSSL_STATIC_MEMORY
  421. /* Disable fallback malloc/free */
  422. #define WOLFSSL_NO_MALLOC
  423. #if 1
  424. #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
  425. #endif
  426. #endif
  427. /* Memory callbacks */
  428. #if 1
  429. #undef USE_WOLFSSL_MEMORY
  430. #define USE_WOLFSSL_MEMORY
  431. /* Use this to measure / print heap usage */
  432. #if 0
  433. #undef WOLFSSL_TRACK_MEMORY
  434. // #define WOLFSSL_TRACK_MEMORY
  435. #undef WOLFSSL_DEBUG_MEMORY
  436. //#define WOLFSSL_DEBUG_MEMORY
  437. #undef WOLFSSL_DEBUG_MEMORY_PRINT
  438. //#define WOLFSSL_DEBUG_MEMORY_PRINT
  439. #endif
  440. #else
  441. #ifndef WOLFSSL_STATIC_MEMORY
  442. #define NO_WOLFSSL_MEMORY
  443. /* Otherwise we will use stdlib malloc, free and realloc */
  444. #endif
  445. #endif
  446. /* ------------------------------------------------------------------------- */
  447. /* Port */
  448. /* ------------------------------------------------------------------------- */
  449. /* Override Current Time */
  450. /* Allows custom "custom_time()" function to be used for benchmark */
  451. //#define WOLFSSL_USER_CURRTIME
  452. //#define WOLFSSL_GMTIME
  453. //#define USER_TICKS
  454. //extern unsigned long my_time(unsigned long* timer);
  455. //#define XTIME my_time
  456. /* ------------------------------------------------------------------------- */
  457. /* RNG */
  458. /* ------------------------------------------------------------------------- */
  459. /* Seed Source */
  460. /* Seed Source */
  461. // extern int my_rng_generate_seed(unsigned char* output, int sz);
  462. // #undef CUSTOM_RAND_GENERATE_SEED
  463. // #define CUSTOM_RAND_GENERATE_SEED my_rng_generate_seed
  464. /* Choose RNG method */
  465. #if 1
  466. /* Use built-in P-RNG (SHA256 based) with HW RNG */
  467. /* P-RNG + HW RNG (P-RNG is ~8K) */
  468. //#define WOLFSSL_GENSEED_FORTEST
  469. #undef HAVE_HASHDRBG
  470. #define HAVE_HASHDRBG
  471. #else
  472. #undef WC_NO_HASHDRBG
  473. #define WC_NO_HASHDRBG
  474. /* Bypass P-RNG and use only HW RNG */
  475. extern int my_rng_gen_block(unsigned char* output, unsigned int sz);
  476. #undef CUSTOM_RAND_GENERATE_BLOCK
  477. #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
  478. #endif
  479. /* ------------------------------------------------------------------------- */
  480. /* Custom Standard Lib */
  481. /* ------------------------------------------------------------------------- */
  482. /* Allows override of all standard library functions */
  483. #undef STRING_USER
  484. #if 0
  485. #define STRING_USER
  486. #include <string.h>
  487. #undef USE_WOLF_STRSEP
  488. #define USE_WOLF_STRSEP
  489. #define XSTRSEP(s1,d) wc_strsep((s1),(d))
  490. #undef USE_WOLF_STRTOK
  491. #define USE_WOLF_STRTOK
  492. #define XSTRTOK(s1,d,ptr) wc_strtok((s1),(d),(ptr))
  493. #define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n))
  494. #define XMEMCPY(d,s,l) memcpy((d),(s),(l))
  495. #define XMEMSET(b,c,l) memset((b),(c),(l))
  496. #define XMEMCMP(s1,s2,n) memcmp((s1),(s2),(n))
  497. #define XMEMMOVE(d,s,l) memmove((d),(s),(l))
  498. #define XSTRLEN(s1) strlen((s1))
  499. #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
  500. #define XSTRSTR(s1,s2) strstr((s1),(s2))
  501. #define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
  502. #define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
  503. #define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
  504. #define XSNPRINTF snprintf
  505. #endif
  506. /* ------------------------------------------------------------------------- */
  507. /* Enable Features */
  508. /* ------------------------------------------------------------------------- */
  509. #undef WOLFSSL_ASN_TEMPLATE
  510. #define WOLFSSL_ASN_TEMPLATE
  511. #undef WOLFSSL_ASN_PRINT
  512. #define WOLFSSL_ASN_PRINT
  513. #undef WOLFSSL_TLS13
  514. #if 1
  515. #define WOLFSSL_TLS13
  516. #endif
  517. #undef WOLFSSL_KEY_GEN
  518. #if 1
  519. #define WOLFSSL_KEY_GEN
  520. #endif
  521. #undef KEEP_PEER_CERT
  522. //#define KEEP_PEER_CERT
  523. #undef HAVE_TLS_EXTENSIONS
  524. #define HAVE_TLS_EXTENSIONS
  525. #undef HAVE_EXTENDED_MASTER
  526. #define HAVE_EXTENDED_MASTER
  527. #undef HAVE_SUPPORTED_CURVES
  528. #define HAVE_SUPPORTED_CURVES
  529. #undef WOLFSSL_BASE64_ENCODE
  530. #define WOLFSSL_BASE64_ENCODE
  531. #undef WOLFSSL_NO_HASH_RAW
  532. #define WOLFSSL_NO_HASH_RAW
  533. /* TLS Session Cache */
  534. #if 1
  535. #define SMALL_SESSION_CACHE
  536. #else
  537. #define NO_SESSION_CACHE
  538. #endif
  539. #undef WOLFSSL_DER_LOAD
  540. #define WOLFSSL_DER_LOAD
  541. #undef HAVE_SESSION_TICKET
  542. #define HAVE_SESSION_TICKET
  543. #undef HAVE_EX_DATA
  544. #define HAVE_EX_DATA
  545. #undef HAVE_ENCRYPT_THEN_MAC
  546. #define HAVE_ENCRYPT_THEN_MAC
  547. #undef WOLFSSL_CERT_GEN
  548. #define WOLFSSL_CERT_GEN
  549. #undef ATOMIC_USER
  550. #define ATOMIC_USER
  551. #undef HAVE_SECRET_CALLBACK
  552. #define HAVE_SECRET_CALLBACK
  553. /* wolfEngine */
  554. #if 0
  555. #define OPENSSL_COEXIST
  556. /* HKDF for engine */
  557. #undef HAVE_HKDF
  558. #if 1
  559. #define HAVE_HKDF
  560. #define HAVE_X963_KDF
  561. #endif
  562. #undef WOLFSSL_PUBLIC_MP
  563. #define WOLFSSL_PUBLIC_MP
  564. #undef NO_OLD_RNGNAME
  565. #define NO_OLD_RNGNAME
  566. #undef NO_OLD_WC_NAMES
  567. #define NO_OLD_WC_NAMES
  568. #undef NO_OLD_SSL_NAMES
  569. #define NO_OLD_SSL_NAMES
  570. #undef NO_OLD_SHA_NAMES
  571. #define NO_OLD_SHA_NAMES
  572. #undef NO_OLD_MD5_NAME
  573. #define NO_OLD_MD5_NAME
  574. #undef NO_OLD_SHA256_NAMES
  575. #define NO_OLD_SHA256_NAMES
  576. #endif
  577. #undef WOLFSSL_SYS_CA_CERTS
  578. //#define WOLFSSL_SYS_CA_CERTS
  579. #undef LIBWOLFSSL_GLOBAL_EXTRA_CFLAGS
  580. #define LIBWOLFSSL_GLOBAL_EXTRA_CFLAGS
  581. #undef HAVE_SERVER_RENEGOTIATION_INFO
  582. #define HAVE_SERVER_RENEGOTIATION_INFO
  583. #undef WOLFSSL_PEM_TO_DER
  584. #define WOLFSSL_PEM_TO_DER
  585. #undef WOLFSSL_PUB_PEM_TO_DER
  586. #define WOLFSSL_PUB_PEM_TO_DER
  587. /* ------------------------------------------------------------------------- */
  588. /* Disable Features */
  589. /* ------------------------------------------------------------------------- */
  590. #undef NO_WOLFSSL_SERVER
  591. //#define NO_WOLFSSL_SERVER
  592. #undef NO_WOLFSSL_CLIENT
  593. //#define NO_WOLFSSL_CLIENT
  594. #undef NO_CRYPT_TEST
  595. //#define NO_CRYPT_TEST
  596. #undef NO_CRYPT_BENCHMARK
  597. //#define NO_CRYPT_BENCHMARK
  598. #undef WOLFCRYPT_ONLY
  599. //#define WOLFCRYPT_ONLY
  600. /* In-lining of misc.c functions */
  601. /* If defined, must include wolfcrypt/src/misc.c in build */
  602. /* Slower, but about 1k smaller */
  603. #undef NO_INLINE
  604. //#define NO_INLINE
  605. #undef NO_FILESYSTEM
  606. //#define NO_FILESYSTEM
  607. #undef NO_WRITEV
  608. //#define NO_WRITEV
  609. #undef NO_MAIN_DRIVER
  610. #define NO_MAIN_DRIVER
  611. #undef NO_DEV_RANDOM
  612. //#define NO_DEV_RANDOM
  613. #undef NO_DSA
  614. #define NO_DSA
  615. #undef NO_RC4
  616. #define NO_RC4
  617. #undef NO_OLD_TLS
  618. #define NO_OLD_TLS
  619. #undef NO_PSK
  620. #define NO_PSK
  621. #undef NO_MD4
  622. #define NO_MD4
  623. #undef NO_PWDBASED
  624. //#define NO_PWDBASED
  625. #undef NO_CODING
  626. //#define NO_CODING
  627. #undef NO_ASN_TIME
  628. //#define NO_ASN_TIME
  629. #undef NO_CERTS
  630. //#define NO_CERTS
  631. #undef NO_SIG_WRAPPER
  632. //#define NO_SIG_WRAPPER
  633. #undef NO_DO178
  634. #define NO_DO178
  635. #undef WOLFSSL_NO_SHAKE128
  636. #define WOLFSSL_NO_SHAKE128
  637. #undef WOLFSSL_NO_SHAKE256
  638. #define WOLFSSL_NO_SHAKE256
  639. /* wolfSSL engineering ACVP algo and operational testing only (Default: Off) */
  640. #if 0
  641. #undef NO_EARLY_BAIL
  642. #define NO_EARLY_BAIL
  643. #undef WOLFSSL_PUBLIC_MP
  644. #define WOLFSSL_PUBLIC_MP
  645. #undef OPTEST_LOGGING_ENABLED
  646. //#define OPTEST_LOGGING_ENABLED
  647. #undef OPTEST_INVALID_LOGGING_ENABLED
  648. //#define OPTEST_INVALID_LOGGING_ENABLED
  649. #undef NO_MAIN_OPTEST_DRIVER
  650. #define NO_MAIN_OPTEST_DRIVER
  651. #undef DEBUG_FIPS_VERBOSE
  652. #define DEBUG_FIPS_VERBOSE
  653. #undef HAVE_FORCE_FIPS_FAILURE
  654. #define HAVE_FORCE_FIPS_FAILURE
  655. #undef NO_WRITE_TEMP_FILES
  656. #define NO_WRITE_TEMPT_FILES
  657. #endif
  658. #ifdef __cplusplus
  659. }
  660. #endif
  661. /* Customer Specific Section */
  662. /* #define CUSTOMER_1_IOS */
  663. #ifdef CUSTOMER_1_IOS
  664. /* not certified, disable for full FIPS compliance, will attempt to include
  665. * in UPDT submission and/or next FS submission */
  666. #undef HAVE_AES_KEYWRAP
  667. #define HAVE_AES_KEYWRAP
  668. #undef HAVE_PKCS7
  669. #define HAVE_PKCS7
  670. #undef HAVE_SNI
  671. #define HAVE_SNI
  672. #undef HAVE_THREAD_LS
  673. #define HAVE_THREAD_LS
  674. /* Not certifiable but external to module boundary and out of scope */
  675. #undef WOLFCRYPT_HAVE_ECCSI
  676. #define WOLFCRYPT_HAVE_ECCSI
  677. /* Not certifiable but external to module boundary and out of scope */
  678. #undef WOLFCRYPT_HAVE_SAKKE
  679. #define WOLFCRYPT_HAVE_SAKKE
  680. #undef WOLFSSL_DTLS
  681. #define WOLFSSL_DTLS
  682. #undef WOLFSSL_DTLS_MTU
  683. #define WOLFSSL_DTLS_MTU
  684. /* OpenSSL Compatibility (NOTE: Incompatible with wolfEngine and
  685. OPENSSL_COEXIST) */
  686. #ifndef OPENSSL_COEXIST
  687. #undef OPENSSL_EXTRA
  688. #if 1
  689. #define OPENSSL_EXTRA
  690. /* Larger footprint but enable ALL compatibility not just a subset */
  691. #if 1
  692. #define OPENSSL_ALL
  693. #endif
  694. #endif
  695. #endif
  696. #endif /* CUSTOMER_1_IOS */
  697. #define CUSTOMER_1_ANDROID
  698. #ifdef CUSTOMER_1_ANDROID
  699. /* TODO */
  700. #endif
  701. #endif /* WOLFSSL_USER_SETTINGS_H */