@annadata/capacitor-mqtt-quic 0.1.5 → 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 (795) hide show
  1. package/AnnadataCapacitorMqttQuic.podspec +36 -0
  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/ios-arm64/libmqttquic_native_device.a +0 -0
  642. package/ios/libs/MqttQuicLibs.xcframework/ios-arm64_x86_64-simulator/libmqttquic_native_simulator.a +0 -0
  643. package/ios/libs/libnghttp3.a +0 -0
  644. package/ios/libs/libngtcp2.a +0 -0
  645. package/ios/libs/libngtcp2_crypto_wolfssl.a +0 -0
  646. package/ios/libs/libwolfssl.a +0 -0
  647. package/ios/libs-simulator/libnghttp3.a +0 -0
  648. package/ios/libs-simulator/libngtcp2.a +0 -0
  649. package/ios/libs-simulator/libngtcp2_crypto_wolfssl.a +0 -0
  650. package/ios/libs-simulator/libwolfssl.a +0 -0
  651. package/ios/libs-simulator-x86_64/libnghttp3.a +0 -0
  652. package/ios/libs-simulator-x86_64/libngtcp2.a +0 -0
  653. package/ios/libs-simulator-x86_64/libngtcp2_crypto_wolfssl.a +0 -0
  654. package/ios/libs-simulator-x86_64/libwolfssl.a +0 -0
  655. package/package.json +22 -8
  656. package/ios/include/ngtcp2/ngtcp2_crypto_quictls.h +0 -147
  657. package/ios/include/openssl/aes.h +0 -111
  658. package/ios/include/openssl/asn1.h +0 -1131
  659. package/ios/include/openssl/asn1_mac.h +0 -10
  660. package/ios/include/openssl/asn1err.h +0 -140
  661. package/ios/include/openssl/asn1t.h +0 -946
  662. package/ios/include/openssl/async.h +0 -96
  663. package/ios/include/openssl/asyncerr.h +0 -29
  664. package/ios/include/openssl/bio.h +0 -887
  665. package/ios/include/openssl/bioerr.h +0 -65
  666. package/ios/include/openssl/blowfish.h +0 -78
  667. package/ios/include/openssl/bn.h +0 -584
  668. package/ios/include/openssl/bnerr.h +0 -47
  669. package/ios/include/openssl/buffer.h +0 -62
  670. package/ios/include/openssl/buffererr.h +0 -25
  671. package/ios/include/openssl/camellia.h +0 -117
  672. package/ios/include/openssl/cast.h +0 -71
  673. package/ios/include/openssl/cmac.h +0 -52
  674. package/ios/include/openssl/cmp.h +0 -597
  675. package/ios/include/openssl/cmp_util.h +0 -56
  676. package/ios/include/openssl/cmperr.h +0 -116
  677. package/ios/include/openssl/cms.h +0 -493
  678. package/ios/include/openssl/cmserr.h +0 -124
  679. package/ios/include/openssl/comp.h +0 -59
  680. package/ios/include/openssl/comperr.h +0 -31
  681. package/ios/include/openssl/conf.h +0 -214
  682. package/ios/include/openssl/conf_api.h +0 -46
  683. package/ios/include/openssl/conferr.h +0 -52
  684. package/ios/include/openssl/configuration.h +0 -149
  685. package/ios/include/openssl/conftypes.h +0 -44
  686. package/ios/include/openssl/core.h +0 -233
  687. package/ios/include/openssl/core_dispatch.h +0 -960
  688. package/ios/include/openssl/core_names.h +0 -561
  689. package/ios/include/openssl/core_object.h +0 -41
  690. package/ios/include/openssl/crmf.h +0 -227
  691. package/ios/include/openssl/crmferr.h +0 -50
  692. package/ios/include/openssl/crypto.h +0 -558
  693. package/ios/include/openssl/cryptoerr.h +0 -55
  694. package/ios/include/openssl/cryptoerr_legacy.h +0 -1466
  695. package/ios/include/openssl/ct.h +0 -573
  696. package/ios/include/openssl/cterr.h +0 -45
  697. package/ios/include/openssl/decoder.h +0 -133
  698. package/ios/include/openssl/decodererr.h +0 -28
  699. package/ios/include/openssl/des.h +0 -211
  700. package/ios/include/openssl/dh.h +0 -335
  701. package/ios/include/openssl/dherr.h +0 -58
  702. package/ios/include/openssl/dsa.h +0 -280
  703. package/ios/include/openssl/dsaerr.h +0 -44
  704. package/ios/include/openssl/dtls1.h +0 -57
  705. package/ios/include/openssl/e_os2.h +0 -308
  706. package/ios/include/openssl/ebcdic.h +0 -39
  707. package/ios/include/openssl/ec.h +0 -1572
  708. package/ios/include/openssl/ecdh.h +0 -10
  709. package/ios/include/openssl/ecdsa.h +0 -10
  710. package/ios/include/openssl/ecerr.h +0 -104
  711. package/ios/include/openssl/encoder.h +0 -124
  712. package/ios/include/openssl/encodererr.h +0 -28
  713. package/ios/include/openssl/engine.h +0 -833
  714. package/ios/include/openssl/engineerr.h +0 -63
  715. package/ios/include/openssl/err.h +0 -504
  716. package/ios/include/openssl/ess.h +0 -128
  717. package/ios/include/openssl/esserr.h +0 -32
  718. package/ios/include/openssl/evp.h +0 -2175
  719. package/ios/include/openssl/evperr.h +0 -134
  720. package/ios/include/openssl/fips_names.h +0 -77
  721. package/ios/include/openssl/fipskey.h +0 -36
  722. package/ios/include/openssl/hmac.h +0 -62
  723. package/ios/include/openssl/http.h +0 -109
  724. package/ios/include/openssl/httperr.h +0 -55
  725. package/ios/include/openssl/idea.h +0 -82
  726. package/ios/include/openssl/kdf.h +0 -138
  727. package/ios/include/openssl/kdferr.h +0 -16
  728. package/ios/include/openssl/lhash.h +0 -331
  729. package/ios/include/openssl/macros.h +0 -325
  730. package/ios/include/openssl/md2.h +0 -56
  731. package/ios/include/openssl/md4.h +0 -63
  732. package/ios/include/openssl/md5.h +0 -62
  733. package/ios/include/openssl/mdc2.h +0 -55
  734. package/ios/include/openssl/modes.h +0 -219
  735. package/ios/include/openssl/obj_mac.h +0 -5481
  736. package/ios/include/openssl/objects.h +0 -183
  737. package/ios/include/openssl/objectserr.h +0 -28
  738. package/ios/include/openssl/ocsp.h +0 -483
  739. package/ios/include/openssl/ocsperr.h +0 -53
  740. package/ios/include/openssl/opensslconf.h +0 -17
  741. package/ios/include/openssl/opensslv.h +0 -114
  742. package/ios/include/openssl/ossl_typ.h +0 -16
  743. package/ios/include/openssl/param_build.h +0 -63
  744. package/ios/include/openssl/params.h +0 -160
  745. package/ios/include/openssl/pem.h +0 -541
  746. package/ios/include/openssl/pem2.h +0 -19
  747. package/ios/include/openssl/pemerr.h +0 -58
  748. package/ios/include/openssl/pkcs12.h +0 -353
  749. package/ios/include/openssl/pkcs12err.h +0 -45
  750. package/ios/include/openssl/pkcs7.h +0 -430
  751. package/ios/include/openssl/pkcs7err.h +0 -63
  752. package/ios/include/openssl/prov_ssl.h +0 -34
  753. package/ios/include/openssl/proverr.h +0 -149
  754. package/ios/include/openssl/provider.h +0 -60
  755. package/ios/include/openssl/quic.h +0 -19
  756. package/ios/include/openssl/rand.h +0 -125
  757. package/ios/include/openssl/randerr.h +0 -69
  758. package/ios/include/openssl/rc2.h +0 -68
  759. package/ios/include/openssl/rc4.h +0 -47
  760. package/ios/include/openssl/rc5.h +0 -79
  761. package/ios/include/openssl/ripemd.h +0 -59
  762. package/ios/include/openssl/rsa.h +0 -610
  763. package/ios/include/openssl/rsaerr.h +0 -107
  764. package/ios/include/openssl/safestack.h +0 -297
  765. package/ios/include/openssl/seed.h +0 -113
  766. package/ios/include/openssl/self_test.h +0 -94
  767. package/ios/include/openssl/sha.h +0 -138
  768. package/ios/include/openssl/srp.h +0 -285
  769. package/ios/include/openssl/srtp.h +0 -56
  770. package/ios/include/openssl/ssl.h +0 -2671
  771. package/ios/include/openssl/ssl2.h +0 -30
  772. package/ios/include/openssl/ssl3.h +0 -347
  773. package/ios/include/openssl/sslerr.h +0 -348
  774. package/ios/include/openssl/sslerr_legacy.h +0 -468
  775. package/ios/include/openssl/stack.h +0 -90
  776. package/ios/include/openssl/store.h +0 -369
  777. package/ios/include/openssl/storeerr.h +0 -49
  778. package/ios/include/openssl/symhacks.h +0 -39
  779. package/ios/include/openssl/tls1.h +0 -1186
  780. package/ios/include/openssl/trace.h +0 -312
  781. package/ios/include/openssl/ts.h +0 -505
  782. package/ios/include/openssl/tserr.h +0 -67
  783. package/ios/include/openssl/txt_db.h +0 -63
  784. package/ios/include/openssl/types.h +0 -239
  785. package/ios/include/openssl/ui.h +0 -407
  786. package/ios/include/openssl/uierr.h +0 -38
  787. package/ios/include/openssl/whrlpool.h +0 -62
  788. package/ios/include/openssl/x509.h +0 -1279
  789. package/ios/include/openssl/x509_vfy.h +0 -894
  790. package/ios/include/openssl/x509err.h +0 -69
  791. package/ios/include/openssl/x509v3.h +0 -1453
  792. package/ios/include/openssl/x509v3err.h +0 -93
  793. package/ios/libs/libcrypto.a +0 -0
  794. package/ios/libs/libngtcp2_crypto_quictls.a +0 -0
  795. package/ios/libs/libssl.a +0 -0
@@ -0,0 +1,2357 @@
1
+ /* tls_bench.c
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
+ /*
24
+ Example gcc build statement
25
+
26
+ gcc -lwolfssl -lpthread -o tls_bench tls_bench.c
27
+ ./tls_bench
28
+
29
+ Or
30
+
31
+ #include <examples/benchmark/tls_bench.h>
32
+ bench_tls(args);
33
+ */
34
+
35
+ #ifdef HAVE_CONFIG_H
36
+ #include <config.h>
37
+ #endif
38
+ #ifndef WOLFSSL_USER_SETTINGS
39
+ #include <wolfssl/options.h>
40
+ #endif
41
+ #include <wolfssl/wolfcrypt/settings.h>
42
+
43
+ #undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
44
+ #undef OPENSSL_COEXIST /* can't use this option with this example */
45
+
46
+ #include <wolfssl/wolfcrypt/types.h>
47
+ #include <wolfssl/wolfcrypt/wc_port.h>
48
+ #include <wolfssl/ssl.h>
49
+ #include <wolfssl/wolfcrypt/hash.h> /* WC_MAX_DIGEST_SIZE */
50
+ #include <wolfssl/test.h>
51
+ #include <wolfssl/wolfio.h>
52
+ #include <examples/benchmark/tls_bench.h>
53
+
54
+ /* force certificate test buffers to be included via headers */
55
+ #undef USE_CERT_BUFFERS_2048
56
+ #define USE_CERT_BUFFERS_2048
57
+ #undef USE_CERT_BUFFERS_256
58
+ #define USE_CERT_BUFFERS_256
59
+ #include <wolfssl/certs_test.h>
60
+
61
+ #include <stdio.h>
62
+ #include <stdlib.h>
63
+ #include <string.h>
64
+ #include <unistd.h>
65
+ #include <sys/time.h>
66
+ #include <errno.h>
67
+
68
+ /* For testing no threading support */
69
+ #if 0
70
+ #undef HAVE_PTHREAD
71
+ #define SINGLE_THREADED
72
+ #endif
73
+
74
+ /* PTHREAD requires server and client enabled */
75
+ #if !defined(NO_TLS) && \
76
+ (defined(NO_WOLFSSL_CLIENT) || defined(NO_WOLFSSL_SERVER))
77
+ #if !defined(SINGLE_THREADED)
78
+ #ifdef __GNUC__ /* GCC compiler */
79
+ #pragma message "PTHREAD requires server and client enabled."
80
+ #elif defined(_MSC_VER) /* Microsoft Visual C++ compiler */
81
+ #pragma message("PTHREAD requires server and client enabled.")
82
+ #else
83
+ #warning "PTHREAD requires server and client enabled."
84
+ #endif
85
+ #define SINGLE_THREADED
86
+ #endif
87
+ #endif
88
+
89
+ /* If both client and server are enabled and single threaded, just disable this example */
90
+ #if !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) \
91
+ && defined(SINGLE_THREADED)
92
+ #undef NO_TLS
93
+ #define NO_TLS
94
+ #endif
95
+
96
+ #if 0
97
+ #define BENCH_USE_NONBLOCK
98
+ #endif
99
+
100
+ /* Defaults for configuration parameters */
101
+ #define BENCH_DEFAULT_HOST "localhost"
102
+ #define BENCH_DEFAULT_PORT 11112
103
+ #define NUM_THREAD_PAIRS 1 /* Thread pairs of server/client */
104
+ #ifndef BENCH_RUNTIME_SEC
105
+ #ifdef BENCH_EMBEDDED
106
+ #define BENCH_RUNTIME_SEC 15
107
+ #else
108
+ #define BENCH_RUNTIME_SEC 1
109
+ #endif
110
+ #endif
111
+ /* TLS packet size */
112
+ #ifndef TEST_PACKET_SIZE
113
+ #ifdef BENCH_EMBEDDED
114
+ #define TEST_PACKET_SIZE (2 * 1024)
115
+ #else
116
+ #define TEST_PACKET_SIZE (16 * 1024)
117
+ #endif
118
+ #endif
119
+ /* Total bytes to benchmark per connection */
120
+ #ifndef TEST_MAX_SIZE
121
+ #ifdef BENCH_EMBEDDED
122
+ #define TEST_MAX_SIZE (16 * 1024)
123
+ #else
124
+ #define TEST_MAX_SIZE (128 * 1024)
125
+ #endif
126
+ #endif
127
+
128
+ #ifdef WOLFSSL_DTLS
129
+ #ifdef BENCH_EMBEDDED
130
+ /* WOLFSSL_MAX_MTU in internal.h */
131
+ #define TEST_DTLS_PACKET_SIZE (1500)
132
+ #else
133
+ /* MAX_UDP_SIZE in interna.h */
134
+ #define TEST_DTLS_PACKET_SIZE (8092)
135
+ #endif
136
+ #endif
137
+
138
+ /* In memory transfer buffer maximum size */
139
+ /* Must be large enough to handle max TLS packet size plus max TLS header MAX_MSG_EXTRA */
140
+ #define MEM_BUFFER_SZ (TEST_PACKET_SIZE + 38 + WC_MAX_DIGEST_SIZE)
141
+ #define SHOW_VERBOSE 0 /* Default output is tab delimited format */
142
+
143
+ #if (!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
144
+ !defined(WOLFCRYPT_ONLY) && !defined(NO_TLS) && defined(USE_WOLFSSL_IO)
145
+
146
+ /* shutdown message - nice signal to server, we are done */
147
+ static const char* kShutdown = "shutdown";
148
+
149
+ #ifndef NO_WOLFSSL_CLIENT
150
+ PEDANTIC_EXTENSION static const char* kTestStr =
151
+ "Biodiesel cupidatat marfa, cliche aute put a bird on it incididunt elit\n"
152
+ "polaroid. Sunt tattooed bespoke reprehenderit. Sint twee organic id\n"
153
+ "marfa. Commodo veniam ad esse gastropub. 3 wolf moon sartorial vero,\n"
154
+ "plaid delectus biodiesel squid +1 vice. Post-ironic keffiyeh leggings\n"
155
+ "selfies cray fap hoodie, forage anim. Carles cupidatat shoreditch, VHS\n"
156
+ "small batch meggings kogi dolore food truck bespoke gastropub.\n"
157
+ "\n"
158
+ "Terry richardson adipisicing actually typewriter tumblr, twee whatever\n"
159
+ "four loko you probably haven't heard of them high life. Messenger bag\n"
160
+ "whatever tattooed deep v mlkshk. Brooklyn pinterest assumenda chillwave\n"
161
+ "et, banksy ullamco messenger bag umami pariatur direct trade forage.\n"
162
+ "Typewriter culpa try-hard, pariatur sint brooklyn meggings. Gentrify\n"
163
+ "food truck next level, tousled irony non semiotics PBR ethical anim cred\n"
164
+ "readymade. Mumblecore brunch lomo odd future, portland organic terry\n"
165
+ "richardson elit leggings adipisicing ennui raw denim banjo hella. Godard\n"
166
+ "mixtape polaroid, pork belly readymade organic cray typewriter helvetica\n"
167
+ "four loko whatever street art yr farm-to-table.\n"
168
+ "\n"
169
+ "Vinyl keytar vice tofu. Locavore you probably haven't heard of them pug\n"
170
+ "pickled, hella tonx labore truffaut DIY mlkshk elit cosby sweater sint\n"
171
+ "et mumblecore. Elit swag semiotics, reprehenderit DIY sartorial nisi ugh\n"
172
+ "nesciunt pug pork belly wayfarers selfies delectus. Ethical hoodie\n"
173
+ "seitan fingerstache kale chips. Terry richardson artisan williamsburg,\n"
174
+ "eiusmod fanny pack irony tonx ennui lo-fi incididunt tofu YOLO\n"
175
+ "readymade. 8-bit sed ethnic beard officia. Pour-over iphone DIY butcher,\n"
176
+ "ethnic art party qui letterpress nisi proident jean shorts mlkshk\n"
177
+ "locavore.\n"
178
+ "\n"
179
+ "Narwhal flexitarian letterpress, do gluten-free voluptate next level\n"
180
+ "banh mi tonx incididunt carles DIY. Odd future nulla 8-bit beard ut\n"
181
+ "cillum pickled velit, YOLO officia you probably haven't heard of them\n"
182
+ "trust fund gastropub. Nisi adipisicing tattooed, Austin mlkshk 90's\n"
183
+ "small batch american apparel. Put a bird on it cosby sweater before they\n"
184
+ "sold out pork belly kogi hella. Street art mollit sustainable polaroid,\n"
185
+ "DIY ethnic ea pug beard dreamcatcher cosby sweater magna scenester nisi.\n"
186
+ "Sed pork belly skateboard mollit, labore proident eiusmod. Sriracha\n"
187
+ "excepteur cosby sweater, anim deserunt laborum eu aliquip ethical et\n"
188
+ "neutra PBR selvage.\n"
189
+ "\n"
190
+ "Raw denim pork belly truffaut, irony plaid sustainable put a bird on it\n"
191
+ "next level jean shorts exercitation. Hashtag keytar whatever, nihil\n"
192
+ "authentic aliquip disrupt laborum. Tattooed selfies deserunt trust fund\n"
193
+ "wayfarers. 3 wolf moon synth church-key sartorial, gastropub leggings\n"
194
+ "tattooed. Labore high life commodo, meggings raw denim fingerstache pug\n"
195
+ "trust fund leggings seitan forage. Nostrud ullamco duis, reprehenderit\n"
196
+ "incididunt flannel sustainable helvetica pork belly pug banksy you\n"
197
+ "probably haven't heard of them nesciunt farm-to-table. Disrupt nostrud\n"
198
+ "mollit magna, sriracha sartorial helvetica.\n"
199
+ "\n"
200
+ "Nulla kogi reprehenderit, skateboard sustainable duis adipisicing viral\n"
201
+ "ad fanny pack salvia. Fanny pack trust fund you probably haven't heard\n"
202
+ "of them YOLO vice nihil. Keffiyeh cray lo-fi pinterest cardigan aliqua,\n"
203
+ "reprehenderit aute. Culpa tousled williamsburg, marfa lomo actually anim\n"
204
+ "skateboard. Iphone aliqua ugh, semiotics pariatur vero readymade\n"
205
+ "organic. Marfa squid nulla, in laborum disrupt laboris irure gastropub.\n"
206
+ "Veniam sunt food truck leggings, sint vinyl fap.\n"
207
+ "\n"
208
+ "Hella dolore pork belly, truffaut carles you probably haven't heard of\n"
209
+ "them PBR helvetica in sapiente. Fashion axe ugh bushwick american\n"
210
+ "apparel. Fingerstache sed iphone, jean shorts blue bottle nisi bushwick\n"
211
+ "flexitarian officia veniam plaid bespoke fap YOLO lo-fi. Blog\n"
212
+ "letterpress mumblecore, food truck id cray brooklyn cillum ad sed.\n"
213
+ "Assumenda chambray wayfarers vinyl mixtape sustainable. VHS vinyl\n"
214
+ "delectus, culpa williamsburg polaroid cliche swag church-key synth kogi\n"
215
+ "magna pop-up literally. Swag thundercats ennui shoreditch vegan\n"
216
+ "pitchfork neutra truffaut etsy, sed single-origin coffee craft beer.\n"
217
+ "\n"
218
+ "Odio letterpress brooklyn elit. Nulla single-origin coffee in occaecat\n"
219
+ "meggings. Irony meggings 8-bit, chillwave lo-fi adipisicing cred\n"
220
+ "dreamcatcher veniam. Put a bird on it irony umami, trust fund bushwick\n"
221
+ "locavore kale chips. Sriracha swag thundercats, chillwave disrupt\n"
222
+ "tousled beard mollit mustache leggings portland next level. Nihil esse\n"
223
+ "est, skateboard art party etsy thundercats sed dreamcatcher ut iphone\n"
224
+ "swag consectetur et. Irure skateboard banjo, nulla deserunt messenger\n"
225
+ "bag dolor terry richardson sapiente.\n";
226
+ #endif
227
+
228
+ #if !defined(NO_DH)
229
+
230
+ #define MIN_DHKEY_BITS 1024
231
+
232
+ #if !defined(NO_WOLFSSL_SERVER)
233
+ /* dh2048 p */
234
+ static const unsigned char dhp[] =
235
+ {
236
+ 0xb0, 0xa1, 0x08, 0x06, 0x9c, 0x08, 0x13, 0xba, 0x59, 0x06, 0x3c, 0xbc, 0x30,
237
+ 0xd5, 0xf5, 0x00, 0xc1, 0x4f, 0x44, 0xa7, 0xd6, 0xef, 0x4a, 0xc6, 0x25, 0x27,
238
+ 0x1c, 0xe8, 0xd2, 0x96, 0x53, 0x0a, 0x5c, 0x91, 0xdd, 0xa2, 0xc2, 0x94, 0x84,
239
+ 0xbf, 0x7d, 0xb2, 0x44, 0x9f, 0x9b, 0xd2, 0xc1, 0x8a, 0xc5, 0xbe, 0x72, 0x5c,
240
+ 0xa7, 0xe7, 0x91, 0xe6, 0xd4, 0x9f, 0x73, 0x07, 0x85, 0x5b, 0x66, 0x48, 0xc7,
241
+ 0x70, 0xfa, 0xb4, 0xee, 0x02, 0xc9, 0x3d, 0x9a, 0x4a, 0xda, 0x3d, 0xc1, 0x46,
242
+ 0x3e, 0x19, 0x69, 0xd1, 0x17, 0x46, 0x07, 0xa3, 0x4d, 0x9f, 0x2b, 0x96, 0x17,
243
+ 0x39, 0x6d, 0x30, 0x8d, 0x2a, 0xf3, 0x94, 0xd3, 0x75, 0xcf, 0xa0, 0x75, 0xe6,
244
+ 0xf2, 0x92, 0x1f, 0x1a, 0x70, 0x05, 0xaa, 0x04, 0x83, 0x57, 0x30, 0xfb, 0xda,
245
+ 0x76, 0x93, 0x38, 0x50, 0xe8, 0x27, 0xfd, 0x63, 0xee, 0x3c, 0xe5, 0xb7, 0xc8,
246
+ 0x09, 0xae, 0x6f, 0x50, 0x35, 0x8e, 0x84, 0xce, 0x4a, 0x00, 0xe9, 0x12, 0x7e,
247
+ 0x5a, 0x31, 0xd7, 0x33, 0xfc, 0x21, 0x13, 0x76, 0xcc, 0x16, 0x30, 0xdb, 0x0c,
248
+ 0xfc, 0xc5, 0x62, 0xa7, 0x35, 0xb8, 0xef, 0xb7, 0xb0, 0xac, 0xc0, 0x36, 0xf6,
249
+ 0xd9, 0xc9, 0x46, 0x48, 0xf9, 0x40, 0x90, 0x00, 0x2b, 0x1b, 0xaa, 0x6c, 0xe3,
250
+ 0x1a, 0xc3, 0x0b, 0x03, 0x9e, 0x1b, 0xc2, 0x46, 0xe4, 0x48, 0x4e, 0x22, 0x73,
251
+ 0x6f, 0xc3, 0x5f, 0xd4, 0x9a, 0xd6, 0x30, 0x07, 0x48, 0xd6, 0x8c, 0x90, 0xab,
252
+ 0xd4, 0xf6, 0xf1, 0xe3, 0x48, 0xd3, 0x58, 0x4b, 0xa6, 0xb9, 0xcd, 0x29, 0xbf,
253
+ 0x68, 0x1f, 0x08, 0x4b, 0x63, 0x86, 0x2f, 0x5c, 0x6b, 0xd6, 0xb6, 0x06, 0x65,
254
+ 0xf7, 0xa6, 0xdc, 0x00, 0x67, 0x6b, 0xbb, 0xc3, 0xa9, 0x41, 0x83, 0xfb, 0xc7,
255
+ 0xfa, 0xc8, 0xe2, 0x1e, 0x7e, 0xaf, 0x00, 0x3f, 0x93
256
+ };
257
+
258
+ /* dh2048 g */
259
+ static const unsigned char dhg[] =
260
+ {
261
+ 0x02,
262
+ };
263
+ #endif /* !NO_WOLFSSL_SERVER */
264
+ #endif /* !NO_DH */
265
+
266
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
267
+ struct group_info {
268
+ word16 group;
269
+ const char *name;
270
+ };
271
+
272
+ static struct group_info groups[] = {
273
+ { WOLFSSL_ECC_SECP160K1, "ECC_SECP160K1" },
274
+ { WOLFSSL_ECC_SECP160R1, "ECC_SECP160R1" },
275
+ { WOLFSSL_ECC_SECP160R2, "ECC_SECP160R2" },
276
+ { WOLFSSL_ECC_SECP192K1, "ECC_SECP192K1" },
277
+ { WOLFSSL_ECC_SECP192R1, "ECC_SECP192R1" },
278
+ { WOLFSSL_ECC_SECP224K1, "ECC_SECP224K1" },
279
+ { WOLFSSL_ECC_SECP224R1, "ECC_SECP224R1" },
280
+ { WOLFSSL_ECC_SECP256K1, "ECC_SECP256K1" },
281
+ { WOLFSSL_ECC_SECP256R1, "ECC_SECP256R1" },
282
+ { WOLFSSL_ECC_SECP384R1, "ECC_SECP384R1" },
283
+ { WOLFSSL_ECC_SECP521R1, "ECC_SECP521R1" },
284
+ { WOLFSSL_ECC_BRAINPOOLP256R1, "ECC_BRAINPOOLP256R1" },
285
+ { WOLFSSL_ECC_BRAINPOOLP384R1, "ECC_BRAINPOOLP384R1" },
286
+ { WOLFSSL_ECC_BRAINPOOLP512R1, "ECC_BRAINPOOLP512R1" },
287
+ { WOLFSSL_ECC_X25519, "ECC_X25519" },
288
+ { WOLFSSL_ECC_X448, "ECC_X448" },
289
+ { WOLFSSL_FFDHE_2048, "FFDHE_2048" },
290
+ { WOLFSSL_FFDHE_3072, "FFDHE_3072" },
291
+ { WOLFSSL_FFDHE_4096, "FFDHE_4096" },
292
+ { WOLFSSL_FFDHE_6144, "FFDHE_6144" },
293
+ { WOLFSSL_FFDHE_8192, "FFDHE_8192" },
294
+ #ifdef HAVE_PQC
295
+ #ifndef WOLFSSL_NO_ML_KEM
296
+ { WOLFSSL_ML_KEM_512, "ML_KEM_512" },
297
+ { WOLFSSL_ML_KEM_768, "ML_KEM_768" },
298
+ { WOLFSSL_ML_KEM_1024, "ML_KEM_1024" },
299
+ { WOLFSSL_SECP256R1MLKEM512, "SecP256r1MLKEM512" },
300
+ { WOLFSSL_SECP384R1MLKEM768, "SecP384r1MLKEM768" },
301
+ { WOLFSSL_SECP256R1MLKEM768, "SecP256r1MLKEM768" },
302
+ { WOLFSSL_SECP521R1MLKEM1024, "SecP521r1MLKEM1024" },
303
+ { WOLFSSL_SECP384R1MLKEM1024, "SecP384r1MLKEM1024" },
304
+ { WOLFSSL_X25519MLKEM512, "X25519MLKEM512" },
305
+ { WOLFSSL_X448MLKEM768, "X448MLKEM768" },
306
+ { WOLFSSL_X25519MLKEM768, "X25519MLKEM768" },
307
+ #endif
308
+ #ifdef WOLFSSL_MLKEM_KYBER
309
+ { WOLFSSL_KYBER_LEVEL1, "KYBER_LEVEL1" },
310
+ { WOLFSSL_KYBER_LEVEL3, "KYBER_LEVEL3" },
311
+ { WOLFSSL_KYBER_LEVEL5, "KYBER_LEVEL5" },
312
+ { WOLFSSL_P256_KYBER_LEVEL1, "P256_KYBER_LEVEL1" },
313
+ { WOLFSSL_P384_KYBER_LEVEL3, "P384_KYBER_LEVEL3" },
314
+ { WOLFSSL_P256_KYBER_LEVEL3, "P256_KYBER_LEVEL3" },
315
+ { WOLFSSL_P521_KYBER_LEVEL5, "P521_KYBER_LEVEL5" },
316
+ { WOLFSSL_X25519_KYBER_LEVEL1, "X25519_KYBER_LEVEL1" },
317
+ { WOLFSSL_X448_KYBER_LEVEL3, "X448_KYBER_LEVEL3" },
318
+ { WOLFSSL_X25519_KYBER_LEVEL3, "X25519_KYBER_LEVEL3" },
319
+ #endif
320
+ #endif
321
+ { 0, NULL }
322
+ };
323
+ #endif /* WOLFSSL_TLS13 && HAVE_SUPPORTED_CURVES */
324
+
325
+ #ifndef SINGLE_THREADED
326
+ typedef struct {
327
+ unsigned char buf[MEM_BUFFER_SZ];
328
+ int write_bytes;
329
+ int write_idx;
330
+ int read_bytes;
331
+ int read_idx;
332
+
333
+ COND_TYPE cond;
334
+
335
+ int done;
336
+ } memBuf_t;
337
+ #endif
338
+
339
+ typedef struct {
340
+ double connTime;
341
+ double rxTime;
342
+ double txTime;
343
+ int connCount;
344
+ int rxTotal;
345
+ int txTotal;
346
+ } stats_t;
347
+
348
+ typedef struct {
349
+ int shutdown;
350
+ int sockFd;
351
+ int ret;
352
+ } side_t;
353
+
354
+ typedef struct {
355
+ const char* cipher;
356
+ word16 group;
357
+ const char* host;
358
+ word32 port;
359
+ int packetSize; /* The data payload size in the packet */
360
+ int maxSize;
361
+ int runTimeSec;
362
+ int showPeerInfo;
363
+ int showVerbose;
364
+ #ifndef NO_WOLFSSL_SERVER
365
+ int listenFd;
366
+ #endif
367
+ #ifdef WOLFSSL_DTLS
368
+ int doDTLS;
369
+ struct sockaddr_in serverAddr;
370
+ struct sockaddr_in clientAddr;
371
+ #ifndef SINGLE_THREADED
372
+ int serverReady;
373
+ int clientOrserverOnly;
374
+ wolfSSL_Mutex dtls_mutex;
375
+ COND_TYPE dtls_cond;
376
+ #endif
377
+ #endif
378
+ side_t client;
379
+ side_t server;
380
+
381
+ #ifndef SINGLE_THREADED
382
+ int useLocalMem;
383
+
384
+ /* client messages to server in memory */
385
+ memBuf_t to_server;
386
+
387
+ /* server messages to client in memory */
388
+ memBuf_t to_client;
389
+
390
+ /* Indicates that the server is ready for connection */
391
+ int serverListening;
392
+ #endif
393
+
394
+ /* server */
395
+ stats_t server_stats;
396
+
397
+ /* client */
398
+ stats_t client_stats;
399
+ } info_t;
400
+
401
+ /* Global vars for argument parsing */
402
+ int myoptind = 0;
403
+ char* myoptarg = NULL;
404
+
405
+ #ifdef WOLFSSL_DTLS
406
+ int DoneHandShake = 0;
407
+ #endif
408
+
409
+
410
+ #if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION == 5)
411
+ static int run_all_CAST(void)
412
+ {
413
+ int ret = 0;
414
+ int cast_idx = 0;
415
+
416
+ for (cast_idx = 0; cast_idx < FIPS_CAST_COUNT; cast_idx++) {
417
+ if ((ret = wc_RunCast_fips(cast_idx)) != 0) {
418
+ #ifdef NO_ERROR_STRINGS
419
+ fprintf(stderr,
420
+ "ERROR: FIPS CAST failed with return code: %d\n", ret);
421
+ #else
422
+ fprintf(stderr,
423
+ "ERROR: FIPS CAST failed for algorithm: %s\n",
424
+ wc_GetErrorString(ret));
425
+ #endif
426
+ return ret;
427
+ }
428
+ }
429
+
430
+ return ret;
431
+ }
432
+ #endif /* HAVE_FIPS && HAVE_FIPS_VERSION == 5 */
433
+
434
+
435
+ static double gettime_secs(int reset)
436
+ {
437
+ struct timeval tv;
438
+ LIBCALL_CHECK_RET(gettimeofday(&tv, 0));
439
+ (void)reset;
440
+
441
+ return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
442
+ }
443
+
444
+
445
+ #ifndef SINGLE_THREADED
446
+ /* server send callback */
447
+ static int ServerMemSend(info_t* info, char* buf, int sz)
448
+ {
449
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->to_client.cond));
450
+
451
+ #ifndef BENCH_USE_NONBLOCK
452
+ /* check for overflow */
453
+ if (info->to_client.write_idx + sz > MEM_BUFFER_SZ) {
454
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_client.cond));
455
+ fprintf(stderr, "ServerMemSend overflow\n");
456
+ return -1;
457
+ }
458
+ #else
459
+ if (info->to_client.write_idx + sz > MEM_BUFFER_SZ) {
460
+ sz = MEM_BUFFER_SZ - info->to_client.write_idx;
461
+ }
462
+ #endif
463
+
464
+ XMEMCPY(&info->to_client.buf[info->to_client.write_idx], buf, (size_t)sz);
465
+ info->to_client.write_idx += sz;
466
+ info->to_client.write_bytes += sz;
467
+
468
+ THREAD_CHECK_RET(wolfSSL_CondSignal(&info->to_client.cond));
469
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_client.cond));
470
+
471
+ #ifdef BENCH_USE_NONBLOCK
472
+ if (sz == 0) {
473
+ return WOLFSSL_CBIO_ERR_WANT_WRITE;
474
+ }
475
+ #endif
476
+ return sz;
477
+ }
478
+
479
+ /* server recv callback */
480
+ static int ServerMemRecv(info_t* info, char* buf, int sz)
481
+ {
482
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->to_server.cond));
483
+
484
+ #ifndef BENCH_USE_NONBLOCK
485
+ while (info->to_server.write_idx - info->to_server.read_idx < sz &&
486
+ !info->to_client.done) {
487
+ THREAD_CHECK_RET(wolfSSL_CondWait(&info->to_server.cond));
488
+ }
489
+ #else
490
+ if (info->to_server.write_idx - info->to_server.read_idx < sz) {
491
+ sz = info->to_server.write_idx - info->to_server.read_idx;
492
+ }
493
+ #endif
494
+
495
+ XMEMCPY(buf, &info->to_server.buf[info->to_server.read_idx], (size_t)sz);
496
+ info->to_server.read_idx += sz;
497
+ info->to_server.read_bytes += sz;
498
+
499
+ /* if the rx has caught up with pending then reset buffer positions */
500
+ if (info->to_server.read_bytes == info->to_server.write_bytes) {
501
+ info->to_server.read_bytes = info->to_server.read_idx = 0;
502
+ info->to_server.write_bytes = info->to_server.write_idx = 0;
503
+ }
504
+
505
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_server.cond));
506
+
507
+ if (info->to_client.done != 0) {
508
+ return -1;
509
+ }
510
+
511
+ #ifdef BENCH_USE_NONBLOCK
512
+ if (sz == 0) {
513
+ return WOLFSSL_CBIO_ERR_WANT_READ;
514
+ }
515
+ #endif
516
+ return sz;
517
+ }
518
+
519
+ /* client send callback */
520
+ static int ClientMemSend(info_t* info, char* buf, int sz)
521
+ {
522
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->to_server.cond));
523
+
524
+ #ifndef BENCH_USE_NONBLOCK
525
+ /* check for overflow */
526
+ if (info->to_server.write_idx + sz > MEM_BUFFER_SZ) {
527
+ fprintf(stderr, "ClientMemSend overflow %d %d %d\n",
528
+ info->to_server.write_idx, sz, MEM_BUFFER_SZ);
529
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_server.cond));
530
+ return -1;
531
+ }
532
+ #else
533
+ if (info->to_server.write_idx + sz > MEM_BUFFER_SZ) {
534
+ sz = MEM_BUFFER_SZ - info->to_server.write_idx;
535
+ }
536
+ #endif
537
+
538
+ XMEMCPY(&info->to_server.buf[info->to_server.write_idx], buf, (size_t)sz);
539
+ info->to_server.write_idx += sz;
540
+ info->to_server.write_bytes += sz;
541
+
542
+ THREAD_CHECK_RET(wolfSSL_CondSignal(&info->to_server.cond));
543
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_server.cond));
544
+
545
+ #ifdef BENCH_USE_NONBLOCK
546
+ if (sz == 0) {
547
+ return WOLFSSL_CBIO_ERR_WANT_WRITE;
548
+ }
549
+ #endif
550
+ return sz;
551
+ }
552
+
553
+ /* client recv callback */
554
+ static int ClientMemRecv(info_t* info, char* buf, int sz)
555
+ {
556
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->to_client.cond));
557
+
558
+ #ifndef BENCH_USE_NONBLOCK
559
+ while (info->to_client.write_idx - info->to_client.read_idx < sz &&
560
+ !info->to_server.done) {
561
+ THREAD_CHECK_RET(wolfSSL_CondWait(&info->to_client.cond));
562
+ }
563
+ #else
564
+ if (info->to_client.write_idx - info->to_client.read_idx < sz) {
565
+ sz = info->to_client.write_idx - info->to_client.read_idx;
566
+ }
567
+ #endif
568
+
569
+ XMEMCPY(buf, &info->to_client.buf[info->to_client.read_idx], (size_t)sz);
570
+ info->to_client.read_idx += sz;
571
+ info->to_client.read_bytes += sz;
572
+
573
+ /* if the rx has caught up with pending then reset buffer positions */
574
+ if (info->to_client.read_bytes == info->to_client.write_bytes) {
575
+ info->to_client.read_bytes = info->to_client.read_idx = 0;
576
+ info->to_client.write_bytes = info->to_client.write_idx = 0;
577
+ }
578
+
579
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_client.cond));
580
+
581
+ if (info->to_server.done != 0) {
582
+ return -1;
583
+ }
584
+
585
+ #ifdef BENCH_USE_NONBLOCK
586
+ if (sz == 0) {
587
+ return WOLFSSL_CBIO_ERR_WANT_READ;
588
+ }
589
+ #endif
590
+ return sz;
591
+ }
592
+ #endif /* !SINGLE_THREADED */
593
+
594
+ static int SocketRecv(int sockFd, char* buf, int sz)
595
+ {
596
+ int recvd = (int)recv(sockFd, buf, (size_t)sz, 0);
597
+ if (recvd == -1) {
598
+ switch (errno) {
599
+ #if EAGAIN != SOCKET_EWOULDBLOCK
600
+ case EAGAIN: /* EAGAIN == EWOULDBLOCK on some systems, but not others */
601
+ #endif
602
+ case SOCKET_EWOULDBLOCK:
603
+ return WOLFSSL_CBIO_ERR_WANT_READ;
604
+ case SOCKET_ECONNRESET:
605
+ return WOLFSSL_CBIO_ERR_CONN_RST;
606
+ case SOCKET_EINTR:
607
+ return WOLFSSL_CBIO_ERR_ISR;
608
+ case SOCKET_ECONNREFUSED: /* DTLS case */
609
+ return WOLFSSL_CBIO_ERR_WANT_READ;
610
+ case SOCKET_ECONNABORTED:
611
+ return WOLFSSL_CBIO_ERR_CONN_CLOSE;
612
+ default:
613
+ return WOLFSSL_CBIO_ERR_GENERAL;
614
+ }
615
+ }
616
+ else if (recvd == 0) {
617
+ return WOLFSSL_CBIO_ERR_CONN_CLOSE;
618
+ }
619
+ return recvd;
620
+ }
621
+
622
+ static int SocketSend(int sockFd, char* buf, int sz)
623
+ {
624
+ int sent = (int)send(sockFd, buf, (size_t)sz, 0);
625
+ if (sent == -1) {
626
+ switch (errno) {
627
+ #if EAGAIN != SOCKET_EWOULDBLOCK
628
+ case EAGAIN: /* EAGAIN == EWOULDBLOCK on some systems, but not others */
629
+ #endif
630
+ case SOCKET_EWOULDBLOCK:
631
+ return WOLFSSL_CBIO_ERR_WANT_READ;
632
+ case SOCKET_ECONNRESET:
633
+ return WOLFSSL_CBIO_ERR_CONN_RST;
634
+ case SOCKET_EINTR:
635
+ return WOLFSSL_CBIO_ERR_ISR;
636
+ case SOCKET_EPIPE:
637
+ return WOLFSSL_CBIO_ERR_CONN_CLOSE;
638
+ default:
639
+ return WOLFSSL_CBIO_ERR_GENERAL;
640
+ }
641
+ }
642
+ else if (sent == 0) {
643
+ return 0;
644
+ }
645
+ return sent;
646
+ }
647
+ #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_SERVER)
648
+ static int ReceiveFrom(WOLFSSL *ssl, int sd, char *buf, int sz)
649
+ {
650
+ int recvd;
651
+ int dtls_timeout = wolfSSL_dtls_get_current_timeout(ssl);
652
+ struct sockaddr peer;
653
+ socklen_t peerSz = 0;
654
+
655
+ if (DoneHandShake) {
656
+ dtls_timeout = 0;
657
+ }
658
+
659
+ if (!wolfSSL_get_using_nonblock(ssl)) {
660
+ struct timeval timeout;
661
+ XMEMSET(&timeout, 0, sizeof(timeout));
662
+ timeout.tv_sec = dtls_timeout;
663
+
664
+ if (setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout,
665
+ sizeof(timeout)) != 0) {
666
+ fprintf(stderr, "setsockopt rcvtimeo failed\n");
667
+ }
668
+ }
669
+
670
+ recvd = (int)recvfrom(sd, buf, (size_t)sz, 0, (SOCKADDR*)&peer, &peerSz);
671
+
672
+ if (recvd < 0) {
673
+ if (errno == SOCKET_EWOULDBLOCK || errno == SOCKET_EAGAIN) {
674
+ if (wolfSSL_dtls_get_using_nonblock(ssl)) {
675
+ return WOLFSSL_CBIO_ERR_WANT_READ;
676
+ }
677
+ else {
678
+ return WOLFSSL_CBIO_ERR_TIMEOUT;
679
+ }
680
+ }
681
+ else if (errno == SOCKET_ECONNRESET) {
682
+ return WOLFSSL_CBIO_ERR_CONN_RST;
683
+ }
684
+ else if (errno == SOCKET_EINTR) {
685
+ return WOLFSSL_CBIO_ERR_ISR;
686
+ }
687
+ else if (errno == SOCKET_ECONNREFUSED) {
688
+ return WOLFSSL_CBIO_ERR_WANT_READ;
689
+ }
690
+ else {
691
+ return WOLFSSL_CBIO_ERR_GENERAL;
692
+ }
693
+ }
694
+ else {
695
+ if (recvd == 0) {
696
+ return WOLFSSL_CBIO_ERR_CONN_CLOSE;
697
+ }
698
+ }
699
+
700
+ return recvd;
701
+ }
702
+ #endif /* WOLFSSL_DTLS && !NO_WOLFSSL_SERVER */
703
+
704
+ #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_CLIENT)
705
+ static int SendTo(int sd, char *buf, int sz, const struct sockaddr *peer,
706
+ socklen_t peerSz)
707
+ {
708
+ int sent;
709
+
710
+ sent = (int)sendto(sd, buf, (size_t)sz, 0, peer, peerSz);
711
+
712
+ if (sent < 0) {
713
+ if (errno == SOCKET_EWOULDBLOCK || errno == SOCKET_EAGAIN) {
714
+ return WOLFSSL_CBIO_ERR_WANT_WRITE;
715
+ }
716
+ else if (errno == SOCKET_ECONNRESET) {
717
+ return WOLFSSL_CBIO_ERR_CONN_RST;
718
+ }
719
+ else if (errno == SOCKET_EINTR) {
720
+ return WOLFSSL_CBIO_ERR_ISR;
721
+ }
722
+ else if (errno == SOCKET_EPIPE) {
723
+ return WOLFSSL_CBIO_ERR_CONN_CLOSE;
724
+ }
725
+ else {
726
+ return WOLFSSL_CBIO_ERR_GENERAL;
727
+ }
728
+ }
729
+
730
+ return sent;
731
+ }
732
+
733
+ static int myDoneHsCb(WOLFSSL* ssl, void* user_ctx)
734
+ {
735
+ (void) ssl;
736
+ (void) user_ctx;
737
+
738
+ DoneHandShake = 1;
739
+ return 1;
740
+ }
741
+ #endif /* WOLFSSL_DTLS && !NO_WOLFSSL_CLIENT */
742
+
743
+ #ifndef NO_WOLFSSL_SERVER
744
+ static int ServerSend(WOLFSSL* ssl, char* buf, int sz, void* ctx)
745
+ {
746
+ info_t* info = (info_t*)ctx;
747
+ (void)ssl;
748
+ #ifndef SINGLE_THREADED
749
+ if (info->useLocalMem) {
750
+ return ServerMemSend(info, buf, sz);
751
+ }
752
+ #endif
753
+ #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_CLIENT)
754
+ if (info->doDTLS) {
755
+ return SendTo(info->server.sockFd, buf, sz,
756
+ (const struct sockaddr*)&info->clientAddr, sizeof(info->clientAddr));
757
+ }
758
+ else
759
+ #endif
760
+ {
761
+ return SocketSend(info->server.sockFd, buf, sz);
762
+ }
763
+ }
764
+ static int ServerRecv(WOLFSSL* ssl, char* buf, int sz, void* ctx)
765
+ {
766
+ info_t* info = (info_t*)ctx;
767
+ (void)ssl;
768
+ #ifndef SINGLE_THREADED
769
+ if (info->useLocalMem) {
770
+ return ServerMemRecv(info, buf, sz);
771
+ }
772
+ #endif
773
+ #ifdef WOLFSSL_DTLS
774
+ if (info->doDTLS) {
775
+ return ReceiveFrom(ssl, info->server.sockFd, buf, sz);
776
+ }
777
+ else
778
+ #endif
779
+ {
780
+ return SocketRecv(info->server.sockFd, buf, sz);
781
+ }
782
+ }
783
+ #endif /* !NO_WOLFSSL_SERVER */
784
+
785
+ #ifndef NO_WOLFSSL_CLIENT
786
+ static int ClientSend(WOLFSSL* ssl, char* buf, int sz, void* ctx)
787
+ {
788
+ info_t* info = (info_t*)ctx;
789
+ (void)ssl;
790
+ #ifndef SINGLE_THREADED
791
+ if (info->useLocalMem) {
792
+ return ClientMemSend(info, buf, sz);
793
+ }
794
+ #endif
795
+ #ifdef WOLFSSL_DTLS
796
+ if (info->doDTLS) {
797
+ return SendTo(info->client.sockFd, buf, sz,
798
+ (const struct sockaddr*)&info->serverAddr, sizeof(info->serverAddr));
799
+ }
800
+ else
801
+ #endif
802
+ {
803
+ return SocketSend(info->client.sockFd, buf, sz);
804
+ }
805
+ }
806
+ static int ClientRecv(WOLFSSL* ssl, char* buf, int sz, void* ctx)
807
+ {
808
+ info_t* info = (info_t*)ctx;
809
+ (void)ssl;
810
+ #ifndef SINGLE_THREADED
811
+ if (info->useLocalMem) {
812
+ return ClientMemRecv(info, buf, sz);
813
+ }
814
+ #endif
815
+ #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_SERVER)
816
+ if (info->doDTLS) {
817
+ return ReceiveFrom(ssl, info->client.sockFd, buf, sz);
818
+ }
819
+ else
820
+ #endif
821
+ {
822
+ return SocketRecv(info->client.sockFd, buf, sz);
823
+ }
824
+ }
825
+ #endif /* !NO_WOLFSSL_CLIENT */
826
+
827
+ static void CloseAndCleanupSocket(int* sockFd)
828
+ {
829
+ if (*sockFd != -1) {
830
+ close(*sockFd);
831
+ *sockFd = -1;
832
+ }
833
+ #ifdef WOLFSSL_DTLS
834
+ DoneHandShake = 0;
835
+ #endif
836
+ }
837
+
838
+ #ifdef BENCH_USE_NONBLOCK
839
+ static int SetSocketNonBlocking(int sockFd)
840
+ {
841
+ int flags = fcntl(sockFd, F_GETFL, 0);
842
+ if (flags < 0) {
843
+ fprintf(stderr, "fcntl get failed\n");
844
+ return -1;
845
+ }
846
+ flags = fcntl(sockFd, F_SETFL, flags | O_NONBLOCK);
847
+ if (flags < 0) {
848
+ fprintf(stderr, "fcntl set failed\n");
849
+ return -1;
850
+ }
851
+ return 0;
852
+ }
853
+ #endif
854
+
855
+ #ifndef NO_WOLFSSL_CLIENT
856
+ static int SetupSocketAndConnect(info_t* info, const char* host,
857
+ word32 port)
858
+ {
859
+ struct sockaddr_in servAddr;
860
+ struct hostent* entry;
861
+
862
+ /* Setup server address */
863
+ XMEMSET(&servAddr, 0, sizeof(servAddr));
864
+ servAddr.sin_family = AF_INET;
865
+ servAddr.sin_port = htons((uint16_t)port);
866
+
867
+ /* Resolve host */
868
+ entry = gethostbyname(host);
869
+ if (entry) {
870
+ XMEMCPY(&servAddr.sin_addr.s_addr, entry->h_addr_list[0],
871
+ (size_t)entry->h_length);
872
+ }
873
+ else {
874
+ servAddr.sin_addr.s_addr = inet_addr(host);
875
+ }
876
+
877
+ #ifdef WOLFSSL_DTLS
878
+ if (info->doDTLS) {
879
+ /* Create the SOCK_DGRAM socket type is implemented on the User
880
+ * Datagram Protocol/Internet Protocol(UDP/IP protocol).*/
881
+ if ((info->client.sockFd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
882
+ fprintf(stderr, "ERROR: failed to create the SOCK_DGRAM socket\n");
883
+ return -1;
884
+ }
885
+ XMEMCPY(&info->serverAddr, &servAddr, sizeof(servAddr));
886
+ }
887
+ else
888
+ #endif
889
+ {
890
+ /* Create a socket that uses an Internet IPv4 address,
891
+ * Sets the socket to be stream based (TCP),
892
+ * 0 means choose the default protocol. */
893
+ if ((info->client.sockFd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
894
+ fprintf(stderr, "ERROR: failed to create the socket\n");
895
+ return -1;
896
+ }
897
+
898
+ /* Connect to the server */
899
+ #ifndef SINGLE_THREADED
900
+ while ((info->serverListening == 0) && (info->server.shutdown == 0)) {
901
+ if (info->showVerbose) {
902
+ fprintf(stderr, "Waiting for server to listen...\n");
903
+ }
904
+ XSLEEP_MS(1);
905
+ }
906
+ #endif
907
+
908
+ if (info->server.shutdown == 1) {
909
+ fprintf(stderr, "ERROR: server side has shutdown\n");
910
+ return -1;
911
+ }
912
+
913
+ if (connect(info->client.sockFd, (struct sockaddr*)&servAddr,
914
+ sizeof(servAddr)) == -1) {
915
+ fprintf(stderr, "ERROR: failed to connect\n");
916
+ return -1;
917
+ }
918
+ }
919
+
920
+ #ifdef BENCH_USE_NONBLOCK
921
+ if (SetSocketNonBlocking(info->client.sockFd) != 0) {
922
+ return -1;
923
+ }
924
+ #endif
925
+
926
+ if (info->showVerbose) {
927
+ fprintf(stderr, "Connected to %s on port %d\n", host, port);
928
+ }
929
+
930
+ return 0;
931
+ }
932
+
933
+ static int bench_tls_client(info_t* info)
934
+ {
935
+ byte *writeBuf = NULL, *readBuf = NULL;
936
+ double start, total = 0;
937
+ int ret, readBufSz;
938
+ WOLFSSL_CTX* cli_ctx = NULL;
939
+ WOLFSSL* cli_ssl = NULL;
940
+ int haveShownPeerInfo = 0;
941
+ int tls13 = XSTRNCMP(info->cipher, "TLS13", 5) == 0;
942
+ int total_sz;
943
+
944
+ total = gettime_secs(0);
945
+
946
+ /* set up client */
947
+ #ifdef WOLFSSL_DTLS
948
+ if (info->doDTLS) {
949
+ if (tls13) {
950
+ #ifdef WOLFSSL_DTLS13
951
+ cli_ctx = wolfSSL_CTX_new(wolfDTLSv1_3_client_method());
952
+ #endif
953
+ }
954
+ else {
955
+ #ifndef WOLFSSL_NO_TLS12
956
+ cli_ctx = wolfSSL_CTX_new(wolfDTLSv1_2_client_method());
957
+ #endif
958
+ }
959
+ }
960
+ else
961
+ #endif
962
+ {
963
+ #ifdef WOLFSSL_TLS13
964
+ if (tls13) {
965
+ cli_ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
966
+ }
967
+ else
968
+ #endif
969
+ {
970
+ #if !defined(WOLFSSL_TLS13)
971
+ cli_ctx = wolfSSL_CTX_new(wolfSSLv23_client_method());
972
+ #elif !defined(WOLFSSL_NO_TLS12)
973
+ cli_ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
974
+ #endif
975
+ }
976
+ }
977
+
978
+ if (cli_ctx == NULL) {
979
+ fprintf(stderr, "error creating ctx\n");
980
+ ret = MEMORY_E; goto exit;
981
+ }
982
+
983
+ #ifndef NO_CERTS
984
+ #ifdef HAVE_ECC
985
+ if (XSTRSTR(info->cipher, "ECDSA")) {
986
+ ret = wolfSSL_CTX_load_verify_buffer(cli_ctx, ca_ecc_cert_der_256,
987
+ sizeof_ca_ecc_cert_der_256, WOLFSSL_FILETYPE_ASN1);
988
+ }
989
+ else
990
+ #endif
991
+ {
992
+ ret = wolfSSL_CTX_load_verify_buffer(cli_ctx, ca_cert_der_2048,
993
+ sizeof_ca_cert_der_2048, WOLFSSL_FILETYPE_ASN1);
994
+ }
995
+ if (ret != WOLFSSL_SUCCESS) {
996
+ fprintf(stderr, "error loading CA\n");
997
+ goto exit;
998
+ }
999
+ #endif
1000
+
1001
+ wolfSSL_CTX_SetIOSend(cli_ctx, ClientSend);
1002
+ wolfSSL_CTX_SetIORecv(cli_ctx, ClientRecv);
1003
+
1004
+ /* set cipher suite */
1005
+ ret = wolfSSL_CTX_set_cipher_list(cli_ctx, info->cipher);
1006
+ if (ret != WOLFSSL_SUCCESS) {
1007
+ fprintf(stderr, "error setting cipher suite\n");
1008
+ goto exit;
1009
+ }
1010
+
1011
+ #ifndef NO_DH
1012
+ ret = wolfSSL_CTX_SetMinDhKey_Sz(cli_ctx, MIN_DHKEY_BITS);
1013
+ if (ret != WOLFSSL_SUCCESS) {
1014
+ fprintf(stderr, "Error setting minimum DH key size\n");
1015
+ goto exit;
1016
+ }
1017
+ #endif
1018
+
1019
+ #ifndef NO_PSK
1020
+ wolfSSL_CTX_set_psk_client_callback(cli_ctx, my_psk_client_cb);
1021
+ #ifdef WOLFSSL_TLS13
1022
+ #if !defined(WOLFSSL_PSK_TLS13_CB) && !defined(WOLFSSL_PSK_ONE_ID)
1023
+ wolfSSL_CTX_set_psk_client_cs_callback(cli_ctx, my_psk_client_cs_cb);
1024
+ #else
1025
+ wolfSSL_CTX_set_psk_client_tls13_callback(cli_ctx, my_psk_client_tls13_cb);
1026
+ #endif
1027
+ #endif
1028
+ wolfSSL_CTX_set_psk_callback_ctx(cli_ctx, (void*)info->cipher);
1029
+ #endif /* !NO_PSK */
1030
+
1031
+
1032
+ /* Allocate and initialize a packet sized buffer */
1033
+ writeBuf = (unsigned char*)XMALLOC((size_t)info->packetSize, NULL,
1034
+ DYNAMIC_TYPE_TMP_BUFFER);
1035
+ if (writeBuf == NULL) {
1036
+ fprintf(stderr, "failed to allocate write memory\n");
1037
+ ret = MEMORY_E; goto exit;
1038
+ }
1039
+
1040
+ /* Allocate read buffer */
1041
+ readBufSz = info->packetSize;
1042
+ readBuf = (unsigned char*)XMALLOC((size_t)readBufSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
1043
+ if (readBuf == NULL) {
1044
+ fprintf(stderr, "failed to allocate read memory\n");
1045
+ ret = MEMORY_E; goto exit;
1046
+ }
1047
+
1048
+ /* BENCHMARK CONNECTIONS LOOP */
1049
+ while (!info->client.shutdown) {
1050
+ int writeSz = info->packetSize;
1051
+ #ifdef BENCH_USE_NONBLOCK
1052
+ int err;
1053
+ #endif
1054
+
1055
+ #ifndef SINGLE_THREADED
1056
+ if (!info->useLocalMem)
1057
+ #endif
1058
+ {
1059
+ /* Setup socket and connection */
1060
+ ret = SetupSocketAndConnect(info, info->host, info->port);
1061
+ if (ret != 0) goto exit;
1062
+ }
1063
+
1064
+ cli_ssl = wolfSSL_new(cli_ctx);
1065
+ if (cli_ssl == NULL) {
1066
+ fprintf(stderr, "error creating client object\n");
1067
+ goto exit;
1068
+ }
1069
+
1070
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
1071
+ if (info->group != 0) {
1072
+ ret = wolfSSL_UseKeyShare(cli_ssl, info->group);
1073
+ if (ret != WOLFSSL_SUCCESS) {
1074
+ fprintf(stderr, "error setting client key share.\n");
1075
+ goto exit;
1076
+ }
1077
+ }
1078
+ #endif
1079
+
1080
+ #ifdef WOLFSSL_DTLS
1081
+ if (info->doDTLS) {
1082
+ ret = wolfSSL_dtls_set_peer(cli_ssl, &info->serverAddr,
1083
+ sizeof(info->serverAddr));
1084
+ if (ret != WOLFSSL_SUCCESS) {
1085
+ fprintf(stderr, "error setting dtls peer\n");
1086
+ goto exit;
1087
+ }
1088
+ ret = wolfSSL_SetHsDoneCb(cli_ssl, myDoneHsCb, NULL);
1089
+ if (ret != WOLFSSL_SUCCESS) {
1090
+ fprintf(stderr, "error handshake done callback\n");
1091
+ goto exit;
1092
+ }
1093
+ }
1094
+ #endif
1095
+ wolfSSL_SetIOReadCtx(cli_ssl, info);
1096
+ wolfSSL_SetIOWriteCtx(cli_ssl, info);
1097
+
1098
+ #if !defined(SINGLE_THREADED) && defined(WOLFSSL_DTLS)
1099
+ /* synchronize with server */
1100
+ if (info->doDTLS && !info->clientOrserverOnly) {
1101
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->dtls_cond));
1102
+ if (info->serverReady != 1) {
1103
+ THREAD_CHECK_RET(wolfSSL_CondWait(&info->dtls_cond));
1104
+ }
1105
+ /* for next loop */
1106
+ info->serverReady = 0;
1107
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->dtls_cond));
1108
+ }
1109
+ #endif
1110
+ /* perform connect */
1111
+ start = gettime_secs(1);
1112
+ #ifndef BENCH_USE_NONBLOCK
1113
+ ret = wolfSSL_connect(cli_ssl);
1114
+ #else
1115
+ do
1116
+ {
1117
+ ret = wolfSSL_connect(cli_ssl);
1118
+ err = wolfSSL_get_error(cli_ssl, ret);
1119
+ }
1120
+ while (err == WOLFSSL_ERROR_WANT_READ || err == WOLFSSL_ERROR_WANT_WRITE);
1121
+ #endif
1122
+ start = gettime_secs(0) - start;
1123
+ if (ret != WOLFSSL_SUCCESS) {
1124
+ fprintf(stderr, "error connecting client\n");
1125
+ ret = wolfSSL_get_error(cli_ssl, ret);
1126
+ goto exit;
1127
+ }
1128
+ info->client_stats.connTime += start;
1129
+ info->client_stats.connCount++;
1130
+
1131
+ if ((info->showPeerInfo) && (!haveShownPeerInfo)) {
1132
+ haveShownPeerInfo = 1;
1133
+ showPeer(cli_ssl);
1134
+ }
1135
+
1136
+ /* check for run time completion and issue shutdown */
1137
+ if (gettime_secs(0) - total >= info->runTimeSec) {
1138
+ info->client.shutdown = 1;
1139
+
1140
+ writeSz = (int)XSTRLEN(kShutdown) + 1;
1141
+ XMEMCPY(writeBuf, kShutdown, (size_t)writeSz); /* include null term */
1142
+ if (info->showVerbose) {
1143
+ fprintf(stderr, "Sending shutdown\n");
1144
+ }
1145
+
1146
+ ret = wolfSSL_write(cli_ssl, writeBuf, writeSz);
1147
+ if (ret < 0) {
1148
+ fprintf(stderr, "error on client write\n");
1149
+ ret = wolfSSL_get_error(cli_ssl, ret);
1150
+ goto exit;
1151
+ }
1152
+ }
1153
+ else {
1154
+ XMEMSET(writeBuf, 0, (size_t)info->packetSize);
1155
+ XSTRNCPY((char*)writeBuf, kTestStr, (size_t)info->packetSize);
1156
+ }
1157
+
1158
+ /* write / read echo loop */
1159
+ ret = 0;
1160
+ total_sz = 0;
1161
+ while (ret == 0 && total_sz < info->maxSize && !info->client.shutdown) {
1162
+ /* write test message to server */
1163
+ start = gettime_secs(1);
1164
+ #ifndef BENCH_USE_NONBLOCK
1165
+ ret = wolfSSL_write(cli_ssl, writeBuf, writeSz);
1166
+ #else
1167
+ do {
1168
+ ret = wolfSSL_write(cli_ssl, writeBuf, writeSz);
1169
+ err = wolfSSL_get_error(cli_ssl, ret);
1170
+ }
1171
+ while (err == WOLFSSL_ERROR_WANT_WRITE);
1172
+ #endif
1173
+ info->client_stats.txTime += gettime_secs(0) - start;
1174
+ if (ret < 0) {
1175
+ fprintf(stderr, "error on client write\n");
1176
+ ret = wolfSSL_get_error(cli_ssl, ret);
1177
+ goto exit;
1178
+ }
1179
+ info->client_stats.txTotal += ret;
1180
+ total_sz += ret;
1181
+
1182
+ /* read echo of message from server */
1183
+ XMEMSET(readBuf, 0, (size_t)readBufSz);
1184
+ start = gettime_secs(1);
1185
+ #ifndef BENCH_USE_NONBLOCK
1186
+ ret = wolfSSL_read(cli_ssl, readBuf, readBufSz);
1187
+ #else
1188
+ do {
1189
+ ret = wolfSSL_read(cli_ssl, readBuf, readBufSz);
1190
+ err = wolfSSL_get_error(cli_ssl, ret);
1191
+ }
1192
+ while (err == WOLFSSL_ERROR_WANT_READ);
1193
+ #endif
1194
+ info->client_stats.rxTime += gettime_secs(0) - start;
1195
+ if (ret < 0) {
1196
+ fprintf(stderr, "error on client read\n");
1197
+ ret = wolfSSL_get_error(cli_ssl, ret);
1198
+ goto exit;
1199
+ }
1200
+ info->client_stats.rxTotal += ret;
1201
+ ret = 0; /* reset return code */
1202
+
1203
+ /* validate echo */
1204
+ if (XMEMCMP((char*)writeBuf, (char*)readBuf, (size_t)writeSz) != 0) {
1205
+ fprintf(stderr, "echo check failed!\n");
1206
+ ret = wolfSSL_get_error(cli_ssl, ret);
1207
+ goto exit;
1208
+ }
1209
+ }
1210
+
1211
+ CloseAndCleanupSocket(&info->client.sockFd);
1212
+
1213
+ wolfSSL_free(cli_ssl);
1214
+ cli_ssl = NULL;
1215
+ }
1216
+
1217
+ exit:
1218
+
1219
+ if (ret != 0 && ret != WOLFSSL_SUCCESS) {
1220
+ fprintf(stderr, "Client Error: %d (%s)\n", ret,
1221
+ wolfSSL_ERR_reason_error_string((unsigned long)ret));
1222
+ }
1223
+
1224
+ /* clean up */
1225
+ CloseAndCleanupSocket(&info->client.sockFd);
1226
+ if (cli_ssl != NULL) {
1227
+ wolfSSL_free(cli_ssl);
1228
+ }
1229
+ if (cli_ctx != NULL) {
1230
+ wolfSSL_CTX_free(cli_ctx);
1231
+ }
1232
+ XFREE(readBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER);
1233
+ XFREE(writeBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER);
1234
+ info->client.ret = ret;
1235
+
1236
+ (void)tls13;
1237
+
1238
+ return ret;
1239
+ }
1240
+
1241
+ #if !defined(SINGLE_THREADED) && defined(WOLFSSL_THREAD_NO_JOIN)
1242
+ static THREAD_RETURN_NOJOIN WOLFSSL_THREAD_NO_JOIN client_thread(void* args)
1243
+ {
1244
+ int ret;
1245
+ info_t* info = (info_t*)args;
1246
+
1247
+ ret = bench_tls_client(info);
1248
+
1249
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->to_server.cond));
1250
+ info->to_client.done = 1;
1251
+ info->client.ret = ret;
1252
+ THREAD_CHECK_RET(wolfSSL_CondSignal(&info->to_server.cond));
1253
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_server.cond));
1254
+
1255
+ RETURN_FROM_THREAD_NOJOIN(0);
1256
+ }
1257
+ #endif /* !SINGLE_THREADED */
1258
+ #endif /* !NO_WOLFSSL_CLIENT */
1259
+
1260
+
1261
+ #ifndef NO_WOLFSSL_SERVER
1262
+ static int SetupSocketAndListen(int* listenFd, word32 port, int doDTLS)
1263
+ {
1264
+ struct sockaddr_in servAddr;
1265
+ #if defined(_MSC_VER) || defined(__MINGW32__)
1266
+ char optval = 1;
1267
+ #else
1268
+ int optval = 1;
1269
+ #endif
1270
+ #ifndef WOLFSSL_DTLS
1271
+ (void) doDTLS;
1272
+ #endif
1273
+ /* Setup server address */
1274
+ XMEMSET(&servAddr, 0, sizeof(servAddr));
1275
+ servAddr.sin_family = AF_INET;
1276
+ servAddr.sin_port = htons((uint16_t)port);
1277
+ servAddr.sin_addr.s_addr = INADDR_ANY;
1278
+
1279
+ #ifdef WOLFSSL_DTLS
1280
+ if (doDTLS) {
1281
+ /* Create a socket that is implemented on the User Datagram Protocol/
1282
+ * Interet Protocol(UDP/IP protocol). */
1283
+ if((*listenFd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
1284
+ fprintf(stderr, "ERROR: failed to create the socket\n");
1285
+ return -1;
1286
+ }
1287
+ }
1288
+ else
1289
+ #endif
1290
+ {
1291
+ /* Create a socket that uses an Internet IPv4 address,
1292
+ * Sets the socket to be stream based (TCP),
1293
+ * 0 means choose the default protocol. */
1294
+ if ((*listenFd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
1295
+ fprintf(stderr, "ERROR: failed to create the socket\n");
1296
+ return -1;
1297
+ }
1298
+
1299
+ /* allow reuse */
1300
+ if (setsockopt(*listenFd, SOL_SOCKET, SO_REUSEADDR,
1301
+ &optval, sizeof(optval)) == -1) {
1302
+ fprintf(stderr, "setsockopt SO_REUSEADDR failed\n");
1303
+ return -1;
1304
+ }
1305
+
1306
+ /* Listen for the client. */
1307
+ if (bind(*listenFd, (struct sockaddr*)&servAddr,
1308
+ sizeof(servAddr)) == -1) {
1309
+ fprintf(stderr, "ERROR: failed to bind\n");
1310
+ return -1;
1311
+ }
1312
+ }
1313
+
1314
+ if (listen(*listenFd, 5) != 0) {
1315
+ fprintf(stderr, "ERROR: failed to listen\n");
1316
+ return -1;
1317
+ }
1318
+
1319
+ #ifdef BENCH_USE_NONBLOCK
1320
+ if (SetSocketNonBlocking(*listenFd) != 0) {
1321
+ return -1;
1322
+ }
1323
+ #endif
1324
+
1325
+ return 0;
1326
+ }
1327
+
1328
+ static int SocketWaitClient(info_t* info)
1329
+ {
1330
+ int connd;
1331
+ struct sockaddr_in clientAddr;
1332
+ socklen_t size = sizeof(clientAddr);
1333
+
1334
+ #ifdef WOLFSSL_DTLS
1335
+ if (info->doDTLS) {
1336
+ char msg[64];
1337
+ #ifndef SINGLE_THREADED
1338
+ if (!info->clientOrserverOnly) {
1339
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->dtls_cond));
1340
+ info->serverReady = 1;
1341
+ THREAD_CHECK_RET(wolfSSL_CondSignal(&info->dtls_cond));
1342
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->dtls_cond));
1343
+ }
1344
+ #endif
1345
+ connd = (int)recvfrom(info->listenFd, (char *)msg, sizeof(msg),
1346
+ MSG_PEEK, (struct sockaddr*)&clientAddr, &size);
1347
+ if (connd < -1) {
1348
+ fprintf(stderr, "ERROR: failed to accept the connection\n");
1349
+ return -1;
1350
+ }
1351
+ XMEMCPY(&info->clientAddr, &clientAddr, sizeof(clientAddr));
1352
+ info->server.sockFd = info->listenFd;
1353
+ }
1354
+ else
1355
+ #endif
1356
+ {
1357
+ #ifndef SINGLE_THREADED
1358
+ info->serverListening = 1;
1359
+ #endif
1360
+ if ((connd = accept(info->listenFd, (struct sockaddr*)&clientAddr,
1361
+ &size)) == -1) {
1362
+ if (errno == SOCKET_EWOULDBLOCK) {
1363
+ return -2;
1364
+ }
1365
+ fprintf(stderr, "ERROR: failed to accept the connection\n");
1366
+ return -1;
1367
+ }
1368
+ info->server.sockFd = connd;
1369
+ }
1370
+
1371
+ if (info->showVerbose) {
1372
+ fprintf(stderr, "Got client %d\n", connd);
1373
+ }
1374
+
1375
+ return 0;
1376
+ }
1377
+ static void CloseAndCleanupListenSocket(int* listenFd)
1378
+ {
1379
+ if (*listenFd != -1) {
1380
+ close(*listenFd);
1381
+ *listenFd = -1;
1382
+ }
1383
+ }
1384
+
1385
+ static int bench_tls_server(info_t* info)
1386
+ {
1387
+ byte *readBuf = NULL;
1388
+ double start;
1389
+ int ret, len = 0, readBufSz;
1390
+ WOLFSSL_CTX* srv_ctx = NULL;
1391
+ WOLFSSL* srv_ssl = NULL;
1392
+ int tls13 = XSTRNCMP(info->cipher, "TLS13", 5) == 0;
1393
+ int total_sz;
1394
+
1395
+ /* set up server */
1396
+ #ifdef WOLFSSL_DTLS
1397
+ if (info->doDTLS) {
1398
+ if (tls13) {
1399
+ #ifdef WOLFSSL_DTLS13
1400
+ srv_ctx = wolfSSL_CTX_new(wolfDTLSv1_3_server_method());
1401
+ #endif
1402
+ }
1403
+ else {
1404
+ #ifndef WOLFSSL_NO_TLS12
1405
+ srv_ctx = wolfSSL_CTX_new(wolfDTLSv1_2_server_method());
1406
+ #endif
1407
+ }
1408
+ }
1409
+ else
1410
+ #endif
1411
+ {
1412
+ #ifdef WOLFSSL_TLS13
1413
+ if (tls13) {
1414
+ srv_ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method());
1415
+ }
1416
+ else
1417
+ #endif
1418
+ {
1419
+ #if !defined(WOLFSSL_TLS13)
1420
+ srv_ctx = wolfSSL_CTX_new(wolfSSLv23_server_method());
1421
+ #elif !defined(WOLFSSL_NO_TLS12)
1422
+ srv_ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
1423
+ #endif
1424
+ }
1425
+ }
1426
+ if (srv_ctx == NULL) {
1427
+ fprintf(stderr, "error creating server ctx\n");
1428
+ ret = MEMORY_E; goto exit;
1429
+ }
1430
+
1431
+ #ifndef NO_CERTS
1432
+ #ifdef HAVE_ECC
1433
+ if (XSTRSTR(info->cipher, "ECDSA")) {
1434
+ ret = wolfSSL_CTX_use_PrivateKey_buffer(srv_ctx, ecc_key_der_256,
1435
+ sizeof_ecc_key_der_256, WOLFSSL_FILETYPE_ASN1);
1436
+ }
1437
+ else
1438
+ #endif
1439
+ {
1440
+ ret = wolfSSL_CTX_use_PrivateKey_buffer(srv_ctx, server_key_der_2048,
1441
+ sizeof_server_key_der_2048, WOLFSSL_FILETYPE_ASN1);
1442
+ }
1443
+ if (ret != WOLFSSL_SUCCESS) {
1444
+ fprintf(stderr, "error loading server key\n");
1445
+ goto exit;
1446
+ }
1447
+
1448
+ #ifdef HAVE_ECC
1449
+ if (XSTRSTR(info->cipher, "ECDSA")) {
1450
+ ret = wolfSSL_CTX_use_certificate_buffer(srv_ctx, serv_ecc_der_256,
1451
+ sizeof_serv_ecc_der_256, WOLFSSL_FILETYPE_ASN1);
1452
+ }
1453
+ else
1454
+ #endif
1455
+ {
1456
+ ret = wolfSSL_CTX_use_certificate_buffer(srv_ctx, server_cert_der_2048,
1457
+ sizeof_server_cert_der_2048, WOLFSSL_FILETYPE_ASN1);
1458
+ }
1459
+ if (ret != WOLFSSL_SUCCESS) {
1460
+ fprintf(stderr, "error loading server cert\n");
1461
+ goto exit;
1462
+ }
1463
+ #endif /* !NO_CERTS */
1464
+
1465
+ wolfSSL_CTX_SetIOSend(srv_ctx, ServerSend);
1466
+ wolfSSL_CTX_SetIORecv(srv_ctx, ServerRecv);
1467
+
1468
+ /* set cipher suite */
1469
+ ret = wolfSSL_CTX_set_cipher_list(srv_ctx, info->cipher);
1470
+ if (ret != WOLFSSL_SUCCESS) {
1471
+ fprintf(stderr, "error setting cipher suite\n");
1472
+ goto exit;
1473
+ }
1474
+
1475
+ #ifndef NO_DH
1476
+ ret = wolfSSL_CTX_SetMinDhKey_Sz(srv_ctx, MIN_DHKEY_BITS);
1477
+ if (ret != WOLFSSL_SUCCESS) {
1478
+ fprintf(stderr, "Error setting minimum DH key size\n");
1479
+ goto exit;
1480
+ }
1481
+ #endif
1482
+
1483
+ #ifndef NO_PSK
1484
+ wolfSSL_CTX_set_psk_server_callback(srv_ctx, my_psk_server_cb);
1485
+ #ifdef WOLFSSL_TLS13
1486
+ wolfSSL_CTX_set_psk_server_tls13_callback(srv_ctx, my_psk_server_tls13_cb);
1487
+ #endif
1488
+ #endif /* !NO_PSK */
1489
+
1490
+ /* Allocate read buffer */
1491
+ readBufSz = info->packetSize;
1492
+ readBuf = (unsigned char*)XMALLOC((size_t)readBufSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
1493
+ if (readBuf == NULL) {
1494
+ fprintf(stderr, "failed to allocate read memory\n");
1495
+ ret = MEMORY_E; goto exit;
1496
+ }
1497
+
1498
+ /* BENCHMARK CONNECTIONS LOOP */
1499
+ while (!info->server.shutdown) {
1500
+ #ifdef BENCH_USE_NONBLOCK
1501
+ int err;
1502
+ #endif
1503
+
1504
+ #ifndef SINGLE_THREADED
1505
+ if (!info->useLocalMem)
1506
+ #endif
1507
+ {
1508
+ /* Accept client connections */
1509
+ ret = SocketWaitClient(info);
1510
+ #ifdef BENCH_USE_NONBLOCK
1511
+ if (ret == -2) {
1512
+ XSLEEP_MS(0);
1513
+ continue;
1514
+ }
1515
+ #endif
1516
+ if (ret != 0) {
1517
+ goto exit;
1518
+ }
1519
+ }
1520
+
1521
+ srv_ssl = wolfSSL_new(srv_ctx);
1522
+ if (srv_ssl == NULL) {
1523
+ fprintf(stderr, "error creating server object\n");
1524
+ ret = MEMORY_E; goto exit;
1525
+ }
1526
+
1527
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
1528
+ if (info->group != 0) {
1529
+ ret = wolfSSL_UseKeyShare(srv_ssl, info->group);
1530
+ if (ret != WOLFSSL_SUCCESS) {
1531
+ fprintf(stderr, "error setting server key share.\n");
1532
+ goto exit;
1533
+ }
1534
+ }
1535
+ #endif
1536
+
1537
+ #ifdef WOLFSSL_DTLS
1538
+ if (info->doDTLS) {
1539
+ ret = wolfSSL_dtls_set_peer(srv_ssl, &info->clientAddr,
1540
+ sizeof(info->clientAddr));
1541
+ if (ret != WOLFSSL_SUCCESS) {
1542
+ fprintf(stderr, "error setting dtls peer\n");
1543
+ goto exit;
1544
+ }
1545
+ }
1546
+ #endif
1547
+
1548
+ wolfSSL_SetIOReadCtx(srv_ssl, info);
1549
+ wolfSSL_SetIOWriteCtx(srv_ssl, info);
1550
+ #ifndef NO_DH
1551
+ wolfSSL_SetTmpDH(srv_ssl, dhp, sizeof(dhp), dhg, sizeof(dhg));
1552
+ #endif
1553
+
1554
+ /* accept TLS connection */
1555
+ start = gettime_secs(1);
1556
+ #ifndef BENCH_USE_NONBLOCK
1557
+ ret = wolfSSL_accept(srv_ssl);
1558
+ #else
1559
+ do {
1560
+ ret = wolfSSL_accept(srv_ssl);
1561
+ err = wolfSSL_get_error(srv_ssl, ret);
1562
+ }
1563
+ while (err == WOLFSSL_ERROR_WANT_READ || err == WOLFSSL_ERROR_WANT_WRITE);
1564
+ #endif
1565
+ start = gettime_secs(0) - start;
1566
+ if (ret != WOLFSSL_SUCCESS) {
1567
+ #ifndef SINGLE_THREADED
1568
+ if (info->to_client.done) {
1569
+ ret = 0; /* done - success */
1570
+ }
1571
+ else
1572
+ #endif
1573
+ {
1574
+ fprintf(stderr, "error on server accept\n");
1575
+ ret = wolfSSL_get_error(srv_ssl, ret);
1576
+ }
1577
+ goto exit;
1578
+ }
1579
+
1580
+ info->server_stats.connTime += start;
1581
+ info->server_stats.connCount++;
1582
+
1583
+ /* echo loop */
1584
+ ret = 0;
1585
+ total_sz = 0;
1586
+ while (ret == 0 && total_sz < info->maxSize) {
1587
+ double rxTime;
1588
+
1589
+ /* read message from client */
1590
+ XMEMSET(readBuf, 0, (size_t)readBufSz);
1591
+ start = gettime_secs(1);
1592
+ #ifndef BENCH_USE_NONBLOCK
1593
+ ret = wolfSSL_read(srv_ssl, readBuf, readBufSz);
1594
+ #else
1595
+ do {
1596
+ ret = wolfSSL_read(srv_ssl, readBuf, readBufSz);
1597
+ err = wolfSSL_get_error(srv_ssl, ret);
1598
+ }
1599
+ while (err == WOLFSSL_ERROR_WANT_READ);
1600
+ #endif
1601
+ rxTime = gettime_secs(0) - start;
1602
+
1603
+ /* shutdown signals, no more connections for this cipher */
1604
+ if (XSTRSTR((const char*)readBuf, kShutdown) != NULL) {
1605
+ info->server.shutdown = 1;
1606
+ if (info->showVerbose) {
1607
+ fprintf(stderr, "Server shutdown done\n");
1608
+ }
1609
+ ret = 0; /* success */
1610
+ break;
1611
+ }
1612
+
1613
+ info->server_stats.rxTime += rxTime;
1614
+ if (ret < 0) {
1615
+ #ifndef SINGLE_THREADED
1616
+ if (info->to_client.done) {
1617
+ ret = 0; /* done - success */
1618
+ }
1619
+ else
1620
+ #endif
1621
+ {
1622
+ fprintf(stderr, "error on server read\n");
1623
+ ret = wolfSSL_get_error(srv_ssl, ret);
1624
+ }
1625
+ goto exit;
1626
+ }
1627
+ info->server_stats.rxTotal += ret;
1628
+ len = ret;
1629
+ total_sz += ret;
1630
+
1631
+ /* write message back to client */
1632
+ start = gettime_secs(1);
1633
+ #ifndef BENCH_USE_NONBLOCK
1634
+ ret = wolfSSL_write(srv_ssl, readBuf, len);
1635
+ #else
1636
+ do {
1637
+ ret = wolfSSL_write(srv_ssl, readBuf, len);
1638
+ err = wolfSSL_get_error(srv_ssl, ret);
1639
+ }
1640
+ while (err == WOLFSSL_ERROR_WANT_WRITE);
1641
+ #endif
1642
+ info->server_stats.txTime += gettime_secs(0) - start;
1643
+ if (ret < 0) {
1644
+ fprintf(stderr, "error on server write\n");
1645
+ ret = wolfSSL_get_error(srv_ssl, ret);
1646
+ goto exit;
1647
+ }
1648
+ info->server_stats.txTotal += ret;
1649
+ ret = 0; /* reset return code */
1650
+ }
1651
+
1652
+ CloseAndCleanupSocket(&info->server.sockFd);
1653
+
1654
+ wolfSSL_free(srv_ssl);
1655
+ srv_ssl = NULL;
1656
+ #ifdef WOLFSSL_DTLS
1657
+ if (info->doDTLS) {
1658
+ SetupSocketAndListen(&info->listenFd, info->port, info->doDTLS);
1659
+ }
1660
+ #endif
1661
+ }
1662
+
1663
+ exit:
1664
+
1665
+ if (ret != 0 && ret != WOLFSSL_SUCCESS) {
1666
+ fprintf(stderr, "Server Error: %d (%s)\n", ret,
1667
+ wolfSSL_ERR_reason_error_string((unsigned long)ret));
1668
+ }
1669
+
1670
+ /* clean up */
1671
+ CloseAndCleanupSocket(&info->server.sockFd);
1672
+ if (srv_ssl != NULL) {
1673
+ wolfSSL_free(srv_ssl);
1674
+ }
1675
+ if (srv_ctx != NULL) {
1676
+ wolfSSL_CTX_free(srv_ctx);
1677
+ }
1678
+ XFREE(readBuf, NULL, DYNAMIC_TYPE_TMP_BUFFER);
1679
+ info->server.ret = ret;
1680
+
1681
+ (void)tls13;
1682
+
1683
+ return ret;
1684
+ }
1685
+
1686
+ #if !defined(SINGLE_THREADED) && defined(WOLFSSL_THREAD_NO_JOIN)
1687
+ static THREAD_RETURN_NOJOIN WOLFSSL_THREAD_NO_JOIN server_thread(void* args)
1688
+ {
1689
+ int ret = 0;
1690
+ info_t* info = (info_t*)args;
1691
+
1692
+ if (!info->useLocalMem) {
1693
+ /* Setup TLS server listener */
1694
+ #ifdef WOLFSSL_DTLS
1695
+ ret = SetupSocketAndListen(&info->listenFd, info->port, info->doDTLS);
1696
+ #else
1697
+ ret = SetupSocketAndListen(&info->listenFd, info->port, 0);
1698
+ #endif
1699
+ }
1700
+
1701
+ if (ret == 0) {
1702
+ ret = bench_tls_server(info);
1703
+
1704
+ if (!info->useLocalMem) {
1705
+ CloseAndCleanupListenSocket(&info->listenFd);
1706
+ }
1707
+ }
1708
+
1709
+ THREAD_CHECK_RET(wolfSSL_CondStart(&info->to_client.cond));
1710
+ info->to_server.done = 1;
1711
+ info->server.ret = ret;
1712
+ THREAD_CHECK_RET(wolfSSL_CondSignal(&info->to_client.cond));
1713
+ THREAD_CHECK_RET(wolfSSL_CondEnd(&info->to_client.cond));
1714
+
1715
+ RETURN_FROM_THREAD_NOJOIN(0);
1716
+ }
1717
+ #endif /* !SINGLE_THREADED */
1718
+ #endif /* !NO_WOLFSSL_SERVER */
1719
+
1720
+
1721
+ static void print_stats(stats_t* wcStat, const char* desc, const char* cipher, const char *group, int verbose)
1722
+ {
1723
+ if (verbose) {
1724
+ fprintf(stderr,
1725
+ "wolfSSL %s Benchmark on %s with group %s:\n"
1726
+ "\tTotal : %9d bytes\n"
1727
+ "\tNum Conns : %9d\n"
1728
+ "\tRx Total : %9.3f ms\n"
1729
+ "\tTx Total : %9.3f ms\n"
1730
+ "\tRx : %9.3f MB/s\n"
1731
+ "\tTx : %9.3f MB/s\n"
1732
+ "\tConnect : %9.3f ms\n"
1733
+ "\tConnect Avg : %9.3f ms\n",
1734
+ desc,
1735
+ cipher,
1736
+ group,
1737
+ wcStat->txTotal + wcStat->rxTotal,
1738
+ wcStat->connCount,
1739
+ wcStat->rxTime * 1000,
1740
+ wcStat->txTime * 1000,
1741
+ wcStat->rxTotal / wcStat->rxTime / 1024 / 1024,
1742
+ wcStat->txTotal / wcStat->txTime / 1024 / 1024,
1743
+ wcStat->connTime * 1000,
1744
+ wcStat->connTime * 1000 / wcStat->connCount);
1745
+ }
1746
+ else {
1747
+ fprintf(stderr,
1748
+ "%-6s %-33s %-25s %11d %9d %9.3f %9.3f %9.3f "
1749
+ "%9.3f %17.3f %15.3f\n",
1750
+ desc,
1751
+ cipher,
1752
+ group,
1753
+ wcStat->txTotal + wcStat->rxTotal,
1754
+ wcStat->connCount,
1755
+ wcStat->rxTime * 1000,
1756
+ wcStat->txTime * 1000,
1757
+ wcStat->rxTotal / wcStat->rxTime / 1024 / 1024,
1758
+ wcStat->txTotal / wcStat->txTime / 1024 / 1024,
1759
+ wcStat->connTime * 1000,
1760
+ wcStat->connTime * 1000 / wcStat->connCount);
1761
+ }
1762
+ }
1763
+
1764
+ static void Usage(void)
1765
+ {
1766
+ fprintf(stderr, "tls_bench " LIBWOLFSSL_VERSION_STRING
1767
+ " NOTE: All files relative to wolfSSL home dir\n");
1768
+ fprintf(stderr, "-? Help, print this usage\n");
1769
+ fprintf(stderr, "-c Run as client only, no threading and uses sockets\n");
1770
+ fprintf(stderr, "-s Run as server only, no threading and uses sockets\n");
1771
+ fprintf(stderr, "-h Host (default %s)\n", BENCH_DEFAULT_HOST);
1772
+ fprintf(stderr, "-P Port (default %d)\n", BENCH_DEFAULT_PORT);
1773
+ fprintf(stderr, "-e List Every cipher suite available\n");
1774
+ fprintf(stderr, "-i Show peer info\n");
1775
+ #ifdef WOLFSSL_TLS13
1776
+ fprintf(stderr, "-g Run through each of the TLS 1.3 groups that are available\n");
1777
+ #endif
1778
+ fprintf(stderr, "-l <str> Cipher suite list (: delimited)\n");
1779
+ fprintf(stderr, "-t <num> Time <num> (seconds) to run each test (default %d)\n", BENCH_RUNTIME_SEC);
1780
+ fprintf(stderr, "-p <num> The packet size <num> in bytes [1-16kB] (default %d)\n", TEST_PACKET_SIZE);
1781
+ #ifdef WOLFSSL_DTLS
1782
+ fprintf(stderr, " In the case of DTLS, [1-8kB] (default %d)\n", TEST_DTLS_PACKET_SIZE);
1783
+ #endif
1784
+ fprintf(stderr, "-S <num> The total size <num> in bytes (default %d)\n", TEST_MAX_SIZE);
1785
+ fprintf(stderr, "-v Show verbose output\n");
1786
+ #ifdef DEBUG_WOLFSSL
1787
+ fprintf(stderr, "-d Enable debug messages\n");
1788
+ #endif
1789
+ #ifndef SINGLE_THREADED
1790
+ fprintf(stderr, "-T <num> Number of threaded server/client pairs (default %d)\n", NUM_THREAD_PAIRS);
1791
+ fprintf(stderr, "-m Use local memory, not socket\n");
1792
+ #endif
1793
+ #ifdef WOLFSSL_DTLS
1794
+ fprintf(stderr, "-u Use DTLS\n");
1795
+ #endif
1796
+ }
1797
+
1798
+ static void ShowCiphers(void)
1799
+ {
1800
+ char ciphers[WOLFSSL_CIPHER_LIST_MAX_SIZE];
1801
+ int ret = wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));
1802
+ if (ret == WOLFSSL_SUCCESS) {
1803
+ fprintf(stderr, "%s\n", ciphers);
1804
+ }
1805
+ }
1806
+
1807
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
1808
+ static int SetupSupportedGroups(int verbose)
1809
+ {
1810
+ int i;
1811
+ WOLFSSL_CTX* ctx = NULL;
1812
+ WOLFSSL* ssl = NULL;
1813
+ int ret = 0;
1814
+
1815
+ if (ret == 0) {
1816
+ #ifdef NO_WOLFSSL_CLIENT
1817
+ ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method());
1818
+ #else
1819
+ ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
1820
+ #endif
1821
+ if (ctx == NULL) {
1822
+ ret = -1;
1823
+ }
1824
+ }
1825
+
1826
+ if (ret == 0) {
1827
+ ssl = wolfSSL_new(ctx);
1828
+ if (ssl == NULL) {
1829
+ ret = -1;
1830
+ }
1831
+ }
1832
+
1833
+ /* Determine which groups are actually supported. */
1834
+ for (i = 0; groups[i].name != NULL; i++) {
1835
+ if (ret == 0) {
1836
+ int uks_ret = wolfSSL_UseKeyShare(ssl, groups[i].group);
1837
+ if (uks_ret == WOLFSSL_SUCCESS) {
1838
+ if (verbose) {
1839
+ printf("Will benchmark the following group: %s\n",
1840
+ groups[i].name);
1841
+ }
1842
+ } else if (uks_ret == WC_NO_ERR_TRACE(BAD_FUNC_ARG) ||
1843
+ uks_ret == WC_NO_ERR_TRACE(NOT_COMPILED_IN))
1844
+ {
1845
+ groups[i].group = 0;
1846
+ if (verbose) {
1847
+ printf("Will NOT benchmark the following group: %s\n",
1848
+ groups[i].name);
1849
+ }
1850
+ } else {
1851
+ ret = -1;
1852
+ }
1853
+ }
1854
+ }
1855
+
1856
+ if (ssl != NULL) {
1857
+ wolfSSL_free(ssl);
1858
+ }
1859
+ if (ctx != NULL) {
1860
+ wolfSSL_CTX_free(ctx);
1861
+ }
1862
+ return ret;
1863
+ }
1864
+ #endif
1865
+
1866
+
1867
+ int bench_tls(void* args)
1868
+ {
1869
+ int ret = 0;
1870
+ info_t *theadInfo = NULL, *info;
1871
+ stats_t cli_comb, srv_comb;
1872
+ int i;
1873
+ char *cipher, *next_cipher, *ciphers = NULL;
1874
+ int argc = 0;
1875
+ char** argv = NULL;
1876
+ int ch;
1877
+
1878
+ /* Vars configured by command line arguments */
1879
+ int argRuntimeSec = BENCH_RUNTIME_SEC;
1880
+ char *argCipherList = NULL;
1881
+ int argTestPacketSize = TEST_PACKET_SIZE;
1882
+ int argTestMaxSize = TEST_MAX_SIZE;
1883
+ int argThreadPairs = NUM_THREAD_PAIRS;
1884
+ int argShowVerbose = SHOW_VERBOSE;
1885
+ int argClientOnly = 0;
1886
+ int argServerOnly = 0;
1887
+ const char* argHost = BENCH_DEFAULT_HOST;
1888
+ word32 argPort = BENCH_DEFAULT_PORT;
1889
+ int argShowPeerInfo = 0;
1890
+ #ifndef SINGLE_THREADED
1891
+ int doShutdown;
1892
+ #endif
1893
+ #if !defined(NO_WOLFSSL_SERVER) || !defined(SINGLE_THREADED)
1894
+ int argLocalMem = 0;
1895
+ int listenFd = -1;
1896
+ #endif
1897
+ #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_SERVER)
1898
+ int option_p = 0;
1899
+ #endif
1900
+ #ifdef WOLFSSL_DTLS
1901
+ int doDTLS = 0;
1902
+ #endif
1903
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
1904
+ int group_index = 0;
1905
+ int argDoGroups = 0;
1906
+ #endif
1907
+
1908
+ if (args != NULL) {
1909
+ argc = ((func_args*)args)->argc;
1910
+ argv = ((func_args*)args)->argv;
1911
+ ((func_args*)args)->return_code = -1; /* error state */
1912
+ }
1913
+
1914
+ /* Initialize wolfSSL */
1915
+ wolfSSL_Init();
1916
+
1917
+ #if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION == 5)
1918
+ /*
1919
+ * When running benchmarks on FIPS builds, we need to run ALL CASTs up
1920
+ * front before spawning client/server threads, otherwise there is the
1921
+ * possibility that both threads try to run a CAST at the same time during
1922
+ * the handshake. In this scenario, the thread that doesn't win the race
1923
+ * will not be able to run the CAST, since it returns "busy", which is treated
1924
+ * as a failure. Running the CASTs up front is a simpler solution than
1925
+ * implementing an additional layer of synchronization.
1926
+ */
1927
+ if ((ret = run_all_CAST()) != 0)
1928
+ {
1929
+ fprintf(stderr, "CAST failed. Exiting benchmark\n");
1930
+ goto exit;
1931
+ }
1932
+ #endif /* HAVE_FIPS && HAVE_FIPS_VERSION == 5 */
1933
+
1934
+ /* Parse command line arguments */
1935
+ while ((ch = mygetopt(argc, argv, "?" "udeil:p:t:vT:sch:P:mS:g")) != -1) {
1936
+ switch (ch) {
1937
+ case '?' :
1938
+ Usage();
1939
+ goto exit;
1940
+
1941
+ case 's':
1942
+ argServerOnly = 1;
1943
+ break;
1944
+
1945
+ case 'c':
1946
+ argClientOnly = 1;
1947
+ break;
1948
+
1949
+ case 'h':
1950
+ argHost = myoptarg;
1951
+ break;
1952
+
1953
+ case 'P':
1954
+ argPort = (word32)atoi(myoptarg);
1955
+ break;
1956
+
1957
+ case 'd' :
1958
+ #ifdef DEBUG_WOLFSSL
1959
+ wolfSSL_Debugging_ON();
1960
+ #endif
1961
+ break;
1962
+
1963
+ case 'e' :
1964
+ ShowCiphers();
1965
+ goto exit;
1966
+
1967
+ case 'g' :
1968
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
1969
+ argDoGroups = 1;
1970
+ break;
1971
+ #else
1972
+ fprintf(stderr, "There are only groups in TLS 1.3\n");
1973
+ Usage();
1974
+ ret = MY_EX_USAGE; goto exit;
1975
+ #endif
1976
+ case 'i' :
1977
+ argShowPeerInfo = 1;
1978
+ break;
1979
+
1980
+ case 'l' :
1981
+ argCipherList = myoptarg;
1982
+ break;
1983
+
1984
+ case 'p' :
1985
+ argTestPacketSize = atoi(myoptarg);
1986
+ if (argTestPacketSize > (16 * 1024)) {
1987
+ fprintf(stderr, "Invalid packet size %d\n", argTestPacketSize);
1988
+ Usage();
1989
+ ret = MY_EX_USAGE; goto exit;
1990
+ }
1991
+ #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_SERVER)
1992
+ option_p = 1;
1993
+ #endif
1994
+ break;
1995
+
1996
+ case 'S' :
1997
+ argTestMaxSize = atoi(myoptarg);
1998
+ break;
1999
+
2000
+ case 't' :
2001
+ argRuntimeSec = atoi(myoptarg);
2002
+ break;
2003
+
2004
+ case 'v' :
2005
+ argShowVerbose = 1;
2006
+ break;
2007
+
2008
+ case 'T' :
2009
+ #ifndef SINGLE_THREADED
2010
+ argThreadPairs = atoi(myoptarg);
2011
+ #endif
2012
+ break;
2013
+
2014
+ case 'm':
2015
+ #ifndef SINGLE_THREADED
2016
+ argLocalMem = 1;
2017
+ #endif
2018
+ break;
2019
+ case 'u':
2020
+ #ifdef WOLFSSL_DTLS
2021
+ doDTLS = 1;
2022
+ #ifdef BENCH_USE_NONBLOCK
2023
+ fprintf(stderr, "tls_bench hasn't yet supported DTLS "
2024
+ "non-blocking mode.\n");
2025
+ Usage();
2026
+ ret = MY_EX_USAGE; goto exit;
2027
+ #endif
2028
+ #endif
2029
+ break;
2030
+ default:
2031
+ Usage();
2032
+ ret = MY_EX_USAGE; goto exit;
2033
+ }
2034
+ }
2035
+
2036
+ /* reset for test cases */
2037
+ myoptind = 0;
2038
+
2039
+ if (argCipherList != NULL) {
2040
+ /* Use the list from CL argument */
2041
+ cipher = argCipherList;
2042
+ }
2043
+ else {
2044
+ /* Run for each cipher */
2045
+ ciphers = (char*)XMALLOC(WOLFSSL_CIPHER_LIST_MAX_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
2046
+ if (ciphers == NULL) {
2047
+ goto exit;
2048
+ }
2049
+ wolfSSL_get_ciphers(ciphers, WOLFSSL_CIPHER_LIST_MAX_SIZE);
2050
+ cipher = ciphers;
2051
+ }
2052
+
2053
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
2054
+ if (argDoGroups) {
2055
+ if (SetupSupportedGroups(argShowVerbose) != 0) {
2056
+ goto exit;
2057
+ }
2058
+ }
2059
+ #endif
2060
+
2061
+ /* for server or client side only, only 1 thread is allowed */
2062
+ if (argServerOnly || argClientOnly) {
2063
+ argThreadPairs = 1;
2064
+ }
2065
+ #ifdef SINGLE_THREADED
2066
+ else {
2067
+ fprintf(stderr, "Threading is not enabled, so please use -s or -c to indicate side\n");
2068
+ Usage();
2069
+ ret = MY_EX_USAGE; goto exit;
2070
+ }
2071
+ #endif
2072
+
2073
+ /* Allocate test info array */
2074
+ theadInfo = (info_t*)XMALLOC(sizeof(info_t) * (size_t)argThreadPairs, NULL,
2075
+ DYNAMIC_TYPE_TMP_BUFFER);
2076
+ if (theadInfo == NULL) {
2077
+ ret = MEMORY_E; goto exit;
2078
+ }
2079
+ XMEMSET(theadInfo, 0, sizeof(info_t) * (size_t)argThreadPairs);
2080
+
2081
+ #ifndef NO_WOLFSSL_SERVER
2082
+ /* Use same listen socket to avoid timing issues between client and server */
2083
+ if (argServerOnly && !argLocalMem) {
2084
+ /* Setup TLS server listener */
2085
+ #ifdef WOLFSSL_DTLS
2086
+ ret = SetupSocketAndListen(&listenFd, argPort, doDTLS);
2087
+ #else
2088
+ ret = SetupSocketAndListen(&listenFd, argPort, 0);
2089
+ #endif
2090
+ if (ret != 0) {
2091
+ goto exit;
2092
+ }
2093
+ }
2094
+ #endif
2095
+
2096
+ #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_SERVER)
2097
+ if (doDTLS) {
2098
+ if (argLocalMem) {
2099
+ fprintf(stderr, "tls_bench hasn't yet supported DTLS with local memory.\n");
2100
+ ret = MY_EX_USAGE; goto exit;
2101
+ }
2102
+ if (option_p && argTestPacketSize > TEST_DTLS_PACKET_SIZE){
2103
+ fprintf(stderr, "Invalid packet size %d\n", argTestPacketSize);
2104
+ Usage();
2105
+ ret = MY_EX_USAGE; goto exit;
2106
+ } else {
2107
+ /* argTestPacketSize would be default for tcp packet */
2108
+ if (argTestPacketSize >= TEST_PACKET_SIZE)
2109
+ argTestPacketSize = TEST_DTLS_PACKET_SIZE;
2110
+ }
2111
+ }
2112
+ #endif
2113
+ fprintf(stderr, "Running TLS Benchmarks...\n");
2114
+
2115
+ /* parse by : */
2116
+ while ((cipher != NULL) && (cipher[0] != '\0')) {
2117
+ #if ! (defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES))
2118
+ const char *gname = "N/A";
2119
+ #endif
2120
+ next_cipher = strchr(cipher, ':');
2121
+ if (next_cipher != NULL) {
2122
+ cipher[next_cipher - cipher] = '\0';
2123
+ }
2124
+
2125
+ if (argShowVerbose) {
2126
+ fprintf(stderr, "Cipher: %s\n", cipher);
2127
+ }
2128
+
2129
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
2130
+ for (group_index = 0; groups[group_index].name != NULL; group_index++) {
2131
+ const char *gname = theadInfo[0].group == 0 ? "N/A"
2132
+ : groups[group_index].name;
2133
+
2134
+ if (argDoGroups && groups[group_index].group == 0) {
2135
+ /* Skip unsupported group. */
2136
+ continue;
2137
+ }
2138
+ #endif
2139
+ for (i=0; i<argThreadPairs; i++) {
2140
+ info = &theadInfo[i];
2141
+ XMEMSET(info, 0, sizeof(info_t));
2142
+
2143
+ info->host = argHost;
2144
+ info->port = argPort + (word32)i; /* threads must have separate ports */
2145
+ info->cipher = cipher;
2146
+
2147
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
2148
+ if (argDoGroups && XSTRNCMP(theadInfo[0].cipher, "TLS13", 5) == 0) {
2149
+ info->group = groups[group_index].group;
2150
+ }
2151
+ else
2152
+ #endif
2153
+ {
2154
+ info->group = 0;
2155
+ }
2156
+
2157
+ info->packetSize = argTestPacketSize;
2158
+
2159
+ info->runTimeSec = argRuntimeSec;
2160
+ info->maxSize = argTestMaxSize;
2161
+ info->showPeerInfo = argShowPeerInfo;
2162
+ info->showVerbose = argShowVerbose;
2163
+ #ifndef NO_WOLFSSL_SERVER
2164
+ info->listenFd = listenFd;
2165
+ #endif
2166
+ info->client.sockFd = -1;
2167
+ info->server.sockFd = -1;
2168
+
2169
+ #ifdef WOLFSSL_DTLS
2170
+ info->doDTLS = doDTLS;
2171
+ #ifndef SINGLE_THREADED
2172
+ info->serverReady = 0;
2173
+ if (argServerOnly || argClientOnly) {
2174
+ info->clientOrserverOnly = 1;
2175
+ }
2176
+ #endif
2177
+ #endif
2178
+ if (argClientOnly) {
2179
+ #if !defined(NO_WOLFSSL_SERVER) && !defined(NO_WOLFSSL_CLIENT) && !defined(SINGLE_THREADED)
2180
+ /* to avoid to wait server forever */
2181
+ info->serverListening = 1;
2182
+ #endif
2183
+ #ifndef NO_WOLFSSL_CLIENT
2184
+ ret = bench_tls_client(info);
2185
+ #endif
2186
+ }
2187
+ else if (argServerOnly) {
2188
+ #ifndef NO_WOLFSSL_SERVER
2189
+ ret = bench_tls_server(info);
2190
+ #endif
2191
+ }
2192
+ else {
2193
+ #if !defined(SINGLE_THREADED) && defined(WOLFSSL_THREAD_NO_JOIN)
2194
+ info->useLocalMem = argLocalMem;
2195
+ #ifdef WOLFSSL_DTLS
2196
+ THREAD_CHECK_RET(wc_InitMutex(&info->dtls_mutex));
2197
+ THREAD_CHECK_RET(wolfSSL_CondInit(&info->dtls_cond));
2198
+ #endif
2199
+ THREAD_CHECK_RET(wolfSSL_CondInit(&info->to_server.cond));
2200
+ THREAD_CHECK_RET(wolfSSL_CondInit(&info->to_client.cond));
2201
+
2202
+ THREAD_CHECK_RET(
2203
+ wolfSSL_NewThreadNoJoin(server_thread, info));
2204
+ THREAD_CHECK_RET(
2205
+ wolfSSL_NewThreadNoJoin(client_thread, info));
2206
+ #endif
2207
+ }
2208
+ }
2209
+
2210
+ #ifndef SINGLE_THREADED
2211
+ /* For threading, wait for completion */
2212
+ if (!argClientOnly && !argServerOnly) {
2213
+ /* Wait until threads are marked done */
2214
+ do {
2215
+ doShutdown = 1;
2216
+
2217
+ for (i = 0; i < argThreadPairs; ++i) {
2218
+ info = &theadInfo[i];
2219
+ if (!info->to_client.done || !info->to_server.done) {
2220
+ doShutdown = 0;
2221
+ XSLEEP_MS(1000); /* Allow other threads to run */
2222
+ }
2223
+
2224
+ }
2225
+ } while (!doShutdown);
2226
+ if (argShowVerbose) {
2227
+ fprintf(stderr, "Shutdown complete\n");
2228
+ }
2229
+ }
2230
+ #endif /* !SINGLE_THREADED */
2231
+
2232
+ if (argShowVerbose) {
2233
+ /* print results */
2234
+ for (i = 0; i < argThreadPairs; ++i) {
2235
+ info = &theadInfo[i];
2236
+
2237
+ fprintf(stderr, "\nThread %d\n", i);
2238
+ #ifndef NO_WOLFSSL_SERVER
2239
+ if (!argClientOnly) {
2240
+ print_stats(&info->server_stats, "Server", info->cipher,
2241
+ gname, 1);
2242
+ }
2243
+ #endif
2244
+ #ifndef NO_WOLFSSL_CLIENT
2245
+ if (!argServerOnly) {
2246
+ print_stats(&info->client_stats, "Client", info->cipher,
2247
+ gname, 1);
2248
+ }
2249
+ #endif
2250
+ }
2251
+ }
2252
+
2253
+ /* print combined results for more than one thread */
2254
+ XMEMSET(&cli_comb, 0, sizeof(cli_comb));
2255
+ XMEMSET(&srv_comb, 0, sizeof(srv_comb));
2256
+
2257
+ for (i = 0; i < argThreadPairs; ++i) {
2258
+ info = &theadInfo[i];
2259
+
2260
+ cli_comb.connCount += info->client_stats.connCount;
2261
+ srv_comb.connCount += info->server_stats.connCount;
2262
+
2263
+ cli_comb.connTime += info->client_stats.connTime;
2264
+ srv_comb.connTime += info->server_stats.connTime;
2265
+
2266
+ cli_comb.rxTotal += info->client_stats.rxTotal;
2267
+ srv_comb.rxTotal += info->server_stats.rxTotal;
2268
+
2269
+ cli_comb.rxTime += info->client_stats.rxTime;
2270
+ srv_comb.rxTime += info->server_stats.rxTime;
2271
+
2272
+ cli_comb.txTotal += info->client_stats.txTotal;
2273
+ srv_comb.txTotal += info->server_stats.txTotal;
2274
+
2275
+ cli_comb.txTime += info->client_stats.txTime;
2276
+ srv_comb.txTime += info->server_stats.txTime;
2277
+ }
2278
+
2279
+ if (argShowVerbose) {
2280
+ fprintf(stderr, "Totals for %d Threads\n", argThreadPairs);
2281
+ }
2282
+ else {
2283
+ fprintf(stderr, "%-6s %-33s %-25s %11s %9s %9s %9s %9s %9s %17s %15s\n",
2284
+ "Side", "Cipher", "Group", "Total Bytes", "Num Conns", "Rx ms", "Tx ms",
2285
+ "Rx MB/s", "Tx MB/s", "Connect Total ms", "Connect Avg ms");
2286
+ #ifndef NO_WOLFSSL_SERVER
2287
+ if (!argClientOnly) {
2288
+ print_stats(&srv_comb, "Server", theadInfo[0].cipher, gname,
2289
+ 0);
2290
+ }
2291
+ #endif
2292
+ #ifndef NO_WOLFSSL_CLIENT
2293
+ if (!argServerOnly) {
2294
+ print_stats(&cli_comb, "Client", theadInfo[0].cipher, gname,
2295
+ 0);
2296
+ }
2297
+ #endif
2298
+ }
2299
+
2300
+ #if defined(WOLFSSL_TLS13) && defined(HAVE_SUPPORTED_CURVES)
2301
+ if (!argDoGroups || theadInfo[0].group == 0) {
2302
+ /* We only needed to do this once because they don't want to
2303
+ * benchmarks groups or this isn't a TLS 1.3 cipher. */
2304
+ break;
2305
+ }
2306
+ }
2307
+ #endif
2308
+ /* target next cipher */
2309
+ cipher = (next_cipher != NULL) ? (next_cipher + 1) : NULL;
2310
+ } /* while */
2311
+
2312
+ exit:
2313
+
2314
+ #ifndef NO_WOLFSSL_SERVER
2315
+ if (argServerOnly && !argLocalMem) {
2316
+ /* Close server listener */
2317
+ CloseAndCleanupListenSocket(&listenFd);
2318
+ }
2319
+ #endif
2320
+
2321
+ /* Cleanup the wolfSSL environment */
2322
+ wolfSSL_Cleanup();
2323
+
2324
+ /* Free theadInfo array */
2325
+ XFREE(theadInfo, NULL, DYNAMIC_TYPE_TMP_BUFFER);
2326
+
2327
+ /* Free cipher list */
2328
+ XFREE(ciphers, NULL, DYNAMIC_TYPE_TMP_BUFFER);
2329
+
2330
+ /* Return reporting a success */
2331
+ if (args) {
2332
+ ((func_args*)args)->return_code = ret;
2333
+ }
2334
+
2335
+ return ret;
2336
+ }
2337
+ #endif /* (!NO_WOLFSSL_CLIENT || !NO_WOLFSSL_SERVER) && !WOLFCRYPT_ONLY && USE_WOLFSSL_IO */
2338
+
2339
+ #ifndef NO_MAIN_DRIVER
2340
+
2341
+ int main(int argc, char** argv)
2342
+ {
2343
+ func_args args;
2344
+
2345
+ args.argc = argc;
2346
+ args.argv = argv;
2347
+ args.return_code = 0;
2348
+
2349
+ #if (!defined(NO_WOLFSSL_CLIENT) || !defined(NO_WOLFSSL_SERVER)) && \
2350
+ !defined(WOLFCRYPT_ONLY) && !defined(NO_TLS) && defined(USE_WOLFSSL_IO)
2351
+ bench_tls(&args);
2352
+ #endif
2353
+
2354
+ return args.return_code;
2355
+ }
2356
+
2357
+ #endif /* !NO_MAIN_DRIVER */