@annadata/capacitor-mqtt-quic 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/AnnadataCapacitorMqttQuic.podspec +2 -1
  2. package/README.md +121 -12
  3. package/android/NGTCP2_BUILD_INSTRUCTIONS.md +65 -44
  4. package/android/build-openssl.sh +1 -1
  5. package/android/install/nghttp3-android/arm64-v8a/include/nghttp3/nghttp3.h +3295 -0
  6. package/android/install/nghttp3-android/arm64-v8a/include/nghttp3/version.h +46 -0
  7. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
  8. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
  9. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
  10. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
  11. package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.a +0 -0
  12. package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.so +0 -0
  13. package/android/install/nghttp3-android/arm64-v8a/lib/pkgconfig/libnghttp3.pc +34 -0
  14. package/android/install/nghttp3-android/arm64-v8a/share/doc/nghttp3/README.rst +75 -0
  15. package/android/install/nghttp3-android/armeabi-v7a/include/nghttp3/nghttp3.h +3295 -0
  16. package/android/install/nghttp3-android/armeabi-v7a/include/nghttp3/version.h +46 -0
  17. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
  18. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
  19. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
  20. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
  21. package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.a +0 -0
  22. package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.so +0 -0
  23. package/android/install/nghttp3-android/armeabi-v7a/lib/pkgconfig/libnghttp3.pc +34 -0
  24. package/android/install/nghttp3-android/armeabi-v7a/share/doc/nghttp3/README.rst +75 -0
  25. package/android/install/nghttp3-android/x86_64/include/nghttp3/nghttp3.h +3295 -0
  26. package/android/install/nghttp3-android/x86_64/include/nghttp3/version.h +46 -0
  27. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
  28. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
  29. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
  30. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
  31. package/android/install/nghttp3-android/x86_64/lib/libnghttp3.a +0 -0
  32. package/android/install/nghttp3-android/x86_64/lib/libnghttp3.so +0 -0
  33. package/android/install/nghttp3-android/x86_64/lib/pkgconfig/libnghttp3.pc +34 -0
  34. package/android/install/nghttp3-android/x86_64/share/doc/nghttp3/README.rst +75 -0
  35. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2.h +6254 -0
  36. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2_crypto.h +1037 -0
  37. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
  38. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/version.h +51 -0
  39. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
  40. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
  41. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
  42. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
  43. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.a +0 -0
  44. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.so +0 -0
  45. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.a +0 -0
  46. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.so +0 -0
  47. package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2.pc +33 -0
  48. package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
  49. package/android/install/ngtcp2-android/arm64-v8a/share/doc/ngtcp2/README.rst +385 -0
  50. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2.h +6254 -0
  51. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2_crypto.h +1037 -0
  52. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
  53. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/version.h +51 -0
  54. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
  55. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
  56. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
  57. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
  58. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.a +0 -0
  59. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.so +0 -0
  60. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.a +0 -0
  61. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.so +0 -0
  62. package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2.pc +33 -0
  63. package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
  64. package/android/install/ngtcp2-android/armeabi-v7a/share/doc/ngtcp2/README.rst +385 -0
  65. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2.h +6254 -0
  66. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2_crypto.h +1037 -0
  67. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
  68. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/version.h +51 -0
  69. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
  70. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
  71. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
  72. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
  73. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.a +0 -0
  74. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.so +0 -0
  75. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.a +0 -0
  76. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.so +0 -0
  77. package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2.pc +33 -0
  78. package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
  79. package/android/install/ngtcp2-android/x86_64/share/doc/ngtcp2/README.rst +385 -0
  80. package/android/install/wolfssl-android/arm64-v8a/bin/wolfssl-config +117 -0
  81. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/callbacks.h +93 -0
  82. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/certs_test.h +7073 -0
  83. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/certs_test_sm.h +2913 -0
  84. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/crl.h +58 -0
  85. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/error-ssl.h +280 -0
  86. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/ocsp.h +191 -0
  87. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/aes.h +117 -0
  88. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/asn1.h +315 -0
  89. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/asn1t.h +30 -0
  90. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/bio.h +237 -0
  91. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/bn.h +332 -0
  92. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/buffer.h +57 -0
  93. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/camellia.h +27 -0
  94. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/cmac.h +66 -0
  95. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/cms.h +26 -0
  96. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/compat_types.h +70 -0
  97. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/conf.h +117 -0
  98. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/crypto.h +171 -0
  99. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/des.h +124 -0
  100. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/dh.h +144 -0
  101. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/dsa.h +164 -0
  102. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec.h +525 -0
  103. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec25519.h +46 -0
  104. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec448.h +46 -0
  105. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ecdh.h +49 -0
  106. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ecdsa.h +87 -0
  107. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ed25519.h +49 -0
  108. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ed448.h +49 -0
  109. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/engine.h +9 -0
  110. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/err.h +84 -0
  111. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/evp.h +1540 -0
  112. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/fips_rand.h +125 -0
  113. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/hmac.h +98 -0
  114. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/kdf.h +45 -0
  115. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/lhash.h +64 -0
  116. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/md4.h +66 -0
  117. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/md5.h +108 -0
  118. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/modes.h +45 -0
  119. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/obj_mac.h +92 -0
  120. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/objects.h +86 -0
  121. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ocsp.h +108 -0
  122. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/opensslconf.h +8 -0
  123. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/opensslv.h +78 -0
  124. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ossl_typ.h +32 -0
  125. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pem.h +301 -0
  126. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pkcs12.h +57 -0
  127. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pkcs7.h +110 -0
  128. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rand.h +38 -0
  129. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rc4.h +64 -0
  130. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ripemd.h +58 -0
  131. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rsa.h +291 -0
  132. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/safestack.h +40 -0
  133. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/sha.h +331 -0
  134. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/sha3.h +158 -0
  135. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/srp.h +33 -0
  136. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ssl.h +1923 -0
  137. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ssl23.h +1 -0
  138. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/stack.h +61 -0
  139. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/tls1.h +64 -0
  140. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/txt_db.h +60 -0
  141. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ui.h +2 -0
  142. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509.h +227 -0
  143. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509_vfy.h +50 -0
  144. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509v3.h +237 -0
  145. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/options.h +273 -0
  146. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/quic.h +310 -0
  147. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/sniffer.h +359 -0
  148. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/sniffer_error.h +151 -0
  149. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/ssl.h +6300 -0
  150. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/test.h +4989 -0
  151. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/version.h +40 -0
  152. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/aes.h +1074 -0
  153. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/arc4.h +69 -0
  154. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ascon.h +109 -0
  155. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/asn.h +2855 -0
  156. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
  157. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
  158. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
  159. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2.h +108 -0
  160. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/camellia.h +116 -0
  161. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/chacha.h +133 -0
  162. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
  163. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cmac.h +168 -0
  164. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/coding.h +107 -0
  165. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/compress.h +60 -0
  166. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cpuid.h +153 -0
  167. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
  168. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/curve25519.h +225 -0
  169. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/curve448.h +151 -0
  170. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/des3.h +167 -0
  171. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dh.h +210 -0
  172. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
  173. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dsa.h +121 -0
  174. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ecc.h +1074 -0
  175. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/eccsi.h +176 -0
  176. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ed25519.h +239 -0
  177. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ed448.h +214 -0
  178. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
  179. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
  180. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
  181. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
  182. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/falcon.h +180 -0
  183. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fe_448.h +122 -0
  184. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
  185. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fips_test.h +131 -0
  186. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ge_448.h +84 -0
  187. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
  188. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hash.h +296 -0
  189. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hmac.h +231 -0
  190. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hpke.h +145 -0
  191. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/integer.h +449 -0
  192. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/kdf.h +199 -0
  193. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/lms.h +202 -0
  194. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/logging.h +588 -0
  195. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md2.h +83 -0
  196. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md4.h +77 -0
  197. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md5.h +141 -0
  198. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mem_track.h +968 -0
  199. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/memory.h +545 -0
  200. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/misc.h +214 -0
  201. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mlkem.h +377 -0
  202. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
  203. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
  204. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
  205. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
  206. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
  207. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/poly1305.h +207 -0
  208. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
  209. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/random.h +300 -0
  210. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/rc2.h +68 -0
  211. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ripemd.h +67 -0
  212. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/rsa.h +494 -0
  213. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sakke.h +228 -0
  214. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/settings.h +4762 -0
  215. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha.h +237 -0
  216. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha256.h +360 -0
  217. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha3.h +274 -0
  218. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha512.h +372 -0
  219. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/signature.h +87 -0
  220. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/siphash.h +101 -0
  221. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm2.h +27 -0
  222. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm3.h +27 -0
  223. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm4.h +27 -0
  224. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
  225. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sphincs.h +167 -0
  226. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/srp.h +313 -0
  227. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/tfm.h +941 -0
  228. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/types.h +2383 -0
  229. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/visibility.h +97 -0
  230. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
  231. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
  232. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
  233. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
  234. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
  235. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
  236. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
  237. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/xmss.h +203 -0
  238. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfio.h +1035 -0
  239. package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.a +0 -0
  240. package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.la +41 -0
  241. package/android/install/wolfssl-android/arm64-v8a/lib/pkgconfig/wolfssl.pc +11 -0
  242. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/QUIC.md +117 -0
  243. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/README.txt +8 -0
  244. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/async_client.c +245 -0
  245. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/async_server.c +331 -0
  246. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/client.c +4885 -0
  247. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/echoclient.c +341 -0
  248. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/echoserver.c +498 -0
  249. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
  250. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-client.c +78 -0
  251. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
  252. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-server.c +83 -0
  253. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/server.c +4124 -0
  254. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/tls_bench.c +2357 -0
  255. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/taoCert.txt +176 -0
  256. package/android/install/wolfssl-android/armeabi-v7a/bin/wolfssl-config +117 -0
  257. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/callbacks.h +93 -0
  258. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/certs_test.h +7073 -0
  259. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/certs_test_sm.h +2913 -0
  260. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/crl.h +58 -0
  261. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/error-ssl.h +280 -0
  262. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/ocsp.h +191 -0
  263. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/aes.h +117 -0
  264. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/asn1.h +315 -0
  265. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/asn1t.h +30 -0
  266. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/bio.h +237 -0
  267. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/bn.h +332 -0
  268. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/buffer.h +57 -0
  269. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/camellia.h +27 -0
  270. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/cmac.h +66 -0
  271. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/cms.h +26 -0
  272. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/compat_types.h +70 -0
  273. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/conf.h +117 -0
  274. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/crypto.h +171 -0
  275. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/des.h +124 -0
  276. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/dh.h +144 -0
  277. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/dsa.h +164 -0
  278. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec.h +525 -0
  279. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec25519.h +46 -0
  280. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec448.h +46 -0
  281. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ecdh.h +49 -0
  282. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ecdsa.h +87 -0
  283. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ed25519.h +49 -0
  284. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ed448.h +49 -0
  285. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/engine.h +9 -0
  286. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/err.h +84 -0
  287. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/evp.h +1540 -0
  288. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/fips_rand.h +125 -0
  289. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/hmac.h +98 -0
  290. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/kdf.h +45 -0
  291. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/lhash.h +64 -0
  292. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/md4.h +66 -0
  293. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/md5.h +108 -0
  294. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/modes.h +45 -0
  295. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/obj_mac.h +92 -0
  296. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/objects.h +86 -0
  297. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ocsp.h +108 -0
  298. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/opensslconf.h +8 -0
  299. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/opensslv.h +78 -0
  300. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ossl_typ.h +32 -0
  301. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pem.h +301 -0
  302. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pkcs12.h +57 -0
  303. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pkcs7.h +110 -0
  304. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rand.h +38 -0
  305. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rc4.h +64 -0
  306. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ripemd.h +58 -0
  307. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rsa.h +291 -0
  308. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/safestack.h +40 -0
  309. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/sha.h +331 -0
  310. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/sha3.h +158 -0
  311. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/srp.h +33 -0
  312. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ssl.h +1923 -0
  313. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ssl23.h +1 -0
  314. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/stack.h +61 -0
  315. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/tls1.h +64 -0
  316. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/txt_db.h +60 -0
  317. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ui.h +2 -0
  318. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509.h +227 -0
  319. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509_vfy.h +50 -0
  320. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509v3.h +237 -0
  321. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/options.h +261 -0
  322. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/quic.h +310 -0
  323. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/sniffer.h +359 -0
  324. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/sniffer_error.h +151 -0
  325. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/ssl.h +6300 -0
  326. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/test.h +4989 -0
  327. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/version.h +40 -0
  328. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/aes.h +1074 -0
  329. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/arc4.h +69 -0
  330. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ascon.h +109 -0
  331. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/asn.h +2855 -0
  332. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
  333. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
  334. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
  335. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2.h +108 -0
  336. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/camellia.h +116 -0
  337. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/chacha.h +133 -0
  338. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
  339. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cmac.h +168 -0
  340. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/coding.h +107 -0
  341. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/compress.h +60 -0
  342. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cpuid.h +153 -0
  343. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
  344. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/curve25519.h +225 -0
  345. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/curve448.h +151 -0
  346. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/des3.h +167 -0
  347. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dh.h +210 -0
  348. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
  349. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dsa.h +121 -0
  350. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ecc.h +1074 -0
  351. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/eccsi.h +176 -0
  352. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ed25519.h +239 -0
  353. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ed448.h +214 -0
  354. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
  355. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
  356. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
  357. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
  358. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/falcon.h +180 -0
  359. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fe_448.h +122 -0
  360. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
  361. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fips_test.h +131 -0
  362. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ge_448.h +84 -0
  363. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
  364. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hash.h +296 -0
  365. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hmac.h +231 -0
  366. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hpke.h +145 -0
  367. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/integer.h +449 -0
  368. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/kdf.h +199 -0
  369. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/lms.h +202 -0
  370. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/logging.h +588 -0
  371. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md2.h +83 -0
  372. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md4.h +77 -0
  373. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md5.h +141 -0
  374. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mem_track.h +968 -0
  375. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/memory.h +545 -0
  376. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/misc.h +214 -0
  377. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mlkem.h +377 -0
  378. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
  379. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
  380. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
  381. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
  382. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
  383. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/poly1305.h +207 -0
  384. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
  385. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/random.h +300 -0
  386. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/rc2.h +68 -0
  387. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ripemd.h +67 -0
  388. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/rsa.h +494 -0
  389. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sakke.h +228 -0
  390. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/settings.h +4762 -0
  391. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha.h +237 -0
  392. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha256.h +360 -0
  393. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha3.h +274 -0
  394. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha512.h +372 -0
  395. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/signature.h +87 -0
  396. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/siphash.h +101 -0
  397. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm2.h +27 -0
  398. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm3.h +27 -0
  399. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm4.h +27 -0
  400. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
  401. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sphincs.h +167 -0
  402. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/srp.h +313 -0
  403. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/tfm.h +941 -0
  404. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/types.h +2383 -0
  405. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/visibility.h +97 -0
  406. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
  407. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
  408. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
  409. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
  410. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
  411. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
  412. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
  413. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/xmss.h +203 -0
  414. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfio.h +1035 -0
  415. package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.a +0 -0
  416. package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.la +41 -0
  417. package/android/install/wolfssl-android/armeabi-v7a/lib/pkgconfig/wolfssl.pc +11 -0
  418. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/QUIC.md +117 -0
  419. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/README.txt +8 -0
  420. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/async_client.c +245 -0
  421. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/async_server.c +331 -0
  422. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/client.c +4885 -0
  423. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/echoclient.c +341 -0
  424. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/echoserver.c +498 -0
  425. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
  426. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-client.c +78 -0
  427. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
  428. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-server.c +83 -0
  429. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/server.c +4124 -0
  430. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/tls_bench.c +2357 -0
  431. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/taoCert.txt +176 -0
  432. package/android/install/wolfssl-android/x86_64/bin/wolfssl-config +117 -0
  433. package/android/install/wolfssl-android/x86_64/include/wolfssl/callbacks.h +93 -0
  434. package/android/install/wolfssl-android/x86_64/include/wolfssl/certs_test.h +7073 -0
  435. package/android/install/wolfssl-android/x86_64/include/wolfssl/certs_test_sm.h +2913 -0
  436. package/android/install/wolfssl-android/x86_64/include/wolfssl/crl.h +58 -0
  437. package/android/install/wolfssl-android/x86_64/include/wolfssl/error-ssl.h +280 -0
  438. package/android/install/wolfssl-android/x86_64/include/wolfssl/ocsp.h +191 -0
  439. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/aes.h +117 -0
  440. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/asn1.h +315 -0
  441. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/asn1t.h +30 -0
  442. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/bio.h +237 -0
  443. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/bn.h +332 -0
  444. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/buffer.h +57 -0
  445. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/camellia.h +27 -0
  446. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/cmac.h +66 -0
  447. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/cms.h +26 -0
  448. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/compat_types.h +70 -0
  449. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/conf.h +117 -0
  450. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/crypto.h +171 -0
  451. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/des.h +124 -0
  452. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/dh.h +144 -0
  453. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/dsa.h +164 -0
  454. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec.h +525 -0
  455. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec25519.h +46 -0
  456. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec448.h +46 -0
  457. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ecdh.h +49 -0
  458. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ecdsa.h +87 -0
  459. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ed25519.h +49 -0
  460. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ed448.h +49 -0
  461. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/engine.h +9 -0
  462. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/err.h +84 -0
  463. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/evp.h +1540 -0
  464. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/fips_rand.h +125 -0
  465. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/hmac.h +98 -0
  466. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/kdf.h +45 -0
  467. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/lhash.h +64 -0
  468. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/md4.h +66 -0
  469. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/md5.h +108 -0
  470. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/modes.h +45 -0
  471. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/obj_mac.h +92 -0
  472. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/objects.h +86 -0
  473. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ocsp.h +108 -0
  474. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/opensslconf.h +8 -0
  475. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/opensslv.h +78 -0
  476. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ossl_typ.h +32 -0
  477. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pem.h +301 -0
  478. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pkcs12.h +57 -0
  479. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pkcs7.h +110 -0
  480. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rand.h +38 -0
  481. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rc4.h +64 -0
  482. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ripemd.h +58 -0
  483. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rsa.h +291 -0
  484. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/safestack.h +40 -0
  485. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/sha.h +331 -0
  486. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/sha3.h +158 -0
  487. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/srp.h +33 -0
  488. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ssl.h +1923 -0
  489. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ssl23.h +1 -0
  490. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/stack.h +61 -0
  491. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/tls1.h +64 -0
  492. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/txt_db.h +60 -0
  493. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ui.h +2 -0
  494. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509.h +227 -0
  495. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509_vfy.h +50 -0
  496. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509v3.h +237 -0
  497. package/android/install/wolfssl-android/x86_64/include/wolfssl/options.h +273 -0
  498. package/android/install/wolfssl-android/x86_64/include/wolfssl/quic.h +310 -0
  499. package/android/install/wolfssl-android/x86_64/include/wolfssl/sniffer.h +359 -0
  500. package/android/install/wolfssl-android/x86_64/include/wolfssl/sniffer_error.h +151 -0
  501. package/android/install/wolfssl-android/x86_64/include/wolfssl/ssl.h +6300 -0
  502. package/android/install/wolfssl-android/x86_64/include/wolfssl/test.h +4989 -0
  503. package/android/install/wolfssl-android/x86_64/include/wolfssl/version.h +40 -0
  504. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/aes.h +1074 -0
  505. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/arc4.h +69 -0
  506. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ascon.h +109 -0
  507. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/asn.h +2855 -0
  508. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
  509. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
  510. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
  511. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2.h +108 -0
  512. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/camellia.h +116 -0
  513. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/chacha.h +133 -0
  514. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
  515. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cmac.h +168 -0
  516. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/coding.h +107 -0
  517. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/compress.h +60 -0
  518. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cpuid.h +153 -0
  519. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
  520. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/curve25519.h +225 -0
  521. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/curve448.h +151 -0
  522. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/des3.h +167 -0
  523. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dh.h +210 -0
  524. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
  525. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dsa.h +121 -0
  526. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ecc.h +1074 -0
  527. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/eccsi.h +176 -0
  528. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ed25519.h +239 -0
  529. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ed448.h +214 -0
  530. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
  531. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
  532. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
  533. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
  534. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/falcon.h +180 -0
  535. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fe_448.h +122 -0
  536. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
  537. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fips_test.h +131 -0
  538. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ge_448.h +84 -0
  539. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
  540. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hash.h +296 -0
  541. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hmac.h +231 -0
  542. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hpke.h +145 -0
  543. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/integer.h +449 -0
  544. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/kdf.h +199 -0
  545. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/lms.h +202 -0
  546. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/logging.h +588 -0
  547. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md2.h +83 -0
  548. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md4.h +77 -0
  549. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md5.h +141 -0
  550. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mem_track.h +968 -0
  551. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/memory.h +545 -0
  552. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/misc.h +214 -0
  553. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mlkem.h +377 -0
  554. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
  555. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
  556. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
  557. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
  558. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
  559. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/poly1305.h +207 -0
  560. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
  561. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/random.h +300 -0
  562. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/rc2.h +68 -0
  563. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ripemd.h +67 -0
  564. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/rsa.h +494 -0
  565. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sakke.h +228 -0
  566. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/settings.h +4762 -0
  567. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha.h +237 -0
  568. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha256.h +360 -0
  569. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha3.h +274 -0
  570. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha512.h +372 -0
  571. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/signature.h +87 -0
  572. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/siphash.h +101 -0
  573. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm2.h +27 -0
  574. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm3.h +27 -0
  575. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm4.h +27 -0
  576. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
  577. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sphincs.h +167 -0
  578. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/srp.h +313 -0
  579. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/tfm.h +941 -0
  580. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/types.h +2383 -0
  581. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/visibility.h +97 -0
  582. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
  583. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
  584. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
  585. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
  586. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
  587. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
  588. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
  589. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/xmss.h +203 -0
  590. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfio.h +1035 -0
  591. package/android/install/wolfssl-android/x86_64/lib/libwolfssl.a +0 -0
  592. package/android/install/wolfssl-android/x86_64/lib/libwolfssl.la +41 -0
  593. package/android/install/wolfssl-android/x86_64/lib/pkgconfig/wolfssl.pc +11 -0
  594. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/QUIC.md +117 -0
  595. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/README.txt +8 -0
  596. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/async_client.c +245 -0
  597. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/async_server.c +331 -0
  598. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/client.c +4885 -0
  599. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/echoclient.c +341 -0
  600. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/echoserver.c +498 -0
  601. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
  602. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-client.c +78 -0
  603. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
  604. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-server.c +83 -0
  605. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/server.c +4124 -0
  606. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/tls_bench.c +2357 -0
  607. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/taoCert.txt +176 -0
  608. package/android/src/main/cpp/CMakeLists.txt +19 -27
  609. package/android/src/main/cpp/ngtcp2_jni.cpp +30 -36
  610. package/android/src/main/kotlin/ai/annadata/mqttquic/MqttQuicPlugin.kt +15 -0
  611. package/android/src/main/kotlin/ai/annadata/mqttquic/client/MQTTClient.kt +6 -2
  612. package/build-native.sh +397 -0
  613. package/deps-versions.sh +25 -0
  614. package/dist/esm/definitions.d.ts +20 -0
  615. package/dist/esm/definitions.d.ts.map +1 -1
  616. package/dist/esm/web.d.ts +26 -3
  617. package/dist/esm/web.d.ts.map +1 -1
  618. package/dist/esm/web.js +230 -10
  619. package/dist/esm/web.js.map +1 -1
  620. package/dist/plugin.cjs.js +11363 -13
  621. package/dist/plugin.cjs.js.map +1 -1
  622. package/dist/plugin.js +11364 -14
  623. package/dist/plugin.js.map +1 -1
  624. package/docs/ARCHITECTURAL_ANALYSIS.md +710 -0
  625. package/docs/CAPACITOR_MQTT_QUIC_PRODUCTION_PLUGIN.md +190 -0
  626. package/docs/CAPACITOR_VERSION_SUPPORT.md +65 -0
  627. package/docs/IMPLEMENTATION_SUMMARY.md +246 -0
  628. package/docs/MQTT5_CLIENT_COMPLIANCE.md +48 -0
  629. package/docs/MQTT5_IMPLEMENTATION_COMPLETE.md +178 -0
  630. package/docs/MQTT_VERSION_ANALYSIS.md +233 -0
  631. package/docs/NGTCP2_IMPLEMENTATION_STATUS.md +214 -0
  632. package/docs/NGTCP2_INTEGRATION_PLAN.md +597 -0
  633. package/docs/P0_P1_CHANGELOG.md +79 -0
  634. package/docs/PRODUCTION_PUBLISH_STEPS.md +161 -0
  635. package/docs/PROJECT_OVERVIEW.md +193 -0
  636. package/ios/.swiftpm/xcode/xcuserdata/annadata.xcuserdatad/xcschemes/xcschememanagement.plist +1 -1
  637. package/ios/NGTCP2_BUILD_INSTRUCTIONS.md +12 -0
  638. package/ios/Sources/MqttQuicPlugin/MqttQuicPlugin.swift +6 -0
  639. package/ios/Sources/MqttQuicPlugin/QUIC/NGTCP2Bridge.mm +6 -0
  640. package/ios/build-openssl.sh +1 -1
  641. package/ios/libs/MqttQuicLibs.xcframework/Info.plist +44 -0
  642. package/ios/libs/MqttQuicLibs.xcframework/ios-arm64/libmqttquic_native_device.a +0 -0
  643. package/ios/libs/MqttQuicLibs.xcframework/ios-arm64_x86_64-simulator/libmqttquic_native_simulator.a +0 -0
  644. package/ios/libs/libnghttp3.a +0 -0
  645. package/ios/libs/libngtcp2.a +0 -0
  646. package/ios/libs/libngtcp2_crypto_wolfssl.a +0 -0
  647. package/ios/libs/libwolfssl.a +0 -0
  648. package/ios/libs-simulator/libnghttp3.a +0 -0
  649. package/ios/libs-simulator/libngtcp2.a +0 -0
  650. package/ios/libs-simulator/libngtcp2_crypto_wolfssl.a +0 -0
  651. package/ios/libs-simulator/libwolfssl.a +0 -0
  652. package/ios/libs-simulator-x86_64/libnghttp3.a +0 -0
  653. package/ios/libs-simulator-x86_64/libngtcp2.a +0 -0
  654. package/ios/libs-simulator-x86_64/libngtcp2_crypto_wolfssl.a +0 -0
  655. package/ios/libs-simulator-x86_64/libwolfssl.a +0 -0
  656. package/package.json +22 -9
@@ -0,0 +1,4762 @@
1
+ /* settings.h
2
+ *
3
+ * Copyright (C) 2006-2025 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 3 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
+
22
+ /*
23
+ * Note, this file should not be edited to activate/deactivate features.
24
+ *
25
+ * Instead, add/edit user_settings.h, and compile with -DWOLFSSL_USER_SETTINGS
26
+ *
27
+ * or
28
+ *
29
+ * ./configure CFLAGS="-DFEATURE_FLAG_TO_DEFINE -UFEATURE_FLAG_TO_CLEAR [...]"
30
+ *
31
+ * To build using a custom configuration method, define WOLFSSL_CUSTOM_CONFIG
32
+ *
33
+ * For more information see:
34
+ *
35
+ * https://www.wolfssl.com/how-do-i-manage-the-build-configuration-of-wolfssl/
36
+ */
37
+
38
+
39
+ /* Place OS specific preprocessor flags, defines, includes here, will be
40
+ included into every file because types.h includes it */
41
+
42
+
43
+ #ifndef WOLF_CRYPT_SETTINGS_H
44
+ #define WOLF_CRYPT_SETTINGS_H
45
+
46
+ #ifdef __cplusplus
47
+ extern "C" {
48
+ #endif
49
+
50
+ #if defined(TEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE) && \
51
+ defined(BUILDING_WOLFSSL) && !defined(LIBWOLFSSL_SOURCES_H) && \
52
+ !defined(LIBWOLFSSL_SOURCES_ASM_H)
53
+ #error settings.h included before libwolfssl_sources[_asm].h.
54
+ #endif
55
+
56
+ /* WOLFSSL_USE_OPTIONS_H directs wolfSSL to include options.h on behalf of
57
+ * application code, rather than the application including it directly. This is
58
+ * not defined when compiling wolfSSL library objects, which are configured
59
+ * through CFLAGS.
60
+ */
61
+ #if (defined(EXTERNAL_OPTS_OPENVPN) || defined(WOLFSSL_USE_OPTIONS_H)) && \
62
+ !defined(WOLFSSL_NO_OPTIONS_H)
63
+ #include <wolfssl/options.h>
64
+ #endif
65
+
66
+ /* Uncomment next line if using IPHONE */
67
+ /* #define IPHONE */
68
+
69
+ /* Uncomment next line if using ThreadX */
70
+ /* #define THREADX */
71
+
72
+ /* Uncomment next line if using Micrium uC/OS-III */
73
+ /* #define MICRIUM */
74
+
75
+ /* Uncomment next line if using Deos RTOS*/
76
+ /* #define WOLFSSL_DEOS*/
77
+
78
+ /* Uncomment next line if using Mbed */
79
+ /* #define MBED */
80
+
81
+ /* Uncomment next line if using Microchip PIC32 ethernet starter kit */
82
+ /* #define MICROCHIP_PIC32 */
83
+
84
+ /* Uncomment next line if using Microchip TCP/IP stack, version 5 */
85
+ /* #define MICROCHIP_TCPIP_V5 */
86
+
87
+ /* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */
88
+ /* #define MICROCHIP_TCPIP */
89
+
90
+ /* Uncomment next line if using above Microchip TCP/IP defines with BSD API */
91
+ /* #define MICROCHIP_TCPIP_BSD_API */
92
+
93
+ /* Uncomment next line if using PIC32MZ Crypto Engine */
94
+ /* #define WOLFSSL_MICROCHIP_PIC32MZ */
95
+
96
+ /* Uncomment next line if using FreeRTOS */
97
+ /* #define FREERTOS */
98
+
99
+ /* Uncomment next line if using FreeRTOS+ TCP */
100
+ /* #define FREERTOS_TCP */
101
+
102
+ /* Uncomment next line if using FreeRTOS Windows Simulator */
103
+ /* #define FREERTOS_WINSIM */
104
+
105
+ /* Uncomment next line if using RTIP */
106
+ /* #define EBSNET */
107
+
108
+ /* Uncomment next line if using lwip */
109
+ /* #define WOLFSSL_LWIP */
110
+
111
+ /* Uncomment next line if building wolfSSL for a game console */
112
+ /* #define WOLFSSL_GAME_BUILD */
113
+
114
+ /* Uncomment next line if building wolfSSL for LSR */
115
+ /* #define WOLFSSL_LSR */
116
+
117
+ /* Uncomment next line if building for Freescale Classic MQX version 5.0 */
118
+ /* #define FREESCALE_MQX_5_0 */
119
+
120
+ /* Uncomment next line if building for Freescale Classic MQX version 4.0 */
121
+ /* #define FREESCALE_MQX_4_0 */
122
+
123
+ /* Uncomment next line if building for Freescale Classic MQX/RTCS/MFS */
124
+ /* #define FREESCALE_MQX */
125
+
126
+ /* Uncomment next line if building for Freescale KSDK MQX/RTCS/MFS */
127
+ /* #define FREESCALE_KSDK_MQX */
128
+
129
+ /* Uncomment next line if building for Freescale KSDK Bare Metal */
130
+ /* #define FREESCALE_KSDK_BM */
131
+
132
+ /* Uncomment next line if building for Freescale KSDK FreeRTOS, */
133
+ /* (old name FREESCALE_FREE_RTOS) */
134
+ /* #define FREESCALE_KSDK_FREERTOS */
135
+
136
+ /* Uncomment next line if using STM32F2 */
137
+ /* #define WOLFSSL_STM32F2 */
138
+
139
+ /* Uncomment next line if using STM32F4 */
140
+ /* #define WOLFSSL_STM32F4 */
141
+
142
+ /* Uncomment next line if using STM32FL */
143
+ /* #define WOLFSSL_STM32FL */
144
+
145
+ /* Uncomment next line if using STM32F7 */
146
+ /* #define WOLFSSL_STM32F7 */
147
+
148
+ /* Uncomment next line if using QL SEP settings */
149
+ /* #define WOLFSSL_QL */
150
+
151
+ /* Uncomment next line if building for EROAD */
152
+ /* #define WOLFSSL_EROAD */
153
+
154
+ /* Uncomment next line if building for IAR EWARM */
155
+ /* #define WOLFSSL_IAR_ARM */
156
+
157
+ /* Uncomment next line if building for Rowley CrossWorks ARM */
158
+ /* #define WOLFSSL_ROWLEY_ARM */
159
+
160
+ /* Uncomment next line if using TI-RTOS settings */
161
+ /* #define WOLFSSL_TIRTOS */
162
+
163
+ /* Uncomment next line if building with PicoTCP */
164
+ /* #define WOLFSSL_PICOTCP */
165
+
166
+ /* Uncomment next line if building for PicoTCP demo bundle */
167
+ /* #define WOLFSSL_PICOTCP_DEMO */
168
+
169
+ /* Uncomment next line if building for uITRON4 */
170
+ /* #define WOLFSSL_uITRON4 */
171
+
172
+ /* Uncomment next line if building for uT-Kernel */
173
+ /* #define WOLFSSL_uTKERNEL2 */
174
+
175
+ /* Uncomment next line if using Max Strength build */
176
+ /* #define WOLFSSL_MAX_STRENGTH */
177
+
178
+ /* Uncomment next line if building for VxWorks */
179
+ /* #define WOLFSSL_VXWORKS */
180
+
181
+ /* Uncomment next line if building for Nordic nRF5x platform */
182
+ /* #define WOLFSSL_NRF5x */
183
+
184
+ /* Uncomment next line to enable deprecated less secure static DH suites */
185
+ /* #define WOLFSSL_STATIC_DH */
186
+
187
+ /* Uncomment next line to enable deprecated less secure static RSA suites */
188
+ /* #define WOLFSSL_STATIC_RSA */
189
+
190
+ /* Uncomment next line if building for ARDUINO */
191
+ /* Uncomment both lines if building for ARDUINO on INTEL_GALILEO */
192
+ /* #define WOLFSSL_ARDUINO */
193
+ /* #define INTEL_GALILEO */
194
+
195
+ /* Uncomment next line to enable asynchronous crypto WC_PENDING_E */
196
+ /* #define WOLFSSL_ASYNC_CRYPT */
197
+
198
+ /* Uncomment next line if building for uTasker */
199
+ /* #define WOLFSSL_UTASKER */
200
+
201
+ /* Uncomment next line if building for embOS */
202
+ /* #define WOLFSSL_EMBOS */
203
+
204
+ /* Uncomment next line if building for RIOT-OS */
205
+ /* #define WOLFSSL_RIOT_OS */
206
+
207
+ /* Uncomment next line if building for using XILINX hardened crypto */
208
+ /* #define WOLFSSL_XILINX_CRYPT */
209
+
210
+ /* Uncomment next line if building for using XILINX */
211
+ /* #define WOLFSSL_XILINX */
212
+
213
+ /* Uncomment next line if building for WICED Studio. */
214
+ /* #define WOLFSSL_WICED */
215
+
216
+ /* Uncomment next line if building for Nucleus 1.2 */
217
+ /* #define WOLFSSL_NUCLEUS_1_2 */
218
+
219
+ /* Uncomment next line if building for Nucleus Plus 2.3 */
220
+ /* #define NUCLEUS_PLUS_2_3 */
221
+
222
+ /* Uncomment next line if building for using Apache mynewt */
223
+ /* #define WOLFSSL_APACHE_MYNEWT */
224
+
225
+ /* For Espressif chips see example user_settings.h
226
+ *
227
+ * https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/user_settings.h
228
+ */
229
+
230
+ /* Uncomment next line if building for using ESP-IDF */
231
+ /* #define WOLFSSL_ESPIDF */
232
+
233
+ /* Uncomment next line if using Espressif ESP32-WROOM-32 */
234
+ /* #define WOLFSSL_ESP32 */
235
+
236
+ /* Uncomment next line if using Espressif ESP32-WROOM-32SE */
237
+ /* #define WOLFSSL_ESPWROOM32SE */
238
+
239
+ /* Uncomment next line if using ARM CRYPTOCELL*/
240
+ /* #define WOLFSSL_CRYPTOCELL */
241
+
242
+ /* Uncomment next line if using RENESAS TSIP */
243
+ /* #define WOLFSSL_RENESAS_TSIP */
244
+
245
+ /* Uncomment next line if using RENESAS RX64N */
246
+ /* #define WOLFSSL_RENESAS_RX65N */
247
+
248
+ /* Uncomment next line if using RENESAS SCE Protected Mode */
249
+ /* #define WOLFSSL_RENESAS_SCEPROTECT */
250
+
251
+ /* Uncomment next line if using RENESAS RA6M4 */
252
+ /* #define WOLFSSL_RENESAS_RA6M4 */
253
+
254
+ /* Uncomment next line if using RENESAS RX64 hardware acceleration */
255
+ /* #define WOLFSSL_RENESAS_RX64_HASH */
256
+
257
+ /* Uncomment next line if using Solaris OS*/
258
+ /* #define WOLFSSL_SOLARIS */
259
+
260
+ /* Uncomment next line if building for Linux Kernel Module */
261
+ /* #define WOLFSSL_LINUXKM */
262
+
263
+ /* Uncomment next line if building for devkitPro */
264
+ /* #define DEVKITPRO */
265
+
266
+ /* Uncomment next line if building for Dolphin Emulator */
267
+ /* #define DOLPHIN_EMULATOR */
268
+
269
+ /* Uncomment next line if building for WOLFSSL_NDS */
270
+ /* #define WOLFSSL_NDS */
271
+
272
+ /* Uncomment next line if using MAXQ1065 */
273
+ /* #define WOLFSSL_MAXQ1065 */
274
+
275
+ /* Uncomment next line if using MAXQ108x */
276
+ /* #define WOLFSSL_MAXQ108X */
277
+
278
+ /* Uncomment next line if using Raspberry Pi RP2040 or RP2350 */
279
+ /* #define WOLFSSL_RPIPICO */
280
+
281
+ /* Check PLATFORMIO first, as it may define other known environments. */
282
+ #ifdef PLATFORMIO
283
+ #ifdef ESP_PLATFORM
284
+ /* Turn on the wolfSSL ESPIDF flag for the PlatformIO ESP-IDF detect */
285
+ #undef WOLFSSL_ESPIDF
286
+ #define WOLFSSL_ESPIDF
287
+ #endif /* ESP_PLATFORM */
288
+
289
+ /* Ensure all PlatformIO boards have the wolfSSL user_setting.h enabled. */
290
+ #ifndef WOLFSSL_USER_SETTINGS
291
+ #define WOLFSSL_USER_SETTINGS
292
+ #endif /* WOLFSSL_USER_SETTINGS */
293
+
294
+ /* Similar to Arduino we have limited build control, so suppress warning */
295
+ #undef WOLFSSL_IGNORE_FILE_WARN
296
+ #define WOLFSSL_IGNORE_FILE_WARN
297
+ #endif
298
+
299
+ #if defined(ARDUINO)
300
+ /* Due to limited build control, we'll ignore file warnings. */
301
+ /* See https://github.com/arduino/arduino-cli/issues/631 */
302
+ #undef WOLFSSL_IGNORE_FILE_WARN
303
+ #define WOLFSSL_IGNORE_FILE_WARN
304
+
305
+ /* we don't have the luxury of compiler options, so manually define */
306
+ #if defined(__arm__)
307
+ #undef WOLFSSL_ARDUINO
308
+ #define WOLFSSL_ARDUINO
309
+ /* ESP32? */
310
+ #endif
311
+
312
+ #undef FREERTOS
313
+ #ifndef WOLFSSL_USER_SETTINGS
314
+ #define WOLFSSL_USER_SETTINGS
315
+ #endif /* WOLFSSL_USER_SETTINGS */
316
+
317
+ /* board-specific */
318
+ #if defined(__AVR__)
319
+ #define WOLFSSL_USER_IO
320
+ #define WOLFSSL_NO_SOCK
321
+ #define NO_WRITEV
322
+
323
+ /* boards less than 32 bit int get tripped up on long OID values */
324
+ #define WC_16BIT_CPU
325
+ #define WOLFSSL_OLD_OID_SUM
326
+ #elif defined(__SAM3X8E__)
327
+ #define WOLFSSL_NO_ATOMIC
328
+ #define WOLFSSL_NO_SOCK
329
+ #define WOLFSSL_USER_IO
330
+ #define NO_WRITEV
331
+ #elif defined(__arm__)
332
+ #define WOLFSSL_NO_SOCK
333
+ #define NO_WRITEV
334
+ #elif defined(ESP32)
335
+ /* assume sockets available */
336
+ #elif defined(ESP8266)
337
+ #define WOLFSSL_NO_SOCK
338
+ #define WOLFSSL_USER_IO
339
+ #define NO_WRITEV
340
+ #else
341
+ #define WOLFSSL_NO_SOCK
342
+ #endif
343
+ #endif
344
+
345
+ #if !defined(WOLFSSL_CUSTOM_CONFIG) && \
346
+ ((defined(BUILDING_WOLFSSL) && defined(WOLFSSL_USE_OPTIONS_H)) || \
347
+ (defined(BUILDING_WOLFSSL) && defined(WOLFSSL_OPTIONS_H) && \
348
+ !defined(EXTERNAL_OPTS_OPENVPN)))
349
+ #warning wolfssl/options.h included in compiled wolfssl library object.
350
+ #endif
351
+
352
+ #ifdef WOLFSSL_USER_SETTINGS
353
+ #include "user_settings.h"
354
+ #elif defined(USE_HAL_DRIVER) && !defined(HAVE_CONFIG_H)
355
+ /* STM Configuration File (generated by CubeMX) */
356
+ #include "wolfSSL.I-CUBE-wolfSSL_conf.h"
357
+ #elif defined(NUCLEUS_PLUS_2_3)
358
+ /* NOTE: cyassl_nucleus_defs.h is akin to user_settings.h */
359
+ #include "nucleus.h"
360
+ #include "os/networking/ssl/lite/cyassl_nucleus_defs.h"
361
+ #elif !defined(BUILDING_WOLFSSL) && !defined(WOLFSSL_OPTIONS_H) && \
362
+ !defined(WOLFSSL_NO_OPTIONS_H) && !defined(WOLFSSL_CUSTOM_CONFIG)
363
+ /* This warning indicates that wolfSSL features may not have been properly
364
+ * configured before other wolfSSL headers were included. If you are using
365
+ * an alternative configuration method -- e.g. custom header, or CFLAGS in
366
+ * an application build -- then your application can avoid this warning by
367
+ * defining WOLFSSL_NO_OPTIONS_H or WOLFSSL_CUSTOM_CONFIG as appropriate.
368
+ */
369
+ #warning "No configuration for wolfSSL detected, check header order"
370
+ #endif
371
+
372
+ /* Ensure WOLFSSL_DEBUG_CERTS is always set when DEBUG_WOLFSSL is enabled */
373
+ #ifdef DEBUG_WOLFSSL
374
+ #undef WOLFSSL_DEBUG_CERTS
375
+ #define WOLFSSL_DEBUG_CERTS
376
+ #endif
377
+
378
+ #include <wolfssl/wolfcrypt/visibility.h>
379
+
380
+ /*------------------------------------------------------------*/
381
+ #if defined(WOLFSSL_FIPS_READY) || defined(WOLFSSL_FIPS_DEV)
382
+ #undef HAVE_FIPS_VERSION_MAJOR
383
+ #define HAVE_FIPS_VERSION_MAJOR 7 /* always one more than major version */
384
+ /* of most recent FIPS certificate */
385
+ #undef HAVE_FIPS_VERSION
386
+ #define HAVE_FIPS_VERSION HAVE_FIPS_VERSION_MAJOR
387
+ #undef HAVE_FIPS_VERSION_MINOR
388
+ #define HAVE_FIPS_VERSION_MINOR 0 /* always 0 */
389
+ #undef HAVE_FIPS_VERSION_PATCH
390
+ #define HAVE_FIPS_VERSION_PATCH 0 /* always 0 */
391
+ #endif
392
+
393
+ #define WOLFSSL_MAKE_FIPS_VERSION3(major, minor, patch) \
394
+ (((major) * 65536) + ((minor) * 256) + (patch))
395
+ #define WOLFSSL_MAKE_FIPS_VERSION(major, minor) \
396
+ WOLFSSL_MAKE_FIPS_VERSION3(major, minor, 0)
397
+
398
+ #if !defined(HAVE_FIPS)
399
+ #define WOLFSSL_FIPS_VERSION_CODE WOLFSSL_MAKE_FIPS_VERSION3(0,0,0)
400
+ #define WOLFSSL_FIPS_VERSION2_CODE WOLFSSL_FIPS_VERSION_CODE
401
+ #elif !defined(HAVE_FIPS_VERSION)
402
+ #define WOLFSSL_FIPS_VERSION_CODE WOLFSSL_MAKE_FIPS_VERSION3(1,0,0)
403
+ #define WOLFSSL_FIPS_VERSION2_CODE WOLFSSL_FIPS_VERSION_CODE
404
+ #elif !defined(HAVE_FIPS_VERSION_MINOR)
405
+ #define WOLFSSL_FIPS_VERSION_CODE \
406
+ WOLFSSL_MAKE_FIPS_VERSION3(HAVE_FIPS_VERSION,0,0)
407
+ #define WOLFSSL_FIPS_VERSION2_CODE WOLFSSL_FIPS_VERSION_CODE
408
+ #elif !defined(HAVE_FIPS_VERSION_PATCH)
409
+ #define WOLFSSL_FIPS_VERSION_CODE \
410
+ WOLFSSL_MAKE_FIPS_VERSION3(HAVE_FIPS_VERSION, \
411
+ HAVE_FIPS_VERSION_MINOR, 0)
412
+ #define WOLFSSL_FIPS_VERSION2_CODE WOLFSSL_FIPS_VERSION_CODE
413
+ #else
414
+ #define WOLFSSL_FIPS_VERSION_CODE \
415
+ WOLFSSL_MAKE_FIPS_VERSION3(HAVE_FIPS_VERSION,\
416
+ HAVE_FIPS_VERSION_MINOR, \
417
+ HAVE_FIPS_VERSION_PATCH)
418
+ #define WOLFSSL_FIPS_VERSION2_CODE \
419
+ WOLFSSL_MAKE_FIPS_VERSION3(HAVE_FIPS_VERSION,\
420
+ HAVE_FIPS_VERSION_MINOR, \
421
+ 0)
422
+ #endif
423
+
424
+ #define FIPS_VERSION_LT(major,minor) \
425
+ (WOLFSSL_FIPS_VERSION2_CODE < WOLFSSL_MAKE_FIPS_VERSION(major,minor))
426
+ #define FIPS_VERSION_LE(major,minor) \
427
+ (WOLFSSL_FIPS_VERSION2_CODE <= WOLFSSL_MAKE_FIPS_VERSION(major,minor))
428
+ #define FIPS_VERSION_EQ(major,minor) \
429
+ (WOLFSSL_FIPS_VERSION2_CODE == WOLFSSL_MAKE_FIPS_VERSION(major,minor))
430
+ #define FIPS_VERSION_GE(major,minor) \
431
+ (WOLFSSL_FIPS_VERSION2_CODE >= WOLFSSL_MAKE_FIPS_VERSION(major,minor))
432
+ #define FIPS_VERSION_GT(major,minor) \
433
+ (WOLFSSL_FIPS_VERSION2_CODE > WOLFSSL_MAKE_FIPS_VERSION(major,minor))
434
+
435
+ #define FIPS_VERSION3_LT(major,minor,patch) \
436
+ (WOLFSSL_FIPS_VERSION_CODE < WOLFSSL_MAKE_FIPS_VERSION3(major,minor,patch))
437
+ #define FIPS_VERSION3_LE(major,minor,patch) \
438
+ (WOLFSSL_FIPS_VERSION_CODE <= WOLFSSL_MAKE_FIPS_VERSION3(major,minor,patch))
439
+ #define FIPS_VERSION3_EQ(major,minor,patch) \
440
+ (WOLFSSL_FIPS_VERSION_CODE == WOLFSSL_MAKE_FIPS_VERSION3(major,minor,patch))
441
+ #define FIPS_VERSION3_GE(major,minor,patch) \
442
+ (WOLFSSL_FIPS_VERSION_CODE >= WOLFSSL_MAKE_FIPS_VERSION3(major,minor,patch))
443
+ #define FIPS_VERSION3_GT(major,minor,patch) \
444
+ (WOLFSSL_FIPS_VERSION_CODE > WOLFSSL_MAKE_FIPS_VERSION3(major,minor,patch))
445
+ /*------------------------------------------------------------*/
446
+
447
+
448
+ /* make sure old RNG name is used with CTaoCrypt FIPS */
449
+ #ifdef HAVE_FIPS
450
+ #if FIPS_VERSION_LT(2,0)
451
+ #define WC_RNG RNG
452
+ #else
453
+ /* RNG needs to be defined to WC_RNG anytime another library on the
454
+ * system or other set of headers included by wolfSSL already defines
455
+ * RNG. Examples are:
456
+ * wolfEngine, wolfProvider and potentially other use-cases */
457
+ #if !defined(RNG) && !defined(NO_OLD_RNGNAME)
458
+ #define RNG WC_RNG
459
+ #endif
460
+ #endif
461
+ /* blinding adds API not available yet in FIPS mode */
462
+ #undef WC_RSA_BLINDING
463
+ #endif
464
+
465
+ /* old FIPS has only AES_BLOCK_SIZE. */
466
+ #if !defined(NO_AES) && (defined(HAVE_SELFTEST) || \
467
+ (defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)))
468
+ #define WC_AES_BLOCK_SIZE AES_BLOCK_SIZE
469
+ #endif /* !NO_AES && (HAVE_SELFTEST || FIPS_VERSION3_LT(6,0,0)) */
470
+
471
+ #ifdef WOLFSSL_HARDEN_TLS
472
+ #if WOLFSSL_HARDEN_TLS != 112 && WOLFSSL_HARDEN_TLS != 128
473
+ #error "WOLFSSL_HARDEN_TLS must be defined either to 112 or 128 bits of security."
474
+ #endif
475
+ #endif
476
+
477
+ /* Important build-time configuration messages may be saved.
478
+ * Enable DEBUG_WOLFSSL and see wolfSSL_Init() for display. */
479
+ #define LIBWOLFSSL_CMAKE_OUTPUT ""
480
+
481
+ /* ---------------------------------------------------------------------------
482
+ * Dual Algorithm Certificate Required Features.
483
+ * ---------------------------------------------------------------------------
484
+ */
485
+ #ifdef WOLFSSL_DUAL_ALG_CERTS
486
+ #ifdef NO_RSA
487
+ #error "Need RSA or else dual alg cert example will not work."
488
+ #endif
489
+
490
+ #ifndef HAVE_ECC
491
+ #error "Need ECDSA or else dual alg cert example will not work."
492
+ #endif
493
+
494
+ #undef WOLFSSL_CERT_GEN
495
+ #define WOLFSSL_CERT_GEN
496
+
497
+ #undef WOLFSSL_CUSTOM_OID
498
+ #define WOLFSSL_CUSTOM_OID
499
+
500
+ #undef HAVE_OID_ENCODING
501
+ #define HAVE_OID_ENCODING
502
+
503
+ #undef WOLFSSL_CERT_EXT
504
+ #define WOLFSSL_CERT_EXT
505
+
506
+ #undef OPENSSL_EXTRA
507
+ #define OPENSSL_EXTRA
508
+
509
+ #undef HAVE_OID_DECODING
510
+ #define HAVE_OID_DECODING
511
+ #endif /* WOLFSSL_DUAL_ALG_CERTS */
512
+
513
+
514
+ #if defined(_WIN32) && !defined(_M_X64) && \
515
+ defined(HAVE_AESGCM) && defined(WOLFSSL_AESNI)
516
+
517
+ /* The _M_X64 macro is what's used in the headers for MSC to tell if it
518
+ * has the 64-bit versions of the 128-bit integers available. If one is
519
+ * building on 32-bit Windows with AES-NI, turn off the AES-GCMloop
520
+ * unrolling. */
521
+
522
+ #define AES_GCM_AESNI_NO_UNROLL
523
+ #endif
524
+
525
+ #ifdef IPHONE
526
+ #define SIZEOF_LONG_LONG 8
527
+ #endif
528
+
529
+ #ifdef THREADX
530
+ #define SIZEOF_LONG_LONG 8
531
+ #endif
532
+
533
+ #ifdef HAVE_NETX
534
+ #ifdef NEED_THREADX_TYPES
535
+ #include <types.h>
536
+ #endif
537
+ #include <nx_api.h>
538
+ #endif
539
+
540
+
541
+ #ifdef WOLFSSL_NDS
542
+ #include <stddef.h>
543
+ #define SIZEOF_LONG_LONG 8
544
+ #define socklen_t int
545
+ #define IPPROTO_UDP 17
546
+ #define IPPROTO_TCP 6
547
+ #define NO_WRITEV
548
+ #endif
549
+
550
+ #if defined(ARDUINO)
551
+ #if defined(ESP32)
552
+ #ifndef NO_ARDUINO_DEFAULT
553
+ #define SIZEOF_LONG_LONG 8
554
+ #ifdef FREERTOS
555
+ #undef FREERTOS
556
+ #endif
557
+
558
+ #define WOLFSSL_LWIP
559
+ #define NO_WRITEV
560
+ #define NO_WOLFSSL_DIR
561
+ #define WOLFSSL_NO_CURRDIR
562
+
563
+ #define TFM_TIMING_RESISTANT
564
+ #define ECC_TIMING_RESISTANT
565
+ #define WC_RSA_BLINDING
566
+ #define WC_NO_CACHE_RESISTANT
567
+ #endif /* !NO_ARDUINO_DEFAULT */
568
+ #elif defined(__arm__)
569
+ #define NO_WRITEV
570
+ #define NO_WOLFSSL_DIR
571
+ #define WOLFSSL_NO_CURRDIR
572
+ #elif defined(OTHERBOARD)
573
+ /* TODO: define other Arduino boards here */
574
+ #endif
575
+ #endif
576
+
577
+ #if defined(WOLFSSL_ESPIDF)
578
+ #define SIZEOF_LONG_LONG 8
579
+
580
+ #ifndef WOLFSSL_MAX_ERROR_SZ
581
+ /* Espressif paths can be quite long. Ensure error prints full path. */
582
+ #define WOLFSSL_MAX_ERROR_SZ 200
583
+ #endif
584
+
585
+ /* Debug message do not need an additional LF for ESP_LOG */
586
+ #define WOLFSSL_DEBUG_LINE_ENDING ""
587
+
588
+ /* Parse any Kconfig / menuconfig items into wolfSSL macro equivalents.
589
+ * Macros may or may not be defined. If defined, they may have a value of
590
+ *
591
+ * 0 - not enabled (also the equivalent of not defined)
592
+ * 1 - enabled
593
+ *
594
+ * The naming convention is generally an exact match of wolfSSL macros
595
+ * in the Kconfig file. At cmake time, the Kconfig is processed and an
596
+ * sdkconfig.h file is created by the ESP-IDF. Any configured options are
597
+ * named CONFIG_[Kconfig name] and thus CONFIG_[macro name]. Those that
598
+ * are expected to be ESP-IDF specific and may be ambiguous can named
599
+ * with an ESP prefix, for example CONFIG_[ESP_(Kconfig name)]
600
+ *
601
+ * Note there are some inconsistent macro names that may have been
602
+ * used in the esp-wolfssl or other places in the ESP-IDF. They should
603
+ * be always be included for backward compatibility.
604
+ *
605
+ * See also: Espressif api-reference kconfig docs.
606
+ *
607
+ * These settings should be checked and assigned wolfssl equivalents before
608
+ * any others.
609
+ *
610
+ * Only the actual config settings should be defined here. Any others that
611
+ * may be application specific should be conditionally defined in the
612
+ * respective user_settings.h file.
613
+ *
614
+ * See the template example for reference:
615
+ * https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples/template
616
+ *
617
+ * Reminder that by the time we are here, the user_settings.h has already
618
+ * been processed. The following settings are additive; Enabled settings
619
+ * from user_settings are not disabled here.
620
+ */
621
+ #if defined(CONFIG_ESP_WOLFSSL_TEST_LOOP) && \
622
+ CONFIG_ESP_WOLFSSL_TEST_LOOP
623
+ #define WOLFSSL_TEST_LOOP 1
624
+ #else
625
+ #define WOLFSSL_TEST_LOOP 0
626
+ #endif
627
+ #if (defined(CONFIG_DEBUG_WOLFSSL) && \
628
+ CONFIG_DEBUG_WOLFSSL) || \
629
+ (defined(CONFIG_ESP_WOLFSSL_DEBUG_WOLFSSL) && \
630
+ CONFIG_ESP_WOLFSSL_DEBUG_WOLFSSL )
631
+ #define DEBUG_WOLFSSL
632
+ #endif
633
+ #if defined(CONFIG_ESP_WOLFSSL_ENABLE_WOLFSSH) && \
634
+ CONFIG_ESP_WOLFSSL_ENABLE_WOLFSSH
635
+ #define WOLFSSL_ENABLE_WOLFSSH
636
+ #endif
637
+ #if (defined(CONFIG_TEST_ESPIDF_ALL_WOLFSSL) && \
638
+ CONFIG_TEST_ESPIDF_ALL_WOLFSSL )
639
+ #define TEST_ESPIDF_ALL_WOLFSSL
640
+ #endif
641
+ #if (defined(CONFIG_WOLFSSL_ALT_CERT_CHAINS) && \
642
+ CONFIG_WOLFSSL_ALT_CERT_CHAINS )
643
+ #define WOLFSSL_ALT_CERT_CHAINS
644
+ #endif
645
+ #if defined(CONFIG_WOLFSSL_ASN_ALLOW_0_SERIAL) && \
646
+ CONFIG_WOLFSSL_ASN_ALLOW_0_SERIAL
647
+ #define WOLFSSL_ASN_ALLOW_0_SERIAL
648
+ #endif
649
+ #if defined(CONFIG_WOLFSSL_NO_ASN_STRICT) && \
650
+ CONFIG_WOLFSSL_NO_ASN_STRICT
651
+ #define WOLFSSL_NO_ASN_STRICT
652
+ #endif
653
+ #if defined(CONFIG_WOLFSSL_DEBUG_CERT_BUNDLE) && \
654
+ CONFIG_WOLFSSL_DEBUG_CERT_BUNDLE
655
+ #define WOLFSSL_DEBUG_CERT_BUNDLE
656
+ #endif
657
+ #if defined(CONFIG_USE_WOLFSSL_ESP_SDK_TIME) && \
658
+ CONFIG_USE_WOLFSSL_ESP_SDK_TIME
659
+ #define USE_WOLFSSL_ESP_SDK_TIME
660
+ #endif
661
+ #if defined(CONFIG_USE_WOLFSSL_ESP_SDK_WIFI) && \
662
+ CONFIG_USE_WOLFSSL_ESP_SDK_WIFI
663
+ #define USE_WOLFSSL_ESP_SDK_WIFI
664
+ #endif
665
+ #if defined(CONFIG_WOLFSSL_APPLE_HOMEKIT) && \
666
+ CONFIG_WOLFSSL_APPLE_HOMEKIT
667
+ #define WOLFSSL_APPLE_HOMEKIT
668
+ #endif
669
+ #if defined(CONFIG_ESP_WOLFSSL_DEBUG_ESP_HW_MULTI_RSAMAX_BITS) && \
670
+ CONFIG_ESP_WOLFSSL_DEBUG_ESP_HW_MULTI_RSAMAX_BITS
671
+ #define WOLFSSL_DEBUG_ESP_HW_MULTI_RSAMAX_BITS
672
+ #endif
673
+ #if defined(CONFIG_ESP_WOLFSSL_DEBUG_ESP_HW_MOD_RSAMAX_BITS) && \
674
+ CONFIG_ESP_WOLFSSL_DEBUG_ESP_HW_MOD_RSAMAX_BITS
675
+ #define WOLFSSL_DEBUG_ESP_HW_MOD_RSAMAX_BITS
676
+ #endif
677
+
678
+ #if defined(CONFIG_TLS_STACK_WOLFSSL)
679
+ /* When using ESP-TLS, some old algorithms such as SHA1 are no longer
680
+ * enabled in wolfSSL, except for the OpenSSL compatibility. So enable
681
+ * that here: */
682
+ #define OPENSSL_EXTRA
683
+ #endif
684
+
685
+ /* Optional Apple HomeKit support. See below for related sanity checks. */
686
+ #if defined(WOLFSSL_APPLE_HOMEKIT)
687
+ /* SRP is known to need 8K; slow on some devices */
688
+ #undef FP_MAX_BITS
689
+ #define FP_MAX_BITS (8192 * 2)
690
+ #define WOLFCRYPT_HAVE_SRP
691
+ #define HAVE_CHACHA
692
+ #define HAVE_POLY1305
693
+ #define WOLFSSL_BASE64_ENCODE
694
+ #define HAVE_HKDF
695
+ #define WOLFSSL_SHA512
696
+ #endif
697
+
698
+ /* Enable benchmark code via menuconfig, or when not otherwise disable: */
699
+ #ifdef CONFIG_ESP_WOLFSSL_ENABLE_BENCHMARK
700
+ #ifdef NO_CRYPT_BENCHMARK
701
+ #pragma message("Benchmark conflict:")
702
+ #pragma message("-- NO_CRYPT_BENCHMARK defined.")
703
+ #pragma message("-- CONFIG_WOLFSSL_ENABLE_BENCHMARK also defined.")
704
+ #pragma message("-- NO_CRYPT_BENCHMARK will be undefined.")
705
+ #undef NO_CRYPT_BENCHMARK
706
+ #endif
707
+ #endif
708
+
709
+ #if !defined(NO_CRYPT_BENCHMARK) || \
710
+ defined(CONFIG_ESP_WOLFSSL_ENABLE_BENCHMARK)
711
+
712
+ #define BENCH_EMBEDDED
713
+ #define WOLFSSL_BENCHMARK_FIXED_UNITS_KB
714
+
715
+ /* See wolfcrypt/benchmark/benchmark.c for debug and other settings: */
716
+
717
+ /* Turn on benchmark timing debugging (CPU Cycles, RTOS ticks, etc) */
718
+ #ifdef CONFIG_ESP_DEBUG_WOLFSSL_BENCHMARK_TIMING
719
+ #define DEBUG_WOLFSSL_BENCHMARK_TIMING
720
+ #endif
721
+
722
+ /* Turn on timer debugging (used when CPU cycles not available) */
723
+ #ifdef CONFIG_ESP_WOLFSSL_BENCHMARK_TIMER_DEBUG
724
+ #define WOLFSSL_BENCHMARK_TIMER_DEBUG
725
+ #endif
726
+ #endif
727
+
728
+ /* Typically only used in tests, but available to all apps is
729
+ * the "enable all" feature: */
730
+ #if defined(TEST_ESPIDF_ALL_WOLFSSL)
731
+ #define WOLFSSL_MD2
732
+ #define HAVE_BLAKE2
733
+ #define HAVE_BLAKE2B
734
+ #define HAVE_BLAKE2S
735
+
736
+ #define WC_RC2
737
+ #define WOLFSSL_ALLOW_RC4
738
+
739
+ #define HAVE_POLY1305
740
+
741
+ #define WOLFSSL_AES_128
742
+ #define WOLFSSL_AES_OFB
743
+ #define WOLFSSL_AES_CFB
744
+ #define WOLFSSL_AES_XTS
745
+
746
+ /* #define WC_SRTP_KDF */
747
+ /* TODO Causes failure with Espressif AES HW Enabled */
748
+ /* #define HAVE_AES_ECB */
749
+ /* #define HAVE_AESCCM */
750
+ /* TODO sanity check when missing HAVE_AES_ECB */
751
+ #define WOLFSSL_WOLFSSH
752
+
753
+ #define HAVE_AESGCM
754
+ #define WOLFSSL_AES_COUNTER
755
+
756
+ #define HAVE_FFDHE
757
+ #define HAVE_FFDHE_2048
758
+ #if defined(CONFIG_IDF_TARGET_ESP8266)
759
+ /* TODO Full size SRP is disabled on the ESP8266 at this time.
760
+ * Low memory issue? */
761
+ #define WOLFCRYPT_HAVE_SRP
762
+ /* MIN_FFDHE_FP_MAX_BITS = (MIN_FFDHE_BITS * 2); see settings.h */
763
+ #define FP_MAX_BITS MIN_FFDHE_FP_MAX_BITS
764
+ #elif defined(CONFIG_IDF_TARGET_ESP32) || \
765
+ defined(CONFIG_IDF_TARGET_ESP32S2) || \
766
+ defined(CONFIG_IDF_TARGET_ESP32S3)
767
+ #define WOLFCRYPT_HAVE_SRP
768
+ #define FP_MAX_BITS (8192 * 2)
769
+ #elif defined(CONFIG_IDF_TARGET_ESP32C3) || \
770
+ defined(CONFIG_IDF_TARGET_ESP32H2)
771
+ /* SRP Known to be working on this target::*/
772
+ #define WOLFCRYPT_HAVE_SRP
773
+ #define FP_MAX_BITS (8192 * 2)
774
+ #else
775
+ /* For everything else, give a try and see if SRP working: */
776
+ #define WOLFCRYPT_HAVE_SRP
777
+ #define FP_MAX_BITS (8192 * 2)
778
+ #endif
779
+
780
+ #define HAVE_DH
781
+
782
+ /* TODO: there may be a problem with HAVE_CAMELLIA with HW AES disabled.
783
+ * Do not define NO_WOLFSSL_ESP32_CRYPT_AES when enabled: */
784
+ /* #define HAVE_CAMELLIA */
785
+
786
+ /* DSA requires old SHA */
787
+ #define HAVE_DSA
788
+
789
+ /* Needs SHA512 ? */
790
+ #define HAVE_HPKE
791
+
792
+ /* Not for Espressif? */
793
+ #if defined(CONFIG_IDF_TARGET_ESP32C2) || \
794
+ defined(CONFIG_IDF_TARGET_ESP8684) || \
795
+ defined(CONFIG_IDF_TARGET_ESP32H2) || \
796
+ defined(CONFIG_IDF_TARGET_ESP8266)
797
+
798
+ #if defined(CONFIG_IDF_TARGET_ESP8266)
799
+ #undef HAVE_ECC
800
+ #undef HAVE_ECC_CDH
801
+ #undef HAVE_CURVE25519
802
+
803
+ #ifdef HAVE_CHACHA
804
+ #error "HAVE_CHACHA not supported on ESP8266"
805
+ #endif
806
+ #ifdef HAVE_XCHACHA
807
+ #error "HAVE_XCHACHA not supported on ESP8266"
808
+ #endif
809
+ #else
810
+ #define HAVE_XCHACHA
811
+ #define HAVE_CHACHA
812
+ /* TODO Not enabled at this time, needs further testing:
813
+ * #define WC_SRTP_KDF
814
+ * #define HAVE_COMP_KEY
815
+ * #define WOLFSSL_HAVE_XMSS
816
+ */
817
+ #endif
818
+ /* TODO AES-EAX needs stesting on this platform */
819
+
820
+ /* Optionally disable DH
821
+ * #undef HAVE_DH
822
+ * #undef HAVE_FFDHE
823
+ */
824
+
825
+ /* ECC_SHAMIR out of memory on ESP32-C2 during ECC */
826
+ #ifndef HAVE_ECC
827
+ #define ECC_SHAMIR
828
+ #endif
829
+ #else
830
+ #define WOLFSSL_AES_EAX
831
+
832
+ #define ECC_SHAMIR
833
+ #endif
834
+
835
+ /* Only for WOLFSSL_IMX6_CAAM / WOLFSSL_QNX_CAAM ? */
836
+ /* #define WOLFSSL_CAAM */
837
+ /* #define WOLFSSL_CAAM_BLOB */
838
+
839
+ #define WOLFSSL_AES_SIV
840
+ #define WOLFSSL_CMAC
841
+
842
+ #define WOLFSSL_CERT_PIV
843
+
844
+ /* HAVE_SCRYPT may turn on HAVE_PBKDF2 see settings.h */
845
+ /* #define HAVE_SCRYPT */
846
+ #define SCRYPT_TEST_ALL
847
+ #define HAVE_X963_KDF
848
+ #endif
849
+
850
+ /* Optionally enable some wolfSSH settings via compiler def or Kconfig */
851
+ #if defined(ESP_ENABLE_WOLFSSH)
852
+ /* The default SSH Windows size is massive for an embedded target.
853
+ * Limit it: */
854
+ #define DEFAULT_WINDOW_SZ 2000
855
+
856
+ /* These may be defined in cmake for other examples: */
857
+ #undef WOLFSSH_TERM
858
+ #define WOLFSSH_TERM
859
+
860
+ #if defined(CONFIG_ESP_WOLFSSL_DEBUG_WOLFSSH)
861
+ /* wolfSSH debugging enabled via Kconfig / menuconfig */
862
+ #undef DEBUG_WOLFSSH
863
+ #define DEBUG_WOLFSSH
864
+ #endif
865
+
866
+ #undef WOLFSSL_KEY_GEN
867
+ #define WOLFSSL_KEY_GEN
868
+
869
+ #undef WOLFSSL_PTHREADS
870
+ #define WOLFSSL_PTHREADS
871
+
872
+ #define WOLFSSH_TEST_SERVER
873
+ #define WOLFSSH_TEST_THREADING
874
+
875
+ #endif /* ESP_ENABLE_WOLFSSH */
876
+
877
+ /* ML-KEM. */
878
+ #ifdef CONFIG_ESP_WOLFSSL_ENABLE_KYBER
879
+ #define CONFIG_ESP_WOLFSSL_ENABLE_MLKEM
880
+ #endif
881
+ #ifdef CONFIG_ESP_WOLFSSL_ENABLE_MLKEM
882
+ /* Kyber typically needs a minimum 10K stack */
883
+ #define WOLFSSL_HAVE_MLKEM
884
+ #define WOLFSSL_WC_MLKEM
885
+ #define WOLFSSL_SHA3
886
+ #if defined(CONFIG_IDF_TARGET_ESP8266)
887
+ /* With limited RAM, we'll disable some of the Kyber sizes: */
888
+ #define WOLFSSL_NO_ML_KEM_1024
889
+ #define WOLFSSL_NO_ML_KEM_768
890
+ #define NO_SESSION_CACHE
891
+ #endif
892
+ #endif
893
+
894
+ #ifndef NO_ESPIDF_DEFAULT
895
+ #define FREERTOS
896
+ #define WOLFSSL_LWIP
897
+ #define NO_WRITEV
898
+ #define NO_WOLFSSL_DIR
899
+ #define WOLFSSL_NO_CURRDIR
900
+
901
+ #define TFM_TIMING_RESISTANT
902
+ #define ECC_TIMING_RESISTANT
903
+
904
+ /* WC_RSA_BLINDING takes up extra space! */
905
+ #define WC_RSA_BLINDING
906
+
907
+ /* Cache Resistant features are on by default, but has performance
908
+ * penalty on embedded systems. May not be needed here. Disabled: */
909
+ #define WC_NO_CACHE_RESISTANT
910
+ #endif /* !WOLFSSL_ESPIDF_NO_DEFAULT */
911
+
912
+ #if defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA384) && \
913
+ !defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512)
914
+ #error "NO_WOLFSSL_ESP32_CRYPT_HASH_SHA384 cannot be defined without" \
915
+ "NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512 (enable or disable both)"
916
+ #endif
917
+ #if defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512) && \
918
+ !defined(NO_WOLFSSL_ESP32_CRYPT_HASH_SHA384)
919
+ #error "NO_WOLFSSL_ESP32_CRYPT_HASH_SHA512 cannot be defined without" \
920
+ "NO_WOLFSSL_ESP32_CRYPT_HASH_SHA384 (enable or disable both)"
921
+ #endif
922
+ #if defined(WOLFSSL_ESPWROOM32)
923
+ /* WOLFSSL_ESPWROOM32 is a legacy macro gate.
924
+ ** Not be be confused with WOLFSSL_ESPWROOM32SE, naming a specific board */
925
+ #undef WOLFSSL_ESP32
926
+ #define WOLFSSL_ESP32
927
+ #endif
928
+
929
+ #if defined(NO_ESP32WROOM32_CRYPT)
930
+ #undef NO_ESP32WROOM32_CRYPT
931
+ #define NO_ESP32_CRYPT
932
+ #error "Please use NO_ESP32_CRYPT not NO_ESP32WROOM32_CRYPT"
933
+ #endif
934
+
935
+ #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)
936
+ #undef NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH
937
+ #define NO_WOLFSSL_ESP32_CRYPT_HASH
938
+ #error "Please use NO_WOLFSSL_ESP32_CRYPT_HASH not NO_ESP32WROOM32_CRYPT"
939
+ #endif
940
+
941
+ #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES)
942
+ #undef NO_WOLFSSL_ESP32WROOM32_CRYPT_AES
943
+ #define NO_WOLFSSL_ESP32_CRYPT_AES
944
+ #error "Please use NO_WOLFSSL_ESP32_CRYPT_AES" \
945
+ " not " "NO_WOLFSSL_ESP32WROOM32_CRYPT_AES"
946
+ #endif
947
+
948
+ #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI)
949
+ #undef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI
950
+ #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI
951
+ #error "Please use NO_WOLFSSL_ESP32_CRYPT_RSA_PRI" \
952
+ " not " "NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI"
953
+ #endif
954
+
955
+ #if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE)
956
+ #ifndef NO_ESP32_CRYPT
957
+ #define WOLFSSL_ESP32_CRYPT
958
+ #if defined(ESP32_USE_RSA_PRIMITIVE) && \
959
+ !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI)
960
+ #define WOLFSSL_ESP32_CRYPT_RSA_PRI
961
+ #define WOLFSSL_SMALL_STACK
962
+ #endif
963
+ #endif
964
+
965
+ #if defined(WOLFSSL_SP_RISCV32)
966
+ #if defined(CONFIG_IDF_TARGET_ESP32C2) || \
967
+ defined(CONFIG_IDF_TARGET_ESP32C3) || \
968
+ defined(CONFIG_IDF_TARGET_ESP32C6)
969
+ /* ok, only the known C2, C3, C6 chips allowed */
970
+ #else
971
+ #error "WOLFSSL_SP_RISCV32 can only be used on RISC-V architecture"
972
+ #endif
973
+ #endif
974
+ #if defined(WOLFSSL_SM2) || defined(WOLFSSL_SM3) || defined(WOLFSSL_SM4)
975
+ /* SM settings */
976
+ #undef WOLFSSL_BASE16
977
+ #define WOLFSSL_BASE16 /* required for WOLFSSL_SM2 */
978
+
979
+ #undef WOLFSSL_SM4_ECB
980
+ #define WOLFSSL_SM4_ECB
981
+
982
+ #undef WOLFSSL_SM4_CBC
983
+ #define WOLFSSL_SM4_CBC
984
+
985
+ #undef WOLFSSL_SM4_CTR
986
+ #define WOLFSSL_SM4_CTR
987
+
988
+ #undef WOLFSSL_SM4_GCM
989
+ #define WOLFSSL_SM4_GCM
990
+
991
+ #undef WOLFSSL_SM4_CCM
992
+ #define WOLFSSL_SM4_CCM
993
+
994
+ #undef HAVE_POLY1305
995
+ #define HAVE_POLY1305
996
+
997
+ #undef HAVE_CHACHA
998
+ #define HAVE_CHACHA
999
+
1000
+ #undef HAVE_AESGCM
1001
+ #define HAVE_AESGCM
1002
+ #endif /* SM */
1003
+
1004
+ #endif /* defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) */
1005
+ /* Final device-specific hardware settings. user_settings.h loaded above. */
1006
+
1007
+ /* Counters for RSA wait timeout. CPU and frequency specific. */
1008
+ #define ESP_RSA_WAIT_TIMEOUT_CNT 0x000020
1009
+ #if defined(CONFIG_IDF_TARGET_ESP32) || defined(WOLFSSL_ESPWROOM32SE)
1010
+ #ifndef ESP_RSA_TIMEOUT_CNT
1011
+ #define ESP_RSA_TIMEOUT_CNT 0x349F00
1012
+ #endif
1013
+ #elif defined(CONFIG_IDF_TARGET_ESP32S2)
1014
+ #ifndef ESP_RSA_TIMEOUT_CNT
1015
+ #define ESP_RSA_TIMEOUT_CNT 0x349F00
1016
+ #endif
1017
+ #elif defined(CONFIG_IDF_TARGET_ESP32S3)
1018
+ #ifndef ESP_RSA_TIMEOUT_CNT
1019
+ /* Observed: 0xAE8C8F @ 80MHz */
1020
+ #define ESP_RSA_TIMEOUT_CNT 0xAF0000
1021
+ #endif
1022
+ #elif defined(CONFIG_IDF_TARGET_ESP32C2)
1023
+ /* See also CONFIG_IDF_TARGET_ESP8684 equivalent */
1024
+ #ifndef ESP_RSA_TIMEOUT_CNT
1025
+ #define ESP_RSA_TIMEOUT_CNT 0x349F00
1026
+ #endif
1027
+ #elif defined(CONFIG_IDF_TARGET_ESP32C3)
1028
+ #ifndef ESP_RSA_TIMEOUT_CNT
1029
+ /* Observed: 0x2624B2 @ 80MHz */
1030
+ #define ESP_RSA_TIMEOUT_CNT 0x280000
1031
+ #endif
1032
+ #elif defined(CONFIG_IDF_TARGET_ESP32C6)
1033
+ #ifndef ESP_RSA_TIMEOUT_CNT
1034
+ /* Observed: 144323 @ 80MHz */
1035
+ #define ESP_RSA_TIMEOUT_CNT 0x160000
1036
+ #endif
1037
+ #elif defined(CONFIG_IDF_TARGET_ESP32H2)
1038
+ #ifndef ESP_RSA_TIMEOUT_CNT
1039
+ #define ESP_RSA_TIMEOUT_CNT 0x349F00
1040
+ #endif
1041
+ #elif defined(CONFIG_IDF_TARGET_ESP8266)
1042
+ #ifndef ESP_RSA_TIMEOUT_CNT
1043
+ #define ESP_RSA_TIMEOUT_CNT 0x349F00
1044
+ #endif
1045
+ #elif defined(CONFIG_IDF_TARGET_ESP8684)
1046
+ /* See also CONFIG_IDF_TARGET_ESP8684 equivalent */
1047
+ #ifndef ESP_RSA_TIMEOUT_CNT
1048
+ #define ESP_RSA_TIMEOUT_CNT 0x349F00
1049
+ #endif
1050
+ #else
1051
+ #ifndef ESP_RSA_TIMEOUT_CNT
1052
+ #define ESP_RSA_TIMEOUT_CNT 0x349F00
1053
+ #endif
1054
+ #endif
1055
+ #endif /* WOLFSSL_ESPIDF */
1056
+
1057
+ #if defined(WOLFSSL_RENESAS_TSIP)
1058
+ #define TSIP_TLS_HMAC_KEY_INDEX_WORDSIZE 64
1059
+ #define TSIP_TLS_MASTERSECRET_SIZE 80 /* 20 words */
1060
+ #define TSIP_TLS_ENCPUBKEY_SZ_BY_CERTVRFY 560 /* in byte */
1061
+
1062
+ #ifdef WOLF_CRYPTO_CB
1063
+ /* make sure RSA padding callbacks are enabled */
1064
+ #define WOLF_CRYPTO_CB_RSA_PAD
1065
+ #endif
1066
+ #endif /* WOLFSSL_RENESAS_TSIP */
1067
+
1068
+ #if !defined(WOLFSSL_NO_HASH_RAW) && defined(WOLFSSL_RENESAS_RX64_HASH)
1069
+ /* RAW hash function APIs are not implemented with RX64 hardware acceleration */
1070
+ #define WOLFSSL_NO_HASH_RAW
1071
+ #endif
1072
+
1073
+ #if defined(WOLFSSL_RENESAS_SCEPROTECT)
1074
+ #define FSPSM_TLS_MASTERSECRET_SIZE 80 /* 20 words */
1075
+ #define TSIP_TLS_HMAC_KEY_INDEX_WORDSIZE 64
1076
+ #define TSIP_TLS_ENCPUBKEY_SZ_BY_CERTVRFY 560 /* in bytes */
1077
+ #define FSPSM_TLS_CLIENTRANDOM_SZ 36 /* in bytes */
1078
+ #define FSPSM_TLS_SERVERRANDOM_SZ 36 /* in bytes */
1079
+ #define FSPSM_TLS_ENCRYPTED_ECCPUBKEY_SZ 96 /* in bytes */
1080
+
1081
+ #define WOLFSSL_RENESAS_FSPSM_ECC
1082
+ #if defined(WOLFSSL_RENESAS_FSPSM_ECC)
1083
+ #define HAVE_PK_CALLBACKS
1084
+ /* #define DEBUG_PK_CB */
1085
+ #endif
1086
+ #endif
1087
+ #if defined(WOLFSSL_RENESAS_RA6M3G) || defined(WOLFSSL_RENESAS_RA6M3) ||\
1088
+ defined(WOLFSSL_RENESAS_RA6M4)
1089
+ /* settings in user_settings.h */
1090
+ #endif
1091
+
1092
+ #if defined(WOLFSSL_LWIP_NATIVE) || \
1093
+ defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */
1094
+ #undef WOLFSSL_USER_IO
1095
+ #define WOLFSSL_USER_IO
1096
+
1097
+ #if defined(HAVE_LWIP_NATIVE)
1098
+ #define WOLFSSL_LWIP
1099
+ #define NO_WRITEV
1100
+ #define SINGLE_THREADED
1101
+ #define NO_FILESYSTEM
1102
+ #endif
1103
+ #endif
1104
+
1105
+ #if defined(WOLFSSL_CONTIKI)
1106
+ #include <contiki.h>
1107
+ #define WOLFSSL_UIP
1108
+ #define NO_WOLFSSL_MEMORY
1109
+ #define NO_WRITEV
1110
+ #define SINGLE_THREADED
1111
+ #define WOLFSSL_USER_IO
1112
+ #define NO_FILESYSTEM
1113
+ #ifndef CUSTOM_RAND_GENERATE
1114
+ #define CUSTOM_RAND_TYPE uint16_t
1115
+ #define CUSTOM_RAND_GENERATE random_rand
1116
+ #endif
1117
+ static inline word32 LowResTimer(void)
1118
+ {
1119
+ return clock_seconds();
1120
+ }
1121
+ #endif
1122
+
1123
+ #if defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_ROWLEY_ARM)
1124
+ #define NO_MAIN_DRIVER
1125
+ #define SINGLE_THREADED
1126
+ #if !defined(USE_CERT_BUFFERS_2048) && !defined(USE_CERT_BUFFERS_4096)
1127
+ #define USE_CERT_BUFFERS_1024
1128
+ #endif
1129
+ #define BENCH_EMBEDDED
1130
+ #define NO_FILESYSTEM
1131
+ #define NO_WRITEV
1132
+ #define WOLFSSL_USER_IO
1133
+ #define BENCH_EMBEDDED
1134
+ #endif
1135
+
1136
+ #ifdef MICROCHIP_PIC32
1137
+ /* #define WOLFSSL_MICROCHIP_PIC32MZ */
1138
+ #define SIZEOF_LONG_LONG 8
1139
+ #define SINGLE_THREADED
1140
+ #ifndef MICROCHIP_TCPIP_BSD_API
1141
+ #define WOLFSSL_USER_IO
1142
+ #endif
1143
+ #define NO_WRITEV
1144
+ #define NO_DEV_RANDOM
1145
+ #define NO_FILESYSTEM
1146
+ #define TFM_TIMING_RESISTANT
1147
+ #endif
1148
+
1149
+ #ifdef WOLFSSL_MICROCHIP_PIC32MZ
1150
+ #define WOLFSSL_HAVE_MIN
1151
+ #define WOLFSSL_HAVE_MAX
1152
+
1153
+ #ifndef NO_PIC32MZ_CRYPT
1154
+ #define WOLFSSL_PIC32MZ_CRYPT
1155
+ #endif
1156
+ #ifndef NO_PIC32MZ_RNG
1157
+ #define WOLFSSL_PIC32MZ_RNG
1158
+ #endif
1159
+ #ifndef NO_PIC32MZ_HASH
1160
+ #define WOLFSSL_PIC32MZ_HASH
1161
+ #endif
1162
+ #endif
1163
+
1164
+ #ifdef MICROCHIP_TCPIP_V5
1165
+ /* include timer functions */
1166
+ #include "TCPIP Stack/TCPIP.h"
1167
+ #endif
1168
+
1169
+ #ifdef MICROCHIP_TCPIP
1170
+ /* include timer, NTP functions */
1171
+ #ifdef MICROCHIP_MPLAB_HARMONY
1172
+ #include "tcpip/tcpip.h"
1173
+ #else
1174
+ #include "system/system_services.h"
1175
+ #include "tcpip/sntp.h"
1176
+ #endif
1177
+ #endif
1178
+
1179
+ #ifdef WOLFSSL_ATECC508A
1180
+ /* backwards compatibility */
1181
+ #ifndef WOLFSSL_ATECC_NO_ECDH_ENC
1182
+ #define WOLFSSL_ATECC_ECDH_ENC
1183
+ #endif
1184
+ #ifdef WOLFSSL_ATECC508A_DEBUG
1185
+ #define WOLFSSL_ATECC_DEBUG
1186
+ #endif
1187
+ #endif
1188
+
1189
+ #ifdef MBED
1190
+ #define WOLFSSL_USER_IO
1191
+ #define NO_FILESYSTEM
1192
+ #define NO_CERTS
1193
+ #if !defined(USE_CERT_BUFFERS_2048) && !defined(USE_CERT_BUFFERS_4096)
1194
+ #define USE_CERT_BUFFERS_1024
1195
+ #endif
1196
+ #define NO_WRITEV
1197
+ #define NO_DEV_RANDOM
1198
+ #define NO_SHA512
1199
+ #define NO_DH
1200
+ /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
1201
+ /* WOLFSSL_DH_CONST */
1202
+ #define NO_DSA
1203
+ #define HAVE_ECC
1204
+ #define NO_SESSION_CACHE
1205
+ #define WOLFSSL_CMSIS_RTOS
1206
+ #endif
1207
+
1208
+
1209
+ #ifdef WOLFSSL_EROAD
1210
+ #define FREESCALE_MQX
1211
+ #define FREESCALE_MMCAU
1212
+ #define SINGLE_THREADED
1213
+ #define NO_STDIO_FILESYSTEM
1214
+ #define WOLFSSL_LEANPSK
1215
+ #define HAVE_NULL_CIPHER
1216
+ #define NO_OLD_TLS
1217
+ #define NO_ASN
1218
+ #define NO_BIG_INT
1219
+ #define NO_RSA
1220
+ #define NO_DSA
1221
+ #define NO_DH
1222
+ /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
1223
+ /* WOLFSSL_DH_CONST */
1224
+ #define NO_CERTS
1225
+ #define NO_PWDBASED
1226
+ #define NO_DES3
1227
+ #define NO_MD4
1228
+ #define NO_RC4
1229
+ #define NO_MD5
1230
+ #define NO_SESSION_CACHE
1231
+ #define NO_MAIN_DRIVER
1232
+ #endif
1233
+
1234
+ #ifdef WOLFSSL_PICOTCP
1235
+ #ifndef errno
1236
+ #define errno pico_err
1237
+ #endif
1238
+ #include "pico_defines.h"
1239
+ #include "pico_stack.h"
1240
+ #include "pico_constants.h"
1241
+ #include "pico_protocol.h"
1242
+ #ifndef CUSTOM_RAND_GENERATE
1243
+ #define CUSTOM_RAND_GENERATE pico_rand
1244
+ #endif
1245
+ #endif
1246
+
1247
+ #ifdef WOLFSSL_PICOTCP_DEMO
1248
+ #define WOLFSSL_STM32
1249
+ #define TFM_TIMING_RESISTANT
1250
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), PICO_ZALLOC((s)))
1251
+ #define XFREE(p, h, type) ((void)(h), (void)(type), PICO_FREE((p)))
1252
+ #define SINGLE_THREADED
1253
+ #define NO_WRITEV
1254
+ #define WOLFSSL_USER_IO
1255
+ #define NO_DEV_RANDOM
1256
+ #define NO_FILESYSTEM
1257
+ #endif
1258
+
1259
+ #ifdef FREERTOS_WINSIM
1260
+ #define FREERTOS
1261
+ #define USE_WINDOWS_API
1262
+ #endif
1263
+
1264
+
1265
+ #ifdef WOLFSSL_VXWORKS
1266
+ /* VxWorks simulator incorrectly detects building for i386 */
1267
+ #ifdef VXWORKS_SIM
1268
+ #define TFM_NO_ASM
1269
+ #endif
1270
+ /* For VxWorks pthreads wrappers for mutexes uncomment the next line. */
1271
+ /* #define WOLFSSL_PTHREADS */
1272
+ #define WOLFSSL_HAVE_MIN
1273
+ #define WOLFSSL_HAVE_MAX
1274
+ #define NO_MAIN_DRIVER
1275
+ #define NO_DEV_RANDOM
1276
+ #define NO_WRITEV
1277
+ #define HAVE_STRINGS_H
1278
+ #endif
1279
+
1280
+
1281
+ #ifdef WOLFSSL_ARDUINO
1282
+ /* Define WOLFSSL_USER_IO here to avoid check in internal.c */
1283
+ #define WOLFSSL_USER_IO
1284
+
1285
+ #define NO_WRITEV
1286
+ #define NO_WOLFSSL_DIR
1287
+ #define SINGLE_THREADED
1288
+ #define NO_DEV_RANDOM
1289
+ #if defined(INTEL_GALILEO) || defined(ESP32)
1290
+ /* boards with has time.h compatibility */
1291
+ #elif defined(__arm__)
1292
+ /* TODO is time really missing from Arduino Due? */
1293
+ /* This is a brute-force solution to make it work: */
1294
+ #define NO_ASN_TIME
1295
+ #else
1296
+ #define TIME_OVERRIDES
1297
+ #ifndef XTIME
1298
+ #error "Must define XTIME externally see porting guide"
1299
+ /* https://www.wolfssl.com/docs/porting-guide/ */
1300
+ #endif
1301
+ #ifndef XGMTIME
1302
+ #error "Must define XGMTIME externally see porting guide"
1303
+ /* https://www.wolfssl.com/docs/porting-guide/ */
1304
+ #endif
1305
+ #endif
1306
+
1307
+ #define HAVE_ECC
1308
+ #define NO_DH
1309
+ #define NO_SESSION_CACHE
1310
+ #endif
1311
+
1312
+
1313
+ #ifdef WOLFSSL_UTASKER
1314
+ /* uTasker configuration - used for fnRandom() */
1315
+ #include "config.h"
1316
+
1317
+ #define SINGLE_THREADED
1318
+ #define NO_WOLFSSL_DIR
1319
+ #define WOLFSSL_HAVE_MIN
1320
+ #define NO_WRITEV
1321
+
1322
+ #define HAVE_ECC
1323
+ #define ALT_ECC_SIZE
1324
+ #define TFM_TIMING_RESISTANT
1325
+ #define ECC_TIMING_RESISTANT
1326
+
1327
+ /* used in wolfCrypt test */
1328
+ #define NO_MAIN_DRIVER
1329
+ #define USE_CERT_BUFFERS_2048
1330
+
1331
+ /* uTasker port uses RAW sockets, use I/O callbacks
1332
+ * See wolfSSL uTasker example for sample callbacks */
1333
+ #define WOLFSSL_USER_IO
1334
+
1335
+ /* uTasker filesystem not ported */
1336
+ #define NO_FILESYSTEM
1337
+
1338
+ /* uTasker RNG is abstracted, calls HW RNG when available */
1339
+ #define CUSTOM_RAND_GENERATE fnRandom
1340
+ #define CUSTOM_RAND_TYPE unsigned short
1341
+
1342
+ /* user needs to define XTIME to function that provides
1343
+ * seconds since Unix epoch */
1344
+ #ifndef XTIME
1345
+ #error XTIME must be defined in wolfSSL settings.h
1346
+ /* #define XTIME fnSecondsSinceEpoch */
1347
+ #endif
1348
+
1349
+ /* use uTasker std library replacements where available */
1350
+ #define STRING_USER
1351
+ #define XMEMCPY(d,s,l) uMemcpy((d),(s),(l))
1352
+ #define XMEMSET(b,c,l) uMemset((b),(c),(l))
1353
+ #define XMEMCMP(s1,s2,n) uMemcmp((s1),(s2),(n))
1354
+ #define XMEMMOVE(d,s,l) memmove((d),(s),(l))
1355
+
1356
+ #define XSTRLEN(s1) uStrlen((s1))
1357
+ #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
1358
+ #define XSTRSTR(s1,s2) strstr((s1),(s2))
1359
+ #define XSTRNSTR(s1,s2,n) wolfSSL_strnstr((s1),(s2),(n))
1360
+ #define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
1361
+ #define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
1362
+ #define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n))
1363
+ #if defined(WOLFSSL_CERT_EXT) || defined(OPENSSL_EXTRA) || \
1364
+ defined(OPENSSL_ALL) || defined(HAVE_ALPN)
1365
+ #define XSTRTOK strtok_r
1366
+ #endif
1367
+ #endif
1368
+
1369
+ #ifdef WOLFSSL_EMBOS
1370
+ #define NO_FILESYSTEM /* Not ported at this time */
1371
+ #define USE_CERT_BUFFERS_2048 /* use when NO_FILESYSTEM */
1372
+ #define NO_MAIN_DRIVER
1373
+ #define NO_RC4
1374
+ #endif
1375
+
1376
+ #ifdef WOLFSSL_RIOT_OS
1377
+ #define TFM_NO_ASM
1378
+ #define NO_FILESYSTEM
1379
+ #define USE_CERT_BUFFERS_2048
1380
+ #if defined(WOLFSSL_GNRC) && !defined(WOLFSSL_DTLS)
1381
+ #define WOLFSSL_DTLS
1382
+ #endif
1383
+ #endif
1384
+
1385
+ #ifdef WOLFSSL_CHIBIOS
1386
+ /* ChibiOS definitions. This file is distributed with chibiOS. */
1387
+ #include "wolfssl_chibios.h"
1388
+ #endif
1389
+
1390
+ #ifdef WOLFSSL_PB
1391
+ /* PB is using older 1.2 version of Nucleus */
1392
+ #undef WOLFSSL_NUCLEUS
1393
+ #define WOLFSSL_NUCLEUS_1_2
1394
+ #endif
1395
+
1396
+ #ifdef WOLFSSL_NUCLEUS_1_2
1397
+ #define NO_WRITEV
1398
+ #define NO_WOLFSSL_DIR
1399
+
1400
+ #if !defined(NO_ASN_TIME) && !defined(USER_TIME)
1401
+ #error User must define XTIME, see manual
1402
+ #endif
1403
+
1404
+ #if !defined(XMALLOC_OVERRIDE) && !defined(XMALLOC_USER)
1405
+ extern void* nucleus_malloc(unsigned long size, void* heap, int type);
1406
+ extern void* nucleus_realloc(void* ptr, unsigned long size, void* heap,
1407
+ int type);
1408
+ extern void nucleus_free(void* ptr, void* heap, int type);
1409
+
1410
+ #define XMALLOC(s, h, type) nucleus_malloc((s), (h), (type))
1411
+ #define XREALLOC(p, n, h, t) nucleus_realloc((p), (n), (h), (t))
1412
+ #define XFREE(p, h, type) nucleus_free((p), (h), (type))
1413
+ #endif
1414
+ #endif
1415
+
1416
+ #ifdef WOLFSSL_NRF5x
1417
+ #define SIZEOF_LONG 4
1418
+ #define SIZEOF_LONG_LONG 8
1419
+ #define NO_DEV_RANDOM
1420
+ #define NO_FILESYSTEM
1421
+ #define NO_MAIN_DRIVER
1422
+ #define NO_WRITEV
1423
+ #define SINGLE_THREADED
1424
+ #define TFM_TIMING_RESISTANT
1425
+ #define WOLFSSL_NRF51
1426
+ #define WOLFSSL_USER_IO
1427
+ #define NO_SESSION_CACHE
1428
+ #endif
1429
+
1430
+ /* For platforms where the target OS is not Windows, but compilation is
1431
+ * done on Windows/Visual Studio, enable a way to disable USE_WINDOWS_API.
1432
+ * Examples: Micrium, TenAsus INtime, uTasker, FreeRTOS simulator */
1433
+ #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \
1434
+ !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_EROAD) && \
1435
+ !defined(WOLFSSL_UTASKER) && !defined(INTIME_RTOS) && \
1436
+ !defined(WOLFSSL_NOT_WINDOWS_API)
1437
+ #define USE_WINDOWS_API
1438
+ #endif
1439
+
1440
+ #if defined(WOLFSSL_uITRON4)
1441
+
1442
+ #define XMALLOC_USER
1443
+ #include <stddef.h>
1444
+ #define ITRON_POOL_SIZE 1024*20
1445
+ extern int uITRON4_minit(size_t poolsz) ;
1446
+ extern void *uITRON4_malloc(size_t sz) ;
1447
+ extern void *uITRON4_realloc(void *p, size_t sz) ;
1448
+ extern void uITRON4_free(void *p) ;
1449
+
1450
+ #define XMALLOC(sz, heap, type) ((void)(heap), (void)(type), uITRON4_malloc(sz))
1451
+ #define XREALLOC(p, sz, heap, type) ((void)(heap), (void)(type), uITRON4_realloc(p, sz))
1452
+ #define XFREE(p, heap, type) ((void)(heap), (void)(type), uITRON4_free(p))
1453
+ #endif
1454
+
1455
+ #if defined(WOLFSSL_uTKERNEL2)
1456
+ #ifndef NO_TKERNEL_MEM_POOL
1457
+ #define XMALLOC_OVERRIDE
1458
+ int uTKernel_init_mpool(unsigned int sz); /* initializing malloc pool */
1459
+ void* uTKernel_malloc(unsigned int sz);
1460
+ void* uTKernel_realloc(void *p, unsigned int sz);
1461
+ void uTKernel_free(void *p);
1462
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), uTKernel_malloc((s)))
1463
+ #define XREALLOC(p, n, h, t) ((void)(h), (void)(t), uTKernel_realloc((p), (n)))
1464
+ #define XFREE(p, h, type) ((void)(h), (void)(type), uTKernel_free((p)))
1465
+ #endif
1466
+
1467
+ #ifndef NO_STDIO_FGETS_REMAP
1468
+ #include <stdio.h>
1469
+ #include "tm/tmonitor.h"
1470
+
1471
+ /* static char* gets(char *buff); */
1472
+ static char* fgets(char *buff, int sz, XFILE fp) {
1473
+ char * s = buff;
1474
+ *s = '\0';
1475
+ while (1) {
1476
+ *s = tm_getchar(-1);
1477
+ tm_putchar(*s);
1478
+ if (*s == '\r') {
1479
+ tm_putchar('\n');
1480
+ *s = '\0';
1481
+ break;
1482
+ }
1483
+ s++;
1484
+ }
1485
+ return buff;
1486
+ }
1487
+ #endif /* !NO_STDIO_FGETS_REMAP */
1488
+ #endif
1489
+
1490
+
1491
+ #if defined(WOLFSSL_LEANPSK) && !defined(XMALLOC_USER) && \
1492
+ !defined(NO_WOLFSSL_MEMORY) && !defined(WOLFSSL_STATIC_MEMORY)
1493
+ #include <stdlib.h>
1494
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), malloc((s))) /* native heap */
1495
+ #define XFREE(p, h, type) ((void)(h), (void)(type), free((p))) /* native heap */
1496
+ #define XREALLOC(p, n, h, t) ((void)(h), (void)(t), realloc((p), (n))) /* native heap */
1497
+ #endif
1498
+
1499
+ #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL)
1500
+ #undef XMALLOC
1501
+ #define XMALLOC yaXMALLOC
1502
+ #undef XFREE
1503
+ #define XFREE yaXFREE
1504
+ #undef XREALLOC
1505
+ #define XREALLOC yaXREALLOC
1506
+ #endif
1507
+
1508
+
1509
+ #ifdef FREERTOS
1510
+
1511
+ #ifdef PLATFORMIO
1512
+ #include <freertos/FreeRTOS.h>
1513
+ #include <freertos/task.h>
1514
+ #else
1515
+ #include "FreeRTOS.h"
1516
+ #include <task.h>
1517
+ #endif
1518
+
1519
+ #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \
1520
+ !defined(WOLFSSL_STATIC_MEMORY) && !defined(WOLFSSL_TRACK_MEMORY)
1521
+
1522
+ #if defined(WOLFSSL_ESPIDF)
1523
+ #include <wolfssl/wolfcrypt/port/Espressif/esp-sdk-lib.h>
1524
+ #endif
1525
+
1526
+ /* XMALLOC */
1527
+ #if defined(WOLFSSL_ESPIDF)
1528
+ #if (defined(DEBUG_WOLFSSL) || defined(DEBUG_WOLFSSL_MALLOC))
1529
+ #define XMALLOC(s, h, type) \
1530
+ ((void)(h), (void)(type), wc_debug_pvPortMalloc( \
1531
+ (s), (__FILE__), (__LINE__), (__FUNCTION__) ))
1532
+ #else
1533
+ #define XMALLOC(s, h, type) \
1534
+ ((void)(h), (void)(type), wc_pvPortMalloc((s))) /* native heap */
1535
+ #endif
1536
+ #else
1537
+ #define XMALLOC(s, h, type) \
1538
+ ((void)(h), (void)(type), pvPortMalloc((s))) /* native heap */
1539
+ #endif
1540
+
1541
+ /* XFREE */
1542
+ #if defined(WOLFSSL_ESPIDF)
1543
+ #if (defined(DEBUG_WOLFSSL) || defined(DEBUG_WOLFSSL_MALLOC))
1544
+ #define XFREE(p, h, type) \
1545
+ ((void)(h), (void)(type), wc_debug_pvPortFree( \
1546
+ (p), (__FILE__), (__LINE__), (__FUNCTION__) ))
1547
+ #else
1548
+ #define XFREE(p, h, type) \
1549
+ ((void)(h), (void)(type), wc_pvPortFree((p)))
1550
+ #endif
1551
+ #else
1552
+ #define XFREE(p, h, type) \
1553
+ ((void)(h), (void)(type), vPortFree((p))) /* native heap */
1554
+ #endif
1555
+
1556
+ /* XREALLOC */
1557
+ #if defined(WOLFSSL_ESPIDF)
1558
+ #if (defined(DEBUG_WOLFSSL) || defined(DEBUG_WOLFSSL_MALLOC))
1559
+ #define XREALLOC(p, n, h, t) \
1560
+ ((void)(h), (void)(t), wc_debug_pvPortRealloc( \
1561
+ (p), (n),(__FILE__), (__LINE__), (__FUNCTION__) ))
1562
+ #else
1563
+ /* In the Espressif EDP-IDF, realloc(p, n) is equivalent to
1564
+ * heap_caps_realloc(p, s, MALLOC_CAP_8BIT)
1565
+ * There's no pvPortRealloc available, use native heap: */
1566
+ #define XREALLOC(p, n, h, t) \
1567
+ ((void)(h), (void)(t), wc_pvPortRealloc((p), (n)))
1568
+ #endif
1569
+ #elif defined(USE_INTEGER_HEAP_MATH) || defined(OPENSSL_EXTRA) || \
1570
+ defined(OPENSSL_ALL)
1571
+ /* FreeRTOS pvPortRealloc() implementation can be found here:
1572
+ * https://github.com/wolfSSL/wolfssl-freertos/pull/3/files */
1573
+ #define XREALLOC(p, n, h, t) ((void)(h), (void)(t), pvPortRealloc((p), (n)))
1574
+ #else
1575
+ /* no XREALLOC available */
1576
+ #endif
1577
+ #endif
1578
+
1579
+ #ifndef NO_WRITEV
1580
+ #define NO_WRITEV
1581
+ #endif
1582
+ #ifndef WOLFSSL_SHA512
1583
+ #ifndef NO_SHA512
1584
+ #define NO_SHA512
1585
+ #endif
1586
+ #endif
1587
+ #ifndef HAVE_DH
1588
+ #ifndef NO_DH
1589
+ #define NO_DH
1590
+ #endif
1591
+ #endif
1592
+ #ifndef HAVE_DSA
1593
+ #ifndef NO_DSA
1594
+ #define NO_DSA
1595
+ #endif
1596
+ #endif
1597
+
1598
+ #ifndef SINGLE_THREADED
1599
+ #ifdef PLATFORMIO
1600
+ #include <freertos/semphr.h>
1601
+ #else
1602
+ #include "semphr.h"
1603
+ #endif
1604
+ #endif
1605
+ #endif
1606
+
1607
+ #ifdef FREERTOS_TCP
1608
+ #if !defined(NO_WOLFSSL_MEMORY) && !defined(XMALLOC_USER) && \
1609
+ !defined(WOLFSSL_STATIC_MEMORY)
1610
+ #ifndef XMALLOC
1611
+ #define XMALLOC(s, h, type) pvPortMalloc((s)) /* native heap */
1612
+ #endif
1613
+ #ifndef XFREE
1614
+ #define XFREE(p, h, type) vPortFree((p)) /* native heap */
1615
+ #endif
1616
+ #endif
1617
+
1618
+ #define WOLFSSL_GENSEED_FORTEST
1619
+
1620
+ #define NO_WOLFSSL_DIR
1621
+ #define NO_WRITEV
1622
+ #define TFM_TIMING_RESISTANT
1623
+ #define NO_MAIN_DRIVER
1624
+ #endif
1625
+
1626
+ #ifdef WOLFSSL_TIRTOS
1627
+ #define SIZEOF_LONG_LONG 8
1628
+ #define NO_WRITEV
1629
+ #define NO_WOLFSSL_DIR
1630
+
1631
+ /* Enable SP math by default, unless fast math
1632
+ * specified in user_settings.
1633
+ */
1634
+ #ifndef USE_FAST_MATH
1635
+ #define SP_WORD_SIZE 32
1636
+ #define WOLFSSL_HAVE_SP_ECC
1637
+ #ifndef NO_RSA
1638
+ #define WOLFSSL_HAVE_SP_RSA
1639
+ #endif
1640
+ #ifndef NO_DH
1641
+ #define WOLFSSL_HAVE_SP_DH
1642
+ #endif
1643
+ #if !defined(NO_RSA) || !defined(NO_DH)
1644
+ /* DH/RSA 2048, 3072 and 4096 */
1645
+ #if defined(SP_INT_MAX_BITS) && SP_INT_MAX_BITS >= 4096
1646
+ #define WOLFSSL_SP_4096
1647
+ #endif
1648
+ #endif
1649
+ #endif
1650
+ #define TFM_TIMING_RESISTANT
1651
+ #define ECC_TIMING_RESISTANT
1652
+ #define WC_RSA_BLINDING
1653
+ #define NO_DEV_RANDOM
1654
+ #define NO_FILESYSTEM
1655
+ #define NO_MAIN_DRIVER
1656
+ #ifndef NO_CRYPT_TEST
1657
+ #define USE_CERT_BUFFERS_2048
1658
+ #endif
1659
+ #ifndef DEBUG_WOLFSSL
1660
+ #define NO_ERROR_STRINGS
1661
+ #endif
1662
+
1663
+ #define HAVE_ECC
1664
+ #define HAVE_ALPN
1665
+ #define USE_WOLF_STRTOK /* use with HAVE_ALPN */
1666
+ #define HAVE_TLS_EXTENSIONS
1667
+ #define HAVE_SUPPORTED_CURVES
1668
+
1669
+ #define HAVE_AESGCM
1670
+
1671
+ #ifdef __IAR_SYSTEMS_ICC__
1672
+ #pragma diag_suppress=Pa089
1673
+ #elif !defined(__GNUC__)
1674
+ /* Suppress the sslpro warning */
1675
+ #pragma diag_suppress=11
1676
+ #endif
1677
+
1678
+ /* Uncomment this setting if your toolchain does not offer time.h header */
1679
+ /* #define USER_TIME */
1680
+ #include <ti/sysbios/hal/Seconds.h>
1681
+ #if defined(__ti__) && !defined(USER_TIME)
1682
+ /* TI internal time() offsets by 2208988800 (1990 -> 1970),
1683
+ * which overflows signed 32-bit */
1684
+ #define NO_TIME_SIGNEDNESS_CHECK
1685
+ #endif
1686
+ #endif
1687
+
1688
+ #ifdef EBSNET
1689
+ #include "rtip.h"
1690
+
1691
+ /* #define DEBUG_WOLFSSL */
1692
+ #define NO_WOLFSSL_DIR /* tbd */
1693
+
1694
+ #if (POLLOS)
1695
+ #define SINGLE_THREADED
1696
+ #endif
1697
+
1698
+ #if (defined(RTPLATFORM) && (RTPLATFORM != 0))
1699
+ #if (!RTP_LITTLE_ENDIAN)
1700
+ #define BIG_ENDIAN_ORDER
1701
+ #endif
1702
+ #else
1703
+ #if (!KS_LITTLE_ENDIAN)
1704
+ #define BIG_ENDIAN_ORDER
1705
+ #endif
1706
+ #endif
1707
+
1708
+ #if (WINMSP3)
1709
+ #undef SIZEOF_LONG
1710
+ #define SIZEOF_LONG_LONG 8
1711
+ #else
1712
+ #if !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
1713
+ #error settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG
1714
+ #endif
1715
+ #endif
1716
+
1717
+ #if (WINMSP3)
1718
+ #define strtok_r strtok_s
1719
+ #endif
1720
+
1721
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), ((void *)rtp_malloc((s), SSL_PRO_MALLOC)))
1722
+ #define XFREE(p, h, type) ((void)(h), (void)(type), rtp_free(p))
1723
+ #define XREALLOC(p, n, h, t) ((void)(h), rtp_realloc((p), (n), (t)))
1724
+
1725
+ #if (WINMSP3)
1726
+ #define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n))
1727
+ #else
1728
+ #ifndef XSTRNCASECMP
1729
+ #error settings.h - please implement XSTRNCASECMP - needed for HAVE_ECC
1730
+ #endif
1731
+ #endif
1732
+
1733
+ #define WOLFSSL_HAVE_MAX
1734
+ #define WOLFSSL_HAVE_MIN
1735
+
1736
+ #define TFM_TIMING_RESISTANT
1737
+ #define WC_RSA_BLINDING
1738
+ #define ECC_TIMING_RESISTANT
1739
+
1740
+ #define HAVE_ECC
1741
+
1742
+ #endif /* EBSNET */
1743
+
1744
+ #ifdef WOLFSSL_GAME_BUILD
1745
+ #define SIZEOF_LONG_LONG 8
1746
+ #endif
1747
+
1748
+ #ifdef WOLFSSL_LSR
1749
+ #define HAVE_WEBSERVER
1750
+ #define SIZEOF_LONG_LONG 8
1751
+ #define WOLFSSL_LOW_MEMORY
1752
+ #define NO_WRITEV
1753
+ #define NO_SHA512
1754
+ #define NO_DH
1755
+ /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
1756
+ /* WOLFSSL_DH_CONST */
1757
+ #define NO_DSA
1758
+ #define NO_DEV_RANDOM
1759
+ #define NO_WOLFSSL_DIR
1760
+ #ifndef NO_FILESYSTEM
1761
+ #define LSR_FS
1762
+ #include "inc/hw_types.h"
1763
+ #include "fs.h"
1764
+ #endif
1765
+ #define WOLFSSL_LWIP
1766
+ #include <errno.h> /* for tcp errno */
1767
+ #define WOLFSSL_SAFERTOS
1768
+ #if defined(__IAR_SYSTEMS_ICC__)
1769
+ /* enum uses enum */
1770
+ #pragma diag_suppress=Pa089
1771
+ #endif
1772
+ #endif
1773
+
1774
+ #ifdef WOLFSSL_SAFERTOS
1775
+ #ifndef SINGLE_THREADED
1776
+ #include "SafeRTOS/semphr.h"
1777
+ #endif
1778
+ #ifndef WOLFSSL_NO_MALLOC
1779
+ #include "SafeRTOS/heap.h"
1780
+ #endif
1781
+ #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \
1782
+ !defined(WOLFSSL_STATIC_MEMORY)
1783
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), pvPortMalloc((s))) /* native heap */
1784
+ #define XFREE(p, h, type) ((void)(h), (void)(type), vPortFree((p))) /* native heap */
1785
+
1786
+ /* FreeRTOS pvPortRealloc() implementation can be found here:
1787
+ https://github.com/wolfSSL/wolfssl-freertos/pull/3/files */
1788
+ #if !defined(USE_FAST_MATH) || defined(HAVE_ED25519) || \
1789
+ defined(HAVE_ED448)
1790
+ #define XREALLOC(p, n, h, t) ((void)(h), (void)(t), pvPortRealloc((p), (n)))
1791
+ #endif
1792
+ #endif
1793
+ #endif
1794
+
1795
+ #ifdef WOLFSSL_LOW_MEMORY
1796
+ #undef RSA_LOW_MEM
1797
+ #define RSA_LOW_MEM
1798
+ #undef WOLFSSL_SMALL_STACK
1799
+ #define WOLFSSL_SMALL_STACK
1800
+ #undef TFM_TIMING_RESISTANT
1801
+ #define TFM_TIMING_RESISTANT
1802
+ #endif
1803
+
1804
+ /* To support storing some of the large constant tables in flash memory rather than SRAM.
1805
+ Useful for processors that have limited SRAM, such as the AVR family of microtrollers. */
1806
+ #ifdef WOLFSSL_USE_FLASHMEM
1807
+ /* This is supported on the avr-gcc compiler, for more information see:
1808
+ https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html */
1809
+ #define FLASH_QUALIFIER __flash
1810
+
1811
+ /* Copy data out of flash memory and into SRAM */
1812
+ #define XMEMCPY_P(pdest, psrc, size) memcpy_P((pdest), (psrc), (size))
1813
+ #else
1814
+ #ifndef FLASH_QUALIFIER
1815
+ #define FLASH_QUALIFIER
1816
+ #endif
1817
+ #endif
1818
+
1819
+ #ifdef FREESCALE_MQX_5_0
1820
+ /* use normal Freescale MQX port, but with minor changes for 5.0 */
1821
+ #define FREESCALE_MQX
1822
+ #endif
1823
+
1824
+ #ifdef FREESCALE_MQX_4_0
1825
+ /* use normal Freescale MQX port, but with minor changes for 4.0 */
1826
+ #define FREESCALE_MQX
1827
+ #endif
1828
+
1829
+ #ifdef FREESCALE_MQX
1830
+ #define FREESCALE_COMMON
1831
+ #include "mqx.h"
1832
+ #ifndef NO_FILESYSTEM
1833
+ #include "mfs.h"
1834
+ #if (defined(MQX_USE_IO_OLD) && MQX_USE_IO_OLD) || \
1835
+ defined(FREESCALE_MQX_5_0)
1836
+ #include "fio.h"
1837
+ #define NO_STDIO_FILESYSTEM
1838
+ #else
1839
+ #include "nio.h"
1840
+ #endif
1841
+ #endif
1842
+ #ifndef SINGLE_THREADED
1843
+ #include "mutex.h"
1844
+ #endif
1845
+
1846
+ #if !defined(XMALLOC_OVERRIDE) && !defined(XMALLOC_USER)
1847
+ #define XMALLOC_OVERRIDE
1848
+ #define XMALLOC(s, h, t) ((void)(h), (void)(t), (void *)_mem_alloc_system((s)))
1849
+ #ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
1850
+ #define XFREE(p, h, t) {(void)(h); (void)(t); _mem_free(p);}
1851
+ #else
1852
+ #define XFREE(p, h, t) {void* xp = (p); (void)(h); (void)(t); if ((xp)) _mem_free((xp));}
1853
+ #endif
1854
+
1855
+ /* Note: MQX has no realloc, using fastmath above */
1856
+ #endif
1857
+ #ifdef USE_FAST_MATH
1858
+ /* Undef first to avoid re-definition if user_settings.h defines */
1859
+ #undef TFM_TIMING_RESISTANT
1860
+ #define TFM_TIMING_RESISTANT
1861
+ #undef ECC_TIMING_RESISTANT
1862
+ #define ECC_TIMING_RESISTANT
1863
+ #undef WC_RSA_BLINDING
1864
+ #define WC_RSA_BLINDING
1865
+ #endif
1866
+ #endif
1867
+
1868
+ #ifdef FREESCALE_KSDK_MQX
1869
+ #define FREESCALE_COMMON
1870
+ #include <mqx.h>
1871
+ #ifndef NO_FILESYSTEM
1872
+ #if (defined(MQX_USE_IO_OLD) && MQX_USE_IO_OLD) || \
1873
+ defined(FREESCALE_MQX_5_0)
1874
+ #include <fio.h>
1875
+ #else
1876
+ #include <stdio.h>
1877
+ #include <nio.h>
1878
+ #endif
1879
+ #endif
1880
+ #ifndef SINGLE_THREADED
1881
+ #include <mutex.h>
1882
+ #endif
1883
+
1884
+ #define XMALLOC(s, h, t) ((void)(h), (void)(t), (void *)_mem_alloc_system((s)))
1885
+ #ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
1886
+ #define XFREE(p, h, t) {(void)(h); (void)(t); _mem_free(p);}
1887
+ #else
1888
+ #define XFREE(p, h, t) {void* xp = (p); (void)(h); (void)(t); if ((xp)) _mem_free((xp));}
1889
+ #endif
1890
+ #define XREALLOC(p, n, h, t) _mem_realloc((p), (n)) /* since MQX 4.1.2 */
1891
+
1892
+ #define MQX_FILE_PTR FILE *
1893
+ #define IO_SEEK_SET SEEK_SET
1894
+ #define IO_SEEK_END SEEK_END
1895
+ #endif /* FREESCALE_KSDK_MQX */
1896
+
1897
+ #if defined(FREESCALE_FREE_RTOS) || defined(FREESCALE_KSDK_FREERTOS)
1898
+ #define NO_FILESYSTEM
1899
+ #define WOLFSSL_CRYPT_HW_MUTEX 1
1900
+
1901
+ #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY)
1902
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), pvPortMalloc((s))) /* native heap */
1903
+ #define XFREE(p, h, type) ((void)(h), (void)(type), vPortFree((p))) /* native heap */
1904
+ #endif
1905
+
1906
+ /* #define USER_TICKS */
1907
+ /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
1908
+ /* WOLFSSL_DH_CONST */
1909
+ #define WOLFSSL_LWIP
1910
+ #define FREERTOS_TCP
1911
+
1912
+ #define FREESCALE_FREE_RTOS
1913
+ #define FREERTOS_SOCKET_ERROR ( -1 )
1914
+ #define FREERTOS_EWOULDBLOCK ( -2 )
1915
+ #define FREERTOS_EINVAL ( -4 )
1916
+ #define FREERTOS_EADDRNOTAVAIL ( -5 )
1917
+ #define FREERTOS_EADDRINUSE ( -6 )
1918
+ #define FREERTOS_ENOBUFS ( -7 )
1919
+ #define FREERTOS_ENOPROTOOPT ( -8 )
1920
+ #endif /* FREESCALE_FREE_RTOS || FREESCALE_KSDK_FREERTOS */
1921
+
1922
+ #ifdef FREESCALE_KSDK_BM
1923
+ #define FREESCALE_COMMON
1924
+ #define WOLFSSL_USER_IO
1925
+ #define SINGLE_THREADED
1926
+ #define NO_FILESYSTEM
1927
+ #ifndef TIME_OVERRIDES
1928
+ #define USER_TICKS
1929
+ #endif
1930
+ #endif /* FREESCALE_KSDK_BM */
1931
+
1932
+ #ifdef FREESCALE_COMMON
1933
+ #define SIZEOF_LONG_LONG 8
1934
+
1935
+ /* disable features */
1936
+ #undef NO_WRITEV
1937
+ #define NO_WRITEV
1938
+ #undef NO_DEV_RANDOM
1939
+ #define NO_DEV_RANDOM
1940
+ #undef NO_WOLFSSL_DIR
1941
+ #define NO_WOLFSSL_DIR
1942
+ #undef NO_RC4
1943
+ #define NO_RC4
1944
+
1945
+ /* enable features */
1946
+ #define USE_CERT_BUFFERS_2048
1947
+ #define BENCH_EMBEDDED
1948
+
1949
+ #define TFM_TIMING_RESISTANT
1950
+ #define ECC_TIMING_RESISTANT
1951
+
1952
+ #ifdef FREESCALE_KSDK_1_3
1953
+ #include "fsl_device_registers.h"
1954
+ #elif !defined(FREESCALE_MQX)
1955
+ /* Classic MQX does not have fsl_common.h */
1956
+ #include "fsl_common.h"
1957
+ #endif
1958
+
1959
+ /* random seed */
1960
+ #define NO_OLD_RNGNAME
1961
+ #if defined(FREESCALE_NO_RNG)
1962
+ /* nothing to define */
1963
+ #elif defined(FSL_FEATURE_SOC_TRNG_COUNT) && (FSL_FEATURE_SOC_TRNG_COUNT > 0)
1964
+ #define FREESCALE_KSDK_2_0_TRNG
1965
+ #elif defined(FSL_FEATURE_SOC_RNG_COUNT) && (FSL_FEATURE_SOC_RNG_COUNT > 0)
1966
+ #ifdef FREESCALE_KSDK_1_3
1967
+ #include "fsl_rnga_driver.h"
1968
+ #define FREESCALE_RNGA
1969
+ #define RNGA_INSTANCE (0)
1970
+ #else
1971
+ #define FREESCALE_KSDK_2_0_RNGA
1972
+ #endif
1973
+ #elif !defined(FREESCALE_KSDK_BM) && !defined(FREESCALE_FREE_RTOS) && !defined(FREESCALE_KSDK_FREERTOS)
1974
+ #define FREESCALE_RNGA
1975
+ #define RNGA_INSTANCE (0)
1976
+ /* defaulting to K70 RNGA, user should change if different */
1977
+ /* #define FREESCALE_K53_RNGB */
1978
+ #define FREESCALE_K70_RNGA
1979
+ #endif
1980
+
1981
+ /* HW crypto */
1982
+ /* automatic enable based on Kinetis feature */
1983
+ /* if case manual selection is required, for example for benchmarking purposes,
1984
+ * just define FREESCALE_USE_MMCAU or FREESCALE_USE_LTC or none of these two macros (for software only)
1985
+ * both can be enabled simultaneously as LTC has priority over MMCAU in source code.
1986
+ */
1987
+ /* #define FSL_HW_CRYPTO_MANUAL_SELECTION */
1988
+ #ifndef FSL_HW_CRYPTO_MANUAL_SELECTION
1989
+ #if defined(FSL_FEATURE_SOC_MMCAU_COUNT) && FSL_FEATURE_SOC_MMCAU_COUNT
1990
+ #define FREESCALE_USE_MMCAU
1991
+ #endif
1992
+
1993
+ #if defined(FSL_FEATURE_SOC_LTC_COUNT) && FSL_FEATURE_SOC_LTC_COUNT
1994
+ #define FREESCALE_USE_LTC
1995
+ #endif
1996
+ #else
1997
+ /* #define FREESCALE_USE_MMCAU */
1998
+ /* #define FREESCALE_USE_LTC */
1999
+ #endif
2000
+ #endif /* FREESCALE_COMMON */
2001
+
2002
+ /* Classic pre-KSDK mmCAU library */
2003
+ #ifdef FREESCALE_USE_MMCAU_CLASSIC
2004
+ #define FREESCALE_USE_MMCAU
2005
+ #define FREESCALE_MMCAU_CLASSIC
2006
+ #define FREESCALE_MMCAU_CLASSIC_SHA
2007
+ #endif
2008
+
2009
+ /* KSDK mmCAU library */
2010
+ #ifdef FREESCALE_USE_MMCAU
2011
+ /* AES and DES */
2012
+ #define FREESCALE_MMCAU
2013
+ /* MD5, SHA-1 and SHA-256 */
2014
+ #define FREESCALE_MMCAU_SHA
2015
+ #endif /* FREESCALE_USE_MMCAU */
2016
+
2017
+ #ifdef FREESCALE_USE_LTC
2018
+ #if defined(FSL_FEATURE_SOC_LTC_COUNT) && FSL_FEATURE_SOC_LTC_COUNT
2019
+ #define FREESCALE_LTC
2020
+ #define LTC_BASE LTC0
2021
+
2022
+ #if defined(FSL_FEATURE_LTC_HAS_DES) && FSL_FEATURE_LTC_HAS_DES
2023
+ #define FREESCALE_LTC_DES
2024
+ #endif
2025
+
2026
+ #if defined(FSL_FEATURE_LTC_HAS_GCM) && FSL_FEATURE_LTC_HAS_GCM
2027
+ #define FREESCALE_LTC_AES_GCM
2028
+ #endif
2029
+
2030
+ #if defined(FSL_FEATURE_LTC_HAS_SHA) && FSL_FEATURE_LTC_HAS_SHA
2031
+ #define FREESCALE_LTC_SHA
2032
+ #endif
2033
+
2034
+ #if defined(FSL_FEATURE_LTC_HAS_PKHA) && FSL_FEATURE_LTC_HAS_PKHA
2035
+ #ifndef WOLFCRYPT_FIPS_RAND
2036
+ #define FREESCALE_LTC_ECC
2037
+ #endif
2038
+ #define FREESCALE_LTC_TFM
2039
+
2040
+ /* the LTC PKHA hardware limit is 2048 bits (256 bytes) for integer arithmetic.
2041
+ the LTC_MAX_INT_BYTES defines the size of local variables that hold big integers. */
2042
+ /* size is multiplication of 2 big ints */
2043
+ #if !defined(NO_RSA) || !defined(NO_DH)
2044
+ #define LTC_MAX_INT_BYTES (256*2)
2045
+ #else
2046
+ #define LTC_MAX_INT_BYTES (48*2)
2047
+ #endif
2048
+
2049
+ /* This FREESCALE_LTC_TFM_RSA_4096_ENABLE macro can be defined.
2050
+ * In such a case both software and hardware algorithm
2051
+ * for TFM is linked in. The decision for which algorithm is used is determined at runtime
2052
+ * from size of inputs. If inputs and result can fit into LTC (see LTC_MAX_INT_BYTES)
2053
+ * then we call hardware algorithm, otherwise we call software algorithm.
2054
+ *
2055
+ * Chinese reminder theorem is used to break RSA 4096 exponentiations (both public and private key)
2056
+ * into several computations with 2048-bit modulus and exponents.
2057
+ */
2058
+ /* #define FREESCALE_LTC_TFM_RSA_4096_ENABLE */
2059
+
2060
+ /* ECC-384, ECC-256, ECC-224 and ECC-192 have been enabled with LTC PKHA acceleration */
2061
+ #ifdef HAVE_ECC
2062
+ #undef ECC_TIMING_RESISTANT
2063
+ #define ECC_TIMING_RESISTANT
2064
+
2065
+ /* the LTC PKHA hardware limit is 512 bits (64 bytes) for ECC.
2066
+ the LTC_MAX_ECC_BITS defines the size of local variables that hold ECC parameters
2067
+ and point coordinates */
2068
+ #ifndef LTC_MAX_ECC_BITS
2069
+ #define LTC_MAX_ECC_BITS (384)
2070
+ #endif
2071
+
2072
+ /* Enable curves up to 384 bits */
2073
+ #if !defined(ECC_USER_CURVES) && !defined(HAVE_ALL_CURVES)
2074
+ #define ECC_USER_CURVES
2075
+ #define HAVE_ECC192
2076
+ #define HAVE_ECC224
2077
+ #undef NO_ECC256
2078
+ #define HAVE_ECC384
2079
+ #endif
2080
+ #endif
2081
+ #endif
2082
+ #endif
2083
+ #endif /* FREESCALE_USE_LTC */
2084
+
2085
+ #ifdef FREESCALE_LTC_TFM_RSA_4096_ENABLE
2086
+ #undef USE_CERT_BUFFERS_4096
2087
+ #define USE_CERT_BUFFERS_4096
2088
+ #undef FP_MAX_BITS
2089
+ #define FP_MAX_BITS (8192)
2090
+ #undef SP_INT_BITS
2091
+ #define SP_INT_BITS (4096)
2092
+
2093
+ #undef NO_DH
2094
+ #define NO_DH
2095
+ #undef NO_DSA
2096
+ #define NO_DSA
2097
+ #endif /* FREESCALE_LTC_TFM_RSA_4096_ENABLE */
2098
+
2099
+ /* if LTC has AES engine but doesn't have GCM, use software with LTC AES ECB mode */
2100
+ #if defined(FREESCALE_USE_LTC) && !defined(FREESCALE_LTC_AES_GCM)
2101
+ #define GCM_TABLE
2102
+ #endif
2103
+
2104
+ #if defined(WOLFSSL_MAXQ1065) || defined(WOLFSSL_MAXQ108X)
2105
+
2106
+ #define MAXQ10XX_MODULE_INIT
2107
+
2108
+ #define HAVE_PK_CALLBACKS
2109
+ #define WOLFSSL_STATIC_PSK
2110
+ /* Server side support to be added at a later date. */
2111
+ #define NO_WOLFSSL_SERVER
2112
+
2113
+ /* Need WOLFSSL_PUBLIC_ASN to use ProcessPeerCert callback. */
2114
+ #define WOLFSSL_PUBLIC_ASN
2115
+
2116
+ #ifdef HAVE_PTHREAD
2117
+ #define WOLFSSL_CRYPT_HW_MUTEX 1
2118
+ #define MAXQ10XX_MUTEX
2119
+ #endif
2120
+
2121
+ #define WOLFSSL_MAXQ10XX_CRYPTO
2122
+ #define WOLFSSL_MAXQ10XX_TLS
2123
+
2124
+
2125
+ #if defined(WOLFSSL_MAXQ1065)
2126
+ #define MAXQ_DEVICE_ID 1065
2127
+ #elif defined(WOLFSSL_MAXQ108X)
2128
+ #define MAXQ_DEVICE_ID 1080
2129
+ #else
2130
+ #error "There is only support for MAXQ1065 or MAXQ1080"
2131
+ #endif
2132
+
2133
+ #if defined(WOLFSSL_TICKET_NONCE_MALLOC)
2134
+ #error "WOLFSSL_TICKET_NONCE_MALLOC disables the HKDF expand callbacks."
2135
+ #endif
2136
+
2137
+ #endif /* WOLFSSL_MAXQ1065 || WOLFSSL_MAXQ108X */
2138
+
2139
+ #if defined(WOLFSSL_STM32F2) || defined(WOLFSSL_STM32F4) || \
2140
+ defined(WOLFSSL_STM32F7) || defined(WOLFSSL_STM32F1) || \
2141
+ defined(WOLFSSL_STM32L4) || defined(WOLFSSL_STM32L5) || \
2142
+ defined(WOLFSSL_STM32WB) || defined(WOLFSSL_STM32H7) || \
2143
+ defined(WOLFSSL_STM32G0) || defined(WOLFSSL_STM32U5) || \
2144
+ defined(WOLFSSL_STM32H5) || defined(WOLFSSL_STM32WL) || \
2145
+ defined(WOLFSSL_STM32G4) || defined(WOLFSSL_STM32MP13) || \
2146
+ defined(WOLFSSL_STM32H7S) || defined(WOLFSSL_STM32WBA) || \
2147
+ defined(WOLFSSL_STM32N6)
2148
+
2149
+ #define SIZEOF_LONG_LONG 8
2150
+ #ifndef CHAR_BIT
2151
+ #define CHAR_BIT 8
2152
+ #endif
2153
+ #define NO_DEV_RANDOM
2154
+ #define NO_WOLFSSL_DIR
2155
+ #ifndef NO_STM32_RNG
2156
+ #undef STM32_RNG
2157
+ #define STM32_RNG
2158
+ #ifdef WOLFSSL_STM32F427_RNG
2159
+ #include "stm32f427xx.h"
2160
+ #endif
2161
+ #endif
2162
+ #ifndef NO_STM32_CRYPTO
2163
+ #undef STM32_CRYPTO
2164
+ #define STM32_CRYPTO
2165
+
2166
+ #if defined(WOLFSSL_STM32L4) || defined(WOLFSSL_STM32L5) || \
2167
+ defined(WOLFSSL_STM32WB) || defined(WOLFSSL_STM32U5) || \
2168
+ defined(WOLFSSL_STM32WL) || defined(WOLFSSL_STM32WBA)
2169
+ #define NO_AES_192 /* hardware does not support 192-bit */
2170
+ #endif
2171
+ #endif
2172
+ #ifndef NO_STM32_HASH
2173
+ #undef STM32_HASH
2174
+ #define STM32_HASH
2175
+ #endif
2176
+ #if !defined(__GNUC__) && !defined(__ICCARM__)
2177
+ #define KEIL_INTRINSICS
2178
+ #endif
2179
+ #define NO_OLD_RNGNAME
2180
+ #ifdef WOLFSSL_STM32_CUBEMX
2181
+ #if defined(WOLFSSL_STM32F1)
2182
+ #include "stm32f1xx_hal.h"
2183
+ #elif defined(WOLFSSL_STM32F2)
2184
+ #include "stm32f2xx_hal.h"
2185
+ #elif defined(WOLFSSL_STM32L5)
2186
+ #include "stm32l5xx_hal.h"
2187
+ #elif defined(WOLFSSL_STM32L4)
2188
+ #include "stm32l4xx_hal.h"
2189
+ #elif defined(WOLFSSL_STM32F4)
2190
+ #include "stm32f4xx_hal.h"
2191
+ #elif defined(WOLFSSL_STM32F7)
2192
+ #include "stm32f7xx_hal.h"
2193
+ #elif defined(WOLFSSL_STM32F1)
2194
+ #include "stm32f1xx_hal.h"
2195
+ #elif defined(WOLFSSL_STM32H7S)
2196
+ #include "stm32h7rsxx_hal.h"
2197
+ #elif defined(WOLFSSL_STM32H7)
2198
+ #include "stm32h7xx_hal.h"
2199
+ #elif defined(WOLFSSL_STM32WB)
2200
+ #include "stm32wbxx_hal.h"
2201
+ #elif defined(WOLFSSL_STM32WL)
2202
+ #include "stm32wlxx_hal.h"
2203
+ #elif defined(WOLFSSL_STM32G0)
2204
+ #include "stm32g0xx_hal.h"
2205
+ #elif defined(WOLFSSL_STM32G4)
2206
+ #include "stm32g4xx_hal.h"
2207
+ #elif defined(WOLFSSL_STM32U5)
2208
+ #include "stm32u5xx_hal.h"
2209
+ #elif defined(WOLFSSL_STM32H5)
2210
+ #include "stm32h5xx_hal.h"
2211
+ #elif defined(WOLFSSL_STM32N6)
2212
+ #include "stm32n6xx_hal.h"
2213
+ #elif defined(WOLFSSL_STM32MP13)
2214
+ /* HAL headers error on our ASM files */
2215
+ #ifndef __ASSEMBLER__
2216
+ #include "stm32mp13xx_hal.h"
2217
+ #include "stm32mp13xx_hal_conf.h"
2218
+ #endif
2219
+ #elif defined(WOLFSSL_STM32WBA)
2220
+ #include "stm32wbaxx_hal.h"
2221
+ #endif
2222
+ #if defined(WOLFSSL_CUBEMX_USE_LL) && defined(WOLFSSL_STM32L4)
2223
+ #include "stm32l4xx_ll_rng.h"
2224
+ #endif
2225
+
2226
+ #ifndef STM32_HAL_TIMEOUT
2227
+ #define STM32_HAL_TIMEOUT 0xFF
2228
+ #endif
2229
+ /* bypass certificate date checking, due to lack of properly configured RTC source */
2230
+ #ifndef HAL_RTC_MODULE_ENABLED
2231
+ #define NO_ASN_TIME
2232
+ #endif
2233
+
2234
+ #if defined(WOLFSSL_STM32_PKA) && !defined(WOLFSSL_SP_INT_NEGATIVE)
2235
+ /* enable the negative support for abs(a) |a| */
2236
+ #define WOLFSSL_SP_INT_NEGATIVE
2237
+ #endif
2238
+ #else
2239
+ #if defined(WOLFSSL_STM32F2)
2240
+ #include "stm32f2xx.h"
2241
+ #ifdef STM32_CRYPTO
2242
+ #include "stm32f2xx_cryp.h"
2243
+ #endif
2244
+ #ifdef STM32_HASH
2245
+ #include "stm32f2xx_hash.h"
2246
+ #endif
2247
+ #elif defined(WOLFSSL_STM32F4)
2248
+ #include "stm32f4xx.h"
2249
+ #ifdef STM32_CRYPTO
2250
+ #include "stm32f4xx_cryp.h"
2251
+ #endif
2252
+ #ifdef STM32_HASH
2253
+ #include "stm32f4xx_hash.h"
2254
+ #endif
2255
+ #elif defined(WOLFSSL_STM32L5)
2256
+ #include "stm32l5xx.h"
2257
+ #ifdef STM32_CRYPTO
2258
+ #include "stm32l5xx_cryp.h"
2259
+ #endif
2260
+ #ifdef STM32_HASH
2261
+ #include "stm32l5xx_hash.h"
2262
+ #endif
2263
+ #elif defined(WOLFSSL_STM32L4)
2264
+ #include "stm32l4xx.h"
2265
+ #ifdef STM32_CRYPTO
2266
+ #include "stm32l4xx_cryp.h"
2267
+ #endif
2268
+ #ifdef STM32_HASH
2269
+ #include "stm32l4xx_hash.h"
2270
+ #endif
2271
+ #elif defined(WOLFSSL_STM32F7)
2272
+ #include "stm32f7xx.h"
2273
+ #elif defined(WOLFSSL_STM32H7)
2274
+ #include "stm32h7xx.h"
2275
+ #elif defined(WOLFSSL_STM32F1)
2276
+ #include "stm32f1xx.h"
2277
+ #endif
2278
+ #endif /* WOLFSSL_STM32_CUBEMX */
2279
+ #endif /* WOLFSSL_STM32* */
2280
+ #ifdef WOLFSSL_DEOS
2281
+ #include <deos.h>
2282
+ #include <timeout.h>
2283
+ #include <socketapi.h>
2284
+ #include <lwip-socket.h>
2285
+ #include <mem.h>
2286
+ #include <string.h>
2287
+ #include <stdlib.h> /* for rand_r: pseudo-random number generator */
2288
+ #include <stdio.h> /* for snprintf */
2289
+
2290
+ /* use external memory XMALLOC, XFREE and XREALLOC functions */
2291
+ #define XMALLOC_USER
2292
+
2293
+ /* disable fall-back case, malloc, realloc and free are unavailable */
2294
+ #define WOLFSSL_NO_MALLOC
2295
+
2296
+ /* file system has not been ported since it is a separate product. */
2297
+
2298
+ #define NO_FILESYSTEM
2299
+
2300
+ #ifdef NO_FILESYSTEM
2301
+ #define NO_WOLFSSL_DIR
2302
+ #define NO_WRITEV
2303
+ #endif
2304
+
2305
+ #define TFM_TIMING_RESISTANT
2306
+ #define ECC_TIMING_RESISTANT
2307
+ #define WC_RSA_BLINDING
2308
+
2309
+ #define HAVE_ECC
2310
+ #define TFM_ECC192
2311
+ #define TFM_ECC224
2312
+ #define TFM_ECC256
2313
+ #define TFM_ECC384
2314
+ #define TFM_ECC521
2315
+
2316
+ #define HAVE_TLS_EXTENSIONS
2317
+ #define HAVE_SUPPORTED_CURVES
2318
+ #define HAVE_EXTENDED_MASTER
2319
+
2320
+ #if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
2321
+ #define BIG_ENDIAN_ORDER
2322
+ #else
2323
+ #undef BIG_ENDIAN_ORDER
2324
+ #define LITTLE_ENDIAN_ORDER
2325
+ #endif
2326
+ #endif /* WOLFSSL_DEOS*/
2327
+
2328
+ #ifdef MICRIUM
2329
+ #include <stdlib.h>
2330
+ #include <os.h>
2331
+ #include <app_cfg.h>
2332
+ #if defined(RTOS_MODULE_NET_AVAIL) || (APP_CFG_TCPIP_EN == DEF_ENABLED)
2333
+ #include <net_cfg.h>
2334
+ #include <net_sock.h>
2335
+ #if (OS_VERSION < 50000)
2336
+ #include <net_err.h>
2337
+ #endif
2338
+ #endif
2339
+ #include <lib_mem.h>
2340
+ #include <lib_math.h>
2341
+ #include <lib_str.h>
2342
+ #include <stdio.h>
2343
+ #include <string.h>
2344
+
2345
+ #define TFM_TIMING_RESISTANT
2346
+ #define ECC_TIMING_RESISTANT
2347
+ #define WC_RSA_BLINDING
2348
+ #define HAVE_HASHDRBG
2349
+
2350
+ #define HAVE_ECC
2351
+ #if !defined(WOLFSSL_STATIC_MEMORY) && !defined(WOLFSSL_NO_MALLOC)
2352
+ #define ALT_ECC_SIZE
2353
+ #endif
2354
+ #define TFM_ECC192
2355
+ #define TFM_ECC224
2356
+ #define TFM_ECC256
2357
+ #define TFM_ECC384
2358
+ #define TFM_ECC521
2359
+
2360
+ #define NO_RC4
2361
+ #define HAVE_TLS_EXTENSIONS
2362
+ #define HAVE_SUPPORTED_CURVES
2363
+ #define HAVE_EXTENDED_MASTER
2364
+
2365
+ #define NO_WOLFSSL_DIR
2366
+ #define NO_WRITEV
2367
+
2368
+ #if !defined(WOLFSSL_SILABS_SE_ACCEL) && !defined(STM32_RNG) && \
2369
+ !defined(CUSTOM_RAND_GENERATE)
2370
+ #define CUSTOM_RAND_TYPE RAND_NBR
2371
+ #define CUSTOM_RAND_GENERATE Math_Rand
2372
+ #endif
2373
+ #define STRING_USER
2374
+ #define XSTRCASECMP(s1,s2) strcasecmp((s1),(s2))
2375
+ #define XSTRCMP(s1,s2) strcmp((s1),(s2))
2376
+ #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
2377
+ #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
2378
+ ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
2379
+ (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
2380
+ #define XSTRNCMP(pstr_1, pstr_2, len_max) \
2381
+ ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
2382
+ (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
2383
+ #define XSTRNCASECMP(pstr_1, pstr_2, len_max) \
2384
+ ((CPU_INT16S)Str_CmpIgnoreCase_N((CPU_CHAR *)(pstr_1), \
2385
+ (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
2386
+ #define XSTRSTR(pstr, pstr_srch) \
2387
+ ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
2388
+ (CPU_CHAR *)(pstr_srch)))
2389
+ #define XSTRNSTR(pstr, pstr_srch, len_max) \
2390
+ ((CPU_CHAR *)Str_Str_N((CPU_CHAR *)(pstr), \
2391
+ (CPU_CHAR *)(pstr_srch),(CPU_SIZE_T)(len_max)))
2392
+ #define XSTRNCAT(pstr_dest, pstr_cat, len_max) \
2393
+ ((CPU_CHAR *)Str_Cat_N((CPU_CHAR *)(pstr_dest), \
2394
+ (const CPU_CHAR *)(pstr_cat),(CPU_SIZE_T)(len_max)))
2395
+ #ifndef XATOI /* if custom XATOI is not already defined */
2396
+ #define XATOI(s) atoi((s))
2397
+ #endif
2398
+ #if defined(USE_WOLF_STRTOK)
2399
+ #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
2400
+ #else
2401
+ #define XSTRTOK(s1, d, ptr) strtok_r((s1), (d), (ptr))
2402
+ #endif
2403
+ #define XMEMSET(pmem, data_val, size) \
2404
+ ((void)Mem_Set((void *)(pmem), \
2405
+ (CPU_INT08U) (data_val), \
2406
+ (CPU_SIZE_T)(size)))
2407
+ #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
2408
+ (void *)(psrc), (CPU_SIZE_T)(size)))
2409
+
2410
+ #if (OS_VERSION < 50000)
2411
+ #define XMEMCMP(pmem_1, pmem_2, size) \
2412
+ (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), \
2413
+ (void *)(pmem_2), \
2414
+ (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
2415
+ #else
2416
+ /* Work around for Micrium OS version 5.8 change in behavior
2417
+ * that returns DEF_NO for 0 size compare
2418
+ */
2419
+ #define XMEMCMP(pmem_1, pmem_2, size) \
2420
+ (( (size < 1 ) || \
2421
+ ((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), \
2422
+ (void *)(pmem_2), \
2423
+ (CPU_SIZE_T)(size)) == DEF_YES)) \
2424
+ ? 0 : 1)
2425
+ #define XSNPRINTF snprintf
2426
+ #endif
2427
+
2428
+ #define XMEMMOVE(pdest, psrc, size) ((void)Mem_Move((void *)(pdest), \
2429
+ (void *)(psrc), (CPU_SIZE_T)(size)))
2430
+
2431
+ #if (OS_CFG_MUTEX_EN == DEF_DISABLED)
2432
+ #define SINGLE_THREADED
2433
+ #endif
2434
+
2435
+ #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
2436
+ #define BIG_ENDIAN_ORDER
2437
+ #else
2438
+ #undef BIG_ENDIAN_ORDER
2439
+ #define LITTLE_ENDIAN_ORDER
2440
+ #endif
2441
+ #endif /* MICRIUM */
2442
+
2443
+ #if defined(sun) || defined(__sun)
2444
+ # if defined(__SVR4) || defined(__svr4__)
2445
+ /* Solaris */
2446
+ #ifndef WOLFSSL_SOLARIS
2447
+ #define WOLFSSL_SOLARIS
2448
+ #endif
2449
+ # else
2450
+ /* SunOS */
2451
+ # endif
2452
+ #endif
2453
+
2454
+ #ifdef WOLFSSL_SOLARIS
2455
+ /* Avoid naming clash with fp_zero from math.h > ieefp.h */
2456
+ #define WOLFSSL_DH_CONST
2457
+ #endif
2458
+
2459
+ #ifdef WOLFSSL_MCF5441X
2460
+ #define BIG_ENDIAN_ORDER
2461
+ #ifndef SIZEOF_LONG
2462
+ #define SIZEOF_LONG 4
2463
+ #endif
2464
+ #ifndef SIZEOF_LONG_LONG
2465
+ #define SIZEOF_LONG_LONG 8
2466
+ #endif
2467
+ #endif
2468
+
2469
+ #ifdef WOLFSSL_QL
2470
+ #ifndef WOLFSSL_SEP
2471
+ #define WOLFSSL_SEP
2472
+ #endif
2473
+ #ifndef OPENSSL_EXTRA
2474
+ #define OPENSSL_EXTRA
2475
+ #endif
2476
+ #ifndef SESSION_CERTS
2477
+ #define SESSION_CERTS
2478
+ #endif
2479
+ #ifndef HAVE_AESCCM
2480
+ #define HAVE_AESCCM
2481
+ #endif
2482
+ #ifndef ATOMIC_USER
2483
+ #define ATOMIC_USER
2484
+ #endif
2485
+ #ifndef WOLFSSL_DER_LOAD
2486
+ #define WOLFSSL_DER_LOAD
2487
+ #endif
2488
+ #ifndef KEEP_PEER_CERT
2489
+ #define KEEP_PEER_CERT
2490
+ #endif
2491
+ #ifndef HAVE_ECC
2492
+ #define HAVE_ECC
2493
+ #endif
2494
+ #ifndef SESSION_INDEX
2495
+ #define SESSION_INDEX
2496
+ #endif
2497
+ #endif /* WOLFSSL_QL */
2498
+
2499
+
2500
+ #if defined(WOLFSSL_XILINX)
2501
+ #if !defined(WOLFSSL_XILINX_CRYPT_VERSAL)
2502
+ #define NO_DEV_RANDOM
2503
+ #endif
2504
+ #undef NO_WOLFSSL_DIR
2505
+ #define NO_WOLFSSL_DIR
2506
+
2507
+ #undef HAVE_AESGCM
2508
+ #define HAVE_AESGCM
2509
+ #endif
2510
+
2511
+ /* Detect Cortex M3 (no UMAAL) */
2512
+ #if defined(__ARM_ARCH_7M__) && !defined(WOLFSSL_ARM_ARCH_7M)
2513
+ #define WOLFSSL_ARM_ARCH_7M
2514
+ #endif
2515
+ #if defined(WOLFSSL_SP_ARM_CORTEX_M_ASM) && defined(WOLFSSL_ARM_ARCH_7M)
2516
+ #undef WOLFSSL_SP_NO_UMAAL
2517
+ #define WOLFSSL_SP_NO_UMAAL
2518
+ #endif
2519
+
2520
+ #if defined(WOLFSSL_XILINX_CRYPT) || defined(WOLFSSL_AFALG_XILINX)
2521
+ #if defined(WOLFSSL_ARMASM)
2522
+ #error can not use both ARMv8 instructions and XILINX hardened crypto
2523
+ #endif
2524
+ #if defined(WOLFSSL_SHA3)
2525
+ /* only SHA3-384 is supported */
2526
+ #undef WOLFSSL_NOSHA3_224
2527
+ #undef WOLFSSL_NOSHA3_256
2528
+ #undef WOLFSSL_NOSHA3_512
2529
+ #define WOLFSSL_NOSHA3_224
2530
+ #define WOLFSSL_NOSHA3_256
2531
+ #define WOLFSSL_NOSHA3_512
2532
+ #ifndef WOLFSSL_NO_SHAKE128
2533
+ #define WOLFSSL_NO_SHAKE128
2534
+ #endif
2535
+ #ifndef WOLFSSL_NO_SHAKE256
2536
+ #define WOLFSSL_NO_SHAKE256
2537
+ #endif
2538
+ #endif
2539
+ #ifdef WOLFSSL_AFALG_XILINX_AES
2540
+ #undef WOLFSSL_AES_DIRECT
2541
+ #define WOLFSSL_AES_DIRECT
2542
+ #endif
2543
+ #endif /*(WOLFSSL_XILINX_CRYPT)*/
2544
+
2545
+ #ifdef WOLFSSL_KCAPI_AES
2546
+ #define WOLFSSL_AES_GCM_FIXED_IV_AAD
2547
+ #endif
2548
+ #ifdef WOLFSSL_KCAPI_ECC
2549
+ #undef ECC_USER_CURVES
2550
+ #define ECC_USER_CURVES
2551
+ #undef NO_ECC256
2552
+ #undef HAVE_ECC384
2553
+ #define HAVE_ECC384
2554
+ #undef HAVE_ECC521
2555
+ #define HAVE_ECC521
2556
+ #endif
2557
+
2558
+ #if defined(WOLFSSL_APACHE_MYNEWT)
2559
+ #include "os/os_malloc.h"
2560
+ #if !defined(WOLFSSL_LWIP)
2561
+ #include <mn_socket/mn_socket.h>
2562
+ #endif
2563
+
2564
+ #if !defined(SIZEOF_LONG)
2565
+ #define SIZEOF_LONG 4
2566
+ #endif
2567
+ #if !defined(SIZEOF_LONG_LONG)
2568
+ #define SIZEOF_LONG_LONG 8
2569
+ #endif
2570
+ #if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
2571
+ #define BIG_ENDIAN_ORDER
2572
+ #else
2573
+ #undef BIG_ENDIAN_ORDER
2574
+ #define LITTLE_ENDIAN_ORDER
2575
+ #endif
2576
+ #define NO_WRITEV
2577
+ #define WOLFSSL_USER_IO
2578
+ #define SINGLE_THREADED
2579
+ #define NO_DEV_RANDOM
2580
+ #define NO_DH
2581
+ #define NO_WOLFSSL_DIR
2582
+ #define NO_ERROR_STRINGS
2583
+ #define HAVE_ECC
2584
+ #define NO_SESSION_CACHE
2585
+ #define NO_ERROR_STRINGS
2586
+ #define XMALLOC_USER
2587
+ #define XMALLOC(sz, heap, type) ((void)(heap), (void)(type), os_malloc(sz))
2588
+ #define XREALLOC(p, sz, heap, type) ((void)(heap), (void)(type), os_realloc(p, sz))
2589
+ #define XFREE(p, heap, type) ((void)(heap), (void)(type), os_free(p))
2590
+
2591
+ #endif /*(WOLFSSL_APACHE_MYNEWT)*/
2592
+
2593
+ #ifdef WOLFSSL_ZEPHYR
2594
+ #include <version.h>
2595
+ #if KERNEL_VERSION_NUMBER >= 0x30100
2596
+ #include <zephyr/kernel.h>
2597
+ #include <zephyr/sys/printk.h>
2598
+ #include <zephyr/sys/util.h>
2599
+ #else
2600
+ #include <kernel.h>
2601
+ #include <sys/printk.h>
2602
+ #include <sys/util.h>
2603
+ #endif
2604
+ #include <stdlib.h>
2605
+
2606
+ #define WOLFSSL_DH_CONST
2607
+ #define WOLFSSL_HAVE_MAX
2608
+ #define NO_WRITEV
2609
+ #define NO_STDLIB_ISASCII
2610
+
2611
+ #define USE_FLAT_BENCHMARK_H
2612
+ #define USE_FLAT_TEST_H
2613
+ #define EXIT_FAILURE 1
2614
+ #define MAIN_NO_ARGS
2615
+
2616
+ void *z_realloc(void *ptr, size_t size);
2617
+ #define realloc z_realloc
2618
+ #define max MAX
2619
+
2620
+ #if !defined(CONFIG_NET_SOCKETS_POSIX_NAMES) && !defined(CONFIG_POSIX_API)
2621
+ #define CONFIG_NET_SOCKETS_POSIX_NAMES
2622
+ #endif
2623
+ #endif /* WOLFSSL_ZEPHYR */
2624
+
2625
+ #ifdef WOLFSSL_IMX6
2626
+ #ifndef SIZEOF_LONG_LONG
2627
+ #define SIZEOF_LONG_LONG 8
2628
+ #endif
2629
+ #endif
2630
+
2631
+ /* Setting supported CAAM algorithms */
2632
+ #ifdef WOLFSSL_IMX6Q_CAAM
2633
+ #undef WOLFSSL_CAAM
2634
+ #define WOLFSSL_CAAM
2635
+
2636
+ /* hardware does not support AES-GCM and ECC
2637
+ * has the low power AES module only (no high power with GCM) */
2638
+ #define WOLFSSL_LP_ONLY_CAAM_AES
2639
+ #define WOLFSSL_NO_CAAM_ECC
2640
+ #endif
2641
+
2642
+ #ifdef WOLFSSL_SECO_CAAM
2643
+ #define WOLFSSL_CAAM
2644
+
2645
+ #define WOLFSSL_HASH_KEEP
2646
+ #define WOLFSSL_NO_CAAM_BLOB
2647
+ #endif
2648
+
2649
+ #ifdef WOLFSSL_IMXRT1170_CAAM
2650
+ #define WOLFSSL_CAAM
2651
+ #endif
2652
+
2653
+ /* OS specific support so far */
2654
+ #ifdef WOLFSSL_QNX_CAAM
2655
+ /* shim layer for QNX hashing not yet implemented */
2656
+ #define WOLFSSL_NO_CAAM_HASH
2657
+ #endif
2658
+
2659
+ #ifdef WOLFSSL_CAAM
2660
+ /* switch for all AES type algos */
2661
+ #undef WOLFSSL_CAAM_CIPHER
2662
+ #define WOLFSSL_CAAM_CIPHER
2663
+ #ifdef WOLFSSL_CAAM_CIPHER
2664
+ #ifndef WOLFSSL_LP_ONLY_CAAM_AES
2665
+ /* GCM and XTS mode are only available in the high power module */
2666
+ #define WOLFSSL_CAAM_AESGCM
2667
+ #define WOLFSSL_CAAM_AESXTS
2668
+ #endif
2669
+ #define WOLFSSL_CAAM_AESCCM
2670
+ #define WOLFSSL_CAAM_AESCTR
2671
+ #define WOLFSSL_CAAM_AESCBC
2672
+ #define WOLFSSL_CAAM_CMAC
2673
+ #endif /* WOLFSSL_CAAM_CIPHER */
2674
+ #if defined(HAVE_AESGCM) || defined(WOLFSSL_AES_XTS) || \
2675
+ defined(WOLFSSL_CMAC)
2676
+ /* large performance gain with HAVE_AES_ECB defined */
2677
+ #undef HAVE_AES_ECB
2678
+ #define HAVE_AES_ECB
2679
+
2680
+ /* @TODO used for now until plugging in caam aes use with qnx */
2681
+ #undef WOLFSSL_AES_DIRECT
2682
+ #define WOLFSSL_AES_DIRECT
2683
+ #endif
2684
+
2685
+ /* switch for all hashing algos */
2686
+ #ifndef WOLFSSL_NO_CAAM_HASH
2687
+ #define WOLFSSL_CAAM_HASH
2688
+ #endif
2689
+ #if defined(WOLFSSL_DEVCRYPTO_HMAC)
2690
+ /* HMAC is through the devcrypto calls */
2691
+ #define WOLFSSL_CAAM_HMAC
2692
+ #endif
2693
+
2694
+ /* public key operations */
2695
+ #ifndef WOLFSSL_NO_CAAM_ECC
2696
+ #undef WOLFSSL_CAAM_ECC
2697
+ #define WOLFSSL_CAAM_ECC
2698
+ #endif
2699
+
2700
+ /* so far curve25519 support was only done with the SECO */
2701
+ #ifdef WOLFSSL_SECO_CAAM
2702
+ #define WOLFSSL_CAAM_CURVE25519
2703
+ #endif
2704
+
2705
+ /* Blob support */
2706
+ #ifndef WOLFSSL_NO_CAAM_BLOB
2707
+ #define WOLFSSL_CAAM_BLOB
2708
+ #endif
2709
+ #endif
2710
+
2711
+ #if defined(__xtensa__)
2712
+ /* Compilers for Xtensa have been seen to compile C code into
2713
+ * non-constant time assembly code. The small implementation is not known
2714
+ * to have these issues. */
2715
+ #undef CURVE25519_SMALL
2716
+ #define CURVE25519_SMALL
2717
+ #undef ED25519_SMALL
2718
+ #define ED25519_SMALL
2719
+ #undef CURVE448_SMALL
2720
+ #define CURVE448_SMALL
2721
+ #undef ED448_SMALL
2722
+ #define ED448_SMALL
2723
+ #warning "Contact wolfSSL support for a fast implementation that is " \
2724
+ "constant time"
2725
+ #endif
2726
+
2727
+ #if defined(NO_WC_SSIZE_TYPE) || defined(ssize_t)
2728
+ /* ssize_t comes from system headers or user_settings.h */
2729
+ #elif defined(WC_SSIZE_TYPE)
2730
+ typedef WC_SSIZE_TYPE ssize_t;
2731
+ #elif defined(_MSC_VER)
2732
+ #include <BaseTsd.h>
2733
+ typedef SSIZE_T ssize_t;
2734
+ #endif
2735
+
2736
+ /* If DCP is used without SINGLE_THREADED, enforce WOLFSSL_CRYPT_HW_MUTEX */
2737
+ #if defined(WOLFSSL_IMXRT_DCP) && !defined(SINGLE_THREADED)
2738
+ #undef WOLFSSL_CRYPT_HW_MUTEX
2739
+ #define WOLFSSL_CRYPT_HW_MUTEX 1
2740
+ #endif
2741
+
2742
+ #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
2743
+ !defined(WOLFSSL_LEANPSK) && !defined(NO_WOLFSSL_MEMORY) && \
2744
+ !defined(XMALLOC_OVERRIDE)
2745
+ #define USE_WOLFSSL_MEMORY
2746
+ #endif
2747
+
2748
+ #ifdef WOLFSSL_EMBOS
2749
+ #include "RTOS.h"
2750
+ #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \
2751
+ !defined(WOLFSSL_STATIC_MEMORY)
2752
+ /* Per the user manual of embOS https://www.segger.com/downloads/embos/UM01001
2753
+ * this API has changed with V5. */
2754
+ #if (OS_VERSION >= 50000U)
2755
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), OS_HEAP_malloc((s)))
2756
+ #define XFREE(p, h, type) ((void)(h), (void)(type), OS_HEAP_free((p)))
2757
+ #define XREALLOC(p, n, h, t) ((void)(h), (void)(t), OS_HEAP_realloc((p), (n)))
2758
+ #else
2759
+ #define XMALLOC(s, h, type) ((void)(h), (void)(type), OS_malloc((s)))
2760
+ #define XFREE(p, h, type) ((void)(h), (void)(type), OS_free((p)))
2761
+ #define XREALLOC(p, n, h, t) ((void)(h), (void)(t), OS_realloc((p), (n)))
2762
+ #endif
2763
+ #endif
2764
+ #endif
2765
+
2766
+
2767
+ /* stream ciphers except arc4 need 32bit alignment, intel ok without */
2768
+ #ifndef XSTREAM_ALIGN
2769
+ #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
2770
+ #define NO_XSTREAM_ALIGN
2771
+ #else
2772
+ #define XSTREAM_ALIGN
2773
+ #endif
2774
+ #endif
2775
+
2776
+ /* write dup cannot be used with secure renegotiation because write dup
2777
+ * make write side write only and read side read only */
2778
+ #if defined(HAVE_WRITE_DUP) && defined(HAVE_SECURE_RENEGOTIATION)
2779
+ #error "WRITE DUP and SECURE RENEGOTIATION cannot both be on"
2780
+ #endif
2781
+
2782
+ #ifdef WOLFSSL_SGX
2783
+ #ifdef _MSC_VER
2784
+ #define NO_RC4
2785
+ #ifndef HAVE_FIPS
2786
+ #define WOLFCRYPT_ONLY
2787
+ #define NO_DES3
2788
+ #define NO_SHA
2789
+ #define NO_MD5
2790
+ #else
2791
+ #define TFM_TIMING_RESISTANT
2792
+ #define NO_WOLFSSL_DIR
2793
+ #define NO_WRITEV
2794
+ #define NO_MAIN_DRIVER
2795
+ #define WOLFSSL_LOG_PRINTF
2796
+ #define WOLFSSL_DH_CONST
2797
+ #endif
2798
+ #else
2799
+ #define HAVE_ECC
2800
+ #define NO_WRITEV
2801
+ #define NO_MAIN_DRIVER
2802
+ #define USER_TICKS
2803
+ #define WOLFSSL_LOG_PRINTF
2804
+ #define WOLFSSL_DH_CONST
2805
+ #endif /* _MSC_VER */
2806
+ #if !defined(HAVE_FIPS) && !defined(NO_RSA)
2807
+ #define WC_RSA_BLINDING
2808
+ #endif
2809
+
2810
+ #define NO_FILESYSTEM
2811
+ #define ECC_TIMING_RESISTANT
2812
+ #define TFM_TIMING_RESISTANT
2813
+ #define SINGLE_THREADED
2814
+ #define NO_ASN_TIME /* can not use headers such as windows.h */
2815
+ #define HAVE_AESGCM
2816
+ #define USE_CERT_BUFFERS_2048
2817
+ #endif /* WOLFSSL_SGX */
2818
+
2819
+ /* FreeScale MMCAU hardware crypto has 4 byte alignment.
2820
+ However, KSDK fsl_mmcau.h gives API with no alignment
2821
+ requirements (4 byte alignment is managed internally by fsl_mmcau.c) */
2822
+ #ifdef FREESCALE_MMCAU
2823
+ #ifdef FREESCALE_MMCAU_CLASSIC
2824
+ #define WOLFSSL_MMCAU_ALIGNMENT 4
2825
+ #else
2826
+ #define WOLFSSL_MMCAU_ALIGNMENT 0
2827
+ #endif
2828
+ #endif
2829
+
2830
+ /* if using hardware crypto and have alignment requirements, specify the
2831
+ requirement here. The record header of SSL/TLS will prevent easy alignment.
2832
+ This hint tries to help as much as possible. */
2833
+ #ifndef WOLFSSL_GENERAL_ALIGNMENT
2834
+ #ifdef WOLFSSL_AESNI
2835
+ #define WOLFSSL_GENERAL_ALIGNMENT 16
2836
+ #elif defined(XSTREAM_ALIGN)
2837
+ #define WOLFSSL_GENERAL_ALIGNMENT 4
2838
+ #elif defined(FREESCALE_MMCAU) || defined(FREESCALE_MMCAU_CLASSIC)
2839
+ #define WOLFSSL_GENERAL_ALIGNMENT WOLFSSL_MMCAU_ALIGNMENT
2840
+ #else
2841
+ #define WOLFSSL_GENERAL_ALIGNMENT 0
2842
+ #endif
2843
+ #endif
2844
+
2845
+ #if defined(WOLFSSL_GENERAL_ALIGNMENT) && (WOLFSSL_GENERAL_ALIGNMENT > 0)
2846
+ #if defined(_MSC_VER)
2847
+ #define XGEN_ALIGN __declspec(align(WOLFSSL_GENERAL_ALIGNMENT))
2848
+ #elif defined(__GNUC__)
2849
+ #define XGEN_ALIGN __attribute__((aligned(WOLFSSL_GENERAL_ALIGNMENT)))
2850
+ #else
2851
+ #define XGEN_ALIGN
2852
+ #endif
2853
+ #else
2854
+ #define XGEN_ALIGN
2855
+ #endif
2856
+
2857
+ #if defined(__mips) || defined(__mips64) || \
2858
+ defined(WOLFSSL_SP_MIPS64) || defined(WOLFSSL_SP_MIPS) || \
2859
+ defined(__sparc) || defined(__arm__) || defined(__aarch64__)
2860
+ /* This setting currently only affects big endian targets, currently
2861
+ * only in sp_read_unsigned_bin().
2862
+ */
2863
+ #undef WOLFSSL_SP_INT_DIGIT_ALIGN
2864
+ #define WOLFSSL_SP_INT_DIGIT_ALIGN
2865
+ #endif
2866
+
2867
+ #if defined(__APPLE__) || defined(WOLF_C89)
2868
+ #define WOLFSSL_SP_NO_DYN_STACK
2869
+ #endif
2870
+
2871
+ #if defined(__WATCOMC__) && !defined(WOLF_NO_VARIADIC_MACROS)
2872
+ #define WOLF_NO_VARIADIC_MACROS
2873
+ #endif
2874
+
2875
+ #ifdef __INTEL_COMPILER
2876
+ #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
2877
+ #endif
2878
+
2879
+ /* ---------------------------------------------------------------------------
2880
+ * Math Library Selection (in order of preference)
2881
+ * ---------------------------------------------------------------------------
2882
+ */
2883
+ #if !defined(HAVE_FIPS_VERSION) || \
2884
+ (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 5))
2885
+ #if defined(WOLFSSL_SP_MATH_ALL)
2886
+ /* 1) SP Math: wolfSSL proprietary math implementation (sp_int.c).
2887
+ * Constant time: Always
2888
+ * Enable: WOLFSSL_SP_MATH_ALL
2889
+ */
2890
+ #undef USE_FAST_MATH
2891
+ #undef USE_INTEGER_HEAP_MATH
2892
+ #elif defined(WOLFSSL_SP_MATH)
2893
+ /* 2) SP Math with restricted key sizes: wolfSSL proprietary math
2894
+ * implementation (sp_*.c).
2895
+ * Constant time: Always
2896
+ * Enable: WOLFSSL_SP_MATH
2897
+ */
2898
+ #undef USE_FAST_MATH
2899
+ #undef USE_INTEGER_HEAP_MATH
2900
+ #elif defined(USE_FAST_MATH)
2901
+ /* 3) Tom's Fast Math: Stack based (tfm.c)
2902
+ * Constant time: Only with TFM_TIMING_RESISTANT
2903
+ * Enable: USE_FAST_MATH
2904
+ */
2905
+ #undef USE_INTEGER_HEAP_MATH
2906
+ #elif defined(USE_INTEGER_HEAP_MATH)
2907
+ /* 4) Integer Heap Math: Heap based (integer.c)
2908
+ * Constant time: Not supported
2909
+ * Enable: USE_INTEGER_HEAP_MATH
2910
+ */
2911
+ #elif defined(NO_BIG_INT)
2912
+ /* 5) No big integer math libraries
2913
+ */
2914
+ #else
2915
+ /* default is SP Math. */
2916
+ #define WOLFSSL_SP_MATH_ALL
2917
+ #endif
2918
+ #elif defined(WOLFCRYPT_FIPS_RAND)
2919
+ #ifndef NO_BIG_INT
2920
+ #define NO_BIG_INT
2921
+ #endif
2922
+ #else
2923
+ /* FIPS 140-2 or older */
2924
+ /* Default to fast math (tfm.c), but allow heap math (integer.c) */
2925
+ #if !defined(USE_INTEGER_HEAP_MATH)
2926
+ #undef USE_FAST_MATH
2927
+ #define USE_FAST_MATH
2928
+ #ifndef FP_MAX_BITS
2929
+ #define FP_MAX_BITS 8192
2930
+ #endif
2931
+ #endif
2932
+ #endif
2933
+
2934
+ /* Verify that only one of the above multi-precision math libraries is enabled */
2935
+ #if (defined(WOLFSSL_SP_MATH_ALL) && \
2936
+ (defined(USE_FAST_MATH) || defined(USE_INTEGER_HEAP_MATH))) || \
2937
+ (defined(USE_FAST_MATH) && defined(USE_INTEGER_HEAP_MATH))
2938
+ #error Cannot enable more than one multiple precision math library!
2939
+ #endif
2940
+ /*----------------------------------------------------------------------------*/
2941
+
2942
+ /* SP Math specific options */
2943
+ /* Determine when mp_add_d is required. */
2944
+ #if !defined(NO_PWDBASED) || defined(WOLFSSL_KEY_GEN) || !defined(NO_DH) || \
2945
+ !defined(NO_DSA) || defined(HAVE_ECC) || \
2946
+ (!defined(NO_RSA) && !defined(WOLFSSL_RSA_VERIFY_ONLY)) || \
2947
+ defined(OPENSSL_EXTRA)
2948
+ #define WOLFSSL_SP_ADD_D
2949
+ #endif
2950
+
2951
+ /* Determine when mp_sub_d is required. */
2952
+ #if (!defined(NO_RSA) && !defined(WOLFSSL_RSA_VERIFY_ONLY)) || \
2953
+ !defined(NO_DH) || defined(HAVE_ECC) || !defined(NO_DSA)
2954
+ #define WOLFSSL_SP_SUB_D
2955
+ #endif
2956
+
2957
+ /* Determine when mp_read_radix with a radix of 10 is required. */
2958
+ #if (defined(WOLFSSL_SP_MATH_ALL) && !defined(NO_RSA) && \
2959
+ !defined(WOLFSSL_RSA_VERIFY_ONLY)) || defined(HAVE_ECC) || \
2960
+ !defined(NO_DSA) || defined(OPENSSL_EXTRA) || defined(WOLFSSL_PUBLIC_MP)
2961
+ #define WOLFSSL_SP_READ_RADIX_16
2962
+ #endif
2963
+
2964
+ /* Determine when mp_read_radix with a radix of 10 is required. */
2965
+ #if defined(WOLFSSL_SP_MATH_ALL) && !defined(NO_RSA) && \
2966
+ !defined(WOLFSSL_RSA_VERIFY_ONLY)
2967
+ #define WOLFSSL_SP_READ_RADIX_10
2968
+ #endif
2969
+
2970
+ /* Determine when mp_invmod is required. */
2971
+ #if defined(HAVE_ECC) || !defined(NO_DSA) || defined(OPENSSL_EXTRA) || \
2972
+ (!defined(NO_RSA) && !defined(WOLFSSL_RSA_VERIFY_ONLY) && \
2973
+ !defined(WOLFSSL_RSA_PUBLIC_ONLY)) || defined(OPENSSL_EXTRA)
2974
+ #define WOLFSSL_SP_INVMOD
2975
+ #endif
2976
+
2977
+ /* Determine when mp_invmod_mont_ct is required. */
2978
+ #if defined(WOLFSSL_SP_MATH_ALL) && defined(HAVE_ECC)
2979
+ #define WOLFSSL_SP_INVMOD_MONT_CT
2980
+ #endif
2981
+
2982
+ /* Determine when mp_prime_gen is required. */
2983
+ #if (defined(WOLFSSL_SP_MATH_ALL) && !defined(WOLFSSL_RSA_VERIFY_ONLY) && \
2984
+ !defined(WOLFSSL_RSA_PUBLIC_ONLY)) || !defined(NO_DH) || \
2985
+ (!defined(NO_RSA) && defined(WOLFSSL_KEY_GEN))
2986
+ #define WOLFSSL_SP_PRIME_GEN
2987
+ #endif
2988
+
2989
+ #if (defined(WOLFSSL_SP_MATH_ALL) && !defined(WOLFSSL_RSA_VERIFY_ONLY)) || \
2990
+ (defined(WOLFSSL_KEY_GEN) && !defined(NO_RSA)) || defined(OPENSSL_EXTRA)
2991
+ /* Determine when mp_mul_d is required */
2992
+ #define WOLFSSL_SP_MUL_D
2993
+ #endif
2994
+
2995
+
2996
+ /* user can specify what curves they want with ECC_USER_CURVES otherwise
2997
+ * all curves are on by default for now */
2998
+ #ifndef ECC_USER_CURVES
2999
+ #ifdef WOLFSSL_SP_MATH
3000
+ /* for single precision math only make sure the enabled key sizes are
3001
+ * included in the ECC curve table */
3002
+ #if defined(WOLFSSL_SP_NO_256) && !defined(NO_ECC256)
3003
+ #define NO_ECC256
3004
+ #endif
3005
+ #if defined(WOLFSSL_SP_384) && !defined(HAVE_ECC384)
3006
+ #define HAVE_ECC384
3007
+ #endif
3008
+ #if defined(WOLFSSL_SP_521) && !defined(HAVE_ECC521)
3009
+ #define HAVE_ECC521
3010
+ #endif
3011
+ #elif !defined(HAVE_ALL_CURVES)
3012
+ #define HAVE_ALL_CURVES
3013
+ #endif
3014
+ #endif
3015
+
3016
+ /* The minimum allowed ECC key size */
3017
+ /* Note: 224-bits is equivalent to 2048-bit RSA */
3018
+ #ifndef ECC_MIN_KEY_SZ
3019
+ #ifdef WOLFSSL_MIN_ECC_BITS
3020
+ #define ECC_MIN_KEY_SZ WOLFSSL_MIN_ECC_BITS
3021
+ #else
3022
+ #if defined(WOLFSSL_HARDEN_TLS) && \
3023
+ !defined(WOLFSSL_HARDEN_TLS_NO_PKEY_CHECK)
3024
+ /* Using guidance from section 5.6.1
3025
+ * https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57pt1r5.pdf */
3026
+ #if WOLFSSL_HARDEN_TLS >= 128
3027
+ #define ECC_MIN_KEY_SZ 256
3028
+ #elif WOLFSSL_HARDEN_TLS >= 112
3029
+ #define ECC_MIN_KEY_SZ 224
3030
+ #endif
3031
+ #elif FIPS_VERSION_GE(2,0)
3032
+ /* FIPSv2 and ready (for now) includes 192-bit support */
3033
+ #define ECC_MIN_KEY_SZ 192
3034
+ #else
3035
+ #define ECC_MIN_KEY_SZ 224
3036
+ #endif
3037
+ #endif
3038
+ #endif
3039
+
3040
+ #if defined(WOLFSSL_HARDEN_TLS) && ECC_MIN_KEY_SZ < 224 && \
3041
+ !defined(WOLFSSL_HARDEN_TLS_NO_PKEY_CHECK)
3042
+ /* Implementations MUST NOT negotiate cipher suites offering less than
3043
+ * 112 bits of security.
3044
+ * https://www.rfc-editor.org/rfc/rfc9325#section-4.1
3045
+ * Using guidance from section 5.6.1
3046
+ * https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57pt1r5.pdf */
3047
+ #error "For 112 bits of security ECC needs at least 224 bit keys"
3048
+ #endif
3049
+
3050
+ /* ECC Configs */
3051
+ #ifdef HAVE_ECC
3052
+ /* By default enable Sign, Verify, DHE, Key Import and Key Export unless
3053
+ * explicitly disabled */
3054
+ #if !defined(NO_ECC_SIGN) && \
3055
+ (!defined(ECC_TIMING_RESISTANT) || \
3056
+ (defined(ECC_TIMING_RESISTANT) && !defined(WC_NO_RNG)))
3057
+ #undef HAVE_ECC_SIGN
3058
+ #define HAVE_ECC_SIGN
3059
+ #endif
3060
+ #ifndef NO_ECC_VERIFY
3061
+ #undef HAVE_ECC_VERIFY
3062
+ #define HAVE_ECC_VERIFY
3063
+ #endif
3064
+ #ifndef NO_ECC_CHECK_KEY
3065
+ #undef HAVE_ECC_CHECK_KEY
3066
+ #define HAVE_ECC_CHECK_KEY
3067
+ #endif
3068
+ #if !defined(NO_ECC_DHE) && !defined(WC_NO_RNG)
3069
+ #undef HAVE_ECC_DHE
3070
+ #define HAVE_ECC_DHE
3071
+ #endif
3072
+ #ifndef NO_ECC_KEY_IMPORT
3073
+ #undef HAVE_ECC_KEY_IMPORT
3074
+ #define HAVE_ECC_KEY_IMPORT
3075
+ #endif
3076
+ /* The ECC key export requires mp_int or SP */
3077
+ #if (!defined(NO_ECC_KEY_EXPORT) && defined(WOLFSSL_SP_MATH)) || \
3078
+ (!defined(NO_ECC_KEY_EXPORT) && !defined(NO_BIG_INT))
3079
+ #undef HAVE_ECC_KEY_EXPORT
3080
+ #define HAVE_ECC_KEY_EXPORT
3081
+ #endif
3082
+ #endif /* HAVE_ECC */
3083
+
3084
+ #if (defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL)) && defined(HAVE_ECC) && \
3085
+ !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A) && \
3086
+ !defined(WOLFSSL_CRYPTOCELL) && !defined(WOLFSSL_SE050) && \
3087
+ !defined(WOLF_CRYPTO_CB_ONLY_ECC) && !defined(WOLFSSL_STM32_PKA)
3088
+ #undef USE_ECC_B_PARAM
3089
+ #define USE_ECC_B_PARAM
3090
+ #endif
3091
+
3092
+ /* Curve25519 Configs */
3093
+ #ifdef HAVE_CURVE25519
3094
+ /* By default enable shared secret, key export and import */
3095
+ #ifndef NO_CURVE25519_SHARED_SECRET
3096
+ #undef HAVE_CURVE25519_SHARED_SECRET
3097
+ #define HAVE_CURVE25519_SHARED_SECRET
3098
+ #endif
3099
+ #ifndef NO_CURVE25519_KEY_EXPORT
3100
+ #undef HAVE_CURVE25519_KEY_EXPORT
3101
+ #define HAVE_CURVE25519_KEY_EXPORT
3102
+ #endif
3103
+ #ifndef NO_CURVE25519_KEY_IMPORT
3104
+ #undef HAVE_CURVE25519_KEY_IMPORT
3105
+ #define HAVE_CURVE25519_KEY_IMPORT
3106
+ #endif
3107
+ #endif /* HAVE_CURVE25519 */
3108
+
3109
+ /* Ed25519 Configs */
3110
+ #ifdef HAVE_ED25519
3111
+ /* By default enable make key, sign, verify, key export and import */
3112
+ #ifndef NO_ED25519_MAKE_KEY
3113
+ #undef HAVE_ED25519_MAKE_KEY
3114
+ #define HAVE_ED25519_MAKE_KEY
3115
+ #endif
3116
+ #ifndef NO_ED25519_SIGN
3117
+ #ifndef HAVE_ED25519_MAKE_KEY
3118
+ #error "Need HAVE_ED25519_MAKE_KEY with HAVE_ED25519_SIGN"
3119
+ #endif
3120
+ #undef HAVE_ED25519_SIGN
3121
+ #define HAVE_ED25519_SIGN
3122
+ #endif
3123
+ #ifndef NO_ED25519_VERIFY
3124
+ #undef HAVE_ED25519_VERIFY
3125
+ #define HAVE_ED25519_VERIFY
3126
+ #ifdef WOLFSSL_ED25519_STREAMING_VERIFY
3127
+ #undef WOLFSSL_ED25519_PERSISTENT_SHA
3128
+ #define WOLFSSL_ED25519_PERSISTENT_SHA
3129
+ #endif
3130
+ #endif
3131
+ #ifndef NO_ED25519_KEY_EXPORT
3132
+ #undef HAVE_ED25519_KEY_EXPORT
3133
+ #define HAVE_ED25519_KEY_EXPORT
3134
+ #endif
3135
+ #ifndef NO_ED25519_KEY_IMPORT
3136
+ #undef HAVE_ED25519_KEY_IMPORT
3137
+ #define HAVE_ED25519_KEY_IMPORT
3138
+ #endif
3139
+ #endif /* HAVE_ED25519 */
3140
+
3141
+ /* Curve448 Configs */
3142
+ #ifdef HAVE_CURVE448
3143
+ /* By default enable shared secret, key export and import */
3144
+ #ifndef NO_CURVE448_SHARED_SECRET
3145
+ #undef HAVE_CURVE448_SHARED_SECRET
3146
+ #define HAVE_CURVE448_SHARED_SECRET
3147
+ #endif
3148
+ #ifndef NO_CURVE448_KEY_EXPORT
3149
+ #undef HAVE_CURVE448_KEY_EXPORT
3150
+ #define HAVE_CURVE448_KEY_EXPORT
3151
+ #endif
3152
+ #ifndef NO_CURVE448_KEY_IMPORT
3153
+ #undef HAVE_CURVE448_KEY_IMPORT
3154
+ #define HAVE_CURVE448_KEY_IMPORT
3155
+ #endif
3156
+ #endif /* HAVE_CURVE448 */
3157
+
3158
+ /* Ed448 Configs */
3159
+ #ifdef HAVE_ED448
3160
+ /* By default enable sign, verify, key export and import */
3161
+ #ifndef NO_ED448_SIGN
3162
+ #undef HAVE_ED448_SIGN
3163
+ #define HAVE_ED448_SIGN
3164
+ #endif
3165
+ #ifndef NO_ED448_VERIFY
3166
+ #undef HAVE_ED448_VERIFY
3167
+ #define HAVE_ED448_VERIFY
3168
+ #ifdef WOLFSSL_ED448_STREAMING_VERIFY
3169
+ #undef WOLFSSL_ED448_PERSISTENT_SHA
3170
+ #define WOLFSSL_ED448_PERSISTENT_SHA
3171
+ #endif
3172
+ #endif
3173
+ #ifndef NO_ED448_KEY_EXPORT
3174
+ #undef HAVE_ED448_KEY_EXPORT
3175
+ #define HAVE_ED448_KEY_EXPORT
3176
+ #endif
3177
+ #ifndef NO_ED448_KEY_IMPORT
3178
+ #undef HAVE_ED448_KEY_IMPORT
3179
+ #define HAVE_ED448_KEY_IMPORT
3180
+ #endif
3181
+ #endif /* HAVE_ED448 */
3182
+
3183
+
3184
+ /* RFC 5958 (Asymmetric Key Packages) */
3185
+ #if !defined(WC_ENABLE_ASYM_KEY_EXPORT) && \
3186
+ ((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_EXPORT)) || \
3187
+ (defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_EXPORT)) || \
3188
+ (defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT)) || \
3189
+ (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_EXPORT)) || \
3190
+ defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || \
3191
+ defined(HAVE_SPHINCS) || defined(HAVE_LIBOQS))
3192
+ #define WC_ENABLE_ASYM_KEY_EXPORT
3193
+ #endif
3194
+
3195
+ #if !defined(WC_ENABLE_ASYM_KEY_IMPORT) && \
3196
+ ((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT)) || \
3197
+ (defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_IMPORT)) || \
3198
+ (defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)) || \
3199
+ (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)) || \
3200
+ defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || \
3201
+ defined(HAVE_SPHINCS) || defined(HAVE_LIBOQS))
3202
+ #define WC_ENABLE_ASYM_KEY_IMPORT
3203
+ #endif
3204
+
3205
+
3206
+ /* FIPS does not support CFB1 or CFB8 */
3207
+ #if !defined(WOLFSSL_NO_AES_CFB_1_8) && \
3208
+ (defined(HAVE_SELFTEST) || \
3209
+ (defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)))
3210
+ #define WOLFSSL_NO_AES_CFB_1_8
3211
+ #endif
3212
+
3213
+ /* AES Config */
3214
+ #ifndef NO_AES
3215
+ /* By default enable all AES key sizes, decryption and CBC */
3216
+ #ifndef AES_MAX_KEY_SIZE
3217
+ #undef AES_MAX_KEY_SIZE
3218
+ #define AES_MAX_KEY_SIZE 256
3219
+ #endif
3220
+
3221
+ #ifndef NO_AES_128
3222
+ #undef WOLFSSL_AES_128
3223
+ #define WOLFSSL_AES_128
3224
+ #endif
3225
+ #if !defined(NO_AES_192) && AES_MAX_KEY_SIZE >= 192
3226
+ #undef WOLFSSL_AES_192
3227
+ #define WOLFSSL_AES_192
3228
+ #endif
3229
+ #if !defined(NO_AES_256) && AES_MAX_KEY_SIZE >= 256
3230
+ #undef WOLFSSL_AES_256
3231
+ #define WOLFSSL_AES_256
3232
+ #endif
3233
+ #if !defined(WOLFSSL_AES_128) && !defined(WOLFSSL_AES_256) && \
3234
+ defined(HAVE_ECC_ENCRYPT)
3235
+ #warning HAVE_ECC_ENCRYPT uses AES 128/256 bit keys
3236
+ #endif
3237
+
3238
+ #ifndef NO_AES_DECRYPT
3239
+ #undef HAVE_AES_DECRYPT
3240
+ #define HAVE_AES_DECRYPT
3241
+ #endif
3242
+ #ifndef NO_AES_CBC
3243
+ #undef HAVE_AES_CBC
3244
+ #define HAVE_AES_CBC
3245
+ #endif
3246
+ #ifdef WOLFSSL_AES_XTS
3247
+ /* AES-XTS makes calls to AES direct functions */
3248
+ #ifndef WOLFSSL_AES_DIRECT
3249
+ #define WOLFSSL_AES_DIRECT
3250
+ #endif
3251
+ #endif
3252
+ #ifdef WOLFSSL_AES_CFB
3253
+ /* AES-CFB makes calls to AES direct functions */
3254
+ #ifndef WOLFSSL_AES_DIRECT
3255
+ #define WOLFSSL_AES_DIRECT
3256
+ #endif
3257
+ #endif
3258
+ #ifdef WOLFSSL_AES_CTS
3259
+ #if defined(NO_AES_CBC) || !defined(HAVE_AES_CBC)
3260
+ #error "AES CTS requires AES CBC"
3261
+ #endif
3262
+ #endif
3263
+ #endif /* !NO_AES */
3264
+
3265
+ /* cmac kdf */
3266
+ #if defined(HAVE_CMAC_KDF)
3267
+ #if defined(NO_AES)
3268
+ #error HAVE_CMAC_KDF and NO_AES are incompatible
3269
+ #endif
3270
+
3271
+ /* SP 800-56C cmac kdf two-step requires AES-128-cmac for expand step. */
3272
+ #if defined(NO_AES_128)
3273
+ #error HAVE_CMAC_KDF and NO_AES_128 are incompatible
3274
+ #endif
3275
+
3276
+ #if !defined(WOLFSSL_CMAC)
3277
+ #define WOLFSSL_CMAC
3278
+ #endif
3279
+ #endif /* HAVE_CMAC_KDF*/
3280
+
3281
+ #if (defined(WOLFSSL_TLS13) && defined(WOLFSSL_NO_TLS12)) || \
3282
+ (!defined(HAVE_AES_CBC) && defined(NO_DES3) && defined(NO_RC4) && \
3283
+ !defined(HAVE_CAMELLIA) & !defined(HAVE_NULL_CIPHER))
3284
+ #define WOLFSSL_AEAD_ONLY
3285
+ #endif
3286
+
3287
+ #if !defined(HAVE_PUBLIC_FFDHE) && !defined(NO_DH) && \
3288
+ !defined(WOLFSSL_NO_PUBLIC_FFDHE) && \
3289
+ (defined(HAVE_SELFTEST) || FIPS_VERSION_LE(2,0))
3290
+ /* This should only be enabled for FIPS v2 or older. It enables use of the
3291
+ * older wc_Dh_ffdhe####_Get() API's */
3292
+ #define HAVE_PUBLIC_FFDHE
3293
+ #endif
3294
+
3295
+ #if !defined(NO_DH) && !defined(HAVE_FFDHE)
3296
+ #if defined(HAVE_FFDHE_2048) || defined(HAVE_FFDHE_3072) || \
3297
+ defined(HAVE_FFDHE_4096) || defined(HAVE_FFDHE_6144) || \
3298
+ defined(HAVE_FFDHE_8192)
3299
+ #define HAVE_FFDHE
3300
+ #endif
3301
+ #endif
3302
+ #if defined(HAVE_FFDHE_8192)
3303
+ #define MIN_FFDHE_BITS 8192
3304
+ #elif defined(HAVE_FFDHE_6144)
3305
+ #define MIN_FFDHE_BITS 6144
3306
+ #elif defined(HAVE_FFDHE_4096)
3307
+ #define MIN_FFDHE_BITS 4096
3308
+ #elif defined(HAVE_FFDHE_3072)
3309
+ #define MIN_FFDHE_BITS 3072
3310
+ #elif defined(HAVE_FFDHE_2048)
3311
+ #define MIN_FFDHE_BITS 2048
3312
+ #else
3313
+ #define MIN_FFDHE_BITS 0
3314
+ #endif
3315
+ #define MIN_FFDHE_FP_MAX_BITS (MIN_FFDHE_BITS * 2)
3316
+ #if defined(HAVE_FFDHE) && defined(FP_MAX_BITS)
3317
+ #if MIN_FFDHE_FP_MAX_BITS > FP_MAX_BITS
3318
+ #error "FFDHE parameters are too large for FP_MAX_BIT as set"
3319
+ #endif
3320
+ #endif
3321
+ #if defined(HAVE_FFDHE) && defined(SP_INT_BITS)
3322
+ #if MIN_FFDHE_BITS > SP_INT_BITS
3323
+ #error "FFDHE parameters are too large for SP_INT_BIT as set"
3324
+ #endif
3325
+ #endif
3326
+
3327
+ /* if desktop type system and fastmath increase default max bits */
3328
+ #if defined(WOLFSSL_X86_64_BUILD) || defined(WOLFSSL_AARCH64_BUILD)
3329
+ #if defined(USE_FAST_MATH) && !defined(FP_MAX_BITS)
3330
+ #if MIN_FFDHE_FP_MAX_BITS <= 8192
3331
+ #define FP_MAX_BITS 8192
3332
+ #else
3333
+ #define FP_MAX_BITS MIN_FFDHE_FP_MAX_BITS
3334
+ #endif
3335
+ #endif
3336
+ #if defined(WOLFSSL_SP_MATH_ALL) && !defined(SP_INT_BITS)
3337
+ #ifdef WOLFSSL_MYSQL_COMPATIBLE
3338
+ #define SP_INT_BITS 8192
3339
+ #elif MIN_FFDHE_BITS <= 4096
3340
+ #define SP_INT_BITS 4096
3341
+ #else
3342
+ #define SP_INT_BITS MIN_FFDHE_BITS
3343
+ #endif
3344
+ #endif
3345
+ #endif
3346
+
3347
+ /* If using the max strength build, ensure OLD TLS is disabled. */
3348
+ #ifdef WOLFSSL_MAX_STRENGTH
3349
+ #undef NO_OLD_TLS
3350
+ #define NO_OLD_TLS
3351
+ #endif
3352
+
3353
+
3354
+ /* Default AES minimum auth tag sz, allow user to override */
3355
+ #ifndef WOLFSSL_MIN_AUTH_TAG_SZ
3356
+ #define WOLFSSL_MIN_AUTH_TAG_SZ 12
3357
+ #endif
3358
+
3359
+
3360
+ /* sniffer requires:
3361
+ * static RSA cipher suites
3362
+ * session stats and peak stats
3363
+ */
3364
+ #ifdef WOLFSSL_SNIFFER
3365
+ #ifndef WOLFSSL_STATIC_RSA
3366
+ #define WOLFSSL_STATIC_RSA
3367
+ #endif
3368
+ #ifndef WOLFSSL_STATIC_DH
3369
+ #define WOLFSSL_STATIC_DH
3370
+ #endif
3371
+ /* Allow option to be disabled. */
3372
+ #ifndef WOLFSSL_NO_SESSION_STATS
3373
+ #ifndef WOLFSSL_SESSION_STATS
3374
+ #define WOLFSSL_SESSION_STATS
3375
+ #endif
3376
+ #ifndef WOLFSSL_PEAK_SESSIONS
3377
+ #define WOLFSSL_PEAK_SESSIONS
3378
+ #endif
3379
+ #endif
3380
+ #endif
3381
+
3382
+ /* Decode Public Key extras on by default, user can turn off with
3383
+ * WOLFSSL_NO_DECODE_EXTRA */
3384
+ #ifndef WOLFSSL_NO_DECODE_EXTRA
3385
+ #ifndef RSA_DECODE_EXTRA
3386
+ #define RSA_DECODE_EXTRA
3387
+ #endif
3388
+ #ifndef ECC_DECODE_EXTRA
3389
+ #define ECC_DECODE_EXTRA
3390
+ #endif
3391
+ #endif
3392
+
3393
+ /* C Sharp wrapper defines */
3394
+ #ifdef HAVE_CSHARP
3395
+ #ifndef WOLFSSL_DTLS
3396
+ #define WOLFSSL_DTLS
3397
+ #endif
3398
+ #undef NO_PSK
3399
+ #undef NO_SHA256
3400
+ #undef NO_DH
3401
+ #endif
3402
+
3403
+ /* CryptoCell defines */
3404
+ #ifdef WOLFSSL_CRYPTOCELL
3405
+ #if defined(HAVE_ECC) && defined(HAVE_ECC_SIGN)
3406
+ /* Don't attempt to sign/verify an all-zero digest in wolfCrypt tests */
3407
+ #define WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST
3408
+ #endif /* HAVE_ECC && HAVE_ECC_SIGN */
3409
+ #endif
3410
+
3411
+ /* Asynchronous Crypto */
3412
+ #ifdef WOLFSSL_ASYNC_CRYPT
3413
+ #if !defined(HAVE_CAVIUM) && !defined(HAVE_INTEL_QA) && \
3414
+ !defined(WOLF_CRYPTO_CB) && !defined(HAVE_PK_CALLBACKS) && \
3415
+ !defined(WOLFSSL_ASYNC_CRYPT_SW)
3416
+ #error No async backend defined with WOLFSSL_ASYNC_CRYPT!
3417
+ #endif
3418
+
3419
+ /* Make sure wolf events are enabled */
3420
+ #undef HAVE_WOLF_EVENT
3421
+ #define HAVE_WOLF_EVENT
3422
+
3423
+ #ifdef WOLFSSL_ASYNC_CRYPT_SW
3424
+ #define WC_ASYNC_DEV_SIZE 168
3425
+ #else
3426
+ #define WC_ASYNC_DEV_SIZE 336
3427
+ #endif
3428
+
3429
+ /* Enable ECC_CACHE_CURVE for ASYNC */
3430
+ #if !defined(ECC_CACHE_CURVE) && !defined(NO_ECC_CACHE_CURVE)
3431
+ /* Enabled by default for increased async performance,
3432
+ * but not required */
3433
+ #define ECC_CACHE_CURVE
3434
+ #endif
3435
+
3436
+ #if defined(HAVE_ECC) && defined(HAVE_ECC_SIGN)
3437
+ /* Don't attempt to sign/verify an all-zero digest in wolfCrypt tests */
3438
+ #define WC_TEST_NO_ECC_SIGN_VERIFY_ZERO_DIGEST
3439
+ #endif /* HAVE_ECC && HAVE_ECC_SIGN */
3440
+
3441
+ #endif /* WOLFSSL_ASYNC_CRYPT */
3442
+ #ifndef WC_ASYNC_DEV_SIZE
3443
+ #define WC_ASYNC_DEV_SIZE 0
3444
+ #endif
3445
+ #ifdef HAVE_INTEL_QA /* Disable SHA512/224 and SHA512/256 support for QAT */
3446
+ #define WOLFSSL_NOSHA512_224
3447
+ #define WOLFSSL_NOSHA512_256
3448
+ #endif
3449
+ /* leantls checks */
3450
+ #ifdef WOLFSSL_LEANTLS
3451
+ #ifndef HAVE_ECC
3452
+ #error leantls build needs ECC
3453
+ #endif
3454
+ #endif /* WOLFSSL_LEANTLS*/
3455
+
3456
+ /* restriction with static memory */
3457
+ #ifdef WOLFSSL_STATIC_MEMORY
3458
+ #if defined(HAVE_IO_POOL) || defined(XMALLOC_USER) || defined(NO_WOLFSSL_MEMORY)
3459
+ #error static memory cannot be used with HAVE_IO_POOL, XMALLOC_USER or NO_WOLFSSL_MEMORY
3460
+ #endif
3461
+ #if !defined(WOLFSSL_SP_MATH_ALL) && !defined(USE_FAST_MATH) && \
3462
+ !defined(WOLFSSL_SP_MATH) && !defined(NO_BIG_INT)
3463
+ #error The static memory option is only supported for fast math or SP Math
3464
+ #endif
3465
+ #endif /* WOLFSSL_STATIC_MEMORY */
3466
+
3467
+ #ifdef HAVE_AES_KEYWRAP
3468
+ #ifndef WOLFSSL_AES_DIRECT
3469
+ #error AES key wrap requires AES direct please define WOLFSSL_AES_DIRECT
3470
+ #endif
3471
+ #endif
3472
+
3473
+ #ifdef HAVE_PKCS7
3474
+ #if defined(NO_AES) && defined(NO_DES3)
3475
+ #error PKCS7 needs either AES or 3DES enabled, please enable one
3476
+ #endif
3477
+ #endif
3478
+
3479
+ #ifndef NO_PKCS12
3480
+ #undef HAVE_PKCS12
3481
+ #define HAVE_PKCS12
3482
+ #endif
3483
+
3484
+ #if !defined(NO_PKCS8) || defined(HAVE_PKCS12)
3485
+ #undef HAVE_PKCS8
3486
+ #define HAVE_PKCS8
3487
+ #endif
3488
+
3489
+ #if !defined(NO_PBKDF1) || defined(WOLFSSL_ENCRYPTED_KEYS) || \
3490
+ defined(HAVE_PKCS8) || defined(HAVE_PKCS12)
3491
+ #undef HAVE_PBKDF1
3492
+ #define HAVE_PBKDF1
3493
+ #endif
3494
+
3495
+ #if !defined(NO_PBKDF2) || defined(HAVE_PKCS7) || defined(HAVE_SCRYPT)
3496
+ #undef HAVE_PBKDF2
3497
+ #define HAVE_PBKDF2
3498
+ #endif
3499
+
3500
+ #if !defined(WOLFCRYPT_ONLY) && !defined(NO_OLD_TLS) && \
3501
+ (defined(NO_SHA) || defined(NO_MD5))
3502
+ #error old TLS requires MD5 and SHA
3503
+ #endif
3504
+
3505
+ /* for backwards compatibility */
3506
+ #if defined(TEST_IPV6) && !defined(WOLFSSL_IPV6)
3507
+ #define WOLFSSL_IPV6
3508
+ #endif
3509
+
3510
+ /* ---------------------------------------------------------------------------
3511
+ * ASN Library Selection (default to ASN_TEMPLATE)
3512
+ * ---------------------------------------------------------------------------
3513
+ */
3514
+ #if !defined(WOLFSSL_ASN_TEMPLATE) && !defined(WOLFSSL_ASN_ORIGINAL) && \
3515
+ !defined(NO_ASN)
3516
+ #define WOLFSSL_ASN_TEMPLATE
3517
+ #endif
3518
+
3519
+ #if defined(WOLFSSL_DUAL_ALG_CERTS) && !defined(WOLFSSL_ASN_TEMPLATE)
3520
+ #error "Dual alg cert support requires the ASN.1 template feature."
3521
+ #endif
3522
+
3523
+ #if defined(WOLFSSL_ACERT) && !defined(WOLFSSL_ASN_TEMPLATE)
3524
+ #error "Attribute Certificate support requires the ASN.1 template feature."
3525
+ #endif
3526
+
3527
+ #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
3528
+ #undef WOLFSSL_ASN_ALL
3529
+ #define WOLFSSL_ASN_ALL
3530
+ #endif
3531
+
3532
+ /* Enable all parsing features for ASN */
3533
+ #ifdef WOLFSSL_ASN_ALL
3534
+ /* Alternate Names */
3535
+ #undef WOLFSSL_ALT_NAMES
3536
+ #define WOLFSSL_ALT_NAMES
3537
+
3538
+ /* Alternate Name: human readable form of IP address*/
3539
+ #undef WOLFSSL_IP_ALT_NAME
3540
+ #define WOLFSSL_IP_ALT_NAME
3541
+
3542
+ /* Alternate name: human readable form of registered ID */
3543
+ #undef WOLFSSL_RID_ALT_NAME
3544
+ #define WOLFSSL_RID_ALT_NAME
3545
+
3546
+ /* CA Issuer URI */
3547
+ #undef WOLFSSL_ASN_CA_ISSUER
3548
+ #define WOLFSSL_ASN_CA_ISSUER
3549
+
3550
+ /* FPKI (Federal PKI) extensions */
3551
+ #undef WOLFSSL_FPKI
3552
+ #define WOLFSSL_FPKI
3553
+
3554
+ /* Certificate policies */
3555
+ #undef WOLFSSL_SEP
3556
+ #define WOLFSSL_SEP
3557
+
3558
+ /* Support for full AuthorityKeyIdentifier extension.
3559
+ * Only supports copying full AKID from an existing certificate */
3560
+ #undef WOLFSSL_AKID_NAME
3561
+ #define WOLFSSL_AKID_NAME
3562
+
3563
+ /* Extended ASN.1 parsing support (typically used with cert gen) */
3564
+ #undef WOLFSSL_CERT_EXT
3565
+ #define WOLFSSL_CERT_EXT
3566
+
3567
+ /* Support for SubjectDirectoryAttributes extension */
3568
+ #undef WOLFSSL_SUBJ_DIR_ATTR
3569
+ #define WOLFSSL_SUBJ_DIR_ATTR
3570
+
3571
+ /* Support for SubjectInfoAccess extension */
3572
+ #undef WOLFSSL_SUBJ_INFO_ACC
3573
+ #define WOLFSSL_SUBJ_INFO_ACC
3574
+
3575
+ #undef WOLFSSL_CERT_NAME_ALL
3576
+ #define WOLFSSL_CERT_NAME_ALL
3577
+
3578
+ /* Store pointers to issuer name components (lengths and encodings) */
3579
+ #undef WOLFSSL_HAVE_ISSUER_NAMES
3580
+ #define WOLFSSL_HAVE_ISSUER_NAMES
3581
+
3582
+ /* Additional ASN.1 encoded name fields. See CTC_MAX_ATTRIB for max limit */
3583
+ #undef WOLFSSL_MULTI_ATTRIB
3584
+ #define WOLFSSL_MULTI_ATTRIB
3585
+
3586
+ /* Parsing of indefinite length encoded ASN.1
3587
+ * Optionally used by PKCS7/PKCS12 */
3588
+ #undef ASN_BER_TO_DER
3589
+ #define ASN_BER_TO_DER
3590
+
3591
+ /* Enable custom OID support for subject and request extensions */
3592
+ #undef WOLFSSL_CUSTOM_OID
3593
+ #define WOLFSSL_CUSTOM_OID
3594
+
3595
+ /* Support for full OID (not just sum) encoding */
3596
+ #undef HAVE_OID_ENCODING
3597
+ #define HAVE_OID_ENCODING
3598
+
3599
+ /* Support for full OID (not just sum) decoding */
3600
+ #undef HAVE_OID_DECODING
3601
+ #define HAVE_OID_DECODING
3602
+
3603
+ /* S/MIME - Secure Multipurpose Internet Mail Extension (used with PKCS7) */
3604
+ #undef HAVE_SMIME
3605
+ #define HAVE_SMIME
3606
+
3607
+ /* Enable compatibility layer function for getting time string */
3608
+ #undef WOLFSSL_ASN_TIME_STRING
3609
+ #define WOLFSSL_ASN_TIME_STRING
3610
+
3611
+ /* Support for parsing key usage */
3612
+ #undef WOLFSSL_ASN_PARSE_KEYUSAGE
3613
+ #define WOLFSSL_ASN_PARSE_KEYUSAGE
3614
+
3615
+ /* Support for parsing OCSP status */
3616
+ #undef WOLFSSL_OCSP_PARSE_STATUS
3617
+ #define WOLFSSL_OCSP_PARSE_STATUS
3618
+
3619
+ /* Extended Key Usage */
3620
+ #undef WOLFSSL_EKU_OID
3621
+ #define WOLFSSL_EKU_OID
3622
+
3623
+ /* Attribute Certificate support */
3624
+ #if defined(WOLFSSL_ASN_TEMPLATE) && !defined(WOLFSSL_ACERT)
3625
+ #define WOLFSSL_ACERT
3626
+ #endif
3627
+ #endif
3628
+
3629
+ #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || \
3630
+ defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(WOLFSSL_NGINX) || \
3631
+ defined(WOLFSSL_HAPROXY)
3632
+ #undef WOLFSSL_ASN_TIME_STRING
3633
+ #define WOLFSSL_ASN_TIME_STRING
3634
+ #endif
3635
+
3636
+ #if (defined(WOLFSSL_CERT_GEN) && defined(WOLFSSL_CERT_EXT)) || \
3637
+ (defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA))
3638
+ #undef WOLFSSL_ASN_PARSE_KEYUSAGE
3639
+ #define WOLFSSL_ASN_PARSE_KEYUSAGE
3640
+ #endif
3641
+
3642
+ #if defined(HAVE_OCSP) && !defined(WOLFCRYPT_ONLY) && \
3643
+ (defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
3644
+ defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY) || \
3645
+ defined(WOLFSSL_APACHE_HTTPD))
3646
+ #undef WOLFSSL_OCSP_PARSE_STATUS
3647
+ #define WOLFSSL_OCSP_PARSE_STATUS
3648
+ #endif
3649
+
3650
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL) || \
3651
+ defined(OPENSSL_EXTRA_X509_SMALL) || defined(WOLFSSL_CERT_GEN)
3652
+ #undef WOLFSSL_MULTI_ATTRIB
3653
+ #define WOLFSSL_MULTI_ATTRIB
3654
+ #endif
3655
+
3656
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL) || \
3657
+ defined(OPENSSL_EXTRA_X509_SMALL)
3658
+ #undef WOLFSSL_EKU_OID
3659
+ #define WOLFSSL_EKU_OID
3660
+ #endif
3661
+
3662
+ /* Disable time checking if no timer */
3663
+ #if defined(NO_ASN_TIME)
3664
+ #define NO_ASN_TIME_CHECK
3665
+ #endif
3666
+
3667
+ /* ASN Unknown Extension Callback support */
3668
+ #if defined(WOLFSSL_CUSTOM_OID) && defined(HAVE_OID_DECODING) && \
3669
+ defined(WOLFSSL_ASN_TEMPLATE)
3670
+ #undef WC_ASN_UNKNOWN_EXT_CB
3671
+ #define WC_ASN_UNKNOWN_EXT_CB
3672
+ #else
3673
+ /* if user supplied build option and not using ASN template, raise error */
3674
+ #if defined(WC_ASN_UNKNOWN_EXT_CB) && !defined(WOLFSSL_ASN_TEMPLATE)
3675
+ #error ASN unknown extension callback is only supported \
3676
+ with ASN template
3677
+ #endif
3678
+ #endif
3679
+
3680
+ /* Linux Kernel Module */
3681
+ #ifdef WOLFSSL_LINUXKM
3682
+ #ifndef WOLFSSL_KERNEL_MODE
3683
+ #define WOLFSSL_KERNEL_MODE
3684
+ #endif
3685
+ #ifndef WOLFSSL_API_PREFIX_MAP
3686
+ #define WOLFSSL_API_PREFIX_MAP
3687
+ #endif
3688
+ #if defined(WOLFSSL_LINUXKM_VERBOSE_DEBUG) && \
3689
+ !defined(WOLFSSL_KERNEL_VERBOSE_DEBUG)
3690
+ #define WOLFSSL_KERNEL_VERBOSE_DEBUG
3691
+ #endif
3692
+ #ifdef HAVE_CONFIG_H
3693
+ #include <config.h>
3694
+ #undef HAVE_CONFIG_H
3695
+ #endif
3696
+ #ifndef NO_DEV_RANDOM
3697
+ #define NO_DEV_RANDOM
3698
+ #endif
3699
+ #ifndef NO_WRITEV
3700
+ #define NO_WRITEV
3701
+ #endif
3702
+ #ifndef NO_FILESYSTEM
3703
+ #define NO_FILESYSTEM
3704
+ #endif
3705
+ #ifndef NO_STDIO_FILESYSTEM
3706
+ #define NO_STDIO_FILESYSTEM
3707
+ #endif
3708
+ #ifndef WOLFSSL_NO_SOCK
3709
+ #define WOLFSSL_NO_SOCK
3710
+ #endif
3711
+ #ifndef WOLFSSL_DH_CONST
3712
+ #define WOLFSSL_DH_CONST
3713
+ #endif
3714
+ #ifndef WOLFSSL_USER_IO
3715
+ #define WOLFSSL_USER_IO
3716
+ #endif
3717
+ #ifndef USE_WOLF_STRTOK
3718
+ #define USE_WOLF_STRTOK
3719
+ #endif
3720
+ #ifndef WOLFSSL_OLD_PRIME_CHECK
3721
+ #define WOLFSSL_OLD_PRIME_CHECK
3722
+ #endif
3723
+ #ifdef LINUXKM_LKCAPI_REGISTER
3724
+ #ifndef WC_TEST_EXPORT_SUBTESTS
3725
+ #define WC_TEST_EXPORT_SUBTESTS
3726
+ #endif
3727
+ #endif
3728
+ #ifndef WOLFSSL_TEST_SUBROUTINE
3729
+ #ifdef WC_TEST_EXPORT_SUBTESTS
3730
+ #define WOLFSSL_TEST_SUBROUTINE
3731
+ #else
3732
+ #define WOLFSSL_TEST_SUBROUTINE static
3733
+ #endif
3734
+ #endif
3735
+ #undef HAVE_PTHREAD
3736
+ /* linuxkm uses linux/string.h, included by linuxkm_wc_port.h. */
3737
+ #undef HAVE_STRINGS_H
3738
+ #define NO_STRING_H
3739
+ /* linuxkm uses linux/limits.h, included by linuxkm_wc_port.h. */
3740
+ #undef HAVE_LIMITS_H
3741
+ #ifndef NO_LIMITS_H
3742
+ #define NO_LIMITS_H
3743
+ #endif
3744
+ #ifndef NO_STDLIB_H
3745
+ #define NO_STDLIB_H
3746
+ #endif
3747
+ #ifndef NO_STDINT_H
3748
+ #define NO_STDINT_H
3749
+ #endif
3750
+ #ifndef NO_CTYPE_H
3751
+ #define NO_CTYPE_H
3752
+ #endif
3753
+ #undef HAVE_ERRNO_H
3754
+ #undef HAVE_THREAD_LS
3755
+ #undef HAVE_ATEXIT
3756
+ #undef WOLFSSL_HAVE_MIN
3757
+ #undef WOLFSSL_HAVE_MAX
3758
+ #undef WOLFSSL_HAVE_ASSERT_H
3759
+ #ifndef WOLFSSL_NO_ASSERT_H
3760
+ #define WOLFSSL_NO_ASSERT_H
3761
+ #endif
3762
+ #ifndef WOLFSSL_NO_GETPID
3763
+ #define WOLFSSL_NO_GETPID
3764
+ #endif /* WOLFSSL_NO_GETPID */
3765
+ #ifndef SIZEOF_LONG
3766
+ #define SIZEOF_LONG 8
3767
+ #endif
3768
+ #ifndef SIZEOF_LONG_LONG
3769
+ #define SIZEOF_LONG_LONG 8
3770
+ #endif
3771
+ #define CHAR_BIT 8
3772
+ #ifndef WOLFSSL_SP_DIV_64
3773
+ #define WOLFSSL_SP_DIV_64
3774
+ #endif
3775
+ #ifndef WOLFSSL_SP_DIV_WORD_HALF
3776
+ #define WOLFSSL_SP_DIV_WORD_HALF
3777
+ #endif
3778
+
3779
+ #ifdef WC_PIE_RELOC_TABLES
3780
+ #ifndef WC_NO_INTERNAL_FUNCTION_POINTERS
3781
+ #define WC_NO_INTERNAL_FUNCTION_POINTERS
3782
+ #endif
3783
+ #ifndef WOLFSSL_ECC_CURVE_STATIC
3784
+ #define WOLFSSL_ECC_CURVE_STATIC
3785
+ #endif
3786
+ #ifndef WOLFSSL_NAMES_STATIC
3787
+ #define WOLFSSL_NAMES_STATIC
3788
+ #endif
3789
+ #ifndef WOLFSSL_NO_PUBLIC_FFDHE
3790
+ #define WOLFSSL_NO_PUBLIC_FFDHE
3791
+ #endif
3792
+ #undef HAVE_PUBLIC_FFDHE
3793
+ #endif
3794
+
3795
+ #ifndef NO_OLD_WC_NAMES
3796
+ #define NO_OLD_WC_NAMES
3797
+ #endif
3798
+ #ifndef NO_OLD_SHA_NAMES
3799
+ #define NO_OLD_SHA_NAMES
3800
+ #endif
3801
+ #ifndef NO_OLD_MD5_NAME
3802
+ #define NO_OLD_MD5_NAME
3803
+ #endif
3804
+ #ifndef OPENSSL_COEXIST
3805
+ #define OPENSSL_COEXIST
3806
+ #endif
3807
+ #ifndef NO_OLD_SSL_NAMES
3808
+ #define NO_OLD_SSL_NAMES
3809
+ #endif
3810
+ #undef WOLFSSL_MIN_AUTH_TAG_SZ
3811
+ #define WOLFSSL_MIN_AUTH_TAG_SZ 4
3812
+
3813
+ #if defined(LINUXKM_LKCAPI_REGISTER) && !defined(WOLFSSL_ASN_INT_LEAD_0_ANY)
3814
+ /* kernel 5.10 crypto manager tests key(s) that fail unless leading
3815
+ * zero bytes are tolerated in GetASN_Integer().
3816
+ */
3817
+ #define WOLFSSL_ASN_INT_LEAD_0_ANY
3818
+ #endif
3819
+
3820
+ #if !defined(WC_RESEED_INTERVAL) && defined(LINUXKM_LKCAPI_REGISTER)
3821
+ /* If installing handlers, use the maximum reseed interval allowed by
3822
+ * NIST SP 800-90A Rev. 1, to avoid unnecessary delays in DRBG
3823
+ * generation.
3824
+ */
3825
+ #if defined(HAVE_FIPS) && FIPS_VERSION_LT(6,0)
3826
+ #define WC_RESEED_INTERVAL UINT_MAX
3827
+ #else
3828
+ #define WC_RESEED_INTERVAL (((word64)1UL)<<48UL)
3829
+ #endif
3830
+ #endif
3831
+ #if defined(__aarch64__) && !defined(WOLFSSL_AARCH64_PRIVILEGE_MODE)
3832
+ #define WOLFSSL_AARCH64_PRIVILEGE_MODE
3833
+ #endif
3834
+ #endif
3835
+
3836
+ /* FreeBSD Kernel Module */
3837
+ #ifdef WOLFSSL_BSDKM
3838
+ #define WOLFSSL_KERNEL_MODE
3839
+ #define WC_TEST_EXPORT_SUBTESTS
3840
+ #ifdef WOLFSSL_BSDKM_VERBOSE_DEBUG
3841
+ #define WOLFSSL_KERNEL_VERBOSE_DEBUG
3842
+ #endif
3843
+ #ifdef HAVE_CONFIG_H
3844
+ #include <config.h>
3845
+ #undef HAVE_CONFIG_H
3846
+ #endif
3847
+ #ifndef NO_ASN_TIME
3848
+ #define NO_ASN_TIME
3849
+ #endif
3850
+ #ifndef NO_DEV_RANDOM
3851
+ #define NO_DEV_RANDOM
3852
+ #endif
3853
+ #ifndef NO_WRITEV
3854
+ #define NO_WRITEV
3855
+ #endif
3856
+ #ifndef NO_FILESYSTEM
3857
+ #define NO_FILESYSTEM
3858
+ #endif
3859
+ #ifndef NO_STDIO_FILESYSTEM
3860
+ #define NO_STDIO_FILESYSTEM
3861
+ #endif
3862
+ #ifndef WOLFSSL_NO_SOCK
3863
+ #define WOLFSSL_NO_SOCK
3864
+ #endif
3865
+ #ifndef WOLFSSL_DH_CONST
3866
+ #define WOLFSSL_DH_CONST
3867
+ #endif
3868
+ #ifndef WOLFSSL_USER_IO
3869
+ #define WOLFSSL_USER_IO
3870
+ #endif
3871
+ #ifndef USE_WOLF_STRTOK
3872
+ #define USE_WOLF_STRTOK
3873
+ #endif
3874
+ #ifndef WOLFSSL_OLD_PRIME_CHECK
3875
+ #define WOLFSSL_OLD_PRIME_CHECK
3876
+ #endif
3877
+ #ifndef WOLFSSL_TEST_SUBROUTINE
3878
+ #ifndef NO_CRYPT_TEST
3879
+ #define WOLFSSL_TEST_SUBROUTINE
3880
+ #else
3881
+ #define WOLFSSL_TEST_SUBROUTINE static
3882
+ #endif
3883
+ #endif
3884
+ /* bsdkm uses kernel headers, included in bsdkm_wc_port.h. */
3885
+ #undef HAVE_PTHREAD
3886
+ #undef HAVE_STRINGS_H
3887
+ #undef HAVE_LIMITS_H
3888
+ #define NO_STRING_H
3889
+ #define NO_LIMITS_H
3890
+ #define NO_STDLIB_H
3891
+ #define NO_STDINT_H
3892
+ #define NO_CTYPE_H
3893
+ #undef HAVE_ERRNO_H
3894
+ #undef HAVE_THREAD_LS
3895
+ #undef HAVE_ATEXIT
3896
+ #undef WOLFSSL_HAVE_ASSERT_H
3897
+ #define WOLFSSL_NO_ASSERT_H
3898
+ #ifndef WOLFSSL_NO_GETPID
3899
+ #define WOLFSSL_NO_GETPID
3900
+ #endif /* WOLFSSL_NO_GETPID */
3901
+ #ifndef SIZEOF_LONG
3902
+ #define SIZEOF_LONG 8
3903
+ #endif
3904
+ #ifndef SIZEOF_LONG_LONG
3905
+ #define SIZEOF_LONG_LONG 8
3906
+ #endif
3907
+ #ifndef WOLFSSL_SP_DIV_64
3908
+ #define WOLFSSL_SP_DIV_64
3909
+ #endif
3910
+ #ifndef WOLFSSL_SP_DIV_WORD_HALF
3911
+ #define WOLFSSL_SP_DIV_WORD_HALF
3912
+ #endif
3913
+
3914
+ #ifndef NO_OLD_WC_NAMES
3915
+ #define NO_OLD_WC_NAMES
3916
+ #endif
3917
+ #ifndef NO_OLD_SHA_NAMES
3918
+ #define NO_OLD_SHA_NAMES
3919
+ #endif
3920
+ #ifndef NO_OLD_MD5_NAME
3921
+ #define NO_OLD_MD5_NAME
3922
+ #endif
3923
+ #ifndef OPENSSL_COEXIST
3924
+ #define OPENSSL_COEXIST
3925
+ #endif
3926
+ #ifndef NO_OLD_SSL_NAMES
3927
+ #define NO_OLD_SSL_NAMES
3928
+ #endif
3929
+
3930
+ /* FreeBSD kernel defines its own min, max functions in sys/libkern.h */
3931
+ #undef WOLFSSL_HAVE_MIN
3932
+ #define WOLFSSL_HAVE_MIN
3933
+
3934
+ #undef WOLFSSL_HAVE_MAX
3935
+ #define WOLFSSL_HAVE_MAX
3936
+ #endif
3937
+
3938
+ /* Place any other flags or defines here */
3939
+
3940
+ #if defined(WOLFSSL_MYSQL_COMPATIBLE) && defined(_WIN32) \
3941
+ && defined(HAVE_GMTIME_R)
3942
+ #undef HAVE_GMTIME_R /* don't trust macro with windows */
3943
+ #endif /* WOLFSSL_MYSQL_COMPATIBLE */
3944
+
3945
+ #if (defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
3946
+ defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY)) && !defined(NO_TLS)
3947
+ #define OPENSSL_NO_ENGINE
3948
+
3949
+ /* Session Tickets will be enabled when --enable-opensslall is used.
3950
+ * Time is required for ticket expiration checking */
3951
+ #if !defined(HAVE_SESSION_TICKET) && !defined(NO_ASN_TIME)
3952
+ #define HAVE_SESSION_TICKET
3953
+ #endif
3954
+ /* OCSP will be enabled in configure.ac when --enable-opensslall is used,
3955
+ * but do not force all users to have it enabled. */
3956
+ #ifndef HAVE_OCSP
3957
+ /*#define HAVE_OCSP*/
3958
+ #endif
3959
+ #ifndef KEEP_OUR_CERT
3960
+ #define KEEP_OUR_CERT
3961
+ #endif
3962
+ #ifndef HAVE_SNI
3963
+ #define HAVE_SNI
3964
+ #endif
3965
+ #ifndef WOLFSSL_RSA_KEY_CHECK
3966
+ #define WOLFSSL_RSA_KEY_CHECK
3967
+ #endif
3968
+ #endif
3969
+
3970
+ /* Make sure setting OPENSSL_ALL also sets OPENSSL_EXTRA. */
3971
+ #if defined(OPENSSL_ALL) && !defined(OPENSSL_EXTRA)
3972
+ #define OPENSSL_EXTRA
3973
+ #endif
3974
+
3975
+
3976
+ #if (defined(OPENSSL_EXTRA) || defined(WOLFSSL_QT)) && \
3977
+ !defined(WOLFSSL_ASN_CA_ISSUER)
3978
+ #define WOLFSSL_ASN_CA_ISSUER
3979
+ #endif
3980
+
3981
+
3982
+ /* ---------------------------------------------------------------------------
3983
+ * OpenSSL compat layer
3984
+ * ---------------------------------------------------------------------------
3985
+ */
3986
+ #ifdef OPENSSL_EXTRA
3987
+ #undef WOLFSSL_ALWAYS_VERIFY_CB
3988
+ #define WOLFSSL_ALWAYS_VERIFY_CB
3989
+
3990
+ #undef WOLFSSL_VERIFY_CB_ALL_CERTS
3991
+ #define WOLFSSL_VERIFY_CB_ALL_CERTS
3992
+
3993
+ #undef WOLFSSL_EXTRA_ALERTS
3994
+ #define WOLFSSL_EXTRA_ALERTS
3995
+
3996
+ #undef HAVE_EXT_CACHE
3997
+ #define HAVE_EXT_CACHE
3998
+
3999
+ #undef WOLFSSL_FORCE_CACHE_ON_TICKET
4000
+ #define WOLFSSL_FORCE_CACHE_ON_TICKET
4001
+
4002
+ #undef WOLFSSL_AKID_NAME
4003
+ #define WOLFSSL_AKID_NAME
4004
+
4005
+ #undef HAVE_CTS
4006
+ #define HAVE_CTS
4007
+
4008
+ #undef WOLFSSL_SESSION_ID_CTX
4009
+ #define WOLFSSL_SESSION_ID_CTX
4010
+
4011
+ #undef WOLFSSL_CERT_SETUP_CB
4012
+ #define WOLFSSL_CERT_SETUP_CB
4013
+ #endif /* OPENSSL_EXTRA */
4014
+
4015
+ #ifdef OPENSSL_EXTRA_X509_SMALL
4016
+ #undef WOLFSSL_NO_OPENSSL_RAND_CB
4017
+ #define WOLFSSL_NO_OPENSSL_RAND_CB
4018
+ #endif
4019
+
4020
+ #ifdef HAVE_SNI
4021
+ #define SSL_CTRL_SET_TLSEXT_HOSTNAME 55
4022
+ #endif
4023
+
4024
+ /* both CURVE and ED small math should be enabled */
4025
+ #ifdef CURVED25519_SMALL
4026
+ #define CURVE25519_SMALL
4027
+ #define ED25519_SMALL
4028
+ #endif
4029
+
4030
+ /* both CURVE and ED small math should be enabled */
4031
+ #ifdef CURVED448_SMALL
4032
+ #define CURVE448_SMALL
4033
+ #define ED448_SMALL
4034
+ #endif
4035
+
4036
+
4037
+ #ifndef WOLFSSL_ALERT_COUNT_MAX
4038
+ #define WOLFSSL_ALERT_COUNT_MAX 5
4039
+ #endif
4040
+
4041
+ /* Enable blinding by default for C-only, non-small curve25519 implementation */
4042
+ #if defined(HAVE_CURVE25519) && !defined(CURVE25519_SMALL) && \
4043
+ !defined(FREESCALE_LTC_ECC) && !defined(WOLFSSL_ARMASM) && \
4044
+ (!defined(USE_INTEL_SPEEDUP) || defined(NO_CURVED25519_X64)) && \
4045
+ !defined(WOLFSSL_CURVE25519_BLINDING) && !defined(NO_CURVE25519_BLINDING)
4046
+ #define WOLFSSL_CURVE25519_BLINDING
4047
+ #endif
4048
+
4049
+ /* warning for not using harden build options (default with ./configure) */
4050
+ /* do not warn if big integer support is disabled */
4051
+ #if !defined(WC_NO_HARDEN) && !defined(NO_BIG_INT)
4052
+ #if (defined(USE_FAST_MATH) && !defined(TFM_TIMING_RESISTANT)) || \
4053
+ (defined(HAVE_ECC) && !defined(ECC_TIMING_RESISTANT)) || \
4054
+ (!defined(NO_RSA) && !defined(WC_RSA_BLINDING) && !defined(HAVE_FIPS) && \
4055
+ !defined(WC_NO_RNG))
4056
+
4057
+ #ifndef _MSC_VER
4058
+ #warning "For timing resistance / side-channel attack prevention consider using harden options"
4059
+ #else
4060
+ #pragma message("Warning: For timing resistance / side-channel attack prevention consider using harden options")
4061
+ #endif
4062
+ #endif
4063
+ #endif
4064
+
4065
+ #ifdef OPENSSL_COEXIST
4066
+ /* make sure old names are disabled */
4067
+ #ifndef NO_OLD_SSL_NAMES
4068
+ #define NO_OLD_SSL_NAMES
4069
+ #endif
4070
+ #ifndef NO_OLD_WC_NAMES
4071
+ #define NO_OLD_WC_NAMES
4072
+ #endif
4073
+ #if defined(HAVE_SELFTEST) || \
4074
+ (defined(HAVE_FIPS) && FIPS_VERSION3_LT(5,0,0))
4075
+ /* old FIPS needs this remapping. */
4076
+ #define Sha3 wc_Sha3
4077
+ #endif
4078
+ #endif
4079
+
4080
+ #if defined(NO_OLD_WC_NAMES) || defined(OPENSSL_EXTRA)
4081
+ /* added to have compatibility with SHA256() */
4082
+ #if !defined(NO_OLD_SHA_NAMES) && (!defined(HAVE_FIPS) || \
4083
+ FIPS_VERSION_GT(2,0))
4084
+ #define NO_OLD_SHA_NAMES
4085
+ #endif
4086
+ #if !defined(NO_OLD_MD5_NAME) && (!defined(HAVE_FIPS) || \
4087
+ FIPS_VERSION_GT(2,0))
4088
+ #define NO_OLD_MD5_NAME
4089
+ #endif
4090
+ #endif
4091
+
4092
+ /* switch for compatibility layer functionality. Has subparts i.e. BIO/X509
4093
+ * When opensslextra is enabled all subparts should be turned on. */
4094
+ #ifdef OPENSSL_EXTRA
4095
+ #undef OPENSSL_EXTRA_X509_SMALL
4096
+ #define OPENSSL_EXTRA_X509_SMALL
4097
+ #endif /* OPENSSL_EXTRA */
4098
+
4099
+ /* support for converting DER to PEM */
4100
+ #if (defined(WOLFSSL_KEY_GEN) && !defined(WOLFSSL_NO_DER_TO_PEM)) || \
4101
+ defined(WOLFSSL_CERT_GEN) || defined(OPENSSL_EXTRA)
4102
+ #undef WOLFSSL_DER_TO_PEM
4103
+ #define WOLFSSL_DER_TO_PEM
4104
+ #endif
4105
+
4106
+ /* keep backwards compatibility enabling encrypted private key */
4107
+ #ifndef WOLFSSL_ENCRYPTED_KEYS
4108
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
4109
+ defined(HAVE_WEBSERVER)
4110
+ #define WOLFSSL_ENCRYPTED_KEYS
4111
+ #endif
4112
+ #endif
4113
+
4114
+ /* support for disabling PEM to DER */
4115
+ #if !defined(WOLFSSL_NO_PEM) && !defined(NO_CODING)
4116
+ #undef WOLFSSL_PEM_TO_DER
4117
+ #define WOLFSSL_PEM_TO_DER
4118
+ #endif
4119
+
4120
+ /* Parts of the openssl compatibility layer require peer certs */
4121
+ #if (defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL) || \
4122
+ defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
4123
+ defined(HAVE_LIGHTY)) && !defined(NO_CERTS) && !defined(NO_KEEP_PEER_CERT)
4124
+ #undef KEEP_PEER_CERT
4125
+ #define KEEP_PEER_CERT
4126
+ #endif
4127
+
4128
+ /* Always copy certificate(s) from SSL CTX to each SSL object on creation,
4129
+ * if this is not defined then each SSL object shares a pointer to the
4130
+ * original certificate buffer owned by the SSL CTX. */
4131
+ #if defined(OPENSSL_ALL) && !defined(WOLFSSL_NO_COPY_CERT)
4132
+ #undef WOLFSSL_COPY_CERT
4133
+ #define WOLFSSL_COPY_CERT
4134
+ #endif
4135
+
4136
+ /* Always copy private key from SSL CTX to each SSL object on creation,
4137
+ * if this is not defined then each SSL object shares a pointer to the
4138
+ * original key buffer owned by the SSL CTX. */
4139
+ #if defined(OPENSSL_ALL) && !defined(WOLFSSL_NO_COPY_KEY)
4140
+ #undef WOLFSSL_COPY_KEY
4141
+ #define WOLFSSL_COPY_KEY
4142
+ #endif
4143
+
4144
+ /*
4145
+ * Keeps the "Finished" messages after a TLS handshake for use as the so-called
4146
+ * "tls-unique" channel binding. See comment in internal.h around clientFinished
4147
+ * and serverFinished for more information.
4148
+ */
4149
+ #if defined(OPENSSL_ALL) || defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_WPAS)
4150
+ #undef WOLFSSL_HAVE_TLS_UNIQUE
4151
+ #define WOLFSSL_HAVE_TLS_UNIQUE
4152
+ #endif
4153
+
4154
+ /* WPAS Small option requires OPENSSL_EXTRA_X509_SMALL */
4155
+ #if defined(WOLFSSL_WPAS_SMALL) && !defined(OPENSSL_EXTRA_X509_SMALL)
4156
+ #define OPENSSL_EXTRA_X509_SMALL
4157
+ #endif
4158
+
4159
+ /* Web Server needs to enable OPENSSL_EXTRA_X509_SMALL */
4160
+ #if defined(HAVE_WEBSERVER) && !defined(OPENSSL_EXTRA_X509_SMALL)
4161
+ #define OPENSSL_EXTRA_X509_SMALL
4162
+ #endif
4163
+
4164
+ /* The EX data CRYPTO API's used with compatibility */
4165
+ #if !defined(HAVE_EX_DATA_CRYPTO) && \
4166
+ (defined(OPENSSL_ALL) || defined(WOLFSSL_WPAS_SMALL) || \
4167
+ defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || \
4168
+ defined(HAVE_LIGHTY) || defined(WOLFSSL_HAPROXY) || \
4169
+ defined(WOLFSSL_OPENSSH) || defined(HAVE_SBLIM_SFCB) || \
4170
+ defined(WOLFSSL_WOLFSENTRY_HOOKS))
4171
+ #define HAVE_EX_DATA_CRYPTO
4172
+ #endif
4173
+
4174
+ #if defined(WOLFSSL_WOLFSENTRY_HOOKS) && !defined(HAVE_EX_DATA_CLEANUP_HOOKS)
4175
+ #define HAVE_EX_DATA_CLEANUP_HOOKS
4176
+ #endif
4177
+
4178
+ /* Enable EX Data support if required */
4179
+ #if (defined(HAVE_EX_DATA_CRYPTO) || defined(HAVE_EX_DATA_CLEANUP_HOOKS)) && \
4180
+ !defined(HAVE_EX_DATA)
4181
+ #define HAVE_EX_DATA
4182
+ #endif
4183
+
4184
+
4185
+ /* RAW hash function APIs are not implemented */
4186
+ #if defined(WOLFSSL_AFALG_HASH)
4187
+ #undef WOLFSSL_NO_HASH_RAW
4188
+ #define WOLFSSL_NO_HASH_RAW
4189
+ #endif
4190
+
4191
+ #if defined(HAVE_XCHACHA) && !defined(HAVE_CHACHA)
4192
+ /* XChacha requires ChaCha */
4193
+ #undef HAVE_XCHACHA
4194
+ #endif
4195
+
4196
+ #if !defined(NO_KDF) && !defined(NO_HMAC)
4197
+ #undef WOLFSSL_HAVE_PRF
4198
+ #define WOLFSSL_HAVE_PRF
4199
+ #endif
4200
+
4201
+ #if defined(NO_ASN) && defined(WOLFCRYPT_ONLY) && !defined(WOLFSSL_WOLFSSH)
4202
+ #undef WOLFSSL_NO_INT_ENCODE
4203
+ #define WOLFSSL_NO_INT_ENCODE
4204
+ #endif
4205
+
4206
+ #if defined(NO_ASN) && defined(WOLFCRYPT_ONLY)
4207
+ #undef WOLFSSL_NO_INT_DECODE
4208
+ #define WOLFSSL_NO_INT_DECODE
4209
+ #endif
4210
+
4211
+ #if defined(WOLFCRYPT_ONLY) && defined(WOLFSSL_RSA_VERIFY_ONLY) && \
4212
+ defined(WC_NO_RSA_OAEP) && !defined(HAVE_ECC)
4213
+ #undef WOLFSSL_NO_CT_OPS
4214
+ #define WOLFSSL_NO_CT_OPS
4215
+ #endif
4216
+
4217
+ #if defined(WOLFCRYPT_ONLY) && defined(NO_AES) && !defined(HAVE_CURVE25519) && \
4218
+ !defined(HAVE_CURVE448) && defined(WC_NO_RNG) && defined(WC_NO_RSA_OAEP)
4219
+ #undef WOLFSSL_NO_CONST_CMP
4220
+ #define WOLFSSL_NO_CONST_CMP
4221
+ #endif
4222
+
4223
+ #if defined(WOLFCRYPT_ONLY) && defined(NO_AES) && !defined(WOLFSSL_SHA384) && \
4224
+ !defined(WOLFSSL_SHA512) && defined(WC_NO_RNG) && \
4225
+ !defined(WOLFSSL_SP_MATH) && !defined(WOLFSSL_SP_MATH_ALL) \
4226
+ && !defined(USE_FAST_MATH) && defined(NO_SHA256) && \
4227
+ !defined(WOLFSSL_USE_FORCE_ZERO)
4228
+ #undef WOLFSSL_NO_FORCE_ZERO
4229
+ #define WOLFSSL_NO_FORCE_ZERO
4230
+ #endif
4231
+
4232
+ /* Detect old cryptodev name */
4233
+ #if defined(WOLF_CRYPTO_DEV) && !defined(WOLF_CRYPTO_CB)
4234
+ #define WOLF_CRYPTO_CB
4235
+ #endif
4236
+
4237
+ #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_NO_SIGALG)
4238
+ #error TLS 1.3 requires the Signature Algorithms extension to be enabled
4239
+ #endif
4240
+
4241
+ #ifndef NO_WOLFSSL_BASE64_DECODE
4242
+ #define WOLFSSL_BASE64_DECODE
4243
+ #endif
4244
+
4245
+ #if defined(FORTRESS) && !defined(HAVE_EX_DATA)
4246
+ #define HAVE_EX_DATA
4247
+ #endif
4248
+
4249
+ #ifdef HAVE_EX_DATA
4250
+ #ifndef MAX_EX_DATA
4251
+ #define MAX_EX_DATA 5 /* allow for five items of ex_data */
4252
+ #endif
4253
+ #endif
4254
+
4255
+
4256
+ #ifdef NO_WOLFSSL_SMALL_STACK
4257
+ #undef WOLFSSL_SMALL_STACK
4258
+ #endif
4259
+
4260
+ #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SMALL_STACK_STATIC) && \
4261
+ !defined(NO_WOLFSSL_SMALL_STACK_STATIC)
4262
+ #define WOLFSSL_SMALL_STACK_STATIC
4263
+ #endif
4264
+
4265
+ #ifdef WOLFSSL_SMALL_STACK_STATIC
4266
+ #undef WOLFSSL_SMALL_STACK_STATIC
4267
+ #define WOLFSSL_SMALL_STACK_STATIC static
4268
+ #else
4269
+ #define WOLFSSL_SMALL_STACK_STATIC
4270
+ #endif
4271
+
4272
+ /* The client session cache requires time for timeout */
4273
+ #if defined(NO_ASN_TIME) && !defined(NO_SESSION_CACHE)
4274
+ #define NO_SESSION_CACHE
4275
+ #endif
4276
+
4277
+ #if defined(NO_ASN_TIME) && !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB)
4278
+ #define WOLFSSL_NO_DEF_TICKET_ENC_CB
4279
+ #endif
4280
+ #if defined(NO_ASN_TIME) && defined(HAVE_SESSION_TICKET)
4281
+ #undef HAVE_SESSION_TICKET
4282
+ #endif
4283
+
4284
+ /* Use static ECC structs for Position Independent Code (PIC) */
4285
+ #if defined(__IAR_SYSTEMS_ICC__) && defined(__ROPI__)
4286
+ #define WOLFSSL_ECC_CURVE_STATIC
4287
+ #define WOLFSSL_NAMES_STATIC
4288
+ #endif
4289
+
4290
+ /* FIPS v1 does not support TLS v1.3 (requires RSA PSS and HKDF) */
4291
+ #if FIPS_VERSION_EQ(1,0)
4292
+ #undef WC_RSA_PSS
4293
+ #undef WOLFSSL_TLS13
4294
+ #endif
4295
+
4296
+ /* FIPS v2 does not support WOLFSSL_PSS_LONG_SALT */
4297
+ #if FIPS_VERSION_EQ(2,0)
4298
+ #ifdef WOLFSSL_PSS_LONG_SALT
4299
+ #undef WOLFSSL_PSS_LONG_SALT
4300
+ #endif
4301
+ #endif
4302
+
4303
+ /* For FIPSv2 make sure the ECDSA encoding allows extra bytes
4304
+ * but make sure users consider enabling it */
4305
+ #if !defined(NO_STRICT_ECDSA_LEN) && FIPS_VERSION_GE(2,0)
4306
+ /* ECDSA length checks off by default for CAVP testing
4307
+ * consider enabling strict checks in production */
4308
+ #define NO_STRICT_ECDSA_LEN
4309
+ #endif
4310
+
4311
+ /* Do not allow using small stack with no malloc */
4312
+ #if defined(WOLFSSL_NO_MALLOC) && \
4313
+ (defined(WOLFSSL_SMALL_STACK) || defined(WOLFSSL_SMALL_STACK_CACHE)) && \
4314
+ !defined(WOLFSSL_STATIC_MEMORY)
4315
+ #error Small stack cannot be used with no malloc (WOLFSSL_NO_MALLOC) and \
4316
+ without staticmemory (WOLFSSL_STATIC_MEMORY)
4317
+ #endif
4318
+
4319
+ /* If malloc is disabled make sure it is also disabled in SP math */
4320
+ #if defined(WOLFSSL_NO_MALLOC) && !defined(WOLFSSL_SP_NO_MALLOC) && \
4321
+ (defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL))
4322
+ #define WOLFSSL_SP_NO_MALLOC
4323
+ #endif
4324
+
4325
+ /* Enable DH Extra for QT, openssl all, openssh and static ephemeral */
4326
+ /* Allows export/import of DH key and params as DER */
4327
+ #if !defined(NO_DH) && !defined(WOLFSSL_DH_EXTRA) && \
4328
+ (defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || defined(WOLFSSL_OPENSSH) || \
4329
+ defined(WOLFSSL_STATIC_EPHEMERAL))
4330
+ #define WOLFSSL_DH_EXTRA
4331
+ #endif
4332
+
4333
+ /* DH Extra is not supported on FIPS v1 or v2 (is missing DhKey .pub/.priv) */
4334
+ #if defined(WOLFSSL_DH_EXTRA) && defined(HAVE_FIPS) && FIPS_VERSION_LE(2,0)
4335
+ #undef WOLFSSL_DH_EXTRA
4336
+ #endif
4337
+
4338
+ /* FIPS 140-3 does not have this definition in wolfCrypt dh.h, but OpenSSL dh.h depends on it.
4339
+ * Define it here as well if needed, as we want to avoid modifying dh.h in FIPS. */
4340
+ #ifndef DH_MAX_SIZE
4341
+ #ifdef USE_FAST_MATH
4342
+ /* FP implementation support numbers up to FP_MAX_BITS / 2 bits. */
4343
+ #define DH_MAX_SIZE (FP_MAX_BITS / 2)
4344
+ #if defined(WOLFSSL_MYSQL_COMPATIBLE) && DH_MAX_SIZE < 8192
4345
+ #error "MySQL needs FP_MAX_BITS at least at 16384"
4346
+ #endif
4347
+ #elif defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)
4348
+ /* SP implementation supports numbers of SP_INT_BITS bits. */
4349
+ #define DH_MAX_SIZE (((SP_INT_BITS + 7) / 8) * 8)
4350
+ #if defined(WOLFSSL_MYSQL_COMPATIBLE) && DH_MAX_SIZE < 8192
4351
+ #error "MySQL needs SP_INT_BITS at least at 8192"
4352
+ #endif
4353
+ #else
4354
+ #ifdef WOLFSSL_MYSQL_COMPATIBLE
4355
+ /* Integer maths is dynamic but we only go up to 8192 bits. */
4356
+ #define DH_MAX_SIZE 8192
4357
+ #else
4358
+ /* Integer maths is dynamic but we only go up to 4096 bits. */
4359
+ #define DH_MAX_SIZE 4096
4360
+ #endif
4361
+ #endif
4362
+ #endif
4363
+
4364
+ /* wc_Sha512.devId isn't available before FIPS 5.1 */
4365
+ #if defined(HAVE_FIPS) && FIPS_VERSION_LT(5,1)
4366
+ #define NO_SHA2_CRYPTO_CB
4367
+ #endif
4368
+
4369
+ /* Enable HAVE_ONE_TIME_AUTH by default for use with TLS cipher suites
4370
+ * when poly1305 is enabled
4371
+ */
4372
+ #if defined(HAVE_POLY1305) && !defined(HAVE_ONE_TIME_AUTH)
4373
+ #define HAVE_ONE_TIME_AUTH
4374
+ #endif
4375
+
4376
+ /* This is checked for in configure.ac, so might want to do it in here as well.
4377
+ */
4378
+ #if defined(HAVE_SECURE_RENEGOTIATION) && defined(HAVE_RENEGOTIATION_INDICATION)
4379
+ #error HAVE_RENEGOTIATION_INDICATION cannot be defined together with \
4380
+ HAVE_SECURE_RENEGOTIATION
4381
+ #endif
4382
+
4383
+ /* Check for insecure build combination:
4384
+ * secure renegotiation [enabled]
4385
+ * extended master secret [disabled]
4386
+ * session resumption [enabled]
4387
+ */
4388
+ #if defined(HAVE_SECURE_RENEGOTIATION) && !defined(HAVE_EXTENDED_MASTER) && \
4389
+ (defined(HAVE_SESSION_TICKET) || !defined(NO_SESSION_CACHE))
4390
+ /* secure renegotiation requires extended master secret with resumption */
4391
+ #ifndef _MSC_VER
4392
+ #warning Extended master secret must be enabled with secure renegotiation and session resumption
4393
+ #else
4394
+ #pragma message("Warning: Extended master secret must be enabled with secure renegotiation and session resumption")
4395
+ #endif
4396
+
4397
+ /* Note: "--enable-renegotiation-indication" ("HAVE_RENEGOTIATION_INDICATION")
4398
+ * only sends the secure renegotiation extension, but is not actually supported.
4399
+ * This was added because some TLS peers required it even if not used, so we call
4400
+ * this "(FAKE Secure Renegotiation)"
4401
+ */
4402
+ #endif
4403
+
4404
+ /* if secure renegotiation is enabled, make sure server info is enabled */
4405
+ #if !defined(HAVE_RENEGOTIATION_INDICATION) && \
4406
+ !defined(HAVE_SERVER_RENEGOTIATION_INFO) && \
4407
+ defined(HAVE_SECURE_RENEGOTIATION) && \
4408
+ !defined(NO_WOLFSSL_SERVER)
4409
+ #define HAVE_SERVER_RENEGOTIATION_INFO
4410
+ #endif
4411
+
4412
+ /* Crypto callbacks should enable hash flag support */
4413
+ #if defined(WOLF_CRYPTO_CB) && !defined(WOLFSSL_HASH_FLAGS)
4414
+ /* FIPS v1 and v2 do not support hash flags, so do not allow it with
4415
+ * crypto callbacks */
4416
+ #if !defined(HAVE_FIPS) || (defined(HAVE_FIPS) && \
4417
+ defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION >= 3)
4418
+ #define WOLFSSL_HASH_FLAGS
4419
+ #endif
4420
+ #endif
4421
+
4422
+ #ifdef WOLFSSL_HAVE_MLKEM
4423
+ #define HAVE_PQC
4424
+ #endif
4425
+
4426
+ /* Enable Post-Quantum Cryptography if we have liboqs from the OpenQuantumSafe
4427
+ * group */
4428
+ #ifdef HAVE_LIBOQS
4429
+ #define HAVE_PQC
4430
+ #define HAVE_FALCON
4431
+ #ifndef HAVE_DILITHIUM
4432
+ #define HAVE_DILITHIUM
4433
+ #endif
4434
+ #ifndef WOLFSSL_NO_SPHINCS
4435
+ #define HAVE_SPHINCS
4436
+ #endif
4437
+ #ifndef WOLFSSL_HAVE_MLKEM
4438
+ #define WOLFSSL_HAVE_MLKEM
4439
+ #define WOLFSSL_KYBER512
4440
+ #define WOLFSSL_KYBER768
4441
+ #define WOLFSSL_KYBER1024
4442
+ #define WOLFSSL_WC_ML_KEM_512
4443
+ #define WOLFSSL_WC_ML_KEM_768
4444
+ #define WOLFSSL_WC_ML_KEM_1024
4445
+ #endif
4446
+ #endif
4447
+
4448
+ #if (defined(HAVE_LIBOQS) || \
4449
+ defined(HAVE_LIBXMSS) || \
4450
+ defined(HAVE_LIBLMS) || \
4451
+ defined(WOLFSSL_DUAL_ALG_CERTS) || \
4452
+ defined(HAVE_ASCON)) && \
4453
+ !defined(WOLFSSL_EXPERIMENTAL_SETTINGS)
4454
+ #error Experimental settings without WOLFSSL_EXPERIMENTAL_SETTINGS
4455
+ #endif
4456
+
4457
+ #if defined(HAVE_PQC) && !defined(HAVE_LIBOQS) && !defined(WOLFSSL_HAVE_MLKEM)
4458
+ #error Please do not define HAVE_PQC yourself.
4459
+ #endif
4460
+
4461
+ /* If no malloc then make sure the valid Dilithium settings are used */
4462
+ #if defined(HAVE_DILITHIUM) && defined(WOLFSSL_NO_MALLOC)
4463
+ #undef WOLFSSL_DILITHIUM_VERIFY_NO_MALLOC
4464
+ #define WOLFSSL_DILITHIUM_VERIFY_NO_MALLOC
4465
+ #endif
4466
+
4467
+ #if defined(HAVE_PQC) && defined(WOLFSSL_DTLS13) && \
4468
+ !defined(WOLFSSL_DTLS_CH_FRAG)
4469
+ #warning "Using DTLS 1.3 + pqc without WOLFSSL_DTLS_CH_FRAG will probably" \
4470
+ "fail.Use --enable-dtls-frag-ch to enable it."
4471
+ #endif
4472
+ #if !defined(WOLFSSL_DTLS13) && defined(WOLFSSL_DTLS_CH_FRAG)
4473
+ #error "WOLFSSL_DTLS_CH_FRAG only works with DTLS 1.3"
4474
+ #endif
4475
+
4476
+ /* SRTP requires DTLS */
4477
+ #if defined(WOLFSSL_SRTP) && !defined(WOLFSSL_DTLS)
4478
+ #error The SRTP extension requires DTLS
4479
+ #endif
4480
+
4481
+ /* FIPS v5 and older doesn't support WOLF_PRIVATE_KEY_ID with PK callbacks */
4482
+ #if defined(HAVE_FIPS) && FIPS_VERSION_LT(5,3) && defined(HAVE_PK_CALLBACKS)
4483
+ #define NO_WOLF_PRIVATE_KEY_ID
4484
+ #endif
4485
+
4486
+ /* Are we using an external private key store like:
4487
+ * PKCS11 / HSM / crypto callback / PK callback */
4488
+ #if !defined(WOLF_PRIVATE_KEY_ID) && !defined(NO_WOLF_PRIVATE_KEY_ID) && \
4489
+ (defined(HAVE_PKCS11) || defined(HAVE_PK_CALLBACKS) || \
4490
+ defined(WOLF_CRYPTO_CB) || defined(WOLFSSL_KCAPI))
4491
+ /* Enables support for using wolfSSL_CTX_use_PrivateKey_Id and
4492
+ * wolfSSL_CTX_use_PrivateKey_Label */
4493
+ #define WOLF_PRIVATE_KEY_ID
4494
+ #endif
4495
+
4496
+ /* With titan cache size there is too many sessions to fit with the default
4497
+ * multiplier of 8 */
4498
+ #if defined(TITAN_SESSION_CACHE) && !defined(NO_SESSION_CACHE_REF)
4499
+ #define NO_SESSION_CACHE_REF
4500
+ #endif
4501
+
4502
+ /* (D)TLS v1.3 requires 64-bit number wrappers as does XMSS and LMS. */
4503
+ #if defined(WOLFSSL_TLS13) || defined(WOLFSSL_DTLS_DROP_STATS) || \
4504
+ (defined(WOLFSSL_WC_XMSS) && (!defined(WOLFSSL_XMSS_MAX_HEIGHT) || \
4505
+ WOLFSSL_XMSS_MAX_HEIGHT > 32)) || (defined(WOLFSSL_WC_LMS) && \
4506
+ !defined(WOLFSSL_LMS_VERIFY_ONLY))
4507
+ #undef WOLFSSL_W64_WRAPPER
4508
+ #define WOLFSSL_W64_WRAPPER
4509
+ #endif
4510
+
4511
+ /* wc_xmss and wc_lms require these misc.c functions. */
4512
+ #if defined(WOLFSSL_WC_XMSS) || defined(WOLFSSL_WC_LMS)
4513
+ #undef WOLFSSL_NO_INT_ENCODE
4514
+ #undef WOLFSSL_NO_INT_DECODE
4515
+ #endif
4516
+
4517
+ /* DTLS v1.3 requires AES ECB if using AES */
4518
+ #if defined(WOLFSSL_DTLS13) && !defined(NO_AES) && \
4519
+ !defined(WOLFSSL_AES_DIRECT)
4520
+ #define WOLFSSL_AES_DIRECT
4521
+ #endif
4522
+
4523
+ #if defined(WOLFSSL_DTLS13) && (!defined(WOLFSSL_DTLS) || \
4524
+ !defined(WOLFSSL_TLS13))
4525
+ #error "DTLS v1.3 requires both WOLFSSL_TLS13 and WOLFSSL_DTLS"
4526
+ #endif
4527
+
4528
+ #if defined(WOLFSSL_QUIC) && defined(WOLFSSL_CALLBACKS)
4529
+ #error WOLFSSL_QUIC is incompatible with WOLFSSL_CALLBACKS.
4530
+ #endif
4531
+
4532
+ /* RSA Key Checking is disabled by default unless WOLFSSL_RSA_KEY_CHECK is
4533
+ * defined or FIPS v2 3389, FIPS v5 or later.
4534
+ * Not allowed for:
4535
+ * RSA public only, CAVP selftest, fast RSA, user RSA, QAT or CryptoCell */
4536
+ #if (defined(WOLFSSL_RSA_KEY_CHECK) || (defined(HAVE_FIPS) && FIPS_VERSION_GE(2,0))) && \
4537
+ !defined(WOLFSSL_NO_RSA_KEY_CHECK) && !defined(WOLFSSL_RSA_PUBLIC_ONLY) && \
4538
+ !defined(HAVE_INTEL_QA) && !defined(WOLFSSL_CRYPTOCELL) && \
4539
+ !defined(HAVE_SELFTEST)
4540
+
4541
+ #undef WOLFSSL_RSA_KEY_CHECK
4542
+ #define WOLFSSL_RSA_KEY_CHECK
4543
+ #endif
4544
+
4545
+ /* ED448 Requires Shake256 */
4546
+ #if defined(HAVE_ED448) && defined(WOLFSSL_SHA3)
4547
+ #undef WOLFSSL_SHAKE256
4548
+ #define WOLFSSL_SHAKE256
4549
+ #endif
4550
+
4551
+ /* SHAKE - Not allowed in FIPS v5.2 or older */
4552
+ #if defined(WOLFSSL_SHA3) && (defined(HAVE_SELFTEST) || \
4553
+ (defined(HAVE_FIPS) && FIPS_VERSION_LE(5,2)))
4554
+ #undef WOLFSSL_NO_SHAKE128
4555
+ #define WOLFSSL_NO_SHAKE128
4556
+ #undef WOLFSSL_NO_SHAKE256
4557
+ #define WOLFSSL_NO_SHAKE256
4558
+ #endif
4559
+ /* SHAKE Disable */
4560
+ #ifdef WOLFSSL_NO_SHAKE128
4561
+ #undef WOLFSSL_SHAKE128
4562
+ #endif
4563
+ #ifdef WOLFSSL_NO_SHAKE256
4564
+ #undef WOLFSSL_SHAKE256
4565
+ #endif
4566
+
4567
+
4568
+ /* Encrypted Client Hello - requires HPKE */
4569
+ #if defined(HAVE_ECH) && !defined(HAVE_HPKE)
4570
+ #define HAVE_HPKE
4571
+ #endif
4572
+
4573
+ /* Provide way to forcefully disable use of XREALLOC */
4574
+ #ifdef WOLFSSL_NO_REALLOC
4575
+ #undef XREALLOC
4576
+ #endif
4577
+
4578
+ /* There's currently no 100% reliable "smaller than 32 bit" detection.
4579
+ * The user can specify: WC_16BIT_CPU
4580
+ * Lower 16 bits of new OID values may collide on some 16 bit platforms.
4581
+ * e.g Arduino Mega, fqbn=arduino:avr:mega */
4582
+ #if defined(WC_16BIT_CPU)
4583
+ /* Force the old, 16 bit OIDs to be used in wolfcrypt/oid_sum.h */
4584
+ #undef WOLFSSL_OLD_OID_SUM
4585
+ #define WOLFSSL_OLD_OID_SUM
4586
+ #endif
4587
+
4588
+ /* Support for Key to DER conversion */
4589
+ #if !defined(NO_RSA) && \
4590
+ (defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN) || \
4591
+ defined(WOLFSSL_KCAPI_RSA) || defined(OPENSSL_EXTRA) || \
4592
+ defined(WOLFSSL_SE050))
4593
+ /* FIPS v2 has the wc_RsaKeyToDer in rsa.h (in boundary),
4594
+ * so with FIPS or self test only allow with WOLFSSL_KEY_GEN */
4595
+ #if (!defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)) || \
4596
+ defined(WOLFSSL_KEY_GEN)
4597
+
4598
+ #undef WOLFSSL_KEY_TO_DER
4599
+ #define WOLFSSL_KEY_TO_DER
4600
+ #endif
4601
+ #endif
4602
+
4603
+
4604
+ /* ---------------------------------------------------------------------------
4605
+ * Deprecated Algorithm Handling
4606
+ * Unless allowed via a build macro, disable support
4607
+ * ---------------------------------------------------------------------------*/
4608
+
4609
+ /* RC4: Per RFC7465 Feb 2015, the cipher suite has been deprecated due to a
4610
+ * number of exploits capable of decrypting portions of encrypted messages. */
4611
+ #ifndef WOLFSSL_ALLOW_RC4
4612
+ #undef NO_RC4
4613
+ #define NO_RC4
4614
+ #endif
4615
+
4616
+ #if !defined(WOLFSSL_NO_ASYNC_IO) || defined(WOLFSSL_ASYNC_CRYPT) || \
4617
+ defined(WOLFSSL_NONBLOCK_OCSP)
4618
+ /* Enable asynchronous support in TLS functions to support one or more of
4619
+ * the following:
4620
+ * - re-entry after a network blocking return
4621
+ * - re-entry after OCSP blocking return
4622
+ * - asynchronous cryptography */
4623
+ #undef WOLFSSL_ASYNC_IO
4624
+ #define WOLFSSL_ASYNC_IO
4625
+ #endif
4626
+
4627
+ #ifdef WOLFSSL_SYS_CA_CERTS
4628
+ #ifdef NO_FILESYSTEM
4629
+ /* Turning off WOLFSSL_SYS_CA_CERTS b/c NO_FILESYSTEM is defined */
4630
+ #undef WOLFSSL_SYS_CA_CERTS
4631
+ #endif
4632
+
4633
+ #ifdef NO_CERTS
4634
+ /* Turning off WOLFSSL_SYS_CA_CERTS b/c NO_CERTS is defined */
4635
+ #undef WOLFSSL_SYS_CA_CERTS
4636
+ #endif
4637
+ #endif /* WOLFSSL_SYS_CA_CERTS */
4638
+
4639
+ #ifdef NO_WOLFSSL_DEBUG_CERTS
4640
+ /* Simplify certificate debugging gate check with only WOLFSSL_DEBUG_CERTS.
4641
+ * NO_WOLFSSL_DEBUG_CERTS prioritized over WOLFSSL_DEBUG_CERTS; disable: */
4642
+ #undef WOLFSSL_DEBUG_CERTS
4643
+ #endif
4644
+
4645
+ #if defined(SESSION_CACHE_DYNAMIC_MEM) && defined(PERSIST_SESSION_CACHE)
4646
+ #error "Dynamic session cache currently does not support persistent session cache."
4647
+ #endif
4648
+
4649
+ #ifdef WOLFSSL_HARDEN_TLS
4650
+ #if defined(HAVE_TRUNCATED_HMAC) && !defined(WOLFSSL_HARDEN_TLS_ALLOW_TRUNCATED_HMAC)
4651
+ #error "Truncated HMAC Extension not allowed"
4652
+ /* https://www.rfc-editor.org/rfc/rfc9325#section-4.6 */
4653
+ #endif
4654
+ #if !defined(NO_OLD_TLS) && !defined(WOLFSSL_HARDEN_TLS_ALLOW_OLD_TLS)
4655
+ #error "TLS < 1.2 protocol versions not allowed"
4656
+ /* https://www.rfc-editor.org/rfc/rfc9325#section-3.1.1 */
4657
+ #endif
4658
+ #if !defined(WOLFSSL_NO_TLS12) && !defined(HAVE_SECURE_RENEGOTIATION) && \
4659
+ !defined(HAVE_SERVER_RENEGOTIATION_INFO) && !defined(WOLFSSL_HARDEN_TLS_NO_SCR_CHECK)
4660
+ #error "TLS 1.2 requires at least HAVE_SERVER_RENEGOTIATION_INFO to send the secure renegotiation extension"
4661
+ /* https://www.rfc-editor.org/rfc/rfc9325#section-3.5 */
4662
+ #endif
4663
+ #if !defined(WOLFSSL_EXTRA_ALERTS) || !defined(WOLFSSL_CHECK_ALERT_ON_ERR)
4664
+ #error "RFC9325 requires some additional alerts to be sent"
4665
+ #endif
4666
+ /* Ciphersuite check done in internal.h */
4667
+ #endif
4668
+
4669
+ /* Some final sanity checks. See esp32-crypt.h for Apple HomeKit config. */
4670
+ #if defined(WOLFSSL_APPLE_HOMEKIT) || defined(CONFIG_WOLFSSL_APPLE_HOMEKIT)
4671
+ #ifndef WOLFCRYPT_HAVE_SRP
4672
+ #error "WOLFCRYPT_HAVE_SRP is required for Apple Homekit"
4673
+ #endif
4674
+ #ifndef HAVE_CHACHA
4675
+ #error "HAVE_CHACHA is required for Apple Homekit"
4676
+ #endif
4677
+ #ifdef USE_FAST_MATH
4678
+ #ifdef FP_MAX_BITS
4679
+ #if FP_MAX_BITS < (8192 * 2)
4680
+ #error "HomeKit FP_MAX_BITS must at least (8192 * 2)"
4681
+ #endif
4682
+ #else
4683
+ #error "HomeKit FP_MAX_BITS must be assigned a value (8192 * 2)"
4684
+ #endif
4685
+ #endif
4686
+ #endif
4687
+
4688
+ #if defined(CONFIG_WOLFSSL_NO_ASN_STRICT) && !defined(WOLFSSL_NO_ASN_STRICT)
4689
+ /* The settings.h and/or user_settings.h should have detected config
4690
+ * values from Kconfig and set the appropriate wolfSSL macro: */
4691
+ #error "CONFIG_WOLFSSL_NO_ASN_STRICT found without WOLFSSL_NO_ASN_STRICT"
4692
+ #endif
4693
+
4694
+ #if defined(WOLFSSL_ESPIDF) && defined(ARDUINO)
4695
+ #error "Found both ESPIDF and ARDUINO. Pick one."
4696
+ #endif
4697
+
4698
+ #if defined(CONFIG_MBEDTLS_CERTIFICATE_BUNDLE) && \
4699
+ defined(CONFIG_WOLFSSL_CERTIFICATE_BUNDLE) && \
4700
+ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE && \
4701
+ CONFIG_WOLFSSL_CERTIFICATE_BUNDLE
4702
+ #error "mbedTLS and wolfSSL Certificate Bundles both enabled. Pick one".
4703
+ #endif
4704
+
4705
+ #if defined(HAVE_FIPS) && defined(HAVE_PKCS11)
4706
+ #error "PKCS11 not allowed with FIPS enabled (Crypto outside boundary)"
4707
+ #endif
4708
+
4709
+ #if defined(WOLFSSL_CAAM_BLOB)
4710
+ #ifndef WOLFSSL_CAAM
4711
+ #error "WOLFSSL_CAAM_BLOB requires WOLFSSL_CAAM"
4712
+ #endif
4713
+ #endif
4714
+
4715
+ #if defined(HAVE_ED25519)
4716
+ #ifndef WOLFSSL_SHA512
4717
+ #error "HAVE_ED25519 requires WOLFSSL_SHA512"
4718
+ #endif
4719
+ #endif
4720
+
4721
+ #if defined(OPENSSL_ALL) && defined(OPENSSL_COEXIST)
4722
+ #error "OPENSSL_ALL can not be defined with OPENSSL_COEXIST"
4723
+ #endif
4724
+
4725
+ #if !defined(NO_DSA) && defined(NO_SHA)
4726
+ #error "Please disable DSA if disabling SHA-1"
4727
+ #endif
4728
+
4729
+ #if defined(WOLFSSL_SYS_CRYPTO_POLICY)
4730
+ #if !defined(WOLFSSL_CRYPTO_POLICY_FILE)
4731
+ #error "WOLFSSL_SYS_CRYPTO_POLICY requires a crypto policy file"
4732
+ #endif /* ! WOLFSSL_CRYPTO_POLICY_FILE */
4733
+
4734
+ #if !defined(OPENSSL_EXTRA)
4735
+ #error "WOLFSSL_SYS_CRYPTO_POLICY requires OPENSSL_EXTRA"
4736
+ #endif /* ! OPENSSL_EXTRA */
4737
+ #endif /* WOLFSSL_SYS_CRYPTO_POLICY */
4738
+
4739
+ /* if configure.ac turned on this feature, HAVE_ENTROPY_MEMUSE will be set,
4740
+ * also define HAVE_WOLFENTROPY */
4741
+ #ifdef HAVE_ENTROPY_MEMUSE
4742
+ #ifndef HAVE_WOLFENTROPY
4743
+ #define HAVE_WOLFENTROPY
4744
+ #endif
4745
+ #elif defined(HAVE_WOLFENTROPY)
4746
+ /* else if user_settings.h only defined HAVE_WOLFENTROPY
4747
+ * also define HAVE_ENTROPY_MEMUSE */
4748
+ #ifndef HAVE_ENTROPY_MEMUSE
4749
+ #define HAVE_ENTROPY_MEMUSE
4750
+ #endif
4751
+ #endif /* HAVE_ENTROPY_MEMUSE */
4752
+
4753
+ #if defined(NO_WOLFSSL_CLIENT) && defined(NO_WOLFSSL_SERVER) && \
4754
+ !defined(WOLFCRYPT_ONLY) && !defined(NO_TLS)
4755
+ #error "If TLS is enabled please make sure either client or server is enabled."
4756
+ #endif
4757
+
4758
+ #ifdef __cplusplus
4759
+ } /* extern "C" */
4760
+ #endif
4761
+
4762
+ #endif