2
0

user_settings.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /* user_setting.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. #ifndef DEOS_USER_SETTINGS_H_
  22. #define DEOS_USER_SETTINGS_H_
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #if 0
  27. /* RTEMS */
  28. #define WOLFSSL_DEOS_RTEMS
  29. #include <stdio.h>
  30. #include <string.h>
  31. #include <netinet/in.h>
  32. #include <sys/socket.h>
  33. #include <pthread.h>
  34. #include <stdint.h>
  35. #include <stddef.h> /* for size_t */
  36. #include <stdlib.h> /* for malloc/free */
  37. #if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  38. #define BIG_ENDIAN_ORDER
  39. #else
  40. #undef BIG_ENDIAN_ORDER
  41. #define LITTLE_ENDIAN_ORDER
  42. #endif
  43. #else
  44. /* DEOS Native */
  45. #define WOLFSSL_DEOS
  46. #include <deos.h>
  47. #include <timeout.h>
  48. #include <socketapi.h>
  49. #include <lwip-socket.h>
  50. #include <mem.h>
  51. #include <string.h>
  52. #include <stdlib.h> /* for rand_r: pseudo-random number generator */
  53. #include <stdio.h> /* for snprintf */
  54. #endif
  55. /* Porting */
  56. /* adjust CURRENT_UNIX_TIMESTAMP to seconds since Jan 01 1970. (UTC)
  57. You can get the current time from https://www.unixtimestamp.com/ */
  58. #define CURRENT_UNIX_TIMESTAMP 1663020069
  59. #define BENCH_EMBEDDED /* use kB instead of mB for embedded benchmarking */
  60. #define WOLFSSL_IGNORE_FILE_WARN /* ignore warning for include of files not required */
  61. /* Math */
  62. #define USE_FAST_MATH
  63. #define FP_MAX_BITS (4096*2)
  64. #define SIZEOF_LONG_LONG 8
  65. #define TFM_TIMING_RESISTANT
  66. #define ECC_TIMING_RESISTANT
  67. #define WC_RSA_BLINDING
  68. /* Wolf Single Precision Math */
  69. #undef WOLFSSL_SP
  70. #if 1
  71. #define WOLFSSL_HAVE_SP_RSA
  72. #define WOLFSSL_HAVE_SP_DH
  73. #define WOLFSSL_HAVE_SP_ECC
  74. #define WOLFSSL_SP_4096 /* Enable RSA/RH 4096-bit support */
  75. #define WOLFSSL_SP_384 /* Enable ECC 384-bit SECP384R1 support */
  76. #define WOLFSSL_SP_MATH /* only SP math - disables integer.c/tfm.c */
  77. //#define WOLFSSL_SP_MATH_ALL /* use SP math for all key sizes and curves */
  78. #define WOLFSSL_SP_NO_MALLOC
  79. //#define WOLFSSL_SP_DIV_32 /* do not use 64-bit divides */
  80. /* use smaller version of code */
  81. #define WOLFSSL_SP_SMALL
  82. #endif
  83. /* Algorithms */
  84. #undef NO_RSA
  85. #undef NO_DH
  86. #define WOLFSSL_DH_CONST
  87. #define HAVE_ECC
  88. #define ECC_USER_CURVES
  89. #define HAVE_ECC384
  90. #if 1
  91. #define HAVE_CURVE25519
  92. #define HAVE_ED25519
  93. #define CURVED25519_SMALL
  94. #endif
  95. #undef NO_SHA
  96. #undef NO_MD5
  97. #undef NO_SHA256
  98. #define HAVE_AESGCM
  99. #define WOLFSSL_SHA384
  100. #define WOLFSSL_SHA512
  101. /* TLS */
  102. #define HAVE_TLS_EXTENSIONS
  103. #define HAVE_SUPPORTED_CURVES
  104. #define HAVE_EXTENDED_MASTER
  105. #define HAVE_ENCRYPT_THEN_MAC
  106. //#define WOLFSSL_DTLS
  107. //#define WOLFSSL_DTLS13
  108. //#define WOLFSSL_NO_TLS12
  109. #if 0
  110. /* TLS 1.3 */
  111. #define WOLFSSL_TLS13
  112. #define WC_RSA_PSS
  113. #define HAVE_HKDF
  114. #define HAVE_FFDHE_2048
  115. #define HAVE_FFDHE_3072
  116. #define HAVE_FFDHE_4096
  117. #endif
  118. /* wolfSentry */
  119. #if 0
  120. #define WOLFSSL_WOLFSENTRY_HOOKS
  121. #define HAVE_EX_DATA
  122. #define HAVE_EX_DATA_CLEANUP_HOOKS
  123. #endif
  124. /* compatibility layer */
  125. #if 0
  126. #define OPENSSL_EXTRA
  127. #endif
  128. /* Random */
  129. #ifdef WOLFSSL_DEOS_RTEMS
  130. extern int rtems_wolf_seed(unsigned char* output, unsigned int sz);
  131. #define CUSTOM_RAND_GENERATE_SEED rtems_wolf_seed
  132. #endif
  133. /* custom heap handling */
  134. #ifdef WOLFSSL_DEOS
  135. #define WOLFSSL_NO_MALLOC
  136. #define XMALLOC_OVERRIDE
  137. /* prototypes for user heap override functions */
  138. extern void *malloc_deos(size_t size);
  139. extern void free_deos(void *ptr);
  140. extern void *realloc_deos(void *ptr, size_t size);
  141. #define XMALLOC(n, h, t) malloc_deos(n)
  142. #define XFREE(p, h, t) free_deos(p)
  143. #define XREALLOC(p, n, h, t) realloc_deos(p, n)
  144. #endif
  145. #if 0
  146. #define DEBUG_WOLFSSL
  147. #endif
  148. /* You can select none or all of the following tests
  149. * using #define instead of #undef.
  150. * By default, all four tests run*/
  151. #define NO_CRYPT_TEST
  152. #define NO_CRYPT_BENCHMARK
  153. #undef NO_WOLFSSL_CLIENT
  154. #undef NO_WOLFSSL_SERVER
  155. /* file system has not been ported since it is a separate product */
  156. #define NO_FILESYSTEM
  157. #define NO_WOLFSSL_DIR
  158. #define NO_WRITEV
  159. #define NO_WRITE_TEMP_FILES
  160. /* disable old protocols and algorithms */
  161. #define NO_OLD_TLS
  162. #define NO_PSK
  163. #define NO_DSA
  164. #define NO_RC4
  165. #define NO_MD4
  166. #define NO_PWDBASED
  167. /* prevents from including multiple definition of main() */
  168. #define NO_MAIN_DRIVER
  169. #define NO_TESTSUITE_MAIN_DRIVER
  170. #ifdef __cplusplus
  171. } /* extern "C" */
  172. #endif
  173. #endif