1
0

user_settings.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  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. /* Note2: XFREE(NULL) must be properly handled */
  411. #include <stddef.h> /* for size_t */
  412. extern void *myMalloc(size_t n, void* heap, int type);
  413. extern void myFree(void *p, void* heap, int type);
  414. extern void *myRealloc(void *p, size_t n, void* heap, int type);
  415. #define XMALLOC(n, h, t) myMalloc(n, h, t)
  416. #define XFREE(p, h, t) myFree(p, h, t)
  417. #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
  418. #endif
  419. #if 0
  420. /* Static memory requires fast math */
  421. #define WOLFSSL_STATIC_MEMORY
  422. /* Disable fallback malloc/free */
  423. #define WOLFSSL_NO_MALLOC
  424. #if 1
  425. #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
  426. #endif
  427. #endif
  428. /* Memory callbacks */
  429. #if 1
  430. #undef USE_WOLFSSL_MEMORY
  431. #define USE_WOLFSSL_MEMORY
  432. /* Use this to measure / print heap usage */
  433. #if 0
  434. #undef WOLFSSL_TRACK_MEMORY
  435. // #define WOLFSSL_TRACK_MEMORY
  436. #undef WOLFSSL_DEBUG_MEMORY
  437. //#define WOLFSSL_DEBUG_MEMORY
  438. #undef WOLFSSL_DEBUG_MEMORY_PRINT
  439. //#define WOLFSSL_DEBUG_MEMORY_PRINT
  440. #endif
  441. #else
  442. #ifndef WOLFSSL_STATIC_MEMORY
  443. #define NO_WOLFSSL_MEMORY
  444. /* Otherwise we will use stdlib malloc, free and realloc */
  445. #endif
  446. #endif
  447. /* ------------------------------------------------------------------------- */
  448. /* Port */
  449. /* ------------------------------------------------------------------------- */
  450. /* Override Current Time */
  451. /* Allows custom "custom_time()" function to be used for benchmark */
  452. //#define WOLFSSL_USER_CURRTIME
  453. //#define WOLFSSL_GMTIME
  454. //#define USER_TICKS
  455. //extern unsigned long my_time(unsigned long* timer);
  456. //#define XTIME my_time
  457. /* ------------------------------------------------------------------------- */
  458. /* RNG */
  459. /* ------------------------------------------------------------------------- */
  460. /* Seed Source */
  461. /* Seed Source */
  462. // extern int my_rng_generate_seed(unsigned char* output, int sz);
  463. // #undef CUSTOM_RAND_GENERATE_SEED
  464. // #define CUSTOM_RAND_GENERATE_SEED my_rng_generate_seed
  465. /* Choose RNG method */
  466. #if 1
  467. /* Use built-in P-RNG (SHA256 based) with HW RNG */
  468. /* P-RNG + HW RNG (P-RNG is ~8K) */
  469. //#define WOLFSSL_GENSEED_FORTEST
  470. #undef HAVE_HASHDRBG
  471. #define HAVE_HASHDRBG
  472. #else
  473. #undef WC_NO_HASHDRBG
  474. #define WC_NO_HASHDRBG
  475. /* Bypass P-RNG and use only HW RNG */
  476. extern int my_rng_gen_block(unsigned char* output, unsigned int sz);
  477. #undef CUSTOM_RAND_GENERATE_BLOCK
  478. #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
  479. #endif
  480. /* ------------------------------------------------------------------------- */
  481. /* Custom Standard Lib */
  482. /* ------------------------------------------------------------------------- */
  483. /* Allows override of all standard library functions */
  484. #undef STRING_USER
  485. #if 0
  486. #define STRING_USER
  487. #include <string.h>
  488. #undef USE_WOLF_STRSEP
  489. #define USE_WOLF_STRSEP
  490. #define XSTRSEP(s1,d) wc_strsep((s1),(d))
  491. #undef USE_WOLF_STRTOK
  492. #define USE_WOLF_STRTOK
  493. #define XSTRTOK(s1,d,ptr) wc_strtok((s1),(d),(ptr))
  494. #define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n))
  495. #define XMEMCPY(d,s,l) memcpy((d),(s),(l))
  496. #define XMEMSET(b,c,l) memset((b),(c),(l))
  497. #define XMEMCMP(s1,s2,n) memcmp((s1),(s2),(n))
  498. #define XMEMMOVE(d,s,l) memmove((d),(s),(l))
  499. #define XSTRLEN(s1) strlen((s1))
  500. #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
  501. #define XSTRSTR(s1,s2) strstr((s1),(s2))
  502. #define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
  503. #define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
  504. #define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
  505. #define XSNPRINTF snprintf
  506. #endif
  507. /* ------------------------------------------------------------------------- */
  508. /* Enable Features */
  509. /* ------------------------------------------------------------------------- */
  510. #undef WOLFSSL_ASN_TEMPLATE
  511. #define WOLFSSL_ASN_TEMPLATE
  512. #undef WOLFSSL_ASN_PRINT
  513. #define WOLFSSL_ASN_PRINT
  514. #undef WOLFSSL_TLS13
  515. #if 1
  516. #define WOLFSSL_TLS13
  517. #endif
  518. #undef WOLFSSL_KEY_GEN
  519. #if 1
  520. #define WOLFSSL_KEY_GEN
  521. #endif
  522. #undef KEEP_PEER_CERT
  523. //#define KEEP_PEER_CERT
  524. #undef HAVE_TLS_EXTENSIONS
  525. #define HAVE_TLS_EXTENSIONS
  526. #undef HAVE_EXTENDED_MASTER
  527. #define HAVE_EXTENDED_MASTER
  528. #undef HAVE_SUPPORTED_CURVES
  529. #define HAVE_SUPPORTED_CURVES
  530. #undef WOLFSSL_BASE64_ENCODE
  531. #define WOLFSSL_BASE64_ENCODE
  532. #undef WOLFSSL_NO_HASH_RAW
  533. #define WOLFSSL_NO_HASH_RAW
  534. /* TLS Session Cache */
  535. #if 1
  536. #define SMALL_SESSION_CACHE
  537. #else
  538. #define NO_SESSION_CACHE
  539. #endif
  540. #undef WOLFSSL_DER_LOAD
  541. #define WOLFSSL_DER_LOAD
  542. #undef HAVE_SESSION_TICKET
  543. #define HAVE_SESSION_TICKET
  544. #undef HAVE_EX_DATA
  545. #define HAVE_EX_DATA
  546. #undef HAVE_ENCRYPT_THEN_MAC
  547. #define HAVE_ENCRYPT_THEN_MAC
  548. #undef WOLFSSL_CERT_GEN
  549. #define WOLFSSL_CERT_GEN
  550. #undef ATOMIC_USER
  551. #define ATOMIC_USER
  552. #undef HAVE_SECRET_CALLBACK
  553. #define HAVE_SECRET_CALLBACK
  554. /* wolfEngine */
  555. #if 0
  556. #define OPENSSL_COEXIST
  557. /* HKDF for engine */
  558. #undef HAVE_HKDF
  559. #if 1
  560. #define HAVE_HKDF
  561. #define HAVE_X963_KDF
  562. #endif
  563. #undef WOLFSSL_PUBLIC_MP
  564. #define WOLFSSL_PUBLIC_MP
  565. #undef NO_OLD_RNGNAME
  566. #define NO_OLD_RNGNAME
  567. #undef NO_OLD_WC_NAMES
  568. #define NO_OLD_WC_NAMES
  569. #undef NO_OLD_SSL_NAMES
  570. #define NO_OLD_SSL_NAMES
  571. #undef NO_OLD_SHA_NAMES
  572. #define NO_OLD_SHA_NAMES
  573. #undef NO_OLD_MD5_NAME
  574. #define NO_OLD_MD5_NAME
  575. #undef NO_OLD_SHA256_NAMES
  576. #define NO_OLD_SHA256_NAMES
  577. #endif
  578. #undef WOLFSSL_SYS_CA_CERTS
  579. //#define WOLFSSL_SYS_CA_CERTS
  580. #undef LIBWOLFSSL_GLOBAL_EXTRA_CFLAGS
  581. #define LIBWOLFSSL_GLOBAL_EXTRA_CFLAGS
  582. #undef HAVE_SERVER_RENEGOTIATION_INFO
  583. #define HAVE_SERVER_RENEGOTIATION_INFO
  584. #undef WOLFSSL_PEM_TO_DER
  585. #define WOLFSSL_PEM_TO_DER
  586. #undef WOLFSSL_PUB_PEM_TO_DER
  587. #define WOLFSSL_PUB_PEM_TO_DER
  588. /* ------------------------------------------------------------------------- */
  589. /* Disable Features */
  590. /* ------------------------------------------------------------------------- */
  591. #undef NO_WOLFSSL_SERVER
  592. //#define NO_WOLFSSL_SERVER
  593. #undef NO_WOLFSSL_CLIENT
  594. //#define NO_WOLFSSL_CLIENT
  595. #undef NO_CRYPT_TEST
  596. //#define NO_CRYPT_TEST
  597. #undef NO_CRYPT_BENCHMARK
  598. //#define NO_CRYPT_BENCHMARK
  599. #undef WOLFCRYPT_ONLY
  600. //#define WOLFCRYPT_ONLY
  601. /* In-lining of misc.c functions */
  602. /* If defined, must include wolfcrypt/src/misc.c in build */
  603. /* Slower, but about 1k smaller */
  604. #undef NO_INLINE
  605. //#define NO_INLINE
  606. #undef NO_FILESYSTEM
  607. //#define NO_FILESYSTEM
  608. #undef NO_WRITEV
  609. //#define NO_WRITEV
  610. #undef NO_MAIN_DRIVER
  611. #define NO_MAIN_DRIVER
  612. #undef NO_DEV_RANDOM
  613. //#define NO_DEV_RANDOM
  614. #undef NO_DSA
  615. #define NO_DSA
  616. #undef NO_RC4
  617. #define NO_RC4
  618. #undef NO_OLD_TLS
  619. #define NO_OLD_TLS
  620. #undef NO_PSK
  621. #define NO_PSK
  622. #undef NO_MD4
  623. #define NO_MD4
  624. #undef NO_PWDBASED
  625. //#define NO_PWDBASED
  626. #undef NO_CODING
  627. //#define NO_CODING
  628. #undef NO_ASN_TIME
  629. //#define NO_ASN_TIME
  630. #undef NO_CERTS
  631. //#define NO_CERTS
  632. #undef NO_SIG_WRAPPER
  633. //#define NO_SIG_WRAPPER
  634. #undef NO_DO178
  635. #define NO_DO178
  636. #undef WOLFSSL_NO_SHAKE128
  637. #define WOLFSSL_NO_SHAKE128
  638. #undef WOLFSSL_NO_SHAKE256
  639. #define WOLFSSL_NO_SHAKE256
  640. /* wolfSSL engineering ACVP algo and operational testing only (Default: Off) */
  641. #if 0
  642. #undef NO_EARLY_BAIL
  643. #define NO_EARLY_BAIL
  644. #undef WOLFSSL_PUBLIC_MP
  645. #define WOLFSSL_PUBLIC_MP
  646. #undef OPTEST_LOGGING_ENABLED
  647. //#define OPTEST_LOGGING_ENABLED
  648. #undef OPTEST_INVALID_LOGGING_ENABLED
  649. //#define OPTEST_INVALID_LOGGING_ENABLED
  650. #undef NO_MAIN_OPTEST_DRIVER
  651. #define NO_MAIN_OPTEST_DRIVER
  652. #undef DEBUG_FIPS_VERBOSE
  653. #define DEBUG_FIPS_VERBOSE
  654. #undef HAVE_FORCE_FIPS_FAILURE
  655. #define HAVE_FORCE_FIPS_FAILURE
  656. #undef NO_WRITE_TEMP_FILES
  657. #define NO_WRITE_TEMPT_FILES
  658. #endif
  659. #ifdef __cplusplus
  660. }
  661. #endif
  662. /* Customer Specific Section */
  663. /* #define CUSTOMER_1_IOS */
  664. #ifdef CUSTOMER_1_IOS
  665. /* not certified, disable for full FIPS compliance, will attempt to include
  666. * in UPDT submission and/or next FS submission */
  667. #undef HAVE_AES_KEYWRAP
  668. #define HAVE_AES_KEYWRAP
  669. #undef HAVE_PKCS7
  670. #define HAVE_PKCS7
  671. #undef HAVE_SNI
  672. #define HAVE_SNI
  673. #undef HAVE_THREAD_LS
  674. #define HAVE_THREAD_LS
  675. /* Not certifiable but external to module boundary and out of scope */
  676. #undef WOLFCRYPT_HAVE_ECCSI
  677. #define WOLFCRYPT_HAVE_ECCSI
  678. /* Not certifiable but external to module boundary and out of scope */
  679. #undef WOLFCRYPT_HAVE_SAKKE
  680. #define WOLFCRYPT_HAVE_SAKKE
  681. #undef WOLFSSL_DTLS
  682. #define WOLFSSL_DTLS
  683. #undef WOLFSSL_DTLS_MTU
  684. #define WOLFSSL_DTLS_MTU
  685. /* OpenSSL Compatibility (NOTE: Incompatible with wolfEngine and
  686. OPENSSL_COEXIST) */
  687. #ifndef OPENSSL_COEXIST
  688. #undef OPENSSL_EXTRA
  689. #if 1
  690. #define OPENSSL_EXTRA
  691. /* Larger footprint but enable ALL compatibility not just a subset */
  692. #if 1
  693. #define OPENSSL_ALL
  694. #endif
  695. #endif
  696. #endif
  697. #endif /* CUSTOMER_1_IOS */
  698. #define CUSTOMER_1_ANDROID
  699. #ifdef CUSTOMER_1_ANDROID
  700. /* TODO */
  701. #endif
  702. #endif /* WOLFSSL_USER_SETTINGS_H */