@annadata/capacitor-mqtt-quic 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/AnnadataCapacitorMqttQuic.podspec +2 -1
  2. package/README.md +121 -12
  3. package/android/NGTCP2_BUILD_INSTRUCTIONS.md +65 -44
  4. package/android/build-openssl.sh +1 -1
  5. package/android/install/nghttp3-android/arm64-v8a/include/nghttp3/nghttp3.h +3295 -0
  6. package/android/install/nghttp3-android/arm64-v8a/include/nghttp3/version.h +46 -0
  7. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
  8. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
  9. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
  10. package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
  11. package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.a +0 -0
  12. package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.so +0 -0
  13. package/android/install/nghttp3-android/arm64-v8a/lib/pkgconfig/libnghttp3.pc +34 -0
  14. package/android/install/nghttp3-android/arm64-v8a/share/doc/nghttp3/README.rst +75 -0
  15. package/android/install/nghttp3-android/armeabi-v7a/include/nghttp3/nghttp3.h +3295 -0
  16. package/android/install/nghttp3-android/armeabi-v7a/include/nghttp3/version.h +46 -0
  17. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
  18. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
  19. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
  20. package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
  21. package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.a +0 -0
  22. package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.so +0 -0
  23. package/android/install/nghttp3-android/armeabi-v7a/lib/pkgconfig/libnghttp3.pc +34 -0
  24. package/android/install/nghttp3-android/armeabi-v7a/share/doc/nghttp3/README.rst +75 -0
  25. package/android/install/nghttp3-android/x86_64/include/nghttp3/nghttp3.h +3295 -0
  26. package/android/install/nghttp3-android/x86_64/include/nghttp3/version.h +46 -0
  27. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
  28. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
  29. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
  30. package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
  31. package/android/install/nghttp3-android/x86_64/lib/libnghttp3.a +0 -0
  32. package/android/install/nghttp3-android/x86_64/lib/libnghttp3.so +0 -0
  33. package/android/install/nghttp3-android/x86_64/lib/pkgconfig/libnghttp3.pc +34 -0
  34. package/android/install/nghttp3-android/x86_64/share/doc/nghttp3/README.rst +75 -0
  35. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2.h +6254 -0
  36. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2_crypto.h +1037 -0
  37. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
  38. package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/version.h +51 -0
  39. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
  40. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
  41. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
  42. package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
  43. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.a +0 -0
  44. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.so +0 -0
  45. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.a +0 -0
  46. package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.so +0 -0
  47. package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2.pc +33 -0
  48. package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
  49. package/android/install/ngtcp2-android/arm64-v8a/share/doc/ngtcp2/README.rst +385 -0
  50. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2.h +6254 -0
  51. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2_crypto.h +1037 -0
  52. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
  53. package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/version.h +51 -0
  54. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
  55. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
  56. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
  57. package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
  58. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.a +0 -0
  59. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.so +0 -0
  60. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.a +0 -0
  61. package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.so +0 -0
  62. package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2.pc +33 -0
  63. package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
  64. package/android/install/ngtcp2-android/armeabi-v7a/share/doc/ngtcp2/README.rst +385 -0
  65. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2.h +6254 -0
  66. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2_crypto.h +1037 -0
  67. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
  68. package/android/install/ngtcp2-android/x86_64/include/ngtcp2/version.h +51 -0
  69. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
  70. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
  71. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
  72. package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
  73. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.a +0 -0
  74. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.so +0 -0
  75. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.a +0 -0
  76. package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.so +0 -0
  77. package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2.pc +33 -0
  78. package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
  79. package/android/install/ngtcp2-android/x86_64/share/doc/ngtcp2/README.rst +385 -0
  80. package/android/install/wolfssl-android/arm64-v8a/bin/wolfssl-config +117 -0
  81. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/callbacks.h +93 -0
  82. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/certs_test.h +7073 -0
  83. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/certs_test_sm.h +2913 -0
  84. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/crl.h +58 -0
  85. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/error-ssl.h +280 -0
  86. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/ocsp.h +191 -0
  87. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/aes.h +117 -0
  88. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/asn1.h +315 -0
  89. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/asn1t.h +30 -0
  90. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/bio.h +237 -0
  91. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/bn.h +332 -0
  92. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/buffer.h +57 -0
  93. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/camellia.h +27 -0
  94. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/cmac.h +66 -0
  95. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/cms.h +26 -0
  96. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/compat_types.h +70 -0
  97. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/conf.h +117 -0
  98. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/crypto.h +171 -0
  99. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/des.h +124 -0
  100. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/dh.h +144 -0
  101. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/dsa.h +164 -0
  102. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec.h +525 -0
  103. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec25519.h +46 -0
  104. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec448.h +46 -0
  105. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ecdh.h +49 -0
  106. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ecdsa.h +87 -0
  107. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ed25519.h +49 -0
  108. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ed448.h +49 -0
  109. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/engine.h +9 -0
  110. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/err.h +84 -0
  111. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/evp.h +1540 -0
  112. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/fips_rand.h +125 -0
  113. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/hmac.h +98 -0
  114. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/kdf.h +45 -0
  115. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/lhash.h +64 -0
  116. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/md4.h +66 -0
  117. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/md5.h +108 -0
  118. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/modes.h +45 -0
  119. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/obj_mac.h +92 -0
  120. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/objects.h +86 -0
  121. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ocsp.h +108 -0
  122. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/opensslconf.h +8 -0
  123. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/opensslv.h +78 -0
  124. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ossl_typ.h +32 -0
  125. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pem.h +301 -0
  126. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pkcs12.h +57 -0
  127. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pkcs7.h +110 -0
  128. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rand.h +38 -0
  129. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rc4.h +64 -0
  130. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ripemd.h +58 -0
  131. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rsa.h +291 -0
  132. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/safestack.h +40 -0
  133. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/sha.h +331 -0
  134. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/sha3.h +158 -0
  135. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/srp.h +33 -0
  136. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ssl.h +1923 -0
  137. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ssl23.h +1 -0
  138. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/stack.h +61 -0
  139. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/tls1.h +64 -0
  140. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/txt_db.h +60 -0
  141. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ui.h +2 -0
  142. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509.h +227 -0
  143. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509_vfy.h +50 -0
  144. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509v3.h +237 -0
  145. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/options.h +273 -0
  146. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/quic.h +310 -0
  147. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/sniffer.h +359 -0
  148. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/sniffer_error.h +151 -0
  149. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/ssl.h +6300 -0
  150. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/test.h +4989 -0
  151. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/version.h +40 -0
  152. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/aes.h +1074 -0
  153. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/arc4.h +69 -0
  154. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ascon.h +109 -0
  155. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/asn.h +2855 -0
  156. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
  157. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
  158. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
  159. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2.h +108 -0
  160. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/camellia.h +116 -0
  161. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/chacha.h +133 -0
  162. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
  163. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cmac.h +168 -0
  164. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/coding.h +107 -0
  165. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/compress.h +60 -0
  166. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cpuid.h +153 -0
  167. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
  168. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/curve25519.h +225 -0
  169. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/curve448.h +151 -0
  170. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/des3.h +167 -0
  171. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dh.h +210 -0
  172. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
  173. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dsa.h +121 -0
  174. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ecc.h +1074 -0
  175. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/eccsi.h +176 -0
  176. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ed25519.h +239 -0
  177. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ed448.h +214 -0
  178. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
  179. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
  180. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
  181. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
  182. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/falcon.h +180 -0
  183. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fe_448.h +122 -0
  184. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
  185. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fips_test.h +131 -0
  186. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ge_448.h +84 -0
  187. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
  188. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hash.h +296 -0
  189. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hmac.h +231 -0
  190. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hpke.h +145 -0
  191. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/integer.h +449 -0
  192. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/kdf.h +199 -0
  193. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/lms.h +202 -0
  194. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/logging.h +588 -0
  195. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md2.h +83 -0
  196. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md4.h +77 -0
  197. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md5.h +141 -0
  198. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mem_track.h +968 -0
  199. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/memory.h +545 -0
  200. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/misc.h +214 -0
  201. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mlkem.h +377 -0
  202. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
  203. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
  204. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
  205. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
  206. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
  207. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/poly1305.h +207 -0
  208. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
  209. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/random.h +300 -0
  210. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/rc2.h +68 -0
  211. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ripemd.h +67 -0
  212. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/rsa.h +494 -0
  213. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sakke.h +228 -0
  214. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/settings.h +4762 -0
  215. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha.h +237 -0
  216. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha256.h +360 -0
  217. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha3.h +274 -0
  218. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha512.h +372 -0
  219. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/signature.h +87 -0
  220. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/siphash.h +101 -0
  221. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm2.h +27 -0
  222. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm3.h +27 -0
  223. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm4.h +27 -0
  224. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
  225. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sphincs.h +167 -0
  226. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/srp.h +313 -0
  227. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/tfm.h +941 -0
  228. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/types.h +2383 -0
  229. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/visibility.h +97 -0
  230. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
  231. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
  232. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
  233. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
  234. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
  235. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
  236. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
  237. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/xmss.h +203 -0
  238. package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfio.h +1035 -0
  239. package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.a +0 -0
  240. package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.la +41 -0
  241. package/android/install/wolfssl-android/arm64-v8a/lib/pkgconfig/wolfssl.pc +11 -0
  242. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/QUIC.md +117 -0
  243. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/README.txt +8 -0
  244. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/async_client.c +245 -0
  245. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/async_server.c +331 -0
  246. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/client.c +4885 -0
  247. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/echoclient.c +341 -0
  248. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/echoserver.c +498 -0
  249. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
  250. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-client.c +78 -0
  251. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
  252. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-server.c +83 -0
  253. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/server.c +4124 -0
  254. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/tls_bench.c +2357 -0
  255. package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/taoCert.txt +176 -0
  256. package/android/install/wolfssl-android/armeabi-v7a/bin/wolfssl-config +117 -0
  257. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/callbacks.h +93 -0
  258. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/certs_test.h +7073 -0
  259. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/certs_test_sm.h +2913 -0
  260. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/crl.h +58 -0
  261. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/error-ssl.h +280 -0
  262. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/ocsp.h +191 -0
  263. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/aes.h +117 -0
  264. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/asn1.h +315 -0
  265. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/asn1t.h +30 -0
  266. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/bio.h +237 -0
  267. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/bn.h +332 -0
  268. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/buffer.h +57 -0
  269. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/camellia.h +27 -0
  270. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/cmac.h +66 -0
  271. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/cms.h +26 -0
  272. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/compat_types.h +70 -0
  273. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/conf.h +117 -0
  274. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/crypto.h +171 -0
  275. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/des.h +124 -0
  276. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/dh.h +144 -0
  277. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/dsa.h +164 -0
  278. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec.h +525 -0
  279. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec25519.h +46 -0
  280. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec448.h +46 -0
  281. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ecdh.h +49 -0
  282. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ecdsa.h +87 -0
  283. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ed25519.h +49 -0
  284. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ed448.h +49 -0
  285. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/engine.h +9 -0
  286. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/err.h +84 -0
  287. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/evp.h +1540 -0
  288. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/fips_rand.h +125 -0
  289. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/hmac.h +98 -0
  290. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/kdf.h +45 -0
  291. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/lhash.h +64 -0
  292. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/md4.h +66 -0
  293. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/md5.h +108 -0
  294. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/modes.h +45 -0
  295. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/obj_mac.h +92 -0
  296. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/objects.h +86 -0
  297. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ocsp.h +108 -0
  298. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/opensslconf.h +8 -0
  299. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/opensslv.h +78 -0
  300. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ossl_typ.h +32 -0
  301. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pem.h +301 -0
  302. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pkcs12.h +57 -0
  303. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pkcs7.h +110 -0
  304. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rand.h +38 -0
  305. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rc4.h +64 -0
  306. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ripemd.h +58 -0
  307. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rsa.h +291 -0
  308. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/safestack.h +40 -0
  309. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/sha.h +331 -0
  310. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/sha3.h +158 -0
  311. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/srp.h +33 -0
  312. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ssl.h +1923 -0
  313. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ssl23.h +1 -0
  314. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/stack.h +61 -0
  315. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/tls1.h +64 -0
  316. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/txt_db.h +60 -0
  317. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ui.h +2 -0
  318. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509.h +227 -0
  319. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509_vfy.h +50 -0
  320. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509v3.h +237 -0
  321. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/options.h +261 -0
  322. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/quic.h +310 -0
  323. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/sniffer.h +359 -0
  324. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/sniffer_error.h +151 -0
  325. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/ssl.h +6300 -0
  326. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/test.h +4989 -0
  327. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/version.h +40 -0
  328. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/aes.h +1074 -0
  329. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/arc4.h +69 -0
  330. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ascon.h +109 -0
  331. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/asn.h +2855 -0
  332. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
  333. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
  334. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
  335. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2.h +108 -0
  336. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/camellia.h +116 -0
  337. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/chacha.h +133 -0
  338. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
  339. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cmac.h +168 -0
  340. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/coding.h +107 -0
  341. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/compress.h +60 -0
  342. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cpuid.h +153 -0
  343. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
  344. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/curve25519.h +225 -0
  345. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/curve448.h +151 -0
  346. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/des3.h +167 -0
  347. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dh.h +210 -0
  348. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
  349. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dsa.h +121 -0
  350. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ecc.h +1074 -0
  351. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/eccsi.h +176 -0
  352. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ed25519.h +239 -0
  353. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ed448.h +214 -0
  354. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
  355. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
  356. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
  357. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
  358. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/falcon.h +180 -0
  359. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fe_448.h +122 -0
  360. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
  361. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fips_test.h +131 -0
  362. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ge_448.h +84 -0
  363. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
  364. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hash.h +296 -0
  365. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hmac.h +231 -0
  366. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hpke.h +145 -0
  367. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/integer.h +449 -0
  368. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/kdf.h +199 -0
  369. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/lms.h +202 -0
  370. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/logging.h +588 -0
  371. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md2.h +83 -0
  372. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md4.h +77 -0
  373. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md5.h +141 -0
  374. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mem_track.h +968 -0
  375. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/memory.h +545 -0
  376. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/misc.h +214 -0
  377. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mlkem.h +377 -0
  378. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
  379. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
  380. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
  381. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
  382. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
  383. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/poly1305.h +207 -0
  384. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
  385. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/random.h +300 -0
  386. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/rc2.h +68 -0
  387. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ripemd.h +67 -0
  388. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/rsa.h +494 -0
  389. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sakke.h +228 -0
  390. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/settings.h +4762 -0
  391. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha.h +237 -0
  392. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha256.h +360 -0
  393. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha3.h +274 -0
  394. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha512.h +372 -0
  395. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/signature.h +87 -0
  396. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/siphash.h +101 -0
  397. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm2.h +27 -0
  398. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm3.h +27 -0
  399. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm4.h +27 -0
  400. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
  401. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sphincs.h +167 -0
  402. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/srp.h +313 -0
  403. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/tfm.h +941 -0
  404. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/types.h +2383 -0
  405. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/visibility.h +97 -0
  406. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
  407. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
  408. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
  409. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
  410. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
  411. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
  412. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
  413. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/xmss.h +203 -0
  414. package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfio.h +1035 -0
  415. package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.a +0 -0
  416. package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.la +41 -0
  417. package/android/install/wolfssl-android/armeabi-v7a/lib/pkgconfig/wolfssl.pc +11 -0
  418. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/QUIC.md +117 -0
  419. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/README.txt +8 -0
  420. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/async_client.c +245 -0
  421. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/async_server.c +331 -0
  422. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/client.c +4885 -0
  423. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/echoclient.c +341 -0
  424. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/echoserver.c +498 -0
  425. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
  426. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-client.c +78 -0
  427. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
  428. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-server.c +83 -0
  429. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/server.c +4124 -0
  430. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/tls_bench.c +2357 -0
  431. package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/taoCert.txt +176 -0
  432. package/android/install/wolfssl-android/x86_64/bin/wolfssl-config +117 -0
  433. package/android/install/wolfssl-android/x86_64/include/wolfssl/callbacks.h +93 -0
  434. package/android/install/wolfssl-android/x86_64/include/wolfssl/certs_test.h +7073 -0
  435. package/android/install/wolfssl-android/x86_64/include/wolfssl/certs_test_sm.h +2913 -0
  436. package/android/install/wolfssl-android/x86_64/include/wolfssl/crl.h +58 -0
  437. package/android/install/wolfssl-android/x86_64/include/wolfssl/error-ssl.h +280 -0
  438. package/android/install/wolfssl-android/x86_64/include/wolfssl/ocsp.h +191 -0
  439. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/aes.h +117 -0
  440. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/asn1.h +315 -0
  441. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/asn1t.h +30 -0
  442. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/bio.h +237 -0
  443. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/bn.h +332 -0
  444. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/buffer.h +57 -0
  445. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/camellia.h +27 -0
  446. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/cmac.h +66 -0
  447. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/cms.h +26 -0
  448. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/compat_types.h +70 -0
  449. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/conf.h +117 -0
  450. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/crypto.h +171 -0
  451. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/des.h +124 -0
  452. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/dh.h +144 -0
  453. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/dsa.h +164 -0
  454. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec.h +525 -0
  455. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec25519.h +46 -0
  456. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec448.h +46 -0
  457. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ecdh.h +49 -0
  458. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ecdsa.h +87 -0
  459. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ed25519.h +49 -0
  460. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ed448.h +49 -0
  461. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/engine.h +9 -0
  462. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/err.h +84 -0
  463. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/evp.h +1540 -0
  464. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/fips_rand.h +125 -0
  465. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/hmac.h +98 -0
  466. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/kdf.h +45 -0
  467. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/lhash.h +64 -0
  468. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/md4.h +66 -0
  469. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/md5.h +108 -0
  470. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/modes.h +45 -0
  471. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/obj_mac.h +92 -0
  472. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/objects.h +86 -0
  473. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ocsp.h +108 -0
  474. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/opensslconf.h +8 -0
  475. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/opensslv.h +78 -0
  476. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ossl_typ.h +32 -0
  477. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pem.h +301 -0
  478. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pkcs12.h +57 -0
  479. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pkcs7.h +110 -0
  480. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rand.h +38 -0
  481. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rc4.h +64 -0
  482. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ripemd.h +58 -0
  483. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rsa.h +291 -0
  484. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/safestack.h +40 -0
  485. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/sha.h +331 -0
  486. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/sha3.h +158 -0
  487. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/srp.h +33 -0
  488. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ssl.h +1923 -0
  489. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ssl23.h +1 -0
  490. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/stack.h +61 -0
  491. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/tls1.h +64 -0
  492. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/txt_db.h +60 -0
  493. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ui.h +2 -0
  494. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509.h +227 -0
  495. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509_vfy.h +50 -0
  496. package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509v3.h +237 -0
  497. package/android/install/wolfssl-android/x86_64/include/wolfssl/options.h +273 -0
  498. package/android/install/wolfssl-android/x86_64/include/wolfssl/quic.h +310 -0
  499. package/android/install/wolfssl-android/x86_64/include/wolfssl/sniffer.h +359 -0
  500. package/android/install/wolfssl-android/x86_64/include/wolfssl/sniffer_error.h +151 -0
  501. package/android/install/wolfssl-android/x86_64/include/wolfssl/ssl.h +6300 -0
  502. package/android/install/wolfssl-android/x86_64/include/wolfssl/test.h +4989 -0
  503. package/android/install/wolfssl-android/x86_64/include/wolfssl/version.h +40 -0
  504. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/aes.h +1074 -0
  505. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/arc4.h +69 -0
  506. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ascon.h +109 -0
  507. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/asn.h +2855 -0
  508. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
  509. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
  510. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
  511. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2.h +108 -0
  512. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/camellia.h +116 -0
  513. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/chacha.h +133 -0
  514. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
  515. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cmac.h +168 -0
  516. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/coding.h +107 -0
  517. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/compress.h +60 -0
  518. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cpuid.h +153 -0
  519. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
  520. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/curve25519.h +225 -0
  521. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/curve448.h +151 -0
  522. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/des3.h +167 -0
  523. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dh.h +210 -0
  524. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
  525. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dsa.h +121 -0
  526. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ecc.h +1074 -0
  527. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/eccsi.h +176 -0
  528. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ed25519.h +239 -0
  529. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ed448.h +214 -0
  530. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
  531. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
  532. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
  533. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
  534. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/falcon.h +180 -0
  535. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fe_448.h +122 -0
  536. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
  537. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fips_test.h +131 -0
  538. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ge_448.h +84 -0
  539. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
  540. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hash.h +296 -0
  541. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hmac.h +231 -0
  542. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hpke.h +145 -0
  543. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/integer.h +449 -0
  544. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/kdf.h +199 -0
  545. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/lms.h +202 -0
  546. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/logging.h +588 -0
  547. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md2.h +83 -0
  548. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md4.h +77 -0
  549. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md5.h +141 -0
  550. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mem_track.h +968 -0
  551. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/memory.h +545 -0
  552. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/misc.h +214 -0
  553. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mlkem.h +377 -0
  554. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
  555. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
  556. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
  557. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
  558. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
  559. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/poly1305.h +207 -0
  560. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
  561. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/random.h +300 -0
  562. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/rc2.h +68 -0
  563. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ripemd.h +67 -0
  564. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/rsa.h +494 -0
  565. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sakke.h +228 -0
  566. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/settings.h +4762 -0
  567. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha.h +237 -0
  568. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha256.h +360 -0
  569. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha3.h +274 -0
  570. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha512.h +372 -0
  571. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/signature.h +87 -0
  572. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/siphash.h +101 -0
  573. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm2.h +27 -0
  574. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm3.h +27 -0
  575. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm4.h +27 -0
  576. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
  577. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sphincs.h +167 -0
  578. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/srp.h +313 -0
  579. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/tfm.h +941 -0
  580. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/types.h +2383 -0
  581. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/visibility.h +97 -0
  582. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
  583. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
  584. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
  585. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
  586. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
  587. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
  588. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
  589. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/xmss.h +203 -0
  590. package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfio.h +1035 -0
  591. package/android/install/wolfssl-android/x86_64/lib/libwolfssl.a +0 -0
  592. package/android/install/wolfssl-android/x86_64/lib/libwolfssl.la +41 -0
  593. package/android/install/wolfssl-android/x86_64/lib/pkgconfig/wolfssl.pc +11 -0
  594. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/QUIC.md +117 -0
  595. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/README.txt +8 -0
  596. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/async_client.c +245 -0
  597. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/async_server.c +331 -0
  598. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/client.c +4885 -0
  599. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/echoclient.c +341 -0
  600. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/echoserver.c +498 -0
  601. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
  602. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-client.c +78 -0
  603. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
  604. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-server.c +83 -0
  605. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/server.c +4124 -0
  606. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/tls_bench.c +2357 -0
  607. package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/taoCert.txt +176 -0
  608. package/android/src/main/cpp/CMakeLists.txt +19 -27
  609. package/android/src/main/cpp/ngtcp2_jni.cpp +30 -36
  610. package/android/src/main/kotlin/ai/annadata/mqttquic/MqttQuicPlugin.kt +15 -0
  611. package/android/src/main/kotlin/ai/annadata/mqttquic/client/MQTTClient.kt +6 -2
  612. package/build-native.sh +397 -0
  613. package/deps-versions.sh +25 -0
  614. package/dist/esm/definitions.d.ts +20 -0
  615. package/dist/esm/definitions.d.ts.map +1 -1
  616. package/dist/esm/web.d.ts +26 -3
  617. package/dist/esm/web.d.ts.map +1 -1
  618. package/dist/esm/web.js +230 -10
  619. package/dist/esm/web.js.map +1 -1
  620. package/dist/plugin.cjs.js +11363 -13
  621. package/dist/plugin.cjs.js.map +1 -1
  622. package/dist/plugin.js +11364 -14
  623. package/dist/plugin.js.map +1 -1
  624. package/docs/ARCHITECTURAL_ANALYSIS.md +710 -0
  625. package/docs/CAPACITOR_MQTT_QUIC_PRODUCTION_PLUGIN.md +190 -0
  626. package/docs/CAPACITOR_VERSION_SUPPORT.md +65 -0
  627. package/docs/IMPLEMENTATION_SUMMARY.md +246 -0
  628. package/docs/MQTT5_CLIENT_COMPLIANCE.md +48 -0
  629. package/docs/MQTT5_IMPLEMENTATION_COMPLETE.md +178 -0
  630. package/docs/MQTT_VERSION_ANALYSIS.md +233 -0
  631. package/docs/NGTCP2_IMPLEMENTATION_STATUS.md +214 -0
  632. package/docs/NGTCP2_INTEGRATION_PLAN.md +597 -0
  633. package/docs/P0_P1_CHANGELOG.md +79 -0
  634. package/docs/PRODUCTION_PUBLISH_STEPS.md +161 -0
  635. package/docs/PROJECT_OVERVIEW.md +193 -0
  636. package/ios/.swiftpm/xcode/xcuserdata/annadata.xcuserdatad/xcschemes/xcschememanagement.plist +1 -1
  637. package/ios/NGTCP2_BUILD_INSTRUCTIONS.md +12 -0
  638. package/ios/Sources/MqttQuicPlugin/MqttQuicPlugin.swift +6 -0
  639. package/ios/Sources/MqttQuicPlugin/QUIC/NGTCP2Bridge.mm +6 -0
  640. package/ios/build-openssl.sh +1 -1
  641. package/ios/libs/MqttQuicLibs.xcframework/Info.plist +44 -0
  642. package/ios/libs/MqttQuicLibs.xcframework/ios-arm64/libmqttquic_native_device.a +0 -0
  643. package/ios/libs/MqttQuicLibs.xcframework/ios-arm64_x86_64-simulator/libmqttquic_native_simulator.a +0 -0
  644. package/ios/libs/libnghttp3.a +0 -0
  645. package/ios/libs/libngtcp2.a +0 -0
  646. package/ios/libs/libngtcp2_crypto_wolfssl.a +0 -0
  647. package/ios/libs/libwolfssl.a +0 -0
  648. package/ios/libs-simulator/libnghttp3.a +0 -0
  649. package/ios/libs-simulator/libngtcp2.a +0 -0
  650. package/ios/libs-simulator/libngtcp2_crypto_wolfssl.a +0 -0
  651. package/ios/libs-simulator/libwolfssl.a +0 -0
  652. package/ios/libs-simulator-x86_64/libnghttp3.a +0 -0
  653. package/ios/libs-simulator-x86_64/libngtcp2.a +0 -0
  654. package/ios/libs-simulator-x86_64/libngtcp2_crypto_wolfssl.a +0 -0
  655. package/ios/libs-simulator-x86_64/libwolfssl.a +0 -0
  656. package/package.json +22 -9
@@ -0,0 +1,2855 @@
1
+ /* asn.h
2
+ *
3
+ * Copyright (C) 2006-2025 wolfSSL Inc.
4
+ *
5
+ * This file is part of wolfSSL.
6
+ *
7
+ * wolfSSL is free software; you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation; either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * wolfSSL is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20
+ */
21
+
22
+ /*!
23
+ \file wolfssl/wolfcrypt/asn.h
24
+ */
25
+
26
+ /*
27
+
28
+ DESCRIPTION
29
+ This library provides the interface to Abstract Syntax Notation One (ASN.1) objects.
30
+ ASN.1 is a standard interface description language for defining data structures
31
+ that can be serialized and deserialized in a cross-platform way.
32
+
33
+ */
34
+ #ifndef WOLF_CRYPT_ASN_H
35
+ #define WOLF_CRYPT_ASN_H
36
+
37
+ #include <wolfssl/wolfcrypt/types.h>
38
+
39
+ #if !defined(NO_ASN) || !defined(NO_PWDBASED)
40
+
41
+ #if !defined(NO_ASN_TIME) && defined(NO_TIME_H)
42
+ #define NO_ASN_TIME /* backwards compatibility with NO_TIME_H */
43
+ #endif
44
+
45
+ #include <wolfssl/wolfcrypt/wolfmath.h>
46
+
47
+ #ifdef WOLFSSL_ASYNC_CRYPT
48
+ #include <wolfssl/wolfcrypt/async.h>
49
+ #endif
50
+
51
+ #ifndef NO_DH
52
+ #include <wolfssl/wolfcrypt/dh.h>
53
+ #endif
54
+ #ifndef NO_DSA
55
+ #include <wolfssl/wolfcrypt/dsa.h>
56
+ #endif
57
+ #ifndef NO_RSA
58
+ #include <wolfssl/wolfcrypt/rsa.h>
59
+ #endif
60
+ #ifdef HAVE_ECC
61
+ #include <wolfssl/wolfcrypt/ecc.h>
62
+ #endif
63
+ #ifdef HAVE_ED25519
64
+ #include <wolfssl/wolfcrypt/ed25519.h>
65
+ #endif
66
+ #ifdef HAVE_ED448
67
+ #include <wolfssl/wolfcrypt/ed448.h>
68
+ #endif
69
+ #ifdef HAVE_SPHINCS
70
+ #include <wolfssl/wolfcrypt/sphincs.h>
71
+ #endif
72
+ #ifdef HAVE_FALCON
73
+ #include <wolfssl/wolfcrypt/falcon.h>
74
+ #endif
75
+ #ifdef HAVE_DILITHIUM
76
+ #include <wolfssl/wolfcrypt/dilithium.h>
77
+ #endif
78
+ #ifndef NO_SHA
79
+ #include <wolfssl/wolfcrypt/sha.h>
80
+ #endif
81
+ #ifndef NO_MD5
82
+ #include <wolfssl/wolfcrypt/md5.h>
83
+ #endif
84
+ #include <wolfssl/wolfcrypt/sha256.h>
85
+ #ifdef WOLFSSL_SM3
86
+ #include <wolfssl/wolfcrypt/sm3.h>
87
+ #endif
88
+ #include <wolfssl/wolfcrypt/asn_public.h> /* public interface */
89
+
90
+ #if defined(NO_SHA) && defined(NO_SHA256)
91
+ #define WC_SHA256_DIGEST_SIZE 32
92
+ #endif
93
+
94
+ #ifdef __cplusplus
95
+ extern "C" {
96
+ #endif
97
+
98
+ #ifndef NO_ASN
99
+
100
+ #ifndef EXTERNAL_SERIAL_SIZE
101
+ #define EXTERNAL_SERIAL_SIZE 32
102
+ #endif
103
+
104
+ enum {
105
+ ASN_ISSUER = 0,
106
+ ASN_SUBJECT = 1,
107
+
108
+ ASN_BEFORE = 0,
109
+ ASN_AFTER = 1
110
+ };
111
+
112
+ #ifndef NO_ASN_OLD_TYPE_NAMES
113
+ #ifndef ISSUER
114
+ #define ISSUER ASN_ISSUER
115
+ #endif
116
+ #ifndef SUBJECT
117
+ #define SUBJECT ASN_SUBJECT
118
+ #endif
119
+ #ifndef BEFORE
120
+ #define BEFORE ASN_BEFORE
121
+ #endif
122
+ #ifndef AFTER
123
+ #define AFTER ASN_AFTER
124
+ #endif
125
+ #endif
126
+
127
+ /* ASN Tags */
128
+ enum ASN_Tags {
129
+ ASN_EOC = 0x00,
130
+ ASN_BOOLEAN = 0x01,
131
+ ASN_INTEGER = 0x02,
132
+ ASN_BIT_STRING = 0x03,
133
+ ASN_OCTET_STRING = 0x04,
134
+ ASN_TAG_NULL = 0x05,
135
+ ASN_OBJECT_ID = 0x06,
136
+ ASN_OBJECT_DESC = 0x07,
137
+ ASN_INSTANCE_OF = 0x08,
138
+ ASN_REAL = 0x09,
139
+ ASN_ENUMERATED = 0x0a,
140
+ ASN_EMBEDDED_PDV = 0x0b,
141
+ ASN_UTF8STRING = 0x0c,
142
+ ASN_RELATIVE_OID = 0x0d,
143
+ ASN_SEQUENCE = 0x10,
144
+ ASN_SET = 0x11,
145
+ ASN_NUMERICSTRING = 0x12,
146
+ ASN_PRINTABLE_STRING = 0x13,
147
+ ASN_T61STRING = 0x14,
148
+ ASN_VIDEOTEXSTRING = 0x15,
149
+ ASN_IA5_STRING = 0x16,
150
+ ASN_UTC_TIME = 0x17,
151
+ ASN_GENERALIZED_TIME = 0x18,
152
+ ASN_GRAPHICSTRING = 0x19,
153
+ ASN_ISO646STRING = 0x1a,
154
+ ASN_GENERALSTRING = 0x1b,
155
+ ASN_UNIVERSALSTRING = 0x1c,
156
+ ASN_CHARACTER_STRING = 0x1d,
157
+ ASN_BMPSTRING = 0x1e,
158
+ ASN_TYPE_MASK = 0x1f,
159
+
160
+ ASN_LONG_LENGTH = 0x80,
161
+ ASN_INDEF_LENGTH = 0x80,
162
+
163
+ /* ASN_Flags - Bitmask */
164
+ ASN_CONSTRUCTED = 0x20,
165
+ ASN_APPLICATION = 0x40,
166
+ ASN_CONTEXT_SPECIFIC = 0x80,
167
+ ASN_PRIVATE = 0xC0,
168
+ ASN_CLASS_MASK = 0xC0,
169
+
170
+ CRL_EXTENSIONS = 0xa0,
171
+ ASN_EXTENSIONS = 0xa3,
172
+
173
+ /* GeneralName types */
174
+ ASN_OTHER_TYPE = 0x00,
175
+ ASN_RFC822_TYPE = 0x01,
176
+ ASN_DNS_TYPE = 0x02,
177
+ ASN_DIR_TYPE = 0x04,
178
+ ASN_URI_TYPE = 0x06, /* the value 6 is from GeneralName OID */
179
+ ASN_IP_TYPE = 0x07, /* the value 7 is from GeneralName OID */
180
+ ASN_RID_TYPE = 0x08,
181
+
182
+ /* PKCS #7 types */
183
+ ASN_ENC_CONTENT = 0x00,
184
+ ASN_OTHERNAME_VALUE = 0x00,
185
+
186
+ /* AuthorityKeyIdentifier fields */
187
+ ASN_AUTHKEYID_KEYID = 0x00,
188
+ ASN_AUTHKEYID_ISSUER = 0x01,
189
+ ASN_AUTHKEYID_SERIAL = 0x02,
190
+
191
+ /* GeneralSubtree fields */
192
+ ASN_SUBTREE_MIN = 0x00,
193
+ ASN_SUBTREE_MAX = 0x01,
194
+
195
+ /* x509 Cert Fields */
196
+ ASN_X509_CERT_VERSION = 0x00,
197
+
198
+ /* x509 Cert Extension Fields */
199
+ ASN_AKID_KEYID = 0x00,
200
+
201
+ /* ECC Key Fields */
202
+ ASN_ECC_PARAMS = 0x00,
203
+ ASN_ECC_PUBKEY = 0x01,
204
+
205
+ /* OneAsymmetricKey Fields */
206
+ ASN_ASYMKEY_ATTRS = 0x00,
207
+ ASN_ASYMKEY_PUBKEY = 0x01,
208
+
209
+ /* PKEY Fields */
210
+ ASN_PKEY_SEED = 0x00
211
+ };
212
+
213
+ /* NOTE: If ASN_UTC_TIME_SIZE or ASN_GENERALIZED_TIME_SIZE are ever modified
214
+ * one needs to update the logic in asn.c function GetAsnTimeString()
215
+ * which depends on the size 14 and/or 16 to determine which format to
216
+ * place in the "buf" (output)
217
+ */
218
+ #define ASN_UTC_TIME_SIZE 14 /* Read note above before modifying */
219
+ #define ASN_GENERALIZED_TIME_SIZE 16 /* Read note above before modifying */
220
+ #define ASN_GENERALIZED_TIME_MAX 68
221
+
222
+ #ifdef WOLFSSL_ASN_TEMPLATE
223
+ /* Different data types that can be stored in ASNGetData/ASNSetData. */
224
+ enum ASNItem_DataType {
225
+ /* Default for tag type. */
226
+ ASN_DATA_TYPE_NONE = 0,
227
+ /* 8-bit integer value. */
228
+ ASN_DATA_TYPE_WORD8 = 1,
229
+ /* 16-bit integer value. */
230
+ ASN_DATA_TYPE_WORD16 = 2,
231
+ /* 32-bit integer value. */
232
+ ASN_DATA_TYPE_WORD32 = 4,
233
+ /* Buffer with data and length. */
234
+ ASN_DATA_TYPE_BUFFER = 5,
235
+ /* An expected/required buffer with data and length. */
236
+ ASN_DATA_TYPE_EXP_BUFFER = 6,
237
+ /* Replace the item with buffer (data and length). */
238
+ ASN_DATA_TYPE_REPLACE_BUFFER = 7,
239
+ /* Big number as an mp_int. */
240
+ ASN_DATA_TYPE_MP = 8,
241
+ /* Big number as an mp_int that has already been initialized. */
242
+ ASN_DATA_TYPE_MP_INITED = 9,
243
+ /* Big number as a positive or negative mp_int. */
244
+ ASN_DATA_TYPE_MP_POS_NEG = 10,
245
+ /* ASN.1 CHOICE. A 0 terminated list of tags that are valid. */
246
+ ASN_DATA_TYPE_CHOICE = 11
247
+ };
248
+
249
+ /* A template entry describing an ASN.1 item. */
250
+ typedef struct ASNItem {
251
+ /* Depth of ASN.1 item - how many constructed ASN.1 items above. */
252
+ byte depth;
253
+ /* BER/DER tag to expect. */
254
+ byte tag;
255
+ /* Whether the ASN.1 item is constructed. */
256
+ WC_BITFIELD constructed:1;
257
+ /* Whether to parse the header only or skip data. If
258
+ * ASNSetData.data.buffer.data is supplied then this option gets
259
+ * overwritten and the child nodes get ignored. */
260
+ WC_BITFIELD headerOnly:1;
261
+ /* Whether ASN.1 item is optional.
262
+ * - 0 means not optional
263
+ * - 1 means is optional
264
+ * - 2+ means one of these at the same level with same value must appear.
265
+ */
266
+ byte optional;
267
+ } ASNItem;
268
+
269
+ /* Dynamic data for setting (encoding) an ASN.1 item. */
270
+ typedef struct ASNSetData {
271
+ /* Reverse offset into buffer of ASN.1 item - calculated in SizeASN_Items().
272
+ * SetASN_Items() subtracts from total length to get usable value.
273
+ */
274
+ word32 offset;
275
+ /* Length of data in ASN.1 item - calculated in SizeASN_Items(). */
276
+ word32 length;
277
+ /* Different data type representation. */
278
+ union {
279
+ /* 8-bit integer value. */
280
+ byte u8;
281
+ /* 16-bit integer value. */
282
+ word16 u16;
283
+ /* 32-bit integer value. */
284
+ word32 u32;
285
+ /* Big number as an mp_int. */
286
+ mp_int* mp;
287
+ /* Buffer as data pointer and length. */
288
+ struct {
289
+ /* Data to write out. */
290
+ const byte* data;
291
+ /* Length of data to write out. */
292
+ word32 length;
293
+ } buffer;
294
+ } data;
295
+ /* Type of data stored in data field - enum ASNItem_DataType. */
296
+ byte dataType;
297
+ /* Don't write this ASN.1 item out.
298
+ * Optional items are dependent on the data being encoded.
299
+ */
300
+ byte noOut;
301
+ } ASNSetData;
302
+
303
+ /* Dynamic data for getting (decoding) an ASN.1 item. */
304
+ typedef struct ASNGetData {
305
+ /* Offset into buffer where encoding starts. */
306
+ word32 offset;
307
+ /* Total length of data in ASN.1 item.
308
+ * BIT_STRING and INTEGER lengths include leading byte. */
309
+ word32 length;
310
+ union {
311
+ /* Pointer to 8-bit integer. */
312
+ byte* u8;
313
+ /* Pointer to 16-bit integer. */
314
+ word16* u16;
315
+ /* Pointer to 32-bit integer. */
316
+ word32* u32;
317
+ /* Pointer to mp_int for big number. */
318
+ mp_int* mp;
319
+ /* List of possible tags. Useful for CHOICE ASN.1 items. */
320
+ const byte* choice;
321
+ /* Buffer to copy into. */
322
+ struct {
323
+ /* Buffer to hold ASN.1 data. */
324
+ byte* data;
325
+ /* Maximum length of buffer. */
326
+ word32* length;
327
+ } buffer;
328
+ /* Reference to ASN.1 item's data. */
329
+ struct {
330
+ /* Pointer reference into input buffer. */
331
+ const byte* data;
332
+ /* Length of data. */
333
+ word32 length;
334
+ } ref;
335
+ /* Data of an OBJECT_ID. */
336
+ struct {
337
+ /* OID data reference into input buffer. */
338
+ const byte* data;
339
+ /* Length of OID data. */
340
+ word32 length;
341
+ /* Type of OID expected. */
342
+ word32 type;
343
+ /* OID sum - 32-bit id. */
344
+ word32 sum;
345
+ } oid;
346
+ } data;
347
+ /* Type of data stored in data field - enum ASNItem_DataType. */
348
+ byte dataType;
349
+ /* Tag found in BER/DER item. */
350
+ byte tag;
351
+ } ASNGetData;
352
+
353
+ WOLFSSL_LOCAL int SizeASN_Items(const ASNItem* asn, ASNSetData *data,
354
+ int count, int* encSz);
355
+ WOLFSSL_LOCAL int SetASN_Items(const ASNItem* asn, ASNSetData *data, int count,
356
+ byte* output);
357
+ WOLFSSL_LOCAL int GetASN_Items(const ASNItem* asn, ASNGetData *data, int count,
358
+ int complete, const byte* input, word32* inOutIdx, word32 length);
359
+
360
+ #ifdef WOLFSSL_ASN_TEMPLATE_TYPE_CHECK
361
+ WOLFSSL_LOCAL void GetASN_Int8Bit(ASNGetData *dataASN, byte* num);
362
+ WOLFSSL_LOCAL void GetASN_Int16Bit(ASNGetData *dataASN, word16* num);
363
+ WOLFSSL_LOCAL void GetASN_Int32Bit(ASNGetData *dataASN, word32* num);
364
+ WOLFSSL_LOCAL void GetASN_Buffer(ASNGetData *dataASN, byte* data,
365
+ word32* length);
366
+ WOLFSSL_LOCAL void GetASN_ExpBuffer(ASNGetData *dataASN, const byte* data,
367
+ word32 length);
368
+ WOLFSSL_LOCAL void GetASN_MP(ASNGetData *dataASN, mp_int* num);
369
+ WOLFSSL_LOCAL void GetASN_MP_Inited(ASNGetData *dataASN, mp_int* num);
370
+ WOLFSSL_LOCAL void GetASN_MP_PosNeg(ASNGetData *dataASN, mp_int* num);
371
+ WOLFSSL_LOCAL void GetASN_Choice(ASNGetData *dataASN, const byte* options);
372
+ WOLFSSL_LOCAL void GetASN_Boolean(ASNGetData *dataASN, byte* num);
373
+ WOLFSSL_LOCAL void GetASN_OID(ASNGetData *dataASN, int oidType);
374
+ WOLFSSL_LOCAL void GetASN_GetConstRef(ASNGetData * dataASN, const byte** data,
375
+ word32* length);
376
+ WOLFSSL_LOCAL void GetASN_GetRef(ASNGetData * dataASN, byte** data,
377
+ word32* length);
378
+ WOLFSSL_LOCAL void GetASN_OIDData(ASNGetData * dataASN, byte** data,
379
+ word32* length);
380
+ WOLFSSL_LOCAL void SetASN_Boolean(ASNSetData *dataASN, byte val);
381
+ WOLFSSL_LOCAL void SetASN_Int8Bit(ASNSetData *dataASN, byte num);
382
+ WOLFSSL_LOCAL void SetASN_Int16Bit(ASNSetData *dataASN, word16 num);
383
+ WOLFSSL_LOCAL void SetASN_Buffer(ASNSetData *dataASN, const byte* data,
384
+ word32 length);
385
+ WOLFSSL_LOCAL void SetASN_ReplaceBuffer(ASNSetData *dataASN, const byte* data,
386
+ word32 length);
387
+ WOLFSSL_LOCAL void SetASN_MP(ASNSetData *dataASN, mp_int* num);
388
+ WOLFSSL_LOCAL void SetASN_OID(ASNSetData *dataASN, int oid, int oidType);
389
+ #else
390
+ /* Setup ASN data item to get an 8-bit number.
391
+ *
392
+ * @param [in] dataASN Dynamic ASN data item.
393
+ * @param [in] num Pointer to an 8-bit variable.
394
+ */
395
+ #define GetASN_Int8Bit(dataASN, num) \
396
+ do { \
397
+ (dataASN)->dataType = ASN_DATA_TYPE_WORD8; \
398
+ (dataASN)->data.u8 = (num); \
399
+ } while (0)
400
+
401
+ /* Setup ASN data item to get a 16-bit number.
402
+ *
403
+ * @param [in] dataASN Dynamic ASN data item.
404
+ * @param [in] num Pointer to a 16-bit variable.
405
+ */
406
+ #define GetASN_Int16Bit(dataASN, num) \
407
+ do { \
408
+ (dataASN)->dataType = ASN_DATA_TYPE_WORD16; \
409
+ (dataASN)->data.u16 = (num); \
410
+ } while (0)
411
+
412
+ /* Setup ASN data item to get a 32-bit number.
413
+ *
414
+ * @param [in] dataASN Dynamic ASN data item.
415
+ * @param [in] num Pointer to a 32-bit variable.
416
+ */
417
+ #define GetASN_Int32Bit(dataASN, num) \
418
+ do { \
419
+ (dataASN)->dataType = ASN_DATA_TYPE_WORD32; \
420
+ (dataASN)->data.u32 = (num); \
421
+ } while (0)
422
+
423
+ /* Setup ASN data item to get data into a buffer of a specific length.
424
+ *
425
+ * @param [in] dataASN Dynamic ASN data item.
426
+ * @param [in] d Buffer to hold data.
427
+ * @param [in] l Length of buffer in bytes.
428
+ */
429
+ #define GetASN_Buffer(dataASN, d, l) \
430
+ do { \
431
+ (dataASN)->dataType = ASN_DATA_TYPE_BUFFER; \
432
+ (dataASN)->data.buffer.data = (d); \
433
+ (dataASN)->data.buffer.length = (l); \
434
+ } while (0)
435
+
436
+ /* Setup ASN data item to check parsed data against expected buffer.
437
+ *
438
+ * @param [in] dataASN Dynamic ASN data item.
439
+ * @param [in] d Buffer containing expected data.
440
+ * @param [in] l Length of buffer in bytes.
441
+ */
442
+ #define GetASN_ExpBuffer(dataASN, d, l) \
443
+ do { \
444
+ (dataASN)->dataType = ASN_DATA_TYPE_EXP_BUFFER; \
445
+ (dataASN)->data.ref.data = (d); \
446
+ (dataASN)->data.ref.length = (l); \
447
+ } while (0)
448
+
449
+ /* Setup ASN data item to get a number into an mp_int.
450
+ *
451
+ * @param [in] dataASN Dynamic ASN data item.
452
+ * @param [in] num Multi-precision number object.
453
+ */
454
+ #define GetASN_MP(dataASN, num) \
455
+ do { \
456
+ (dataASN)->dataType = ASN_DATA_TYPE_MP; \
457
+ (dataASN)->data.mp = (num); \
458
+ } while (0)
459
+
460
+ /* Setup ASN data item to get a number into an mp_int that is initialized.
461
+ *
462
+ * @param [in] dataASN Dynamic ASN data item.
463
+ * @param [in] num Multi-precision number object.
464
+ */
465
+ #define GetASN_MP_Inited(dataASN, num) \
466
+ do { \
467
+ (dataASN)->dataType = ASN_DATA_TYPE_MP_INITED; \
468
+ (dataASN)->data.mp = (num); \
469
+ } while (0)
470
+
471
+ /* Setup ASN data item to get a positive or negative number into an mp_int.
472
+ *
473
+ * @param [in] dataASN Dynamic ASN data item.
474
+ * @param [in] num Multi-precision number object.
475
+ */
476
+ #define GetASN_MP_PosNeg(dataASN, num) \
477
+ do { \
478
+ (dataASN)->dataType = ASN_DATA_TYPE_MP_POS_NEG; \
479
+ (dataASN)->data.mp = (num); \
480
+ } while (0)
481
+
482
+ /* Setup ASN data item to be a choice of tags.
483
+ *
484
+ * @param [in] dataASN Dynamic ASN data item.
485
+ * @param [in] choice 0 terminated list of tags that are valid.
486
+ */
487
+ #define GetASN_Choice(dataASN, options) \
488
+ do { \
489
+ (dataASN)->dataType = ASN_DATA_TYPE_CHOICE; \
490
+ (dataASN)->data.choice = (options); \
491
+ } while (0)
492
+
493
+ /* Setup ASN data item to get a boolean value.
494
+ *
495
+ * @param [in] dataASN Dynamic ASN data item.
496
+ * @param [in] num Pointer to an 8-bit variable.
497
+ */
498
+ #define GetASN_Boolean(dataASN, num) \
499
+ do { \
500
+ (dataASN)->dataType = ASN_DATA_TYPE_NONE; \
501
+ (dataASN)->data.u8 = (num); \
502
+ } while (0)
503
+
504
+ /* Setup ASN data item to be a an OID of a specific type.
505
+ *
506
+ * @param [in] dataASN Dynamic ASN data item.
507
+ * @param [in] oidType Type of OID to expect.
508
+ */
509
+ #define GetASN_OID(dataASN, oidType) \
510
+ (dataASN)->data.oid.type = (oidType)
511
+
512
+ /* Get the data and length from an ASN data item.
513
+ *
514
+ * @param [in] dataASN Dynamic ASN data item.
515
+ * @param [out] d Pointer to data of item.
516
+ * @param [out] l Length of buffer in bytes.
517
+ */
518
+ #define GetASN_GetConstRef(dataASN, d, l) \
519
+ do { \
520
+ *(d) = (dataASN)->data.ref.data; \
521
+ *(l) = (dataASN)->data.ref.length; \
522
+ } while (0)
523
+
524
+ /* Get the data and length from an ASN data item.
525
+ *
526
+ * @param [in] dataASN Dynamic ASN data item.
527
+ * @param [out] d Pointer to data of item.
528
+ * @param [out] l Length of buffer in bytes.
529
+ */
530
+ #define GetASN_GetRef(dataASN, d, l) \
531
+ do { \
532
+ *(d) = (byte*)(dataASN)->data.ref.data; \
533
+ *(l) = (dataASN)->data.ref.length; \
534
+ } while (0)
535
+
536
+ /* Get the data and length from an ASN data item that is an OID.
537
+ *
538
+ * @param [in] dataASN Dynamic ASN data item.
539
+ * @param [out] d Pointer to .
540
+ * @param [out] l Length of buffer in bytes.
541
+ */
542
+ #define GetASN_OIDData(dataASN, d, l) \
543
+ do { \
544
+ *(d) = (byte*)(dataASN)->data.oid.data; \
545
+ *(l) = (dataASN)->data.oid.length; \
546
+ } while (0)
547
+
548
+ /* Setup an ASN data item to set a boolean.
549
+ *
550
+ * @param [in] dataASN Dynamic ASN data item.
551
+ * @param [in] val Boolean value.
552
+ */
553
+ #define SetASN_Boolean(dataASN, val) \
554
+ do { \
555
+ (dataASN)->dataType = ASN_DATA_TYPE_NONE; \
556
+ (dataASN)->data.u8 = (val); \
557
+ } while (0)
558
+
559
+ /* Setup an ASN data item to set an 8-bit number.
560
+ *
561
+ * @param [in] dataASN Dynamic ASN data item.
562
+ * @param [in] num 8-bit number to set.
563
+ */
564
+ #define SetASN_Int8Bit(dataASN, num) \
565
+ do { \
566
+ (dataASN)->dataType = ASN_DATA_TYPE_WORD8; \
567
+ (dataASN)->data.u8 = (num); \
568
+ } while (0)
569
+
570
+ /* Setup an ASN data item to set a 16-bit number.
571
+ *
572
+ * @param [in] dataASN Dynamic ASN data item.
573
+ * @param [in] num 16-bit number to set.
574
+ */
575
+ #define SetASN_Int16Bit(dataASN, num) \
576
+ do { \
577
+ (dataASN)->dataType = ASN_DATA_TYPE_WORD16; \
578
+ (dataASN)->data.u16 = (num); \
579
+ } while (0)
580
+
581
+ /* Setup an ASN data item to set the data in a buffer.
582
+ *
583
+ * @param [in] dataASN Dynamic ASN data item.
584
+ * @param [in] d Buffer containing data to set.
585
+ * @param [in] l Length of data in buffer in bytes.
586
+ */
587
+ #define SetASN_Buffer(dataASN, d, l) \
588
+ do { \
589
+ (dataASN)->data.buffer.data = (d); \
590
+ (dataASN)->data.buffer.length = (word32)(l); \
591
+ } while (0)
592
+
593
+ /* Setup an ASN data item to set the DER encode data in a buffer.
594
+ *
595
+ * @param [in] dataASN Dynamic ASN data item.
596
+ * @param [in] d Buffer containing BER encoded data to set.
597
+ * @param [in] l Length of data in buffer in bytes.
598
+ */
599
+ #define SetASN_ReplaceBuffer(dataASN, d, l) \
600
+ do { \
601
+ (dataASN)->dataType = ASN_DATA_TYPE_REPLACE_BUFFER; \
602
+ (dataASN)->data.buffer.data = (d); \
603
+ (dataASN)->data.buffer.length = (l); \
604
+ } while (0)
605
+
606
+ /* Setup an ASN data item to set an muli-precision number.
607
+ *
608
+ * @param [in] dataASN Dynamic ASN data item.
609
+ * @param [in] num Multi-precision number.
610
+ */
611
+ #define SetASN_MP(dataASN, num) \
612
+ do { \
613
+ (dataASN)->dataType = ASN_DATA_TYPE_MP; \
614
+ (dataASN)->data.mp = (num); \
615
+ } while (0)
616
+
617
+ /* Setup an ASN data item to set an OID based on id and type.
618
+ *
619
+ * oid and oidType pair are unique.
620
+ *
621
+ * @param [in] dataASN Dynamic ASN data item.
622
+ * @param [in] oid OID identifier.
623
+ * @param [in] oidType Type of OID.
624
+ */
625
+ #define SetASN_OID(dataASN, oid, oidType) \
626
+ (dataASN)->data.buffer.data = OidFromId(oid, oidType, \
627
+ &(dataASN)->data.buffer.length)
628
+ #endif /* WOLFSSL_ASN_TEMPLATE_TYPE_CHECK */
629
+
630
+
631
+ /* Get address at the start of the BER item.
632
+ *
633
+ * @param [in] dataASN Dynamic ASN data item.
634
+ * @param [in] in Input buffer.
635
+ * @return Address at start of BER item.
636
+ */
637
+ #define GetASNItem_Addr(dataASN, in) \
638
+ ((in) + (dataASN).offset)
639
+
640
+ /* Get length of a BER item - including tag and length.
641
+ *
642
+ * @param [in] dataASN Dynamic ASN data item.
643
+ * @param [in] in Input buffer.
644
+ * @return Length of a BER item.
645
+ */
646
+ #define GetASNItem_Length(dataASN, in) \
647
+ ((dataASN).length + (word32)((dataASN).data.buffer.data - (in)) - \
648
+ (dataASN).offset)
649
+
650
+ /* Get the index of a BER item's data.
651
+ *
652
+ * @param [in] dataASN Dynamic ASN data item.
653
+ * @param [in] in Input buffer.
654
+ * @return Index of a BER item's data.
655
+ */
656
+ #define GetASNItem_DataIdx(dataASN, in) \
657
+ (word32)((dataASN).data.ref.data - (in))
658
+
659
+ /* Get the end index of a BER item - index of the start of the next item.
660
+ *
661
+ * @param [in] dataASN Dynamic ASN data item.
662
+ * @param [in] in Input buffer.
663
+ * @return End index of a BER item.
664
+ */
665
+ #define GetASNItem_EndIdx(dataASN, in) \
666
+ ((word32)((dataASN).data.ref.data - (in)) + \
667
+ (dataASN).data.ref.length)
668
+
669
+ /* For a BIT_STRING, get the unused bits byte.
670
+ *
671
+ * @param [in] dataASN Dynamic ASN data item.
672
+ * @return Unused bits byte in BIT_STRING.
673
+ */
674
+ #define GetASNItem_UnusedBits(dataASN) \
675
+ (*((dataASN).data.ref.data - 1))
676
+
677
+ /* Set the data items at indices start to end inclusive to not be encoded.
678
+ *
679
+ * @param [in] dataASN Dynamic ASN data item.
680
+ * @param [in] start First item not to be encoded.
681
+ * @param [in] end Last item not to be encoded.
682
+ */
683
+ #define SetASNItem_NoOut(dataASN, start, end) \
684
+ do { \
685
+ int ii; \
686
+ for (ii = (start); ii <= (end); ii++) { \
687
+ (dataASN)[ii].noOut = 1; \
688
+ } \
689
+ } \
690
+ while (0)
691
+
692
+ /* Set the data items below node to not be encoded.
693
+ *
694
+ * @param [in] dataASN Dynamic ASN data item.
695
+ * @param [in] node Node who's children should not be encoded.
696
+ * @param [in] dataASNLen Number of items in dataASN.
697
+ */
698
+ #define SetASNItem_NoOutBelow(dataASN, asn, node, dataASNLen) \
699
+ do { \
700
+ int ii; \
701
+ for (ii = (node) + 1; ii < (int)(dataASNLen); ii++) { \
702
+ if ((asn)[ii].depth <= (asn)[node].depth) \
703
+ break; \
704
+ (dataASN)[ii].noOut = 1; \
705
+ } \
706
+ } \
707
+ while (0)
708
+
709
+ /* Set the node and all nodes below to not be encoded.
710
+ *
711
+ * @param [in] dataASN Dynamic ASN data item.
712
+ * @param [in] node Node which should not be encoded. Child nodes will
713
+ * also not be encoded.
714
+ * @param [in] dataASNLen Number of items in dataASN.
715
+ */
716
+ #define SetASNItem_NoOutNode(dataASN, asn, node, dataASNLen) \
717
+ do { \
718
+ int ii; \
719
+ (dataASN)[node].noOut = 1; \
720
+ for (ii = (node) + 1; ii < (int)(dataASNLen); ii++) { \
721
+ if ((asn)[ii].depth <= (asn)[node].depth) \
722
+ break; \
723
+ (dataASN)[ii].noOut = 1; \
724
+ } \
725
+ } \
726
+ while (0)
727
+
728
+ #endif /* WOLFSSL_ASN_TEMPLATE */
729
+
730
+
731
+ enum DN_Tags {
732
+ ASN_DN_NULL = 0x00,
733
+ ASN_COMMON_NAME = 0x03, /* CN */
734
+ ASN_SUR_NAME = 0x04, /* SN */
735
+ ASN_SERIAL_NUMBER = 0x05, /* serialNumber */
736
+ ASN_COUNTRY_NAME = 0x06, /* C */
737
+ ASN_LOCALITY_NAME = 0x07, /* L */
738
+ ASN_STATE_NAME = 0x08, /* ST */
739
+ ASN_STREET_ADDR = 0x09, /* street */
740
+ ASN_ORG_NAME = 0x0a, /* O */
741
+ ASN_ORGUNIT_NAME = 0x0b, /* OU */
742
+ ASN_BUS_CAT = 0x0f, /* businessCategory */
743
+ ASN_POSTAL_CODE = 0x11, /* postalCode */
744
+ ASN_USER_ID = 0x12, /* UserID */
745
+ #ifdef WOLFSSL_CERT_NAME_ALL
746
+ ASN_NAME = 0x29, /* name */
747
+ ASN_GIVEN_NAME = 0x2a, /* GN */
748
+ ASN_INITIALS = 0x2b, /* initials */
749
+ ASN_DNQUALIFIER = 0x2e, /* dnQualifier */
750
+ #endif /* WOLFSSL_CERT_NAME_ALL */
751
+
752
+
753
+ ASN_CONTENT_TYPE = 0x97, /* not actual OID (see attrPkcs9ContentTypeOid) */
754
+ ASN_EMAIL_NAME = 0x98, /* not actual OID (see attrEmailOid) */
755
+ ASN_CUSTOM_NAME = 0x99, /* not actual OID (see CertOidField) */
756
+
757
+ /* pilot attribute types
758
+ * OID values of 0.9.2342.19200300.100.1.* */
759
+ ASN_FAVOURITE_DRINK = 0x13, /* favouriteDrink */
760
+ ASN_RFC822_MAILBOX = 0x14, /* rfc822Mailbox */
761
+ ASN_DOMAIN_COMPONENT = 0x19 /* DC */
762
+ };
763
+
764
+ /* This is the size of the smallest possible PEM header and footer */
765
+ extern const int pem_struct_min_sz;
766
+
767
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
768
+ typedef struct WOLFSSL_ObjectInfo {
769
+ int nid;
770
+ int id;
771
+ word32 type;
772
+ const char* sName;
773
+ const char* lName;
774
+ } WOLFSSL_ObjectInfo;
775
+ extern const size_t wolfssl_object_info_sz;
776
+ extern const WOLFSSL_ObjectInfo wolfssl_object_info[];
777
+ #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
778
+
779
+ /* DN Tag Strings */
780
+ #define WOLFSSL_COMMON_NAME "/CN="
781
+ #define WOLFSSL_LN_COMMON_NAME "/commonName="
782
+ #define WOLFSSL_SUR_NAME "/SN="
783
+ #ifdef WOLFSSL_CERT_NAME_ALL
784
+ #define WOLFSSL_NAME "/N="
785
+ #define WOLFSSL_INITIALS "/initials="
786
+ #define WOLFSSL_GIVEN_NAME "/GN="
787
+ #define WOLFSSL_DNQUALIFIER "/dnQualifier="
788
+ #endif /* WOLFSSL_CERT_NAME_ALL */
789
+ #define WOLFSSL_SERIAL_NUMBER "/serialNumber="
790
+ #define WOLFSSL_COUNTRY_NAME "/C="
791
+ #define WOLFSSL_LN_COUNTRY_NAME "/countryName="
792
+ #define WOLFSSL_LOCALITY_NAME "/L="
793
+ #define WOLFSSL_LN_LOCALITY_NAME "/localityName="
794
+ #define WOLFSSL_STATE_NAME "/ST="
795
+ #define WOLFSSL_LN_STATE_NAME "/stateOrProvinceName="
796
+ #define WOLFSSL_STREET_ADDR_NAME "/street="
797
+ #define WOLFSSL_LN_STREET_ADDR_NAME "/streetAddress="
798
+ #define WOLFSSL_POSTAL_NAME "/postalCode="
799
+ #define WOLFSSL_ORG_NAME "/O="
800
+ #define WOLFSSL_LN_ORG_NAME "/organizationName="
801
+ #define WOLFSSL_ORGUNIT_NAME "/OU="
802
+ #define WOLFSSL_LN_ORGUNIT_NAME "/organizationalUnitName="
803
+ #define WOLFSSL_DOMAIN_COMPONENT "/DC="
804
+ #define WOLFSSL_LN_DOMAIN_COMPONENT "/domainComponent="
805
+ #define WOLFSSL_BUS_CAT "/businessCategory="
806
+ #define WOLFSSL_JOI_C "/jurisdictionC="
807
+ #define WOLFSSL_JOI_ST "/jurisdictionST="
808
+ #define WOLFSSL_EMAIL_ADDR "/emailAddress="
809
+
810
+ #define WOLFSSL_USER_ID "/UID="
811
+ #define WOLFSSL_DOMAIN_COMPONENT "/DC="
812
+ #define WOLFSSL_RFC822_MAILBOX "/rfc822Mailbox="
813
+ #define WOLFSSL_FAVOURITE_DRINK "/favouriteDrink="
814
+ #define WOLFSSL_CONTENT_TYPE "/contentType="
815
+
816
+ #if defined(WOLFSSL_APACHE_HTTPD)
817
+ /* otherName strings */
818
+ #define WOLFSSL_SN_MS_UPN "msUPN"
819
+ #define WOLFSSL_LN_MS_UPN "Microsoft User Principal Name"
820
+ #define WOLFSSL_MS_UPN_SUM UPN_OID
821
+ #define WOLFSSL_SN_DNS_SRV "id-on-dnsSRV"
822
+ #define WOLFSSL_LN_DNS_SRV "SRVName"
823
+ #define WOLFSSL_DNS_SRV_SUM DNS_SRV_OID
824
+ /* TLS features extension strings */
825
+ #define WOLFSSL_SN_TLS_FEATURE "tlsfeature"
826
+ #define WOLFSSL_LN_TLS_FEATURE "TLS Feature"
827
+ #define WOLFSSL_TLS_FEATURE_SUM TLS_FEATURE_OID
828
+ #endif
829
+
830
+ /* Maximum number of allowed subject alternative names in a certificate.
831
+ * Any certificate containing more than this number of subject
832
+ * alternative names will cause an error when attempting to parse. */
833
+ #ifndef WOLFSSL_MAX_ALT_NAMES
834
+ #define WOLFSSL_MAX_ALT_NAMES 1024
835
+ #endif
836
+
837
+ /* Maximum number of allowed name constraints in a certificate.
838
+ * Any certificate containing more than this number of name constraints
839
+ * will cause an error when attempting to parse. */
840
+ #ifndef WOLFSSL_MAX_NAME_CONSTRAINTS
841
+ #define WOLFSSL_MAX_NAME_CONSTRAINTS 128
842
+ #endif
843
+
844
+ #define WC_NID_undef 0
845
+
846
+ /* Setup for WC_MAX_RSA_BITS needs to be here, rather than rsa.h, because
847
+ * FIPS headers don't have it. And it needs to be here, rather than internal.h,
848
+ * so that setup occurs even in cryptonly builds.
849
+ */
850
+ #ifndef NO_RSA
851
+ #ifndef WC_MAX_RSA_BITS
852
+ #ifdef USE_FAST_MATH
853
+ /* FP implementation support numbers up to FP_MAX_BITS / 2 bits. */
854
+ #define WC_MAX_RSA_BITS (FP_MAX_BITS / 2)
855
+ #elif defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)
856
+ /* SP implementation supports numbers of SP_INT_BITS bits. */
857
+ #define WC_MAX_RSA_BITS (((SP_INT_BITS + 7) / 8) * 8)
858
+ #else
859
+ /* Integer maths is dynamic but we only go up to 4096 bits. */
860
+ #define WC_MAX_RSA_BITS 4096
861
+ #endif
862
+ #endif
863
+ #if (WC_MAX_RSA_BITS % 8)
864
+ #error RSA maximum bit size must be multiple of 8
865
+ #endif
866
+ #endif
867
+
868
+ #if defined(HAVE_FALCON) || defined(HAVE_DILITHIUM)
869
+ #define WC_MAX_CERT_VERIFY_SZ 6000 /* For Dilithium */
870
+ #elif defined(WOLFSSL_CERT_EXT)
871
+ #define WC_MAX_CERT_VERIFY_SZ 2048 /* For larger extensions */
872
+ #elif !defined(NO_RSA) && defined(WC_MAX_RSA_BITS)
873
+ #define WC_MAX_CERT_VERIFY_SZ (WC_MAX_RSA_BITS / 8) /* max RSA bytes */
874
+ #elif defined(HAVE_ECC)
875
+ #define WC_MAX_CERT_VERIFY_SZ ECC_MAX_SIG_SIZE /* max ECC */
876
+ #elif defined(HAVE_ED448)
877
+ #define WC_MAX_CERT_VERIFY_SZ ED448_SIG_SIZE /* max Ed448 */
878
+ #elif defined(HAVE_ED25519)
879
+ #define WC_MAX_CERT_VERIFY_SZ ED25519_SIG_SIZE /* max Ed25519 */
880
+ #else
881
+ #define WC_MAX_CERT_VERIFY_SZ 1024 /* max default */
882
+ #endif
883
+
884
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
885
+ /* short names */
886
+ #define WC_SN_md4 "MD4"
887
+ #define WC_SN_md5 "MD5"
888
+ #define WC_SN_sha1 "SHA1"
889
+ #define WC_SN_sha224 "SHA224"
890
+ #define WC_SN_sha256 "SHA256"
891
+ #define WC_SN_sha384 "SHA384"
892
+ #define WC_SN_sha512 "SHA512"
893
+ #define WC_SN_sha512_224 "SHA512-224"
894
+ #define WC_SN_sha512_256 "SHA512-256"
895
+ #define WC_SN_sha3_224 "SHA3-224"
896
+ #define WC_SN_sha3_256 "SHA3-256"
897
+ #define WC_SN_sha3_384 "SHA3-384"
898
+ #define WC_SN_sha3_512 "SHA3-512"
899
+ #define WC_SN_shake128 "SHAKE128"
900
+ #define WC_SN_shake256 "SHAKE256"
901
+ #define WC_SN_blake2s256 "BLAKE2s256"
902
+ #define WC_SN_blake2s512 "BLAKE2s512"
903
+ #define WC_SN_blake2b512 "BLAKE2b512"
904
+ #define WC_SN_sm3 "SM3"
905
+
906
+ /* NIDs */
907
+ #define WC_NID_netscape_cert_type 71
908
+ #define WC_NID_des 66
909
+ #define WC_NID_des3 67
910
+ #define WC_NID_sha256 672
911
+ #define WC_NID_sha384 673
912
+ #define WC_NID_sha512 674
913
+ #define WC_NID_sha512_224 1094
914
+ #define WC_NID_sha512_256 1095
915
+ #define WC_NID_pkcs7_signed 22
916
+ #define WC_NID_pkcs7_enveloped 23
917
+ #define WC_NID_pkcs7_signedAndEnveloped 24
918
+ #define WC_NID_pkcs9_emailAddress 48
919
+ #define WC_NID_pkcs9_unstructuredName 49
920
+ #define WC_NID_pkcs9_contentType 50 /* 1.2.840.113549.1.9.3 */
921
+ #define WC_NID_pkcs9_challengePassword 54
922
+ #define WC_NID_hw_name_oid 73
923
+ #define WC_NID_id_pkix_OCSP_basic 74
924
+ #define WC_NID_any_policy 75
925
+ #define WC_NID_anyExtendedKeyUsage 76
926
+ #define WC_NID_givenName 100 /* 2.5.4.42 */
927
+ #define WC_NID_initials 101 /* 2.5.4.43 */
928
+ #define WC_NID_title 106
929
+ #define WC_NID_description 107
930
+ #define WC_NID_basic_constraints BASIC_CA_OID
931
+ #define WC_NID_key_usage KEY_USAGE_OID /* 2.5.29.15 */
932
+ #define WC_NID_ext_key_usage EXT_KEY_USAGE_OID /* 2.5.29.37 */
933
+ #define WC_NID_subject_key_identifier SUBJ_KEY_OID
934
+ #define WC_NID_authority_key_identifier AUTH_KEY_OID
935
+ #define WC_NID_private_key_usage_period PRIV_KEY_USAGE_PERIOD_OID
936
+ #define WC_NID_subject_alt_name ALT_NAMES_OID
937
+ #define WC_NID_issuer_alt_name ISSUE_ALT_NAMES_OID
938
+ #define WC_NID_info_access AUTH_INFO_OID
939
+ #define WC_NID_sinfo_access SUBJ_INFO_ACC_OID /* id-pe 11 */
940
+ #define WC_NID_name_constraints NAME_CONS_OID /* 2.5.29.30 */
941
+ #define WC_NID_crl_distribution_points CRL_DIST_OID /* 2.5.29.31 */
942
+ #define WC_NID_certificate_policies CERT_POLICY_OID
943
+ #define WC_NID_policy_mappings POLICY_MAP_OID
944
+ #define WC_NID_policy_constraints POLICY_CONST_OID
945
+ #define WC_NID_inhibit_any_policy INHIBIT_ANY_OID /* 2.5.29.54 */
946
+ #define WC_NID_tlsfeature TLS_FEATURE_OID /* id-pe 24 */
947
+ #define WC_NID_buildingName 1494
948
+
949
+ #define WC_NID_dnQualifier 174 /* 2.5.4.46 */
950
+ #define WC_NID_commonName 14 /* CN Changed to not conflict
951
+ * with PBE_SHA1_DES3 */
952
+ #define WC_NID_name 173 /* N , OID = 2.5.4.41 */
953
+ #define WC_NID_surname 0x04 /* SN */
954
+ #define WC_NID_serialNumber 0x05 /* serialNumber */
955
+ #define WC_NID_countryName 0x06 /* C */
956
+ #define WC_NID_localityName 0x07 /* L */
957
+ #define WC_NID_stateOrProvinceName 0x08 /* ST */
958
+ #define WC_NID_streetAddress ASN_STREET_ADDR /* street */
959
+ #define WC_NID_organizationName 0x0a /* O */
960
+ #define WC_NID_organizationalUnitName 0x0b /* OU */
961
+ #define WC_NID_jurisdictionCountryName 0xc
962
+ #define WC_NID_jurisdictionStateOrProvinceName 0xd
963
+ #define WC_NID_businessCategory ASN_BUS_CAT
964
+ #define WC_NID_domainComponent ASN_DOMAIN_COMPONENT
965
+ #define WC_NID_postalCode ASN_POSTAL_CODE /* postalCode */
966
+ #define WC_NID_rfc822Mailbox 460
967
+ #define WC_NID_favouriteDrink 462
968
+ #define WC_NID_userId 458
969
+ #define WC_NID_registeredAddress 870
970
+ #define WC_NID_emailAddress 0x30 /* emailAddress */
971
+ #define WC_NID_id_on_dnsSRV 82 /* 1.3.6.1.5.5.7.8.7 */
972
+ #define WC_NID_ms_upn UPN_OID /* 1.3.6.1.4.1.311.20.2.3 */
973
+
974
+ #define WC_NID_X9_62_prime_field 406 /* 1.2.840.10045.1.1 */
975
+
976
+ #define WC_NID_id_GostR3410_2001 811
977
+ #define WC_NID_id_GostR3410_2012_256 979
978
+ #define WC_NID_id_GostR3410_2012_512 980
979
+
980
+ #ifndef OPENSSL_COEXIST
981
+
982
+ #define NID_undef WC_NID_undef
983
+ #define NID_netscape_cert_type WC_NID_netscape_cert_type
984
+ #define NID_des WC_NID_des
985
+ #define NID_des3 WC_NID_des3
986
+ #define NID_sha256 WC_NID_sha256
987
+ #define NID_sha384 WC_NID_sha384
988
+ #define NID_sha512 WC_NID_sha512
989
+ #define NID_sha512_224 WC_NID_sha512_224
990
+ #define NID_sha512_256 WC_NID_sha512_256
991
+ #define NID_pkcs7_signed WC_NID_pkcs7_signed
992
+ #define NID_pkcs7_enveloped WC_NID_pkcs7_enveloped
993
+ #define NID_pkcs7_signedAndEnveloped WC_NID_pkcs7_signedAndEnveloped
994
+ #define NID_pkcs9_unstructuredName WC_NID_pkcs9_unstructuredName
995
+ #define NID_pkcs9_contentType WC_NID_pkcs9_contentType
996
+ #define NID_pkcs9_challengePassword WC_NID_pkcs9_challengePassword
997
+ #define NID_hw_name_oid WC_NID_hw_name_oid
998
+ #define NID_id_pkix_OCSP_basic WC_NID_id_pkix_OCSP_basic
999
+ #define NID_any_policy WC_NID_any_policy
1000
+ #define NID_anyExtendedKeyUsage WC_NID_anyExtendedKeyUsage
1001
+ #define NID_givenName WC_NID_givenName
1002
+ #define NID_initials WC_NID_initials
1003
+ #define NID_title WC_NID_title
1004
+ #define NID_description WC_NID_description
1005
+ #define NID_basic_constraints WC_NID_basic_constraints
1006
+ #define NID_key_usage WC_NID_key_usage
1007
+ #define NID_ext_key_usage WC_NID_ext_key_usage
1008
+ #define NID_subject_key_identifier WC_NID_subject_key_identifier
1009
+ #define NID_authority_key_identifier WC_NID_authority_key_identifier
1010
+ #define NID_private_key_usage_period WC_NID_private_key_usage_period
1011
+ #define NID_subject_alt_name WC_NID_subject_alt_name
1012
+ #define NID_issuer_alt_name WC_NID_issuer_alt_name
1013
+ #define NID_info_access WC_NID_info_access
1014
+ #define NID_sinfo_access WC_NID_sinfo_access
1015
+ #define NID_name_constraints WC_NID_name_constraints
1016
+ #define NID_crl_distribution_points WC_NID_crl_distribution_points
1017
+ #define NID_certificate_policies WC_NID_certificate_policies
1018
+ #define NID_policy_mappings WC_NID_policy_mappings
1019
+ #define NID_policy_constraints WC_NID_policy_constraints
1020
+ #define NID_inhibit_any_policy WC_NID_inhibit_any_policy
1021
+ #define NID_tlsfeature WC_NID_tlsfeature
1022
+ #define NID_buildingName WC_NID_buildingName
1023
+
1024
+ #define NID_dnQualifier WC_NID_dnQualifier
1025
+ #define NID_commonName WC_NID_commonName
1026
+ #define NID_name WC_NID_name
1027
+ #define NID_surname WC_NID_surname
1028
+ #define NID_serialNumber WC_NID_serialNumber
1029
+ #define NID_countryName WC_NID_countryName
1030
+ #define NID_localityName WC_NID_localityName
1031
+ #define NID_stateOrProvinceName WC_NID_stateOrProvinceName
1032
+ #define NID_streetAddress WC_NID_streetAddress
1033
+ #define NID_organizationName WC_NID_organizationName
1034
+ #define NID_organizationalUnitName WC_NID_organizationalUnitName
1035
+ #define NID_jurisdictionCountryName WC_NID_jurisdictionCountryName
1036
+ #define NID_jurisdictionStateOrProvinceName WC_NID_jurisdictionStateOrProvinceName
1037
+ #define NID_businessCategory WC_NID_businessCategory
1038
+ #define NID_domainComponent WC_NID_domainComponent
1039
+ #define NID_postalCode WC_NID_postalCode
1040
+ #define NID_rfc822Mailbox WC_NID_rfc822Mailbox
1041
+ #define NID_favouriteDrink WC_NID_favouriteDrink
1042
+ #define NID_userId WC_NID_userId
1043
+ #define NID_emailAddress WC_NID_emailAddress
1044
+ #define NID_id_on_dnsSRV WC_NID_id_on_dnsSRV
1045
+ #define NID_ms_upn WC_NID_ms_upn
1046
+
1047
+ #define NID_X9_62_prime_field WC_NID_X9_62_prime_field
1048
+
1049
+ #define NID_id_GostR3410_2001 WC_NID_id_GostR3410_2001
1050
+ #define NID_id_GostR3410_2012_256 WC_NID_id_GostR3410_2012_256
1051
+ #define NID_id_GostR3410_2012_512 WC_NID_id_GostR3410_2012_512
1052
+
1053
+ #endif /* !OPENSSL_COEXIST */
1054
+
1055
+ #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
1056
+
1057
+ enum ECC_TYPES
1058
+ {
1059
+ ECC_PREFIX_0 = 160,
1060
+ ECC_PREFIX_1 = 161
1061
+ };
1062
+
1063
+ #ifdef WOLFSSL_CERT_PIV
1064
+ enum PIV_Tags {
1065
+ ASN_PIV_CERT = 0x0A,
1066
+ ASN_PIV_NONCE = 0x0B,
1067
+ ASN_PIV_SIGNED_NONCE = 0x0C,
1068
+
1069
+ ASN_PIV_TAG_CERT = 0x70,
1070
+ ASN_PIV_TAG_CERT_INFO = 0x71,
1071
+ ASN_PIV_TAG_MSCUID = 0x72,
1072
+ ASN_PIV_TAG_ERR_DET = 0xFE,
1073
+
1074
+ /* certificate info masks */
1075
+ ASN_PIV_CERT_INFO_COMPRESSED = 0x03,
1076
+ ASN_PIV_CERT_INFO_ISX509 = 0x04,
1077
+ /* GZIP is 0x01 */
1078
+ ASN_PIV_CERT_INFO_GZIP = 0x01,
1079
+ };
1080
+ #endif /* WOLFSSL_CERT_PIV */
1081
+
1082
+
1083
+ #define ASN_JOI_PREFIX_SZ 10
1084
+ #define ASN_JOI_PREFIX "\x2b\x06\x01\x04\x01\x82\x37\x3c\x02\x01"
1085
+ #define ASN_JOI_C 0x3
1086
+ #define ASN_JOI_ST 0x2
1087
+
1088
+ #ifndef WC_ASN_NAME_MAX
1089
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
1090
+ defined(WOLFSSL_CERT_EXT)
1091
+ #ifdef WOLFSSL_MULTI_ATTRIB
1092
+ #define WC_ASN_NAME_MAX 360
1093
+ #else
1094
+ #define WC_ASN_NAME_MAX 330
1095
+ #endif
1096
+ #else
1097
+ #ifdef WOLFSSL_MULTI_ATTRIB
1098
+ #define WC_ASN_NAME_MAX 330
1099
+ #else
1100
+ #define WC_ASN_NAME_MAX 256
1101
+ #endif
1102
+ #endif
1103
+ #endif
1104
+
1105
+ /* Maximum OID dotted form size. */
1106
+ #define ASN1_OID_DOTTED_MAX_SZ 16
1107
+
1108
+ #ifndef WOLFSSL_ASN_MAX_LENGTH_SZ
1109
+ #define WOLFSSL_ASN_MAX_LENGTH_SZ 5 /* 1 byte length + 4 bytes of number */
1110
+ #endif
1111
+
1112
+ enum Misc_ASN {
1113
+ ASN_BOOL_SIZE = 2, /* including type */
1114
+ ASN_ECC_HEADER_SZ = 2, /* String type + 1 byte len */
1115
+ ASN_ECC_CONTEXT_SZ = 2, /* Content specific type + 1 byte len */
1116
+ #if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
1117
+ KEYID_SIZE = WC_SM3_DIGEST_SIZE,
1118
+ #elif defined(NO_SHA) || (!defined(NO_SHA256) && defined(WC_ASN_HASH_SHA256))
1119
+ KEYID_SIZE = WC_SHA256_DIGEST_SIZE,
1120
+ #else
1121
+ KEYID_SIZE = WC_SHA_DIGEST_SIZE,
1122
+ #endif
1123
+ RSA_INTS = 2 /* RSA ints in private key */
1124
+ #ifndef WOLFSSL_RSA_PUBLIC_ONLY
1125
+ + 3
1126
+ #if defined(WOLFSSL_KEY_GEN) || defined(OPENSSL_EXTRA) || !defined(RSA_LOW_MEM)
1127
+ + 3
1128
+ #endif
1129
+ #endif
1130
+ ,
1131
+ DSA_PARAM_INTS = 3, /* DSA parameter ints */
1132
+ RSA_PUB_INTS = 2, /* RSA ints in public key */
1133
+ MIN_DATE_SIZE = 12,
1134
+ MAX_DATE_SIZE = 32,
1135
+ ASN_GEN_TIME_SZ = 15, /* 7 numbers * 2 + Zulu tag */
1136
+
1137
+ #ifdef WOLFSSL_CERT_GEN
1138
+ #ifdef WOLFSSL_CERT_REQ
1139
+ /* Max encoded cert req attributes length */
1140
+ MAX_ATTRIB_SZ = MAX_SEQ_SZ * 4 + (11 + MAX_SEQ_SZ) * 3 +
1141
+ MAX_PRSTR_SZ * 2 + CTC_NAME_SIZE * 2,
1142
+ /* 11 is the OID size */
1143
+ #endif
1144
+ #if defined(WOLFSSL_ALT_NAMES) || defined(WOLFSSL_CERT_EXT)
1145
+ MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + CTC_MAX_ALT_SIZE,
1146
+ #else
1147
+ MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + MAX_CA_SZ,
1148
+ #endif
1149
+ /* Max total extensions, id + len + others */
1150
+ #endif
1151
+ #ifndef MAX_OID_SZ
1152
+ MAX_OID_SZ = 32, /* Max DER length of OID*/
1153
+ #endif
1154
+ #if defined(WOLFSSL_CERT_EXT) || defined(OPENSSL_EXTRA) || \
1155
+ defined(HAVE_PKCS7) || defined(OPENSSL_EXTRA_X509_SMALL) || \
1156
+ defined(HAVE_OID_DECODING) || defined(HAVE_OID_ENCODING)
1157
+ MAX_OID_STRING_SZ = 64, /* Max string length representation of OID*/
1158
+ #endif
1159
+ #ifdef WOLFSSL_CERT_EXT
1160
+ MAX_KID_SZ = 45, /* Max encoded KID length (SHA-256 case) */
1161
+ MAX_KEYUSAGE_SZ = 18, /* Max encoded Key Usage length */
1162
+ MAX_EXTKEYUSAGE_SZ = 12 + (6 * (8 + 2)) +
1163
+ CTC_MAX_EKU_OID_SZ, /* Max encoded ExtKeyUsage
1164
+ (SEQ/LEN + OBJID + OCTSTR/LEN + SEQ +
1165
+ (6 * (SEQ + OID))) */
1166
+ #ifndef IGNORE_NETSCAPE_CERT_TYPE
1167
+ MAX_NSCERTTYPE_SZ = MAX_SEQ_SZ + 17, /* SEQ + OID + OCTET STR +
1168
+ * NS BIT STR */
1169
+ #endif
1170
+ MAX_CERTPOL_NB = CTC_MAX_CERTPOL_NB,/* Max number of Cert Policy */
1171
+ MAX_CERTPOL_SZ = CTC_MAX_CERTPOL_SZ,
1172
+ #endif
1173
+ OCSP_NONCE_EXT_SZ = 35, /* OCSP Nonce Extension size */
1174
+ MAX_OCSP_EXT_SZ = 58, /* Max OCSP Extension length */
1175
+ MAX_OCSP_NONCE_SZ = 16, /* OCSP Nonce size */
1176
+ TRAILING_ZERO = 1, /* Used for size of zero pad */
1177
+ ASN_TAG_SZ = 1, /* single byte ASN.1 tag */
1178
+ ASN_INDEF_END_SZ = 2, /* 0x00 0x00 at end of indef */
1179
+ MIN_VERSION_SZ = 3, /* Min bytes needed for GetMyVersion */
1180
+ MAX_X509_VERSION = 3, /* Max X509 version allowed */
1181
+ MIN_X509_VERSION = 0, /* Min X509 version allowed */
1182
+ WOLFSSL_X509_V1 = 0,
1183
+ WOLFSSL_X509_V2 = 1,
1184
+ WOLFSSL_X509_V3 = 2,
1185
+ #if defined(OPENSSL_ALL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \
1186
+ defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
1187
+ defined(OPENSSL_EXTRA) || defined(HAVE_PKCS7)
1188
+ MAX_TIME_STRING_SZ = 25, /* Max length of formatted time string */
1189
+ #endif
1190
+
1191
+ PKCS5_SALT_SZ = 8,
1192
+ PKCS5V2_SALT_SZ = 16,
1193
+
1194
+ PEM_LINE_SZ = 64, /* Length of Base64 encoded line, not including new line */
1195
+ PEM_LINE_LEN = PEM_LINE_SZ + 12, /* PEM line max + fudge */
1196
+
1197
+ COUNTRY_CODE_LEN = 2 /* RFC 3739 */
1198
+ };
1199
+
1200
+ #ifndef WC_MAX_NAME_ENTRIES
1201
+ /* entries added to x509 name struct */
1202
+ #ifdef OPENSSL_EXTRA
1203
+ #define WC_MAX_NAME_ENTRIES 16
1204
+ #else
1205
+ #define WC_MAX_NAME_ENTRIES 14
1206
+ #endif
1207
+ #endif
1208
+ #define MAX_NAME_ENTRIES WC_MAX_NAME_ENTRIES
1209
+
1210
+
1211
+ enum Oid_Types {
1212
+ oidHashType = 0,
1213
+ oidSigType = 1,
1214
+ oidKeyType = 2,
1215
+ oidCurveType = 3,
1216
+ oidBlkType = 4,
1217
+ oidOcspType = 5,
1218
+ oidCertExtType = 6,
1219
+ oidCertAuthInfoType = 7,
1220
+ oidCertPolicyType = 8,
1221
+ oidCertAltNameType = 9,
1222
+ oidCertKeyUseType = 10,
1223
+ oidKdfType = 11,
1224
+ oidKeyWrapType = 12,
1225
+ oidCmsKeyAgreeType = 13,
1226
+ oidPBEType = 14,
1227
+ oidHmacType = 15,
1228
+ oidCompressType = 16,
1229
+ oidCertNameType = 17,
1230
+ oidTlsExtType = 18,
1231
+ oidCrlExtType = 19,
1232
+ oidCsrAttrType = 20,
1233
+ #ifdef WOLFSSL_SUBJ_DIR_ATTR
1234
+ oidSubjDirAttrType = 21,
1235
+ #endif
1236
+ oidIgnoreType
1237
+ };
1238
+
1239
+
1240
+ enum VerifyType {
1241
+ NO_VERIFY = 0,
1242
+ VERIFY = 1,
1243
+ VERIFY_CRL = 2,
1244
+ VERIFY_OCSP = 3,
1245
+ VERIFY_NAME = 4,
1246
+ VERIFY_SKIP_DATE = 5,
1247
+ VERIFY_OCSP_CERT = 6
1248
+ };
1249
+
1250
+ #ifdef WOLFSSL_CERT_EXT
1251
+ enum KeyIdType {
1252
+ SKID_TYPE = 0,
1253
+ AKID_TYPE = 1
1254
+ };
1255
+ #endif
1256
+
1257
+ /* Key usage extension bits (based on RFC 5280) */
1258
+ #define KEYUSE_DIGITAL_SIG 0x0080
1259
+ #define KEYUSE_CONTENT_COMMIT 0x0040
1260
+ #define KEYUSE_KEY_ENCIPHER 0x0020
1261
+ #define KEYUSE_DATA_ENCIPHER 0x0010
1262
+ #define KEYUSE_KEY_AGREE 0x0008
1263
+ #define KEYUSE_KEY_CERT_SIGN 0x0004
1264
+ #define KEYUSE_CRL_SIGN 0x0002
1265
+ #define KEYUSE_ENCIPHER_ONLY 0x0001
1266
+ #define KEYUSE_DECIPHER_ONLY 0x8000
1267
+
1268
+ /* Extended Key Usage bits (internal mapping only) */
1269
+ #define EXTKEYUSE_USER 0x80
1270
+ #define EXTKEYUSE_OCSP_SIGN 0x40
1271
+ #define EXTKEYUSE_TIMESTAMP 0x20
1272
+ #define EXTKEYUSE_EMAILPROT 0x10
1273
+ #define EXTKEYUSE_CODESIGN 0x08
1274
+ #define EXTKEYUSE_CLIENT_AUTH 0x04
1275
+ #define EXTKEYUSE_SERVER_AUTH 0x02
1276
+ #define EXTKEYUSE_ANY 0x01
1277
+ #ifdef WOLFSSL_WOLFSSH
1278
+ #define EXTKEYUSE_SSH_CLIENT_AUTH 0x01
1279
+ #define EXTKEYUSE_SSH_MSCL 0x02
1280
+ #define EXTKEYUSE_SSH_KP_CLIENT_AUTH 0x04
1281
+ #endif /* WOLFSSL_WOLFSSH */
1282
+
1283
+ #define WC_NS_SSL_CLIENT 0x80
1284
+ #define WC_NS_SSL_SERVER 0x40
1285
+ #define WC_NS_SMIME 0x20
1286
+ #define WC_NS_OBJSIGN 0x10
1287
+ #define WC_NS_SSL_CA 0x04
1288
+ #define WC_NS_SMIME_CA 0x02
1289
+ #define WC_NS_OBJSIGN_CA 0x01
1290
+
1291
+
1292
+ #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || \
1293
+ defined(WOLFSSL_WPAS_SMALL) || defined(WOLFSSL_IP_ALT_NAME)
1294
+ #ifndef WOLFSSL_MAX_IPSTR
1295
+ #define WOLFSSL_MAX_IPSTR 46 /* max ip size IPv4 mapped IPv6 */
1296
+ #endif
1297
+ #define WOLFSSL_IP4_ADDR_LEN 4
1298
+ #define WOLFSSL_IP6_ADDR_LEN 16
1299
+ #endif /* OPENSSL_ALL || WOLFSSL_IP_ALT_NAME */
1300
+
1301
+ typedef struct DNS_entry DNS_entry;
1302
+
1303
+ struct DNS_entry {
1304
+ DNS_entry* next; /* next on DNS list */
1305
+ int type; /* i.e. ASN_DNS_TYPE */
1306
+ int len; /* actual DNS len */
1307
+ char* name; /* actual DNS name */
1308
+ #ifdef WOLFSSL_IP_ALT_NAME
1309
+ char* ipString; /* human readable form of IP address */
1310
+ #endif
1311
+ #ifdef WOLFSSL_RID_ALT_NAME
1312
+ char* ridString; /* human readable form of registeredID */
1313
+ #endif
1314
+
1315
+ #ifdef WOLFSSL_FPKI
1316
+ int oidSum; /* provide oid sum for verification */
1317
+ #endif
1318
+ };
1319
+
1320
+ #ifdef WOLFSSL_FPKI
1321
+ /* RFC4122 i.e urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6 */
1322
+ #define DEFAULT_UUID_SZ 45
1323
+ #endif
1324
+
1325
+ typedef struct Base_entry Base_entry;
1326
+
1327
+ struct Base_entry {
1328
+ Base_entry* next; /* next on name base list */
1329
+ char* name; /* actual name base */
1330
+ int nameSz; /* name length */
1331
+ byte type; /* Name base type (DNS or RFC822) */
1332
+ };
1333
+
1334
+
1335
+ enum SignatureState {
1336
+ SIG_STATE_BEGIN,
1337
+ SIG_STATE_HASH,
1338
+ SIG_STATE_KEY,
1339
+ SIG_STATE_DO,
1340
+ SIG_STATE_CHECK
1341
+ };
1342
+
1343
+
1344
+ #ifdef HAVE_PK_CALLBACKS
1345
+ #ifdef HAVE_ECC
1346
+ typedef int (*wc_CallbackEccVerify)(
1347
+ const unsigned char* sig, unsigned int sigSz,
1348
+ const unsigned char* hash, unsigned int hashSz,
1349
+ const unsigned char* keyDer, unsigned int keySz,
1350
+ int* result, void* ctx);
1351
+ #endif
1352
+ #ifndef NO_RSA
1353
+ typedef int (*wc_CallbackRsaVerify)(
1354
+ unsigned char* sig, unsigned int sigSz,
1355
+ unsigned char** out,
1356
+ const unsigned char* keyDer, unsigned int keySz,
1357
+ void* ctx);
1358
+ #endif
1359
+ #endif /* HAVE_PK_CALLBACKS */
1360
+
1361
+ #if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_FSPSM_TLS) ||\
1362
+ defined(HAVE_PK_CALLBACKS)
1363
+ typedef struct tagCertAttribute {
1364
+ byte verifyByTSIP_SCE;
1365
+ word32 certBegin;
1366
+ word32 pubkey_n_start;
1367
+ word32 pubkey_n_len;
1368
+ word32 pubkey_e_start;
1369
+ word32 pubkey_e_len;
1370
+ int curve_id;
1371
+ const byte* cert;
1372
+ word32 certSz;
1373
+ const byte* keyIndex;
1374
+ } CertAttribute;
1375
+ #endif
1376
+
1377
+ struct SignatureCtx {
1378
+ void* heap;
1379
+ #ifdef WOLFSSL_NO_MALLOC
1380
+ byte digest[WC_MAX_DIGEST_SIZE];
1381
+ #else
1382
+ byte* digest;
1383
+ #endif
1384
+ #ifndef NO_RSA
1385
+ byte* out;
1386
+ #endif
1387
+ #if !defined(NO_RSA) || !defined(NO_DSA)
1388
+ #ifdef WOLFSSL_NO_MALLOC
1389
+ byte sigCpy[MAX_ENCODED_SIG_SZ];
1390
+ #else
1391
+ byte* sigCpy;
1392
+ #endif
1393
+ #endif
1394
+ #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || \
1395
+ !defined(NO_DSA) || defined(HAVE_DILITHIUM) || defined(HAVE_FALCON) || \
1396
+ defined(HAVE_SPHINCS)
1397
+ int verify;
1398
+ #endif
1399
+ union {
1400
+ #ifndef NO_RSA
1401
+ #ifdef WOLFSSL_NO_MALLOC
1402
+ struct RsaKey rsa[1];
1403
+ #else
1404
+ struct RsaKey* rsa;
1405
+ #endif
1406
+ #endif
1407
+ #ifndef NO_DSA
1408
+ #ifdef WOLFSSL_NO_MALLOC
1409
+ struct DsaKey dsa[1];
1410
+ #else
1411
+ struct DsaKey* dsa;
1412
+ #endif
1413
+ #endif
1414
+ #ifdef HAVE_ECC
1415
+ #ifdef WOLFSSL_NO_MALLOC
1416
+ struct ecc_key ecc[1];
1417
+ #else
1418
+ struct ecc_key* ecc;
1419
+ #endif
1420
+ #endif
1421
+ #ifdef HAVE_ED25519
1422
+ #ifdef WOLFSSL_NO_MALLOC
1423
+ struct ed25519_key ed25519[1];
1424
+ #else
1425
+ struct ed25519_key* ed25519;
1426
+ #endif
1427
+ #endif
1428
+ #ifdef HAVE_ED448
1429
+ #ifdef WOLFSSL_NO_MALLOC
1430
+ struct ed448_key ed448[1];
1431
+ #else
1432
+ struct ed448_key* ed448;
1433
+ #endif
1434
+ #endif
1435
+ #ifdef HAVE_FALCON
1436
+ #ifdef WOLFSSL_NO_MALLOC
1437
+ struct falcon_key falcon[1];
1438
+ #else
1439
+ struct falcon_key* falcon;
1440
+ #endif
1441
+ #endif
1442
+ #ifdef HAVE_DILITHIUM
1443
+ #ifdef WOLFSSL_NO_MALLOC
1444
+ struct dilithium_key dilithium[1];
1445
+ #else
1446
+ struct dilithium_key* dilithium;
1447
+ #endif
1448
+ #endif
1449
+ #ifdef HAVE_SPHINCS
1450
+ #ifdef WOLFSSL_NO_MALLOC
1451
+ struct sphincs_key sphincs[1];
1452
+ #else
1453
+ struct sphincs_key* sphincs;
1454
+ #endif
1455
+ #endif
1456
+ #ifndef WOLFSSL_NO_MALLOC
1457
+ void* ptr;
1458
+ #endif
1459
+ } key;
1460
+ int devId;
1461
+ int state;
1462
+ int typeH;
1463
+ int digestSz;
1464
+ word32 keyOID;
1465
+ #ifdef WOLFSSL_ASYNC_CRYPT
1466
+ WC_ASYNC_DEV* asyncDev;
1467
+ void* asyncCtx;
1468
+ #endif
1469
+
1470
+ #ifdef HAVE_PK_CALLBACKS
1471
+ #ifdef HAVE_ECC
1472
+ wc_CallbackEccVerify pkCbEcc;
1473
+ void* pkCtxEcc;
1474
+ #endif
1475
+ #ifndef NO_RSA
1476
+ wc_CallbackRsaVerify pkCbRsa;
1477
+ void* pkCtxRsa;
1478
+ #endif
1479
+ #endif /* HAVE_PK_CALLBACKS */
1480
+ #ifndef NO_RSA
1481
+ #if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_FSPSM_TLS) ||\
1482
+ defined(HAVE_PK_CALLBACKS)
1483
+ CertAttribute CertAtt;
1484
+ #endif
1485
+ #ifdef WC_RSA_PSS
1486
+ enum wc_HashType hash;
1487
+ int mgf;
1488
+ int saltLen;
1489
+ #endif
1490
+ #endif
1491
+ };
1492
+
1493
+ #define DOMAIN_COMPONENT_MAX 10
1494
+
1495
+ struct DecodedName {
1496
+ char* fullName;
1497
+ int fullNameLen;
1498
+ int entryCount;
1499
+ int cnIdx;
1500
+ int cnLen;
1501
+ int cnNid;
1502
+ int snIdx;
1503
+ int snLen;
1504
+ int snNid;
1505
+ int cIdx;
1506
+ int cLen;
1507
+ int cNid;
1508
+ int lIdx;
1509
+ int lLen;
1510
+ int lNid;
1511
+ int stIdx;
1512
+ int stLen;
1513
+ int stNid;
1514
+ int oIdx;
1515
+ int oLen;
1516
+ int oNid;
1517
+ int ouIdx;
1518
+ int ouLen;
1519
+ #ifdef WOLFSSL_CERT_EXT
1520
+ int bcIdx;
1521
+ int bcLen;
1522
+ int jcIdx;
1523
+ int jcLen;
1524
+ int jsIdx;
1525
+ int jsLen;
1526
+ #endif
1527
+ int ouNid;
1528
+ int emailIdx;
1529
+ int emailLen;
1530
+ int emailNid;
1531
+ int uidIdx;
1532
+ int uidLen;
1533
+ int uidNid;
1534
+ int serialIdx;
1535
+ int serialLen;
1536
+ int serialNid;
1537
+ int dcIdx[DOMAIN_COMPONENT_MAX];
1538
+ int dcLen[DOMAIN_COMPONENT_MAX];
1539
+ int dcNum;
1540
+ int dcMode;
1541
+ };
1542
+
1543
+ /* ASN Encoded Name field */
1544
+ typedef struct EncodedName {
1545
+ int nameLen; /* actual string value length */
1546
+ int totalLen; /* total encoded length */
1547
+ int type; /* type of name */
1548
+ int used; /* are we actually using this one */
1549
+ byte encoded[CTC_NAME_SIZE * 2]; /* encoding */
1550
+ } EncodedName;
1551
+
1552
+ #ifndef WOLFSSL_MAX_PATH_LEN
1553
+ /* RFC 5280 Section 6.1.2. "Initialization" - item (k) defines
1554
+ * (k) max_path_length: this integer is initialized to "n", is
1555
+ * decremented for each non-self-issued certificate in the path,
1556
+ * and may be reduced to the value in the path length constraint
1557
+ * field within the basic constraints extension of a CA
1558
+ * certificate.
1559
+ *
1560
+ * wolfSSL has arbitrarily selected the value 127 for "n" in the above
1561
+ * description. Users can modify the maximum path length by setting
1562
+ * WOLFSSL_MAX_PATH_LEN to a preferred value at build time
1563
+ */
1564
+ #define WOLFSSL_MAX_PATH_LEN 127
1565
+ #endif
1566
+
1567
+ typedef struct DecodedName DecodedName;
1568
+ typedef struct DecodedCert DecodedCert;
1569
+ typedef struct Signer Signer;
1570
+ #ifdef WOLFSSL_TRUST_PEER_CERT
1571
+ typedef struct TrustedPeerCert TrustedPeerCert;
1572
+ #endif /* WOLFSSL_TRUST_PEER_CERT */
1573
+ typedef struct SignatureCtx SignatureCtx;
1574
+
1575
+ #ifdef WC_ASN_UNKNOWN_EXT_CB
1576
+ typedef int (*wc_UnknownExtCallback)(const word16* oid, word32 oidSz, int crit,
1577
+ const unsigned char* der, word32 derSz);
1578
+ typedef int (*wc_UnknownExtCallbackEx)(const word16* oid, word32 oidSz,
1579
+ int crit, const unsigned char* der,
1580
+ word32 derSz, void *ctx);
1581
+ #endif
1582
+
1583
+ struct DecodedCert {
1584
+ const byte* publicKey;
1585
+ word32 pubKeySize;
1586
+ int pubKeyStored;
1587
+ word32 certBegin; /* offset to start of cert */
1588
+ word32 sigIndex; /* offset to start of signature */
1589
+ word32 sigLength; /* length of signature */
1590
+ word32 signatureOID; /* sum of algorithm object id */
1591
+ word32 keyOID; /* sum of key algo object id */
1592
+ #ifdef WC_RSA_PSS
1593
+ word32 sigParamsIndex; /* start of signature parameters */
1594
+ word32 sigParamsLength; /* length of signature parameters */
1595
+ #endif
1596
+ int version; /* cert version, 1 or 3 */
1597
+ DNS_entry* altNames; /* alt names list of dns entries */
1598
+ #ifndef IGNORE_NAME_CONSTRAINTS
1599
+ DNS_entry* altEmailNames; /* alt names list of RFC822 entries */
1600
+ DNS_entry* altDirNames; /* alt names list of DIR entries */
1601
+ Base_entry* permittedNames; /* Permitted name bases */
1602
+ Base_entry* excludedNames; /* Excluded name bases */
1603
+ #endif /* IGNORE_NAME_CONSTRAINTS */
1604
+ byte subjectHash[KEYID_SIZE]; /* hash of all Names */
1605
+ byte issuerHash[KEYID_SIZE]; /* hash of all Names */
1606
+ #ifdef HAVE_OCSP
1607
+ byte subjectKeyHash[KEYID_SIZE]; /* hash of the public Key */
1608
+ byte issuerKeyHash[KEYID_SIZE]; /* hash of the public Key */
1609
+ #endif /* HAVE_OCSP */
1610
+ const byte* signature; /* not owned, points into raw cert */
1611
+ char* subjectCN; /* CommonName */
1612
+ int subjectCNLen; /* CommonName Length */
1613
+ char subjectCNEnc; /* CommonName Encoding */
1614
+ char issuer[WC_ASN_NAME_MAX]; /* full name including common name */
1615
+ char subject[WC_ASN_NAME_MAX];/* full name including common name */
1616
+ int verify; /* Default to yes, but could be off */
1617
+ const byte* source; /* byte buffer holder cert, NOT owner */
1618
+ word32 srcIdx; /* current offset into buffer */
1619
+ word32 maxIdx; /* max offset based on init size */
1620
+ void* heap; /* for user memory overrides */
1621
+ byte serial[EXTERNAL_SERIAL_SIZE]; /* raw serial number */
1622
+ int serialSz; /* raw serial bytes stored */
1623
+ const byte* extensions; /* not owned, points into raw cert */
1624
+ int extensionsSz; /* length of cert extensions */
1625
+ word32 extensionsIdx; /* if want to go back and parse later */
1626
+ const byte* extAuthInfo; /* Authority Information Access URI */
1627
+ int extAuthInfoSz; /* length of the URI */
1628
+ #ifdef WOLFSSL_ASN_CA_ISSUER
1629
+ const byte* extAuthInfoCaIssuer; /* Authority Info Access caIssuer URI */
1630
+ int extAuthInfoCaIssuerSz; /* length of the caIssuer URI */
1631
+ #endif
1632
+ const byte* extCrlInfoRaw; /* Entire CRL Distribution Points
1633
+ * Extension. This is useful when
1634
+ * re-generating the DER. */
1635
+ int extCrlInfoRawSz; /* length of the extension */
1636
+ const byte* extCrlInfo; /* CRL Distribution Points */
1637
+ int extCrlInfoSz; /* length of the URI */
1638
+ byte extSubjKeyId[KEYID_SIZE]; /* Subject Key ID */
1639
+ word32 extSubjKeyIdSz;
1640
+ byte extAuthKeyId[KEYID_SIZE]; /* Authority Key ID */
1641
+ word32 extAuthKeyIdSz;
1642
+ #ifdef WOLFSSL_AKID_NAME
1643
+ const byte* extAuthKeyIdIssuer; /* Authority Key ID authorityCertIssuer */
1644
+ word32 extAuthKeyIdIssuerSz; /* Authority Key ID authorityCertIssuer length */
1645
+ const byte* extAuthKeyIdIssuerSN; /* Authority Key ID authorityCertSerialNumber */
1646
+ word32 extAuthKeyIdIssuerSNSz; /* Authority Key ID authorityCertSerialNumber length */
1647
+ #endif
1648
+ word16 pathLength; /* CA basic constraint path length */
1649
+ word16 maxPathLen; /* max_path_len see RFC 5280 section
1650
+ * 6.1.2 "Initialization" - (k) for
1651
+ * description of max_path_len */
1652
+ byte policyConstSkip; /* Policy Constraints skip certs value */
1653
+ word16 extKeyUsage; /* Key usage bitfield */
1654
+ byte extExtKeyUsage; /* Extended Key usage bitfield */
1655
+ #ifdef WOLFSSL_WOLFSSH
1656
+ byte extExtKeyUsageSsh; /* Extended Key Usage bitfield for SSH */
1657
+ #endif /* WOLFSSL_WOLFSSH */
1658
+
1659
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
1660
+ const byte* extExtKeyUsageSrc;
1661
+ word32 extExtKeyUsageSz;
1662
+ word32 extExtKeyUsageCount;
1663
+ #ifdef WOLFSSL_AKID_NAME
1664
+ const byte* extRawAuthKeyIdSrc;
1665
+ word32 extRawAuthKeyIdSz;
1666
+ #endif
1667
+ const byte* extAuthKeyIdSrc;
1668
+ const byte* extSubjKeyIdSrc;
1669
+ #endif
1670
+ #ifdef OPENSSL_ALL
1671
+ const byte* extSubjAltNameSrc;
1672
+ word32 extSubjAltNameSz;
1673
+ #endif
1674
+ #ifdef WOLFSSL_SUBJ_DIR_ATTR
1675
+ char countryOfCitizenship[COUNTRY_CODE_LEN+1]; /* ISO 3166 Country Code */
1676
+ #ifdef OPENSSL_ALL
1677
+ const byte* extSubjDirAttrSrc;
1678
+ word32 extSubjDirAttrSz;
1679
+ #endif
1680
+ #endif /* WOLFSSL_SUBJ_DIR_ATTR */
1681
+ #ifdef WOLFSSL_SUBJ_INFO_ACC
1682
+ const byte* extSubjInfoAccCaRepo;
1683
+ word32 extSubjInfoAccCaRepoSz;
1684
+ #ifdef OPENSSL_ALL
1685
+ const byte* extSubjInfoAccSrc;
1686
+ word32 extSubjInfoAccSz;
1687
+ #endif
1688
+ #endif /* WOLFSSL_SUBJ_INFO_ACC */
1689
+
1690
+ #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || \
1691
+ defined(HAVE_DILITHIUM) || defined(HAVE_FALCON) || defined(HAVE_SPHINCS)
1692
+ word32 pkCurveOID; /* Public Key's curve OID */
1693
+ #ifdef WOLFSSL_CUSTOM_CURVES
1694
+ int pkCurveSize; /* Public Key's curve size */
1695
+ #endif
1696
+ #endif /* HAVE_ECC || HAVE_ED25519 || HAVE_ED448 || HAVE_DILITHIUM ||
1697
+ * HAVE_FALCON || HAVE_SPHINCS */
1698
+ const byte* beforeDate;
1699
+ int beforeDateLen;
1700
+ const byte* afterDate;
1701
+ int afterDateLen;
1702
+ #if defined(HAVE_PKCS7) || defined(WOLFSSL_CERT_EXT)
1703
+ const byte* issuerRaw; /* pointer to issuer inside source */
1704
+ int issuerRawLen;
1705
+ #endif
1706
+ #if !defined(IGNORE_NAME_CONSTRAINTS) || defined(WOLFSSL_CERT_EXT)
1707
+ const byte* subjectRaw; /* pointer to subject inside source */
1708
+ int subjectRawLen;
1709
+ #endif
1710
+ #if !defined(IGNORE_NAME_CONSTRAINTS) || \
1711
+ defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
1712
+ char* subjectEmail;
1713
+ int subjectEmailLen;
1714
+ #endif
1715
+ #if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
1716
+ /* easy access to subject info for other sign */
1717
+ char* subjectSN;
1718
+ int subjectSNLen;
1719
+ char subjectSNEnc;
1720
+ #ifdef WOLFSSL_CERT_NAME_ALL
1721
+ char* subjectN;
1722
+ int subjectNLen;
1723
+ char subjectNEnc;
1724
+ char* subjectI;
1725
+ int subjectILen;
1726
+ char subjectIEnc;
1727
+ char* subjectGN;
1728
+ int subjectGNLen;
1729
+ char subjectGNEnc;
1730
+ char* subjectDNQ;
1731
+ int subjectDNQLen;
1732
+ char subjectDNQEnc;
1733
+ #endif /* WOLFSSL_CERT_NAME_ALL */
1734
+ char* subjectC;
1735
+ int subjectCLen;
1736
+ char subjectCEnc;
1737
+ char* subjectL;
1738
+ int subjectLLen;
1739
+ char subjectLEnc;
1740
+ char* subjectST;
1741
+ int subjectSTLen;
1742
+ char subjectSTEnc;
1743
+ char* subjectO;
1744
+ int subjectOLen;
1745
+ char subjectOEnc;
1746
+ char* subjectOU;
1747
+ int subjectOULen;
1748
+ char subjectOUEnc;
1749
+ char* subjectSND;
1750
+ int subjectSNDLen;
1751
+ char subjectSNDEnc;
1752
+ char* subjectUID;
1753
+ int subjectUIDLen;
1754
+ char subjectUIDEnc;
1755
+ char* subjectStreet;
1756
+ int subjectStreetLen;
1757
+ char subjectStreetEnc;
1758
+ char* subjectBC;
1759
+ int subjectBCLen;
1760
+ char subjectBCEnc;
1761
+ char* subjectJC;
1762
+ int subjectJCLen;
1763
+ char subjectJCEnc;
1764
+ char* subjectJS;
1765
+ int subjectJSLen;
1766
+ char subjectJSEnc;
1767
+ char* subjectPC;
1768
+ int subjectPCLen;
1769
+ char subjectPCEnc;
1770
+ #if defined(WOLFSSL_HAVE_ISSUER_NAMES)
1771
+ char* issuerCN;
1772
+ int issuerCNLen;
1773
+ char issuerCNEnc;
1774
+ char* issuerSN;
1775
+ int issuerSNLen;
1776
+ char issuerSNEnc;
1777
+ char* issuerC;
1778
+ int issuerCLen;
1779
+ char issuerCEnc;
1780
+ char* issuerL;
1781
+ int issuerLLen;
1782
+ char issuerLEnc;
1783
+ char* issuerST;
1784
+ int issuerSTLen;
1785
+ char issuerSTEnc;
1786
+ char* issuerO;
1787
+ int issuerOLen;
1788
+ char issuerOEnc;
1789
+ char* issuerOU;
1790
+ int issuerOULen;
1791
+ char issuerOUEnc;
1792
+ char* issuerSND;
1793
+ int issuerSNDLen;
1794
+ char issuerSNDEnc;
1795
+ char* issuerEmail;
1796
+ int issuerEmailLen;
1797
+ #endif /* WOLFSSL_HAVE_ISSUER_NAMES */
1798
+ #endif /* WOLFSSL_CERT_GEN || WOLFSSL_CERT_EXT */
1799
+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
1800
+ /* WOLFSSL_X509_NAME structures (used void* to avoid including ssl.h) */
1801
+ void* issuerName;
1802
+ void* subjectName;
1803
+ #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
1804
+ #ifdef WOLFSSL_SEP
1805
+ int deviceTypeSz;
1806
+ byte* deviceType;
1807
+ int hwTypeSz;
1808
+ byte* hwType;
1809
+ int hwSerialNumSz;
1810
+ byte* hwSerialNum;
1811
+ #endif /* WOLFSSL_SEP */
1812
+ #ifdef WOLFSSL_CERT_EXT
1813
+ char extCertPolicies[MAX_CERTPOL_NB][MAX_CERTPOL_SZ];
1814
+ int extCertPoliciesNb;
1815
+ #endif /* WOLFSSL_CERT_EXT */
1816
+ #ifndef IGNORE_NETSCAPE_CERT_TYPE
1817
+ byte nsCertType;
1818
+ #endif
1819
+
1820
+ #ifdef WOLFSSL_CERT_REQ
1821
+ /* CSR attributes */
1822
+ char* contentType; /* Content Type */
1823
+ int contentTypeLen;
1824
+ char* cPwd; /* Challenge Password */
1825
+ int cPwdLen;
1826
+ char* sNum; /* Serial Number */
1827
+ int sNumLen;
1828
+ char* dnQualifier;
1829
+ int dnQualifierLen;
1830
+ char* initials;
1831
+ int initialsLen;
1832
+ char* surname;
1833
+ int surnameLen;
1834
+ char* givenName;
1835
+ int givenNameLen;
1836
+ char* unstructuredName;
1837
+ int unstructuredNameLen;
1838
+ #endif /* WOLFSSL_CERT_REQ */
1839
+
1840
+ Signer* ca;
1841
+ #ifndef NO_CERTS
1842
+ SignatureCtx sigCtx;
1843
+ #endif
1844
+ #if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_FSPSM_TLS)
1845
+ byte* sce_tsip_encRsaKeyIdx;
1846
+ #endif
1847
+ #ifdef WOLFSSL_MAXQ10XX_TLS
1848
+ word32 publicKeyIndex; /* offset to start of public key */
1849
+ #endif
1850
+
1851
+ int badDate;
1852
+ int criticalExt;
1853
+
1854
+ /* Option Bits */
1855
+ WC_BITFIELD subjectCNStored:1; /* have we saved a copy we own */
1856
+ WC_BITFIELD extSubjKeyIdSet:1; /* Set when the SKID was read from cert */
1857
+ WC_BITFIELD extAuthKeyIdSet:1; /* Set when the AKID was read from cert */
1858
+ #ifndef IGNORE_NAME_CONSTRAINTS
1859
+ WC_BITFIELD extNameConstraintSet:1;
1860
+ #endif
1861
+ WC_BITFIELD isCA:1; /* CA basic constraint true */
1862
+ WC_BITFIELD pathLengthSet:1; /* CA basic const path length set */
1863
+ WC_BITFIELD weOwnAltNames:1; /* altNames haven't been given to copy */
1864
+ WC_BITFIELD extKeyUsageSet:1;
1865
+ WC_BITFIELD extExtKeyUsageSet:1; /* Extended Key Usage set */
1866
+ #ifdef HAVE_OCSP
1867
+ WC_BITFIELD ocspNoCheckSet:1; /* id-pkix-ocsp-nocheck set */
1868
+ #endif
1869
+ WC_BITFIELD extCRLdistSet:1;
1870
+ WC_BITFIELD extAuthInfoSet:1;
1871
+ WC_BITFIELD extBasicConstSet:1;
1872
+ WC_BITFIELD extPolicyConstSet:1;
1873
+ WC_BITFIELD extPolicyConstRxpSet:1; /* requireExplicitPolicy set */
1874
+ WC_BITFIELD extPolicyConstIpmSet:1; /* inhibitPolicyMapping set */
1875
+ WC_BITFIELD extSubjAltNameSet:1;
1876
+ WC_BITFIELD inhibitAnyOidSet:1;
1877
+ WC_BITFIELD selfSigned:1; /* Indicates subject and issuer are same */
1878
+ #ifdef WOLFSSL_SEP
1879
+ WC_BITFIELD extCertPolicySet:1;
1880
+ #endif
1881
+ WC_BITFIELD extCRLdistCrit:1;
1882
+ WC_BITFIELD extAuthInfoCrit:1;
1883
+ WC_BITFIELD extBasicConstCrit:1;
1884
+ WC_BITFIELD extPolicyConstCrit:1;
1885
+ WC_BITFIELD extSubjAltNameCrit:1;
1886
+ WC_BITFIELD extAuthKeyIdCrit:1;
1887
+ #ifndef IGNORE_NAME_CONSTRAINTS
1888
+ WC_BITFIELD extNameConstraintCrit:1;
1889
+ #endif
1890
+ WC_BITFIELD extSubjKeyIdCrit:1;
1891
+ WC_BITFIELD extKeyUsageCrit:1;
1892
+ WC_BITFIELD extExtKeyUsageCrit:1;
1893
+ #ifdef WOLFSSL_SUBJ_DIR_ATTR
1894
+ WC_BITFIELD extSubjDirAttrSet:1;
1895
+ #endif
1896
+ #ifdef WOLFSSL_SUBJ_INFO_ACC
1897
+ WC_BITFIELD extSubjInfoAccSet:1;
1898
+ #endif
1899
+ #ifdef WOLFSSL_SEP
1900
+ WC_BITFIELD extCertPolicyCrit:1;
1901
+ #endif
1902
+ #ifdef WOLFSSL_CERT_REQ
1903
+ WC_BITFIELD isCSR:1; /* Do we intend on parsing a CSR? */
1904
+ #endif
1905
+ #ifdef HAVE_RPK
1906
+ WC_BITFIELD isRPK:1; /* indicate the cert is Raw-Public-Key cert in RFC7250 */
1907
+ #endif
1908
+ #ifdef WC_ASN_UNKNOWN_EXT_CB
1909
+ wc_UnknownExtCallback unknownExtCallback;
1910
+ wc_UnknownExtCallbackEx unknownExtCallbackEx;
1911
+ void *unknownExtCallbackExCtx;
1912
+ #endif
1913
+ #ifdef WOLFSSL_DUAL_ALG_CERTS
1914
+ /* Subject Alternative Public Key Info */
1915
+ byte *sapkiDer;
1916
+ int sapkiLen;
1917
+ word32 sapkiOID;
1918
+ /* Alternative Signature Algorithm */
1919
+ byte *altSigAlgDer;
1920
+ int altSigAlgLen;
1921
+ word32 altSigAlgOID;
1922
+ /* Alternative Signature Value */
1923
+ byte *altSigValDer;
1924
+ int altSigValLen;
1925
+
1926
+ WC_BITFIELD extSapkiSet:1;
1927
+ WC_BITFIELD extAltSigAlgSet:1;
1928
+ WC_BITFIELD extAltSigValSet:1;
1929
+ WC_BITFIELD extSapkiCrit:1;
1930
+ WC_BITFIELD extAltSigAlgCrit:1;
1931
+ WC_BITFIELD extAltSigValCrit:1;
1932
+ #endif /* WOLFSSL_DUAL_ALG_CERTS */
1933
+ };
1934
+
1935
+ #if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
1936
+ #define SIGNER_DIGEST_SIZE WC_SM3_DIGEST_SIZE
1937
+ #elif defined(NO_SHA)
1938
+ #define SIGNER_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
1939
+ #else
1940
+ #define SIGNER_DIGEST_SIZE WC_SHA_DIGEST_SIZE
1941
+ #endif
1942
+
1943
+ /* CA Signers */
1944
+ /* if change layout change PERSIST_CERT_CACHE functions too */
1945
+ struct Signer {
1946
+ word32 pubKeySize;
1947
+ word32 keyOID; /* key type */
1948
+ word16 keyUsage;
1949
+ word16 maxPathLen;
1950
+ WC_BITFIELD selfSigned:1;
1951
+ const byte* publicKey;
1952
+ int nameLen;
1953
+ char* name; /* common name */
1954
+ #ifndef IGNORE_NAME_CONSTRAINTS
1955
+ Base_entry* permittedNames;
1956
+ Base_entry* excludedNames;
1957
+ #endif /* !IGNORE_NAME_CONSTRAINTS */
1958
+ byte subjectNameHash[SIGNER_DIGEST_SIZE];
1959
+ /* sha hash of names in certificate */
1960
+ #if defined(HAVE_OCSP) || defined(HAVE_CRL)
1961
+ byte issuerNameHash[SIGNER_DIGEST_SIZE];
1962
+ /* sha hash of issuer names in certificate.
1963
+ * Used in OCSP to check for authorized
1964
+ * responders. */
1965
+ #endif
1966
+ #ifndef NO_SKID
1967
+ byte subjectKeyIdHash[SIGNER_DIGEST_SIZE];
1968
+ /* sha hash of key in certificate */
1969
+ #endif
1970
+ #ifdef HAVE_OCSP
1971
+ byte subjectKeyHash[KEYID_SIZE];
1972
+ #endif
1973
+ #if defined(WOLFSSL_AKID_NAME) || defined(HAVE_CRL)
1974
+ byte serialHash[SIGNER_DIGEST_SIZE]; /* serial number hash */
1975
+ #endif
1976
+ #ifdef WOLFSSL_SIGNER_DER_CERT
1977
+ DerBuffer* derCert;
1978
+ #endif
1979
+ #if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_FSPSM_TLS)
1980
+ word32 cm_idx;
1981
+ #endif
1982
+ #ifdef WOLFSSL_DUAL_ALG_CERTS
1983
+ word32 sapkiOID; /* key type */
1984
+ byte* sapkiDer;
1985
+ int sapkiLen;
1986
+ #endif /* WOLFSSL_DUAL_ALG_CERTS */
1987
+ byte type;
1988
+
1989
+ Signer* next;
1990
+ };
1991
+
1992
+
1993
+ #ifdef WOLFSSL_TRUST_PEER_CERT
1994
+ /* used for having trusted peer certs rather then CA */
1995
+ struct TrustedPeerCert {
1996
+ int nameLen;
1997
+ char* name; /* common name */
1998
+ #ifndef IGNORE_NAME_CONSTRAINTS
1999
+ Base_entry* permittedNames;
2000
+ Base_entry* excludedNames;
2001
+ #endif /* IGNORE_NAME_CONSTRAINTS */
2002
+ byte subjectNameHash[SIGNER_DIGEST_SIZE];
2003
+ /* sha hash of names in certificate */
2004
+ #ifndef WOLFSSL_NO_ISSUERHASH_TDPEER
2005
+ byte issuerHash[SIGNER_DIGEST_SIZE];
2006
+ /* sha hash of issuer name in certificate */
2007
+ #endif
2008
+ #ifndef NO_SKID
2009
+ byte subjectKeyIdHash[SIGNER_DIGEST_SIZE];
2010
+ /* sha hash of SKID in certificate */
2011
+ #endif
2012
+ word32 sigLen;
2013
+ byte* sig;
2014
+ struct TrustedPeerCert* next;
2015
+ };
2016
+ #endif /* WOLFSSL_TRUST_PEER_CERT */
2017
+
2018
+
2019
+ /* for testing or custom openssl wrappers */
2020
+ #if defined(WOLFSSL_TEST_CERT) || defined(OPENSSL_EXTRA) || \
2021
+ defined(OPENSSL_EXTRA_X509_SMALL) || defined(WOLFSSL_PUBLIC_ASN)
2022
+ #define WOLFSSL_ASN_API WOLFSSL_API
2023
+ #else
2024
+ #define WOLFSSL_ASN_API WOLFSSL_LOCAL
2025
+ #endif
2026
+
2027
+ #ifdef HAVE_SMIME
2028
+ #define MIME_HEADER_ASCII_MIN 33
2029
+ #define MIME_HEADER_ASCII_MAX 126
2030
+
2031
+ typedef struct MimeParam MimeParam;
2032
+ typedef struct MimeHdr MimeHdr;
2033
+
2034
+ struct MimeParam
2035
+ {
2036
+ MimeParam* next;
2037
+ char* attribute;
2038
+ char* value;
2039
+ };
2040
+
2041
+ struct MimeHdr
2042
+ {
2043
+ MimeHdr* next;
2044
+ MimeParam* params;
2045
+ char* name;
2046
+ char* body;
2047
+ };
2048
+
2049
+ typedef enum MimeTypes
2050
+ {
2051
+ MIME_HDR,
2052
+ MIME_PARAM
2053
+ } MimeTypes;
2054
+
2055
+ typedef enum MimeStatus
2056
+ {
2057
+ MIME_NAMEATTR,
2058
+ MIME_BODYVAL
2059
+ } MimeStatus;
2060
+ #endif /* HAVE_SMIME */
2061
+
2062
+ WOLFSSL_LOCAL int HashIdAlg(word32 oidSum);
2063
+ WOLFSSL_LOCAL int CalcHashId(const byte* data, word32 len, byte* hash);
2064
+ WOLFSSL_LOCAL int CalcHashId_ex(const byte* data, word32 len, byte* hash,
2065
+ int hashAlg);
2066
+ WOLFSSL_LOCAL int GetHashId(const byte* id, int length, byte* hash,
2067
+ int hashAlg);
2068
+ WOLFSSL_LOCAL int GetName(DecodedCert* cert, int nameType, int maxIdx);
2069
+
2070
+ #ifdef ASN_BER_TO_DER
2071
+ WOLFSSL_API int wc_BerToDer(const byte* ber, word32 berSz, byte* der,
2072
+ word32* derSz);
2073
+ #endif
2074
+ WOLFSSL_LOCAL int StreamOctetString(const byte* inBuf, word32 inBufSz,
2075
+ byte* out, word32* outSz, word32* idx);
2076
+
2077
+ #ifdef WOLFSSL_API_PREFIX_MAP
2078
+ #define FreeAltNames wc_FreeAltNames
2079
+ #define AltNameNew wc_AltNameNew
2080
+ #define AltNameDup wc_AltNameDup
2081
+ #ifndef IGNORE_NAME_CONSTRAINTS
2082
+ #define FreeNameSubtrees wc_FreeNameSubtrees
2083
+ #endif
2084
+ #define InitDecodedCert wc_AsnApi_InitDecodedCert
2085
+ #define FreeDecodedCert wc_AsnApi_FreeDecodedCert
2086
+ #define ParseCert wc_AsnApi_ParseCert
2087
+ #define AddSignature wc_AddSignature
2088
+ #define ToTraditional wc_ToTraditional
2089
+ #define ToTraditional_ex wc_ToTraditional_ex
2090
+ #define UnTraditionalEnc wc_UnTraditionalEnc
2091
+ #define TraditionalEnc_ex wc_TraditionalEnc_ex
2092
+ #define TraditionalEnc wc_TraditionalEnc
2093
+ #define SetName wc_SetName
2094
+ #define GetShortInt wc_GetShortInt
2095
+ #define SetShortInt wc_SetShortInt
2096
+ #define GetLength wc_GetLength
2097
+ #define GetASNInt wc_GetASNInt
2098
+ #define GetASNTag wc_GetASNTag
2099
+ #define SetAlgoID wc_SetAlgoID
2100
+ #define SetAsymKeyDer wc_SetAsymKeyDer
2101
+ #endif /* WOLFSSL_API_PREFIX_MAP */
2102
+
2103
+ WOLFSSL_ASN_API void FreeAltNames(DNS_entry* altNames, void* heap);
2104
+ WOLFSSL_ASN_API DNS_entry* AltNameNew(void* heap);
2105
+ WOLFSSL_ASN_API DNS_entry* AltNameDup(DNS_entry* from, void* heap);
2106
+ #ifndef IGNORE_NAME_CONSTRAINTS
2107
+ WOLFSSL_ASN_API void FreeNameSubtrees(Base_entry* names, void* heap);
2108
+ #endif /* IGNORE_NAME_CONSTRAINTS */
2109
+ WOLFSSL_ASN_API void InitDecodedCert(DecodedCert* cert, const byte* source,
2110
+ word32 inSz, void* heap);
2111
+ WOLFSSL_LOCAL void InitDecodedCert_ex(DecodedCert* cert, const byte* source,
2112
+ word32 inSz, void* heap, int devId);
2113
+ WOLFSSL_ASN_API void FreeDecodedCert(DecodedCert* cert);
2114
+ WOLFSSL_ASN_API int ParseCert(DecodedCert* cert, int type, int verify,
2115
+ void* cm);
2116
+
2117
+ #ifdef WC_ASN_UNKNOWN_EXT_CB
2118
+ WOLFSSL_API int wc_SetUnknownExtCallback(DecodedCert* cert,
2119
+ wc_UnknownExtCallback cb);
2120
+ WOLFSSL_API int wc_SetUnknownExtCallbackEx(DecodedCert* cert,
2121
+ wc_UnknownExtCallbackEx cb,
2122
+ void *ctx);
2123
+ #endif
2124
+
2125
+ WOLFSSL_LOCAL int DecodePolicyOID(char *out, word32 outSz, const byte *in,
2126
+ word32 inSz);
2127
+ WOLFSSL_LOCAL int EncodePolicyOID(byte *out, word32 *outSz,
2128
+ const char *in, void* heap);
2129
+ WOLFSSL_LOCAL int DecodeExtensionType(const byte* input, word32 length,
2130
+ word32 oid, byte critical,
2131
+ DecodedCert* cert, int *isUnknownExt);
2132
+ WOLFSSL_LOCAL int CheckCertSignaturePubKey(const byte* cert, word32 certSz,
2133
+ void* heap, const byte* pubKey, word32 pubKeySz, int pubKeyOID);
2134
+ #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_SMALL_CERT_VERIFY)
2135
+ WOLFSSL_API int wc_CheckCertSignature(const byte* cert, word32 certSz,
2136
+ void* heap, void* cm);
2137
+ /* Deprecated public API name kept for backwards build compatibility */
2138
+ #define CheckCertSignature(cert, certSz, heap, cm) \
2139
+ wc_CheckCertSignature(cert, certSz, heap, cm)
2140
+
2141
+ WOLFSSL_API int wc_CheckCertSigPubKey(const byte* cert, word32 certSz,
2142
+ void* heap, const byte* pubKey,
2143
+ word32 pubKeySz, int pubKeyOID);
2144
+ #endif /* OPENSSL_EXTRA || WOLFSSL_SMALL_CERT_VERIFY */
2145
+
2146
+ #if (defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT) || \
2147
+ (defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)))
2148
+ WOLFSSL_LOCAL int wc_CertGetPubKey(const byte* cert, word32 certSz,
2149
+ const unsigned char** pubKey, word32* pubKeySz);
2150
+ #endif
2151
+ WOLFSSL_LOCAL int ConfirmSignature(SignatureCtx* sigCtx,
2152
+ const byte* buf, word32 bufSz,
2153
+ const byte* key, word32 keySz, word32 keyOID,
2154
+ const byte* sig, word32 sigSz, word32 sigOID,
2155
+ const byte* sigParams, word32 sigParamsSz,
2156
+ byte* rsaKeyIdx);
2157
+ #ifdef WOLFSSL_CERT_REQ
2158
+ WOLFSSL_LOCAL int CheckCSRSignaturePubKey(const byte* cert, word32 certSz,
2159
+ void* heap, const byte* pubKey, word32 pubKeySz, int pubKeyOID);
2160
+ #endif /* WOLFSSL_CERT_REQ */
2161
+ WOLFSSL_ASN_API int AddSignature(byte* buf, int bodySz, const byte* sig, int sigSz,
2162
+ int sigAlgoType);
2163
+ WOLFSSL_LOCAL int ParseCertRelative(DecodedCert* cert, int type, int verify,
2164
+ void* cm, Signer *extraCa);
2165
+ WOLFSSL_LOCAL int DecodeToKey(DecodedCert* cert, int verify);
2166
+ #ifdef WOLFSSL_ASN_TEMPLATE
2167
+ WOLFSSL_LOCAL int DecodeCert(DecodedCert* cert, int verify, int* criticalExt);
2168
+ #endif
2169
+
2170
+ WOLFSSL_LOCAL int DecodeBasicCaConstraint(const byte* input, int sz,
2171
+ byte *isCa, word16 *pathLength, byte *pathLengthSet);
2172
+
2173
+ WOLFSSL_LOCAL int DecodeSubjKeyId(const byte* input, word32 sz,
2174
+ const byte **extSubjKeyId, word32 *extSubjKeyIdSz);
2175
+
2176
+ WOLFSSL_LOCAL int DecodeAuthKeyId(const byte* input, word32 sz,
2177
+ const byte **extAuthKeyId, word32 *extAuthKeyIdSz,
2178
+ const byte **extAuthKeyIdIssuer, word32 *extAuthKeyIdIssuerSz,
2179
+ const byte **extAuthKeyIdIssuerSN, word32 *extAuthKeyIdIssuerSNSz);
2180
+
2181
+ WOLFSSL_LOCAL int DecodeKeyUsage(const byte* input, word32 sz,
2182
+ word16 *extKeyUsage);
2183
+
2184
+ WOLFSSL_LOCAL int DecodeExtKeyUsage(const byte* input, word32 sz,
2185
+ const byte **extExtKeyUsageSrc, word32 *extExtKeyUsageSz,
2186
+ word32 *extExtKeyUsageCount, byte *extExtKeyUsage,
2187
+ byte *extExtKeyUsageSsh);
2188
+
2189
+ WOLFSSL_LOCAL int TryDecodeRPKToKey(DecodedCert* cert);
2190
+ WOLFSSL_LOCAL int wc_GetPubX509(DecodedCert* cert, int verify, int* badDate);
2191
+
2192
+ WOLFSSL_LOCAL const byte* OidFromId(word32 id, word32 type, word32* oidSz);
2193
+ WOLFSSL_LOCAL Signer* findSignerByKeyHash(Signer *list, byte *hash);
2194
+ WOLFSSL_LOCAL Signer* findSignerByName(Signer *list, byte *hash);
2195
+ WOLFSSL_LOCAL int FillSigner(Signer* signer, DecodedCert* cert, int type, DerBuffer *der);
2196
+ WOLFSSL_LOCAL Signer* MakeSigner(void* heap);
2197
+ WOLFSSL_LOCAL void FreeSigner(Signer* signer, void* heap);
2198
+ WOLFSSL_LOCAL void FreeSignerTable(Signer** table, int rows, void* heap);
2199
+ WOLFSSL_LOCAL void FreeSignerTableType(Signer** table, int rows, byte type,
2200
+ void* heap);
2201
+ #ifdef WOLFSSL_TRUST_PEER_CERT
2202
+ WOLFSSL_LOCAL void FreeTrustedPeer(TrustedPeerCert* tp, void* heap);
2203
+ WOLFSSL_LOCAL void FreeTrustedPeerTable(TrustedPeerCert** table, int rows,
2204
+ void* heap);
2205
+ #endif /* WOLFSSL_TRUST_PEER_CERT */
2206
+
2207
+ WOLFSSL_ASN_API int ToTraditional(byte* input, word32 sz);
2208
+ WOLFSSL_ASN_API int ToTraditional_ex(byte* input, word32 sz, word32* algId);
2209
+ WOLFSSL_LOCAL int ToTraditionalInline(const byte* input, word32* inOutIdx,
2210
+ word32 sz);
2211
+ WOLFSSL_LOCAL int ToTraditionalInline_ex(const byte* input, word32* inOutIdx,
2212
+ word32 sz, word32* algId);
2213
+ WOLFSSL_LOCAL int ToTraditionalInline_ex2(const byte* input, word32* inOutIdx,
2214
+ word32 sz, word32* algId,
2215
+ word32* eccOid);
2216
+ WOLFSSL_LOCAL int ToTraditionalEnc(byte* input, word32 sz, const char* password,
2217
+ int passwordSz, word32* algId);
2218
+ WOLFSSL_ASN_API int UnTraditionalEnc(byte* key, word32 keySz, byte* out,
2219
+ word32* outSz, const char* password, int passwordSz, int vPKCS,
2220
+ int vAlgo, byte* salt, word32 saltSz, int itt, WC_RNG* rng, void* heap);
2221
+ WOLFSSL_ASN_API int TraditionalEnc_ex(byte* key, word32 keySz, byte* out,
2222
+ word32* outSz, const char* password, int passwordSz, int vPKCS,
2223
+ int vAlgo, int encAlgId, byte* salt, word32 saltSz, int itt,
2224
+ int hmacOid, WC_RNG* rng, void* heap);
2225
+ WOLFSSL_ASN_API int TraditionalEnc(byte* key, word32 keySz, byte* out,
2226
+ word32* outSz, const char* password, int passwordSz, int vPKCS,
2227
+ int vAlgo, int encAlgId, byte* salt, word32 saltSz, int itt,
2228
+ WC_RNG* rng, void* heap);
2229
+ WOLFSSL_LOCAL int DecryptContent(byte* input, word32 sz, const char* password, int passwordSz);
2230
+ WOLFSSL_LOCAL int EncryptContent(byte* input, word32 sz, byte* out, word32* outSz,
2231
+ const char* password,int passwordSz, int vPKCS, int vAlgo, int encAlgId,
2232
+ byte* salt, word32 saltSz, int itt, int hmacOid, WC_RNG* rng,
2233
+ void* heap);
2234
+ WOLFSSL_LOCAL int wc_GetKeyOID(byte* key, word32 keySz, const byte** curveOID,
2235
+ word32* oidSz, int* algoID, void* heap);
2236
+
2237
+ typedef struct tm wolfssl_tm;
2238
+ #ifdef WOLFSSL_ASN_TIME_STRING
2239
+ WOLFSSL_LOCAL int GetTimeString(byte* date, int format, char* buf, int len);
2240
+ #endif
2241
+ #if !defined(NO_ASN_TIME) && !defined(USER_TIME) && \
2242
+ !defined(TIME_OVERRIDES) && (defined(OPENSSL_EXTRA) || defined(HAVE_PKCS7))
2243
+ WOLFSSL_LOCAL int GetFormattedTime(void* currTime, byte* buf, word32 len);
2244
+ WOLFSSL_LOCAL int GetAsnTimeString(void* currTime, byte* buf, word32 len);
2245
+ #endif
2246
+ WOLFSSL_LOCAL int ExtractDate(const unsigned char* date, unsigned char format,
2247
+ wolfssl_tm* certTime, int* idx);
2248
+ WOLFSSL_LOCAL int DateGreaterThan(const struct tm* a, const struct tm* b);
2249
+ WOLFSSL_LOCAL int wc_ValidateDate(const byte* date, byte format, int dateType);
2250
+ WOLFSSL_TEST_VIS int wc_AsnSetSkipDateCheck(int skip_p);
2251
+ WOLFSSL_LOCAL int wc_AsnGetSkipDateCheck(void);
2252
+
2253
+ /* ASN.1 helper functions */
2254
+ #ifdef WOLFSSL_CERT_GEN
2255
+ WOLFSSL_LOCAL int SetNameEx(byte* output, word32 outputSz, CertName* name, void* heap);
2256
+ WOLFSSL_ASN_API int SetName(byte* output, word32 outputSz, CertName* name);
2257
+ WOLFSSL_LOCAL const char* GetOneCertName(CertName* name, int idx);
2258
+ WOLFSSL_LOCAL byte GetCertNameId(int idx);
2259
+ #endif
2260
+ WOLFSSL_TEST_VIS int GetShortInt(const byte* input, word32* inOutIdx,
2261
+ int* number, word32 maxIdx);
2262
+ WOLFSSL_TEST_VIS int SetShortInt(byte* output, word32* inOutIdx, word32 number,
2263
+ word32 maxIdx);
2264
+
2265
+ WOLFSSL_LOCAL const char* GetSigName(int oid);
2266
+ WOLFSSL_ASN_API int GetLength(const byte* input, word32* inOutIdx, int* len,
2267
+ word32 maxIdx);
2268
+ WOLFSSL_LOCAL int GetLength_ex(const byte* input, word32* inOutIdx, int* len,
2269
+ word32 maxIdx, int check);
2270
+ WOLFSSL_LOCAL int GetASNHeader(const byte* input, byte tag, word32* inOutIdx,
2271
+ int* len, word32 maxIdx);
2272
+ WOLFSSL_LOCAL int GetSequence(const byte* input, word32* inOutIdx, int* len,
2273
+ word32 maxIdx);
2274
+ WOLFSSL_LOCAL int GetSequence_ex(const byte* input, word32* inOutIdx, int* len,
2275
+ word32 maxIdx, int check);
2276
+ WOLFSSL_TEST_VIS int wc_IndexSequenceOf(byte const * seqOf, word32 seqOfSz,
2277
+ size_t seqIndex, byte const ** out, word32 * outSz);
2278
+ WOLFSSL_LOCAL int GetOctetString(const byte* input, word32* inOutIdx, int* len,
2279
+ word32 maxIdx);
2280
+ WOLFSSL_LOCAL int CheckBitString(const byte* input, word32* inOutIdx, int* len,
2281
+ word32 maxIdx, int zeroBits, byte* unusedBits);
2282
+ WOLFSSL_LOCAL int GetSet(const byte* input, word32* inOutIdx, int* len,
2283
+ word32 maxIdx);
2284
+ WOLFSSL_LOCAL int GetSet_ex(const byte* input, word32* inOutIdx, int* len,
2285
+ word32 maxIdx, int check);
2286
+ WOLFSSL_LOCAL int GetMyVersion(const byte* input, word32* inOutIdx,
2287
+ int* version, word32 maxIdx);
2288
+ WOLFSSL_LOCAL int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
2289
+ word32 maxIdx);
2290
+ WOLFSSL_ASN_API int GetASNInt(const byte* input, word32* inOutIdx, int* len,
2291
+ word32 maxIdx);
2292
+
2293
+ WOLFSSL_LOCAL word32 wc_oid_sum(const byte* input, int length);
2294
+
2295
+ #ifdef HAVE_OID_ENCODING
2296
+ WOLFSSL_API int wc_EncodeObjectId(const word16* in, word32 inSz,
2297
+ byte* out, word32* outSz);
2298
+ WOLFSSL_LOCAL int EncodeObjectId(const word16* in, word32 inSz,
2299
+ byte* out, word32* outSz);
2300
+ #endif
2301
+ #if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT) || \
2302
+ defined(OPENSSL_ALL)
2303
+ WOLFSSL_LOCAL int DecodeObjectId(const byte* in, word32 inSz,
2304
+ word16* out, word32* outSz);
2305
+ #endif
2306
+ WOLFSSL_LOCAL int GetASNObjectId(const byte* input, word32* inOutIdx, int* len,
2307
+ word32 maxIdx);
2308
+ WOLFSSL_LOCAL int SetObjectId(int len, byte* output);
2309
+ WOLFSSL_LOCAL int GetObjectId(const byte* input, word32* inOutIdx, word32* oid,
2310
+ word32 oidType, word32 maxIdx);
2311
+ WOLFSSL_LOCAL int GetAlgoId(const byte* input, word32* inOutIdx, word32* oid,
2312
+ word32 oidType, word32 maxIdx);
2313
+ WOLFSSL_LOCAL int GetAlgoIdEx(const byte* input, word32* inOutIdx, word32* oid,
2314
+ word32 oidType, word32 maxIdx, byte *absentParams);
2315
+ WOLFSSL_ASN_API int GetASNTag(const byte* input, word32* inOutIdx, byte* tag,
2316
+ word32 maxIdx);
2317
+ WOLFSSL_LOCAL int GetASN_BitString(const byte* input, word32 idx, int length);
2318
+
2319
+ WOLFSSL_LOCAL word32 SetASNLength(word32 length, byte* output);
2320
+ WOLFSSL_LOCAL word32 SetASNSequence(word32 len, byte* output);
2321
+ WOLFSSL_LOCAL word32 SetASNOctetString(word32 len, byte* output);
2322
+ WOLFSSL_LOCAL word32 SetASNImplicit(byte tag,byte number, word32 len,
2323
+ byte* output);
2324
+ WOLFSSL_LOCAL word32 SetASNExplicit(byte number, word32 len, byte* output);
2325
+ WOLFSSL_LOCAL word32 SetASNSet(word32 len, byte* output);
2326
+
2327
+ WOLFSSL_LOCAL word32 SetLength(word32 length, byte* output);
2328
+ WOLFSSL_LOCAL word32 SetLengthEx(word32 length, byte* output, byte isIndef);
2329
+ WOLFSSL_LOCAL word32 SetHeader(byte tag, word32 len, byte* output,
2330
+ byte isIndef);
2331
+ WOLFSSL_LOCAL word32 SetSequence(word32 len, byte* output);
2332
+ WOLFSSL_LOCAL word32 SetSequenceEx(word32 len, byte* output, byte isIndef);
2333
+ WOLFSSL_LOCAL word32 SetIndefEnd(byte* output);
2334
+ WOLFSSL_LOCAL word32 SetOctetString(word32 len, byte* output);
2335
+ WOLFSSL_LOCAL word32 SetOctetStringEx(word32 len, byte* output, byte indef);
2336
+ WOLFSSL_LOCAL int SetASNInt(int len, byte firstByte, byte* output);
2337
+ WOLFSSL_LOCAL word32 SetBitString(word32 len, byte unusedBits, byte* output);
2338
+ WOLFSSL_LOCAL word32 SetImplicit(byte tag,byte number,word32 len,byte* output,
2339
+ byte isIndef);
2340
+ WOLFSSL_LOCAL word32 SetExplicit(byte number, word32 len, byte* output,
2341
+ byte isIndef);
2342
+ WOLFSSL_LOCAL word32 SetSet(word32 len, byte* output);
2343
+ WOLFSSL_API word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz);
2344
+ WOLFSSL_LOCAL word32 SetAlgoIDEx(int algoOID, byte* output, int type, int curveSz,
2345
+ byte absentParams);
2346
+ WOLFSSL_LOCAL int SetMyVersion(word32 version, byte* output, int header);
2347
+ WOLFSSL_LOCAL int SetSerialNumber(const byte* sn, word32 snSz, byte* output,
2348
+ word32 outputSz, int maxSnSz);
2349
+ /* name is of type WOLFSSL_ASN1_OTHERNAME; use void* to avoid including ssl.h */
2350
+ WOLFSSL_LOCAL word32 SetOthername(void *name, byte *output);
2351
+
2352
+ #ifndef WOLFSSL_ASN_TEMPLATE
2353
+ WOLFSSL_LOCAL int wc_GetSerialNumber(const byte* input, word32* inOutIdx,
2354
+ byte* serial, int* serialSz, word32 maxIdx);
2355
+ #endif
2356
+ WOLFSSL_LOCAL int GetNameHash(const byte* source, word32* idx, byte* hash,
2357
+ int maxIdx);
2358
+ WOLFSSL_LOCAL int GetNameHash_ex(const byte* source, word32* idx, byte* hash,
2359
+ int maxIdx, word32 sigOID);
2360
+ WOLFSSL_LOCAL int wc_CheckPrivateKeyCert(const byte* key, word32 keySz,
2361
+ DecodedCert* der, int checkAlt,
2362
+ void* heap);
2363
+ WOLFSSL_LOCAL int wc_CheckPrivateKey(const byte* privKey, word32 privKeySz,
2364
+ const byte* pubKey, word32 pubKeySz,
2365
+ enum Key_Sum ks, void* heap);
2366
+ WOLFSSL_LOCAL int StoreDHparams(byte* out, word32* outLen, mp_int* p, mp_int* g);
2367
+ #ifdef WOLFSSL_DH_EXTRA
2368
+ WOLFSSL_API int wc_DhPublicKeyDecode(const byte* input, word32* inOutIdx,
2369
+ DhKey* key, word32 inSz);
2370
+ #endif
2371
+ WOLFSSL_LOCAL int FlattenAltNames(byte* output, word32 outputSz,
2372
+ const DNS_entry* names);
2373
+
2374
+ WOLFSSL_LOCAL int wc_EncodeName(EncodedName* name, const char* nameStr,
2375
+ char nameType, byte type);
2376
+ WOLFSSL_LOCAL int wc_EncodeNameCanonical(EncodedName* name, const char* nameStr,
2377
+ char nameType, byte type);
2378
+
2379
+ #if defined(HAVE_ECC) || !defined(NO_DSA)
2380
+ /* ASN sig helpers */
2381
+ WOLFSSL_LOCAL int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r,
2382
+ mp_int* s);
2383
+ WOLFSSL_LOCAL int StoreECC_DSA_Sig_Bin(byte* out, word32* outLen,
2384
+ const byte* r, word32 rLen, const byte* s, word32 sLen);
2385
+ WOLFSSL_LOCAL int DecodeECC_DSA_Sig_Bin(const byte* sig, word32 sigLen,
2386
+ byte* r, word32* rLen, byte* s, word32* sLen);
2387
+ WOLFSSL_LOCAL int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen,
2388
+ mp_int* r, mp_int* s);
2389
+ WOLFSSL_LOCAL int DecodeECC_DSA_Sig_Ex(const byte* sig, word32 sigLen,
2390
+ mp_int* r, mp_int* s, int init);
2391
+ #endif
2392
+ #ifndef NO_DSA
2393
+ WOLFSSL_LOCAL int StoreDSAParams(byte*, word32*, const mp_int*, const mp_int*,
2394
+ const mp_int*);
2395
+ #endif
2396
+
2397
+ WOLFSSL_LOCAL void InitSignatureCtx(SignatureCtx* sigCtx, void* heap, int devId);
2398
+ WOLFSSL_LOCAL void FreeSignatureCtx(SignatureCtx* sigCtx);
2399
+
2400
+ #ifdef WC_ENABLE_ASYM_KEY_EXPORT
2401
+ WOLFSSL_LOCAL int SetAsymKeyDerPublic(const byte* pubKey, word32 pubKeyLen,
2402
+ byte* output, word32 outLen, int keyType, int withHeader);
2403
+ #endif /* WC_ENABLE_ASYM_KEY_EXPORT */
2404
+ #ifdef WC_ENABLE_ASYM_KEY_IMPORT
2405
+ WOLFSSL_LOCAL int DecodeAsymKeyPublic_Assign(const byte* input,
2406
+ word32* inOutIdx, word32 inSz, const byte** pubKey, word32* pubKeyLen,
2407
+ int* keyType);
2408
+
2409
+ WOLFSSL_LOCAL int DecodeAsymKeyPublic(const byte* input, word32* inOutIdx,
2410
+ word32 inSz, byte* pubKey, word32* pubKeyLen, int keyType);
2411
+ #endif /* WC_ENABLE_ASYM_KEY_IMPORT */
2412
+
2413
+ #ifndef NO_CERTS
2414
+
2415
+ WOLFSSL_LOCAL int wc_EncryptedInfoParse(EncryptedInfo* info,
2416
+ const char** pBuffer, size_t bufSz);
2417
+
2418
+ WOLFSSL_LOCAL int PemToDer(const unsigned char* buff, long longSz, int type,
2419
+ DerBuffer** pDer, void* heap, EncryptedInfo* info,
2420
+ int* keyFormat);
2421
+ WOLFSSL_LOCAL int AllocDer(DerBuffer** der, word32 length, int type,
2422
+ void* heap);
2423
+ WOLFSSL_LOCAL int AllocCopyDer(DerBuffer** der, const unsigned char* buff,
2424
+ word32 length, int type, void* heap);
2425
+ WOLFSSL_LOCAL void FreeDer(DerBuffer** der);
2426
+
2427
+ #ifdef WOLFSSL_ASN_PARSE_KEYUSAGE
2428
+ WOLFSSL_LOCAL int ParseKeyUsageStr(const char* value, word16* keyUsage,
2429
+ void* heap);
2430
+ WOLFSSL_LOCAL int ParseExtKeyUsageStr(const char* value, byte* extKeyUsage,
2431
+ void* heap);
2432
+ #endif
2433
+
2434
+ #endif /* !NO_CERTS */
2435
+
2436
+ #ifdef HAVE_SMIME
2437
+ WOLFSSL_LOCAL int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** hdrs);
2438
+ WOLFSSL_LOCAL int wc_MIME_header_strip(char* in, char** out, size_t start, size_t end);
2439
+ WOLFSSL_LOCAL MimeHdr* wc_MIME_find_header_name(const char* name, MimeHdr* hdr);
2440
+ WOLFSSL_LOCAL MimeParam* wc_MIME_find_param_attr(const char* attribute, MimeParam* param);
2441
+ WOLFSSL_LOCAL char* wc_MIME_single_canonicalize(const char* line, word32* len);
2442
+ WOLFSSL_LOCAL int wc_MIME_free_hdrs(MimeHdr* head);
2443
+ #endif /* HAVE_SMIME */
2444
+
2445
+ #ifdef WOLFSSL_CERT_GEN
2446
+
2447
+ enum cert_enums {
2448
+ RSA_KEY = 10,
2449
+ ECC_KEY = 12,
2450
+ ED25519_KEY = 13,
2451
+ ED448_KEY = 14,
2452
+ DSA_KEY = 15,
2453
+ FALCON_LEVEL1_KEY = 16,
2454
+ FALCON_LEVEL5_KEY = 17,
2455
+ DILITHIUM_LEVEL2_KEY = 18,
2456
+ DILITHIUM_LEVEL3_KEY = 19,
2457
+ DILITHIUM_LEVEL5_KEY = 20,
2458
+ ML_DSA_LEVEL2_KEY = 21,
2459
+ ML_DSA_LEVEL3_KEY = 22,
2460
+ ML_DSA_LEVEL5_KEY = 23,
2461
+ SPHINCS_FAST_LEVEL1_KEY = 24,
2462
+ SPHINCS_FAST_LEVEL3_KEY = 25,
2463
+ SPHINCS_FAST_LEVEL5_KEY = 26,
2464
+ SPHINCS_SMALL_LEVEL1_KEY = 27,
2465
+ SPHINCS_SMALL_LEVEL3_KEY = 28,
2466
+ SPHINCS_SMALL_LEVEL5_KEY = 29
2467
+ };
2468
+
2469
+ #endif /* WOLFSSL_CERT_GEN */
2470
+
2471
+
2472
+
2473
+ /* for pointer use */
2474
+ typedef struct CertStatus CertStatus;
2475
+
2476
+ #ifdef HAVE_OCSP
2477
+
2478
+ enum Ocsp_Response_Status {
2479
+ OCSP_SUCCESSFUL = 0, /* Response has valid confirmations */
2480
+ OCSP_MALFORMED_REQUEST = 1, /* Illegal confirmation request */
2481
+ OCSP_INTERNAL_ERROR = 2, /* Internal error in issuer */
2482
+ OCSP_TRY_LATER = 3, /* Try again later */
2483
+ OCSP_SIG_REQUIRED = 5, /* Must sign the request (4 is skipped) */
2484
+ OCSP_UNAUTHORIZED = 6 /* Request unauthorized */
2485
+ };
2486
+
2487
+
2488
+ enum Ocsp_Cert_Status {
2489
+ CERT_GOOD = 0,
2490
+ CERT_REVOKED = 1,
2491
+ CERT_UNKNOWN = 2
2492
+ };
2493
+
2494
+
2495
+ #ifdef OPENSSL_EXTRA
2496
+ enum Ocsp_Verify_Error {
2497
+ OCSP_VERIFY_ERROR_NONE = 0,
2498
+ OCSP_BAD_ISSUER = 1
2499
+ };
2500
+ #endif
2501
+
2502
+
2503
+ typedef struct OcspRequest OcspRequest;
2504
+ typedef struct OcspResponse OcspResponse;
2505
+
2506
+
2507
+ struct CertStatus {
2508
+ CertStatus* next;
2509
+
2510
+ byte serial[EXTERNAL_SERIAL_SIZE];
2511
+ int serialSz;
2512
+ #ifdef OPENSSL_EXTRA
2513
+ WOLFSSL_ASN1_INTEGER* serialInt;
2514
+ #endif
2515
+
2516
+ int status;
2517
+
2518
+ byte thisDate[MAX_DATE_SIZE];
2519
+ byte nextDate[MAX_DATE_SIZE];
2520
+ byte thisDateFormat;
2521
+ byte nextDateFormat;
2522
+ #ifdef WOLFSSL_OCSP_PARSE_STATUS
2523
+ WOLFSSL_ASN1_TIME thisDateParsed;
2524
+ WOLFSSL_ASN1_TIME nextDateParsed;
2525
+ byte* thisDateAsn;
2526
+ byte* nextDateAsn;
2527
+ #endif
2528
+
2529
+ byte* rawOcspResponse;
2530
+ word32 rawOcspResponseSz;
2531
+ };
2532
+
2533
+ typedef struct OcspEntry OcspEntry;
2534
+
2535
+ #if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
2536
+ #define OCSP_DIGEST WC_HASH_TYPE_SM3
2537
+ #elif defined(NO_SHA)
2538
+ #define OCSP_DIGEST WC_HASH_TYPE_SHA256
2539
+ #else
2540
+ #define OCSP_DIGEST WC_HASH_TYPE_SHA
2541
+ #endif
2542
+
2543
+ #if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
2544
+ #define OCSP_DIGEST_SIZE WC_SM3_DIGEST_SIZE
2545
+ #elif defined(NO_SHA)
2546
+ #define OCSP_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
2547
+ #else
2548
+ #define OCSP_DIGEST_SIZE WC_SHA_DIGEST_SIZE
2549
+ #endif
2550
+
2551
+ struct OcspEntry
2552
+ {
2553
+ OcspEntry *next; /* next entry */
2554
+ word32 hashAlgoOID; /* hash algo ID */
2555
+ byte issuerHash[OCSP_DIGEST_SIZE]; /* issuer hash */
2556
+ byte issuerKeyHash[OCSP_DIGEST_SIZE]; /* issuer public key hash */
2557
+ CertStatus *status; /* OCSP response list */
2558
+ int totalStatus; /* number on list */
2559
+ byte* rawCertId; /* raw bytes of the CertID */
2560
+ int rawCertIdSize; /* num bytes in raw CertID */
2561
+ /* option bits - using 32-bit for alignment */
2562
+ WC_BITFIELD ownStatus:1; /* do we need to free the status
2563
+ * response list */
2564
+ WC_BITFIELD isDynamic:1; /* was dynamically allocated */
2565
+ WC_BITFIELD used:1; /* entry used */
2566
+ };
2567
+
2568
+ #define OCSP_RESPONDER_ID_KEY_SZ 20
2569
+ #if !defined(NO_SHA)
2570
+ #define OCSP_RESPONDER_ID_HASH_TYPE WC_SHA
2571
+ #else
2572
+ #define OCSP_RESPONDER_ID_HASH_TYPE WC_SHA256
2573
+ #endif
2574
+ enum responderIdType {
2575
+ OCSP_RESPONDER_ID_INVALID = 0,
2576
+ OCSP_RESPONDER_ID_NAME = 1,
2577
+ OCSP_RESPONDER_ID_KEY = 2,
2578
+ };
2579
+ /* TODO: Long-term, it would be helpful if we made this struct and other OCSP
2580
+ structs conform to the ASN spec as described in RFC 6960. It will help
2581
+ with readability and with implementing OpenSSL compatibility API
2582
+ functions, because OpenSSL's OCSP data structures conform to the
2583
+ RFC. */
2584
+ struct OcspResponse {
2585
+ int responseStatus; /* return code from Responder */
2586
+
2587
+ byte* response; /* Pointer to beginning of OCSP Response */
2588
+ word32 responseSz; /* length of the OCSP Response */
2589
+
2590
+ enum responderIdType responderIdType;
2591
+ union {
2592
+ byte keyHash[OCSP_RESPONDER_ID_KEY_SZ];
2593
+ byte nameHash[KEYID_SIZE];
2594
+ } responderId ;
2595
+
2596
+ byte producedDate[MAX_DATE_SIZE];
2597
+ /* Date at which this response was signed */
2598
+ byte producedDateFormat; /* format of the producedDate */
2599
+
2600
+ byte* cert;
2601
+ word32 certSz;
2602
+
2603
+ byte* sig; /* Pointer to sig in source */
2604
+ word32 sigSz; /* Length in octets for the sig */
2605
+ word32 sigOID; /* OID for hash used for sig */
2606
+
2607
+ byte* sigParams;
2608
+ word32 sigParamsSz;
2609
+
2610
+ OcspEntry* single; /* chain of OCSP single responses */
2611
+
2612
+ byte* nonce; /* pointer to nonce inside ASN.1 response */
2613
+ int nonceSz; /* length of the nonce string */
2614
+
2615
+ byte* source; /* pointer to source buffer, not owned */
2616
+ word32 maxIdx; /* max offset based on init size */
2617
+ Signer* pendingCAs;
2618
+ void* heap;
2619
+ };
2620
+
2621
+
2622
+ struct OcspRequest {
2623
+ byte issuerHash[KEYID_SIZE];
2624
+ byte issuerKeyHash[KEYID_SIZE];
2625
+ #if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
2626
+ int hashSz;
2627
+ #endif
2628
+ byte* serial; /* copy of the serial number in source cert */
2629
+ int serialSz;
2630
+ #ifdef OPENSSL_EXTRA
2631
+ WOLFSSL_ASN1_INTEGER* serialInt;
2632
+ void* cid; /* WOLFSSL_OCSP_CERTID kept to free */
2633
+ #endif
2634
+ byte* url; /* copy of the extAuthInfo in source cert */
2635
+ int urlSz;
2636
+
2637
+ byte nonce[MAX_OCSP_NONCE_SZ];
2638
+ int nonceSz;
2639
+ void* heap;
2640
+ void* ssl;
2641
+ };
2642
+
2643
+ WOLFSSL_LOCAL void InitOcspResponse(OcspResponse* resp, OcspEntry* single,
2644
+ CertStatus* status, byte* source, word32 inSz, void* heap);
2645
+ WOLFSSL_LOCAL void FreeOcspResponse(OcspResponse* resp);
2646
+ WOLFSSL_LOCAL int OcspResponseDecode(OcspResponse* resp, void* cm, void* heap,
2647
+ int noVerifyCert, int noVerifySignature);
2648
+
2649
+ WOLFSSL_LOCAL int InitOcspRequest(OcspRequest* req, DecodedCert* cert,
2650
+ byte useNonce, void* heap);
2651
+ WOLFSSL_LOCAL void FreeOcspRequest(OcspRequest* req);
2652
+ WOLFSSL_LOCAL int EncodeOcspRequest(OcspRequest* req, byte* output,
2653
+ word32 size);
2654
+ WOLFSSL_LOCAL word32 EncodeOcspRequestExtensions(OcspRequest* req, byte* output,
2655
+ word32 size);
2656
+
2657
+
2658
+ WOLFSSL_LOCAL int CompareOcspReqResp(OcspRequest* req, OcspResponse* resp);
2659
+ WOLFSSL_LOCAL int OcspDecodeCertID(const byte* input, word32* inOutIdx, word32 inSz,
2660
+ OcspEntry* entry);
2661
+
2662
+ #endif /* HAVE_OCSP */
2663
+
2664
+
2665
+ /* for pointer use */
2666
+ typedef struct RevokedCert RevokedCert;
2667
+
2668
+ #ifdef HAVE_CRL
2669
+
2670
+ struct RevokedCert {
2671
+ byte serialNumber[EXTERNAL_SERIAL_SIZE];
2672
+ int serialSz;
2673
+ RevokedCert* next;
2674
+ byte revDate[MAX_DATE_SIZE];
2675
+ byte revDateFormat;
2676
+ };
2677
+
2678
+ #ifndef CRL_MAX_NUM_SZ
2679
+ #define CRL_MAX_NUM_SZ 20 /* RFC5280 states that CRL number can be up to 20 */
2680
+ #endif /* octets long */
2681
+
2682
+
2683
+ typedef struct DecodedCRL DecodedCRL;
2684
+
2685
+ struct DecodedCRL {
2686
+ word32 certBegin; /* offset to start of cert */
2687
+ word32 sigIndex; /* offset to start of signature */
2688
+ word32 sigLength; /* length of signature */
2689
+ word32 signatureOID; /* sum of algorithm object id */
2690
+ #ifdef WC_RSA_PSS
2691
+ word32 sigParamsIndex; /* start of signature parameters */
2692
+ word32 sigParamsLength; /* length of signature parameters */
2693
+ #endif
2694
+ byte* signature; /* pointer into raw source, not owned */
2695
+ byte crlNumber[CRL_MAX_NUM_SZ]; /* CRL number extension */
2696
+ byte issuerHash[SIGNER_DIGEST_SIZE]; /* issuer name hash */
2697
+ byte crlHash[SIGNER_DIGEST_SIZE]; /* raw crl data hash */
2698
+ byte lastDate[MAX_DATE_SIZE]; /* last date updated */
2699
+ byte nextDate[MAX_DATE_SIZE]; /* next update date */
2700
+ byte lastDateFormat; /* format of last date */
2701
+ byte nextDateFormat; /* format of next date */
2702
+ RevokedCert* certs; /* revoked cert list */
2703
+ #if defined(OPENSSL_EXTRA)
2704
+ byte* issuer; /* full name including common name */
2705
+ word32 issuerSz; /* length of the issuer */
2706
+ #endif
2707
+ int totalCerts; /* number on list */
2708
+ int version; /* version of cert */
2709
+ void* heap;
2710
+ #ifndef NO_SKID
2711
+ byte extAuthKeyId[SIGNER_DIGEST_SIZE]; /* Authority Key ID */
2712
+ WC_BITFIELD extAuthKeyIdSet:1; /* Auth key identifier set indicator */
2713
+ #endif
2714
+ WC_BITFIELD crlNumberSet:1; /* CRL number set indicator */
2715
+ };
2716
+
2717
+ WOLFSSL_LOCAL void InitDecodedCRL(DecodedCRL* dcrl, void* heap);
2718
+ WOLFSSL_LOCAL int VerifyCRL_Signature(SignatureCtx* sigCtx,
2719
+ const byte* toBeSigned, word32 tbsSz,
2720
+ const byte* signature, word32 sigSz,
2721
+ word32 signatureOID, const byte* sigParams,
2722
+ int sigParamsSz, Signer *ca, void* heap);
2723
+ WOLFSSL_LOCAL int ParseCRL(RevokedCert* rcert, DecodedCRL* dcrl,
2724
+ const byte* buff, word32 sz, int verify, void* cm);
2725
+ WOLFSSL_LOCAL void FreeDecodedCRL(DecodedCRL* dcrl);
2726
+
2727
+ #endif /* HAVE_CRL */
2728
+
2729
+ #if defined(WOLFSSL_ACERT)
2730
+ /* Minimal structure for x509 attribute certificate (rfc 5755).
2731
+ *
2732
+ * The attributes field is not parsed, but is stored as raw buffer.
2733
+ * */
2734
+ struct DecodedAcert {
2735
+ word32 certBegin; /* Offset to start of acert. */
2736
+ word32 sigIndex; /* Offset to start of signature. */
2737
+ word32 sigLength; /* Signature length. */
2738
+ word32 signatureOID; /* Sum of algorithm object id. */
2739
+ #ifdef WC_RSA_PSS
2740
+ word32 sigParamsIndex; /* start of signature parameters */
2741
+ word32 sigParamsLength; /* length of signature parameters */
2742
+ #endif
2743
+ const byte * signature; /* Not owned, points into raw acert. */
2744
+ const byte * source; /* Byte buffer holding acert, NOT owned. */
2745
+ word32 srcIdx; /* Current offset into buffer. */
2746
+ word32 maxIdx; /* Max allowed offset. Set in init. */
2747
+ void * heap; /* For user memory overrides. */
2748
+ int version; /* attribute cert version. */
2749
+ byte serial[EXTERNAL_SERIAL_SIZE]; /* Raw serial number. */
2750
+ int serialSz;
2751
+ const byte * beforeDate; /* Before and After dates. */
2752
+ int beforeDateLen;
2753
+ const byte * afterDate;
2754
+ int afterDateLen;
2755
+ byte holderSerial[EXTERNAL_SERIAL_SIZE];
2756
+ int holderSerialSz;
2757
+ DNS_entry * holderEntityName; /* Holder entityName from ACERT */
2758
+ DNS_entry * holderIssuerName; /* Holder issuerName from ACERT */
2759
+ DNS_entry * AttCertIssuerName; /* AttCertIssuer name from ACERT */
2760
+ const byte * rawAttr; /* Not owned, points into raw acert. */
2761
+ word32 rawAttrLen;
2762
+ SignatureCtx sigCtx;
2763
+ };
2764
+
2765
+ typedef struct DecodedAcert DecodedAcert;
2766
+
2767
+ WOLFSSL_LOCAL void InitDecodedAcert(DecodedAcert* acert,
2768
+ const byte* source, word32 inSz,
2769
+ void* heap);
2770
+ WOLFSSL_LOCAL void FreeDecodedAcert(DecodedAcert * acert);
2771
+ WOLFSSL_LOCAL int ParseX509Acert(DecodedAcert* cert, int verify);
2772
+ WOLFSSL_LOCAL int VerifyX509Acert(const byte* cert, word32 certSz,
2773
+ const byte* pubKey, word32 pubKeySz,
2774
+ int pubKeyOID, void * heap);
2775
+ #endif /* WOLFSSL_ACERT */
2776
+
2777
+
2778
+ #if ((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT)) \
2779
+ || (defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_IMPORT)) \
2780
+ || (defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)) \
2781
+ || (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)) \
2782
+ || defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || defined(HAVE_SPHINCS))
2783
+ WOLFSSL_LOCAL int DecodeAsymKey_Assign(const byte* input, word32* inOutIdx,
2784
+ word32 inSz, const byte** seed, word32* seedLen, const byte** privKey,
2785
+ word32* privKeyLen, const byte** pubKey, word32* pubKeyLen,
2786
+ int* inOutKeyType);
2787
+
2788
+ WOLFSSL_LOCAL int DecodeAsymKey(const byte* input, word32* inOutIdx,
2789
+ word32 inSz, byte* privKey, word32* privKeyLen, byte* pubKey,
2790
+ word32* pubKeyLen, int keyType);
2791
+ #endif
2792
+
2793
+ #ifdef WC_ENABLE_ASYM_KEY_EXPORT
2794
+ WOLFSSL_TEST_VIS int SetAsymKeyDer(const byte* privKey, word32 privKeyLen,
2795
+ const byte* pubKey, word32 pubKeyLen, byte* output, word32 outLen,
2796
+ int keyType);
2797
+ #endif
2798
+
2799
+ #endif /* !NO_ASN */
2800
+
2801
+ #if !defined(NO_ASN) || !defined(NO_PWDBASED)
2802
+
2803
+ #ifndef PKCS_MAX_KEY_SIZE
2804
+ #define PKCS_MAX_KEY_SIZE 64 /* MAX PKCS Key length */
2805
+ #endif
2806
+ #if !defined(WOLFSSL_GAME_BUILD) && !defined(MAX_KEY_SIZE)
2807
+ /* for backwards compatibility */
2808
+ #define MAX_KEY_SIZE PKCS_MAX_KEY_SIZE
2809
+ #endif
2810
+ #ifndef MAX_UNICODE_SZ
2811
+ #define MAX_UNICODE_SZ 256
2812
+ #endif
2813
+
2814
+ enum PBESTypes {
2815
+ PBE_MD5_DES = 0,
2816
+ PBE_SHA1_RC4_128 = 1,
2817
+ PBE_SHA1_DES = 2,
2818
+ PBE_SHA1_DES3 = 3,
2819
+ PBE_AES256_CBC = 4,
2820
+ PBE_AES128_CBC = 5,
2821
+ PBE_SHA1_40RC2_CBC = 6,
2822
+
2823
+ PBE_SHA1_RC4_128_SUM = 657,
2824
+ PBE_SHA1_DES3_SUM = 659,
2825
+ PBE_SHA1_40RC2_CBC_SUM = 662,
2826
+ PBE_MD5_DES_SUM = 651,
2827
+ PBE_SHA1_DES_SUM = 658,
2828
+ PBES2_SUM = 661,
2829
+
2830
+ PBES2 = 13, /* algo ID */
2831
+ PBES1_MD5_DES = 3,
2832
+ PBES1_SHA1_DES = 10,
2833
+
2834
+ PBE_NONE = 999
2835
+ };
2836
+
2837
+ enum PKCSTypes {
2838
+ PKCS5v2 = 6, /* PKCS #5 v2.0 */
2839
+ PKCS12v1 = 12, /* PKCS #12 */
2840
+ PKCS5 = 5, /* PKCS oid tag */
2841
+ PKCS8v0 = 0, /* default PKCS#8 version */
2842
+ PKCS8v1 = 1, /* PKCS#8 version including public key */
2843
+ PKCS1v0 = 0, /* default PKCS#1 version */
2844
+ PKCS1v1 = 1 /* Multi-prime version */
2845
+ };
2846
+
2847
+ #endif /* !NO_ASN || !NO_PWDBASED */
2848
+
2849
+ #ifdef __cplusplus
2850
+ } /* extern "C" */
2851
+ #endif
2852
+
2853
+ #endif /* !NO_ASN || !NO_PWDBASED */
2854
+
2855
+ #endif /* WOLF_CRYPT_ASN_H */