@fails-components/webtransport 0.0.1 → 0.0.2

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 (300) hide show
  1. package/package.json +1 -1
  2. package/readme.md +1 -3
  3. package/src/http3eventloop.cc +83 -9
  4. package/src/http3eventloop.h +13 -3
  5. package/src/http3server.cc +22 -22
  6. package/src/http3server.h +7 -20
  7. package/src/http3wtstreamvisitor.cc +31 -10
  8. package/src/http3wtstreamvisitor.h +38 -11
  9. package/src/webtransport.js +91 -23
  10. package/test/echoserver.js +29 -5
  11. package/test/testsuite.js +242 -220
  12. package/third_party/boringssl/src/CMakeLists.txt +2 -0
  13. package/third_party/boringssl/src/crypto/CMakeLists.txt +1 -0
  14. package/third_party/boringssl/src/crypto/asn1/a_bitstr.c +174 -177
  15. package/third_party/boringssl/src/crypto/asn1/a_bool.c +46 -48
  16. package/third_party/boringssl/src/crypto/asn1/a_d2i_fp.c +21 -23
  17. package/third_party/boringssl/src/crypto/asn1/a_dup.c +21 -23
  18. package/third_party/boringssl/src/crypto/asn1/a_gentm.c +84 -187
  19. package/third_party/boringssl/src/crypto/asn1/a_i2d_fp.c +19 -21
  20. package/third_party/boringssl/src/crypto/asn1/a_int.c +305 -329
  21. package/third_party/boringssl/src/crypto/asn1/a_mbstr.c +190 -195
  22. package/third_party/boringssl/src/crypto/asn1/a_object.c +182 -189
  23. package/third_party/boringssl/src/crypto/asn1/a_octet.c +6 -9
  24. package/third_party/boringssl/src/crypto/asn1/a_print.c +15 -16
  25. package/third_party/boringssl/src/crypto/asn1/a_strex.c +386 -399
  26. package/third_party/boringssl/src/crypto/asn1/a_strnid.c +110 -131
  27. package/third_party/boringssl/src/crypto/asn1/a_time.c +118 -111
  28. package/third_party/boringssl/src/crypto/asn1/a_type.c +59 -60
  29. package/third_party/boringssl/src/crypto/asn1/a_utctm.c +114 -186
  30. package/third_party/boringssl/src/crypto/asn1/a_utf8.c +171 -159
  31. package/third_party/boringssl/src/crypto/asn1/asn1_lib.c +245 -260
  32. package/third_party/boringssl/src/crypto/asn1/asn1_par.c +41 -40
  33. package/third_party/boringssl/src/crypto/asn1/asn1_test.cc +31 -0
  34. package/third_party/boringssl/src/crypto/asn1/asn_pack.c +31 -33
  35. package/third_party/boringssl/src/crypto/asn1/f_int.c +36 -33
  36. package/third_party/boringssl/src/crypto/asn1/f_string.c +29 -26
  37. package/third_party/boringssl/src/crypto/asn1/internal.h +62 -61
  38. package/third_party/boringssl/src/crypto/asn1/tasn_dec.c +706 -702
  39. package/third_party/boringssl/src/crypto/asn1/tasn_enc.c +507 -524
  40. package/third_party/boringssl/src/crypto/asn1/tasn_fre.c +141 -133
  41. package/third_party/boringssl/src/crypto/asn1/tasn_new.c +207 -199
  42. package/third_party/boringssl/src/crypto/asn1/tasn_typ.c +19 -22
  43. package/third_party/boringssl/src/crypto/asn1/tasn_utl.c +24 -24
  44. package/third_party/boringssl/src/crypto/asn1/time_support.c +13 -13
  45. package/third_party/boringssl/src/crypto/bio/connect.c +9 -3
  46. package/third_party/boringssl/src/crypto/bytestring/bytestring_test.cc +125 -1
  47. package/third_party/boringssl/src/crypto/bytestring/cbb.c +4 -7
  48. package/third_party/boringssl/src/crypto/bytestring/cbs.c +167 -9
  49. package/third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c +0 -2
  50. package/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c +23 -54
  51. package/third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c +0 -2
  52. package/third_party/boringssl/src/crypto/cipher_extra/e_tls.c +0 -2
  53. package/third_party/boringssl/src/crypto/curve25519/curve25519.c +6 -8
  54. package/third_party/boringssl/src/crypto/evp/evp_ctx.c +25 -22
  55. package/third_party/boringssl/src/crypto/evp/internal.h +15 -9
  56. package/third_party/boringssl/src/crypto/evp/p_dsa_asn1.c +2 -0
  57. package/third_party/boringssl/src/crypto/evp/p_ec_asn1.c +2 -0
  58. package/third_party/boringssl/src/crypto/evp/p_ed25519.c +3 -3
  59. package/third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c +10 -7
  60. package/third_party/boringssl/src/crypto/evp/p_hkdf.c +241 -0
  61. package/third_party/boringssl/src/crypto/evp/p_rsa_asn1.c +2 -0
  62. package/third_party/boringssl/src/crypto/evp/p_x25519_asn1.c +1 -0
  63. package/third_party/boringssl/src/crypto/fipsmodule/aes/aes_nohw.c +9 -10
  64. package/third_party/boringssl/src/crypto/fipsmodule/aes/key_wrap.c +2 -6
  65. package/third_party/boringssl/src/crypto/fipsmodule/bn/exponentiation.c +5 -11
  66. package/third_party/boringssl/src/crypto/fipsmodule/bn/internal.h +1 -1
  67. package/third_party/boringssl/src/crypto/fipsmodule/bn/prime.c +2 -0
  68. package/third_party/boringssl/src/crypto/fipsmodule/cipher/e_aes.c +10 -26
  69. package/third_party/boringssl/src/crypto/fipsmodule/cipher/e_aesccm.c +2 -3
  70. package/third_party/boringssl/src/crypto/fipsmodule/digestsign/digestsign.c +1 -0
  71. package/third_party/boringssl/src/crypto/fipsmodule/ec/p256-nistz.c +44 -43
  72. package/third_party/boringssl/src/crypto/fipsmodule/modes/cbc.c +5 -9
  73. package/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c +14 -21
  74. package/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c +8 -8
  75. package/third_party/boringssl/src/crypto/fipsmodule/rand/internal.h +1 -4
  76. package/third_party/boringssl/src/crypto/hkdf/hkdf_test.cc +104 -0
  77. package/third_party/boringssl/src/crypto/internal.h +18 -4
  78. package/third_party/boringssl/src/crypto/lhash/internal.h +13 -1
  79. package/third_party/boringssl/src/crypto/obj/obj_dat.h +4 -1
  80. package/third_party/boringssl/src/crypto/obj/obj_mac.num +1 -0
  81. package/third_party/boringssl/src/crypto/obj/objects.txt +2 -0
  82. package/third_party/boringssl/src/crypto/pem/pem_all.c +77 -86
  83. package/third_party/boringssl/src/crypto/pem/pem_info.c +221 -233
  84. package/third_party/boringssl/src/crypto/pem/pem_lib.c +639 -608
  85. package/third_party/boringssl/src/crypto/pem/pem_oth.c +17 -16
  86. package/third_party/boringssl/src/crypto/pem/pem_pk8.c +133 -142
  87. package/third_party/boringssl/src/crypto/pem/pem_pkey.c +96 -92
  88. package/third_party/boringssl/src/crypto/poly1305/poly1305_vec.c +12 -28
  89. package/third_party/boringssl/src/crypto/siphash/siphash.c +8 -11
  90. package/third_party/boringssl/src/crypto/siphash/siphash_test.cc +5 -7
  91. package/third_party/boringssl/src/crypto/stack/stack.c +33 -16
  92. package/third_party/boringssl/src/crypto/thread_pthread.c +0 -2
  93. package/third_party/boringssl/src/crypto/thread_win.c +0 -2
  94. package/third_party/boringssl/src/crypto/trust_token/internal.h +14 -0
  95. package/third_party/boringssl/src/crypto/trust_token/pmbtoken.c +127 -30
  96. package/third_party/boringssl/src/crypto/trust_token/trust_token.c +40 -0
  97. package/third_party/boringssl/src/crypto/trust_token/trust_token_test.cc +165 -0
  98. package/third_party/boringssl/src/crypto/trust_token/voprf.c +55 -6
  99. package/third_party/boringssl/src/crypto/x509/a_digest.c +23 -24
  100. package/third_party/boringssl/src/crypto/x509/a_sign.c +52 -55
  101. package/third_party/boringssl/src/crypto/x509/a_verify.c +33 -34
  102. package/third_party/boringssl/src/crypto/x509/algorithm.c +17 -18
  103. package/third_party/boringssl/src/crypto/x509/asn1_gen.c +618 -612
  104. package/third_party/boringssl/src/crypto/x509/by_dir.c +320 -337
  105. package/third_party/boringssl/src/crypto/x509/by_file.c +186 -186
  106. package/third_party/boringssl/src/crypto/x509/i2d_pr.c +11 -14
  107. package/third_party/boringssl/src/crypto/x509/internal.h +22 -22
  108. package/third_party/boringssl/src/crypto/x509/name_print.c +155 -150
  109. package/third_party/boringssl/src/crypto/x509/rsa_pss.c +27 -29
  110. package/third_party/boringssl/src/crypto/x509/t_crl.c +67 -70
  111. package/third_party/boringssl/src/crypto/x509/t_req.c +3 -5
  112. package/third_party/boringssl/src/crypto/x509/t_x509.c +280 -251
  113. package/third_party/boringssl/src/crypto/x509/t_x509a.c +52 -47
  114. package/third_party/boringssl/src/crypto/x509/x509.c +3 -4
  115. package/third_party/boringssl/src/crypto/x509/x509_att.c +234 -223
  116. package/third_party/boringssl/src/crypto/x509/x509_cmp.c +286 -296
  117. package/third_party/boringssl/src/crypto/x509/x509_d2.c +37 -32
  118. package/third_party/boringssl/src/crypto/x509/x509_def.c +14 -30
  119. package/third_party/boringssl/src/crypto/x509/x509_ext.c +55 -84
  120. package/third_party/boringssl/src/crypto/x509/x509_lu.c +545 -581
  121. package/third_party/boringssl/src/crypto/x509/x509_obj.c +131 -121
  122. package/third_party/boringssl/src/crypto/x509/x509_req.c +120 -139
  123. package/third_party/boringssl/src/crypto/x509/x509_set.c +128 -142
  124. package/third_party/boringssl/src/crypto/x509/x509_trs.c +185 -193
  125. package/third_party/boringssl/src/crypto/x509/x509_txt.c +70 -72
  126. package/third_party/boringssl/src/crypto/x509/x509_v3.c +172 -161
  127. package/third_party/boringssl/src/crypto/x509/x509_vfy.c +2041 -2053
  128. package/third_party/boringssl/src/crypto/x509/x509_vpm.c +441 -461
  129. package/third_party/boringssl/src/crypto/x509/x509cset.c +152 -170
  130. package/third_party/boringssl/src/crypto/x509/x509name.c +274 -260
  131. package/third_party/boringssl/src/crypto/x509/x509rset.c +43 -20
  132. package/third_party/boringssl/src/crypto/x509/x509spki.c +62 -63
  133. package/third_party/boringssl/src/crypto/x509/x_algor.c +64 -62
  134. package/third_party/boringssl/src/crypto/x509/x_all.c +103 -133
  135. package/third_party/boringssl/src/crypto/x509/x_attrib.c +23 -24
  136. package/third_party/boringssl/src/crypto/x509/x_crl.c +310 -321
  137. package/third_party/boringssl/src/crypto/x509/x_exten.c +6 -5
  138. package/third_party/boringssl/src/crypto/x509/x_info.c +31 -28
  139. package/third_party/boringssl/src/crypto/x509/x_name.c +361 -365
  140. package/third_party/boringssl/src/crypto/x509/x_pkey.c +38 -32
  141. package/third_party/boringssl/src/crypto/x509/x_pubkey.c +114 -117
  142. package/third_party/boringssl/src/crypto/x509/x_req.c +27 -29
  143. package/third_party/boringssl/src/crypto/x509/x_sig.c +2 -2
  144. package/third_party/boringssl/src/crypto/x509/x_spki.c +8 -10
  145. package/third_party/boringssl/src/crypto/x509/x_val.c +2 -2
  146. package/third_party/boringssl/src/crypto/x509/x_x509.c +212 -226
  147. package/third_party/boringssl/src/crypto/x509/x_x509a.c +112 -109
  148. package/third_party/boringssl/src/crypto/x509v3/ext_dat.h +10 -13
  149. package/third_party/boringssl/src/crypto/x509v3/internal.h +72 -87
  150. package/third_party/boringssl/src/crypto/x509v3/pcy_cache.c +184 -176
  151. package/third_party/boringssl/src/crypto/x509v3/pcy_data.c +58 -56
  152. package/third_party/boringssl/src/crypto/x509v3/pcy_lib.c +71 -70
  153. package/third_party/boringssl/src/crypto/x509v3/pcy_map.c +56 -58
  154. package/third_party/boringssl/src/crypto/x509v3/pcy_node.c +89 -91
  155. package/third_party/boringssl/src/crypto/x509v3/pcy_tree.c +585 -590
  156. package/third_party/boringssl/src/crypto/x509v3/v3_akey.c +118 -112
  157. package/third_party/boringssl/src/crypto/x509v3/v3_akeya.c +3 -3
  158. package/third_party/boringssl/src/crypto/x509v3/v3_alt.c +447 -451
  159. package/third_party/boringssl/src/crypto/x509v3/v3_bcons.c +44 -38
  160. package/third_party/boringssl/src/crypto/x509v3/v3_bitst.c +39 -43
  161. package/third_party/boringssl/src/crypto/x509v3/v3_conf.c +321 -320
  162. package/third_party/boringssl/src/crypto/x509v3/v3_cpols.c +352 -327
  163. package/third_party/boringssl/src/crypto/x509v3/v3_crld.c +437 -383
  164. package/third_party/boringssl/src/crypto/x509v3/v3_enum.c +23 -16
  165. package/third_party/boringssl/src/crypto/x509v3/v3_extku.c +62 -53
  166. package/third_party/boringssl/src/crypto/x509v3/v3_genn.c +118 -115
  167. package/third_party/boringssl/src/crypto/x509v3/v3_ia5.c +30 -31
  168. package/third_party/boringssl/src/crypto/x509v3/v3_info.c +112 -98
  169. package/third_party/boringssl/src/crypto/x509v3/v3_int.c +40 -15
  170. package/third_party/boringssl/src/crypto/x509v3/v3_lib.c +248 -252
  171. package/third_party/boringssl/src/crypto/x509v3/v3_ncons.c +390 -386
  172. package/third_party/boringssl/src/crypto/x509v3/v3_ocsp.c +45 -32
  173. package/third_party/boringssl/src/crypto/x509v3/v3_pci.c +206 -209
  174. package/third_party/boringssl/src/crypto/x509v3/v3_pcia.c +6 -8
  175. package/third_party/boringssl/src/crypto/x509v3/v3_pcons.c +54 -50
  176. package/third_party/boringssl/src/crypto/x509v3/v3_pmaps.c +66 -65
  177. package/third_party/boringssl/src/crypto/x509v3/v3_prn.c +144 -133
  178. package/third_party/boringssl/src/crypto/x509v3/v3_purp.c +695 -709
  179. package/third_party/boringssl/src/crypto/x509v3/v3_skey.c +75 -69
  180. package/third_party/boringssl/src/crypto/x509v3/v3_utl.c +1102 -1082
  181. package/third_party/boringssl/src/include/openssl/base.h +3 -1
  182. package/third_party/boringssl/src/include/openssl/bn.h +3 -0
  183. package/third_party/boringssl/src/include/openssl/bytestring.h +20 -0
  184. package/third_party/boringssl/src/include/openssl/evp.h +6 -5
  185. package/third_party/boringssl/src/include/openssl/kdf.h +91 -0
  186. package/third_party/boringssl/src/include/openssl/nid.h +4 -0
  187. package/third_party/boringssl/src/include/openssl/ssl.h +6 -1
  188. package/third_party/boringssl/src/include/openssl/stack.h +47 -32
  189. package/third_party/boringssl/src/include/openssl/trust_token.h +18 -3
  190. package/third_party/boringssl/src/include/openssl/x509.h +18 -0
  191. package/third_party/boringssl/src/ssl/ssl_file.cc +61 -99
  192. package/third_party/boringssl/src/ssl/ssl_test.cc +101 -0
  193. package/third_party/boringssl/src/util/doc.config +2 -1
  194. package/third_party/boringssl/src/util/fipstools/acvp/acvptool/subprocess/subprocess.go +8 -0
  195. package/third_party/googleurl/AUTHORS +16 -2
  196. package/third_party/googleurl/base/BUILD +1 -0
  197. package/third_party/googleurl/base/compiler_specific.h +16 -17
  198. package/third_party/googleurl/base/containers/contiguous_iterator.h +13 -9
  199. package/third_party/googleurl/base/containers/span.h +23 -8
  200. package/third_party/googleurl/base/memory/raw_ptr.h +17 -25
  201. package/third_party/googleurl/base/memory/raw_ptr_exclusion.h +21 -0
  202. package/third_party/googleurl/base/strings/escape.cc +14 -2
  203. package/third_party/googleurl/base/strings/safe_sprintf.h +1 -1
  204. package/third_party/googleurl/base/strings/string_number_conversions.cc +5 -3
  205. package/third_party/googleurl/base/strings/string_number_conversions_internal.h +5 -5
  206. package/third_party/googleurl/base/strings/string_piece.h +3 -3
  207. package/third_party/googleurl/base/strings/string_util.cc +4 -27
  208. package/third_party/googleurl/base/strings/string_util.h +43 -8
  209. package/third_party/googleurl/base/strings/string_util_internal.h +11 -12
  210. package/third_party/googleurl/base/strings/string_util_unittest.cc +33 -0
  211. package/third_party/googleurl/base/strings/string_util_win.cc +0 -5
  212. package/third_party/googleurl/base/strings/string_util_win.h +9 -1
  213. package/third_party/googleurl/base/strings/utf_offset_string_conversions.cc +1 -1
  214. package/third_party/googleurl/base/strings/utf_string_conversion_utils.cc +5 -8
  215. package/third_party/googleurl/base/strings/utf_string_conversion_utils.h +13 -10
  216. package/third_party/googleurl/base/strings/utf_string_conversions.cc +32 -25
  217. package/third_party/googleurl/base/template_util.h +23 -35
  218. package/third_party/googleurl/build/build_config.h +14 -3
  219. package/third_party/googleurl/copy.bara.sky +1 -1
  220. package/third_party/googleurl/url/gurl.cc +8 -4
  221. package/third_party/googleurl/url/gurl.h +1 -0
  222. package/third_party/googleurl/url/gurl_unittest.cc +1 -0
  223. package/third_party/googleurl/url/origin.h +36 -26
  224. package/third_party/googleurl/url/scheme_host_port.h +4 -1
  225. package/third_party/googleurl/url/url_canon.h +2 -1
  226. package/third_party/googleurl/url/url_canon_internal.cc +9 -7
  227. package/third_party/googleurl/url/url_canon_internal.h +16 -16
  228. package/third_party/googleurl/url/url_canon_stdstring.h +2 -1
  229. package/third_party/googleurl/url/url_util.cc +9 -8
  230. package/third_party/quiche/build/source_list.bzl +7 -0
  231. package/third_party/quiche/build/source_list.gni +7 -0
  232. package/third_party/quiche/build/source_list.json +7 -0
  233. package/third_party/quiche/quiche/common/platform/api/quiche_mem_slice.h +7 -3
  234. package/third_party/quiche/quiche/http2/adapter/nghttp2_adapter_test.cc +86 -2
  235. package/third_party/quiche/quiche/http2/adapter/oghttp2_adapter_test.cc +104 -2
  236. package/third_party/quiche/quiche/http2/adapter/oghttp2_session.cc +23 -0
  237. package/third_party/quiche/quiche/http2/adapter/oghttp2_session.h +6 -1
  238. package/third_party/quiche/quiche/quic/core/congestion_control/send_algorithm_test.cc +0 -16
  239. package/third_party/quiche/quiche/quic/core/crypto/crypto_protocol.h +1 -1
  240. package/third_party/quiche/quiche/quic/core/http/end_to_end_test.cc +56 -2
  241. package/third_party/quiche/quiche/quic/core/http/http_constants.cc +1 -0
  242. package/third_party/quiche/quiche/quic/core/http/http_constants.h +1 -0
  243. package/third_party/quiche/quiche/quic/core/http/http_encoder.cc +28 -17
  244. package/third_party/quiche/quiche/quic/core/http/http_encoder.h +5 -0
  245. package/third_party/quiche/quiche/quic/core/http/http_encoder_test.cc +26 -30
  246. package/third_party/quiche/quiche/quic/core/http/http_frames.h +1 -0
  247. package/third_party/quiche/quiche/quic/core/http/quic_server_session_base.cc +4 -4
  248. package/third_party/quiche/quiche/quic/core/http/quic_server_session_base_test.cc +1 -1
  249. package/third_party/quiche/quiche/quic/core/http/quic_spdy_client_session.cc +5 -1
  250. package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.cc +6 -33
  251. package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.h +0 -17
  252. package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream_test.cc +5 -20
  253. package/third_party/quiche/quiche/quic/core/io/quic_event_loop.h +81 -0
  254. package/third_party/quiche/quiche/quic/core/io/quic_poll_event_loop.cc +265 -0
  255. package/third_party/quiche/quiche/quic/core/io/quic_poll_event_loop.h +152 -0
  256. package/third_party/quiche/quiche/quic/core/io/quic_poll_event_loop_test.cc +341 -0
  257. package/third_party/quiche/quiche/quic/core/quic_buffered_packet_store.cc +3 -1
  258. package/third_party/quiche/quiche/quic/core/quic_buffered_packet_store.h +7 -7
  259. package/third_party/quiche/quiche/quic/core/quic_buffered_packet_store_test.cc +4 -3
  260. package/third_party/quiche/quiche/quic/core/quic_connection.cc +69 -19
  261. package/third_party/quiche/quiche/quic/core/quic_connection.h +9 -3
  262. package/third_party/quiche/quiche/quic/core/quic_connection_id_manager.cc +29 -10
  263. package/third_party/quiche/quiche/quic/core/quic_connection_id_manager.h +5 -3
  264. package/third_party/quiche/quiche/quic/core/quic_connection_id_manager_test.cc +85 -22
  265. package/third_party/quiche/quiche/quic/core/quic_connection_test.cc +186 -30
  266. package/third_party/quiche/quiche/quic/core/quic_crypto_stream.cc +2 -1
  267. package/third_party/quiche/quiche/quic/core/quic_default_clock.cc +31 -0
  268. package/third_party/quiche/quiche/quic/core/quic_default_clock.h +34 -0
  269. package/third_party/quiche/quiche/quic/core/quic_default_connection_helper.h +49 -0
  270. package/third_party/quiche/quiche/quic/core/quic_dispatcher.cc +53 -37
  271. package/third_party/quiche/quiche/quic/core/quic_dispatcher.h +19 -11
  272. package/third_party/quiche/quiche/quic/core/quic_dispatcher_test.cc +15 -2
  273. package/third_party/quiche/quiche/quic/core/quic_flags_list.h +10 -4
  274. package/third_party/quiche/quiche/quic/core/quic_idle_network_detector.cc +2 -2
  275. package/third_party/quiche/quiche/quic/core/quic_idle_network_detector_test.cc +4 -4
  276. package/third_party/quiche/quiche/quic/core/quic_packet_creator.cc +14 -3
  277. package/third_party/quiche/quiche/quic/core/quic_packet_creator_test.cc +145 -2
  278. package/third_party/quiche/quiche/quic/core/quic_packets.cc +3 -1
  279. package/third_party/quiche/quiche/quic/core/quic_packets.h +4 -0
  280. package/third_party/quiche/quiche/quic/core/quic_sent_packet_manager.cc +13 -11
  281. package/third_party/quiche/quiche/quic/core/quic_sent_packet_manager.h +9 -0
  282. package/third_party/quiche/quiche/quic/core/quic_sent_packet_manager_test.cc +6 -0
  283. package/third_party/quiche/quiche/quic/core/quic_session.cc +3 -2
  284. package/third_party/quiche/quiche/quic/core/quic_session.h +8 -3
  285. package/third_party/quiche/quiche/quic/core/quic_types.cc +18 -0
  286. package/third_party/quiche/quiche/quic/core/quic_types.h +3 -0
  287. package/third_party/quiche/quiche/quic/core/tls_chlo_extractor.cc +3 -0
  288. package/third_party/quiche/quiche/quic/core/tls_chlo_extractor.h +10 -0
  289. package/third_party/quiche/quiche/quic/test_tools/mock_quic_session_visitor.h +1 -1
  290. package/third_party/quiche/quiche/quic/test_tools/quic_test_utils.h +1 -1
  291. package/third_party/quiche/quiche/quic/test_tools/server_thread.cc +3 -2
  292. package/third_party/quiche/quiche/quic/test_tools/simple_session_notifier.cc +7 -1
  293. package/third_party/quiche/quiche/quic/test_tools/simple_session_notifier.h +3 -0
  294. package/third_party/quiche/quiche/quic/test_tools/simulator/quic_endpoint.h +4 -2
  295. package/certs/ca.cnf +0 -69
  296. package/certs/generate_certs.sh +0 -53
  297. package/certs/generate_certs_leaf.sh +0 -53
  298. package/certs/leaf.cnf +0 -24
  299. package/certs/readme.txt +0 -2
  300. package/third_party/quiche/build/BUILD.bazel +0 -7
@@ -82,7 +82,7 @@ int X509_REQ_print_ex(BIO *bio, X509_REQ *x, unsigned long nmflags,
82
82
  unsigned long cflag) {
83
83
  long l;
84
84
  EVP_PKEY *pkey;
85
- STACK_OF(X509_ATTRIBUTE) * sk;
85
+ STACK_OF(X509_ATTRIBUTE) *sk;
86
86
  char mlch = ' ';
87
87
 
88
88
  int nmindent = 0;
@@ -187,10 +187,8 @@ int X509_REQ_print_ex(BIO *bio, X509_REQ *x, unsigned long nmflags,
187
187
  goto err;
188
188
  }
189
189
 
190
- if (type == V_ASN1_PRINTABLESTRING ||
191
- type == V_ASN1_UTF8STRING ||
192
- type == V_ASN1_IA5STRING ||
193
- type == V_ASN1_T61STRING) {
190
+ if (type == V_ASN1_PRINTABLESTRING || type == V_ASN1_UTF8STRING ||
191
+ type == V_ASN1_IA5STRING || type == V_ASN1_T61STRING) {
194
192
  if (BIO_write(bio, (char *)bs->data, bs->length) != bs->length) {
195
193
  goto err;
196
194
  }
@@ -70,295 +70,324 @@
70
70
 
71
71
 
72
72
  int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag,
73
- unsigned long cflag)
74
- {
75
- BIO *b = BIO_new_fp(fp, BIO_NOCLOSE);
76
- if (b == NULL) {
77
- OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB);
78
- return 0;
79
- }
80
- int ret = X509_print_ex(b, x, nmflag, cflag);
81
- BIO_free(b);
82
- return ret;
73
+ unsigned long cflag) {
74
+ BIO *b = BIO_new_fp(fp, BIO_NOCLOSE);
75
+ if (b == NULL) {
76
+ OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB);
77
+ return 0;
78
+ }
79
+ int ret = X509_print_ex(b, x, nmflag, cflag);
80
+ BIO_free(b);
81
+ return ret;
83
82
  }
84
83
 
85
- int X509_print_fp(FILE *fp, X509 *x)
86
- {
87
- return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
84
+ int X509_print_fp(FILE *fp, X509 *x) {
85
+ return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
88
86
  }
89
87
 
90
- int X509_print(BIO *bp, X509 *x)
91
- {
92
- return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
88
+ int X509_print(BIO *bp, X509 *x) {
89
+ return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
93
90
  }
94
91
 
95
92
  int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
96
- unsigned long cflag)
97
- {
98
- long l;
99
- int ret = 0, i;
100
- char *m = NULL, mlch = ' ';
101
- int nmindent = 0;
102
- X509_CINF *ci;
103
- EVP_PKEY *pkey = NULL;
104
- const char *neg;
105
-
106
- if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
107
- mlch = '\n';
108
- nmindent = 12;
93
+ unsigned long cflag) {
94
+ long l;
95
+ int ret = 0, i;
96
+ char *m = NULL, mlch = ' ';
97
+ int nmindent = 0;
98
+ X509_CINF *ci;
99
+ EVP_PKEY *pkey = NULL;
100
+ const char *neg;
101
+
102
+ if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
103
+ mlch = '\n';
104
+ nmindent = 12;
105
+ }
106
+
107
+ if (nmflags == X509_FLAG_COMPAT) {
108
+ nmindent = 16;
109
+ }
110
+
111
+ ci = x->cert_info;
112
+ if (!(cflag & X509_FLAG_NO_HEADER)) {
113
+ if (BIO_write(bp, "Certificate:\n", 13) <= 0) {
114
+ goto err;
109
115
  }
110
-
111
- if (nmflags == X509_FLAG_COMPAT)
112
- nmindent = 16;
113
-
114
- ci = x->cert_info;
115
- if (!(cflag & X509_FLAG_NO_HEADER)) {
116
- if (BIO_write(bp, "Certificate:\n", 13) <= 0)
117
- goto err;
118
- if (BIO_write(bp, " Data:\n", 10) <= 0)
119
- goto err;
116
+ if (BIO_write(bp, " Data:\n", 10) <= 0) {
117
+ goto err;
120
118
  }
121
- if (!(cflag & X509_FLAG_NO_VERSION)) {
122
- l = X509_get_version(x);
123
- assert(X509_VERSION_1 <= l && l <= X509_VERSION_3);
124
- if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1,
125
- (unsigned long)l) <= 0) {
126
- goto err;
127
- }
119
+ }
120
+ if (!(cflag & X509_FLAG_NO_VERSION)) {
121
+ l = X509_get_version(x);
122
+ assert(X509_VERSION_1 <= l && l <= X509_VERSION_3);
123
+ if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1,
124
+ (unsigned long)l) <= 0) {
125
+ goto err;
126
+ }
127
+ }
128
+ if (!(cflag & X509_FLAG_NO_SERIAL)) {
129
+ if (BIO_write(bp, " Serial Number:", 22) <= 0) {
130
+ goto err;
128
131
  }
129
- if (!(cflag & X509_FLAG_NO_SERIAL)) {
130
- if (BIO_write(bp, " Serial Number:", 22) <= 0) {
131
- goto err;
132
- }
133
132
 
134
- const ASN1_INTEGER *serial = X509_get0_serialNumber(x);
135
- uint64_t serial_u64;
136
- if (ASN1_INTEGER_get_uint64(&serial_u64, serial)) {
137
- assert(serial->type != V_ASN1_NEG_INTEGER);
138
- if (BIO_printf(bp, " %" PRIu64 " (0x%" PRIx64 ")\n", serial_u64,
139
- serial_u64) <= 0) {
140
- goto err;
141
- }
142
- } else {
143
- ERR_clear_error(); /* Clear |ASN1_INTEGER_get_uint64|'s error. */
144
- neg = (serial->type == V_ASN1_NEG_INTEGER) ? " (Negative)" : "";
145
- if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0) {
146
- goto err;
147
- }
148
-
149
- for (i = 0; i < serial->length; i++) {
150
- if (BIO_printf(bp, "%02x%c", serial->data[i],
151
- ((i + 1 == serial->length) ? '\n' : ':')) <= 0) {
152
- goto err;
153
- }
154
- }
133
+ const ASN1_INTEGER *serial = X509_get0_serialNumber(x);
134
+ uint64_t serial_u64;
135
+ if (ASN1_INTEGER_get_uint64(&serial_u64, serial)) {
136
+ assert(serial->type != V_ASN1_NEG_INTEGER);
137
+ if (BIO_printf(bp, " %" PRIu64 " (0x%" PRIx64 ")\n", serial_u64,
138
+ serial_u64) <= 0) {
139
+ goto err;
140
+ }
141
+ } else {
142
+ ERR_clear_error(); // Clear |ASN1_INTEGER_get_uint64|'s error.
143
+ neg = (serial->type == V_ASN1_NEG_INTEGER) ? " (Negative)" : "";
144
+ if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0) {
145
+ goto err;
146
+ }
147
+
148
+ for (i = 0; i < serial->length; i++) {
149
+ if (BIO_printf(bp, "%02x%c", serial->data[i],
150
+ ((i + 1 == serial->length) ? '\n' : ':')) <= 0) {
151
+ goto err;
155
152
  }
153
+ }
156
154
  }
155
+ }
157
156
 
158
- if (!(cflag & X509_FLAG_NO_SIGNAME)) {
159
- if (X509_signature_print(bp, ci->signature, NULL) <= 0)
160
- goto err;
157
+ if (!(cflag & X509_FLAG_NO_SIGNAME)) {
158
+ if (X509_signature_print(bp, ci->signature, NULL) <= 0) {
159
+ goto err;
161
160
  }
161
+ }
162
162
 
163
- if (!(cflag & X509_FLAG_NO_ISSUER)) {
164
- if (BIO_printf(bp, " Issuer:%c", mlch) <= 0)
165
- goto err;
166
- if (X509_NAME_print_ex(bp, X509_get_issuer_name(x), nmindent, nmflags)
167
- < 0)
168
- goto err;
169
- if (BIO_write(bp, "\n", 1) <= 0)
170
- goto err;
163
+ if (!(cflag & X509_FLAG_NO_ISSUER)) {
164
+ if (BIO_printf(bp, " Issuer:%c", mlch) <= 0) {
165
+ goto err;
171
166
  }
172
- if (!(cflag & X509_FLAG_NO_VALIDITY)) {
173
- if (BIO_write(bp, " Validity\n", 17) <= 0)
174
- goto err;
175
- if (BIO_write(bp, " Not Before: ", 24) <= 0)
176
- goto err;
177
- if (!ASN1_TIME_print(bp, X509_get_notBefore(x)))
178
- goto err;
179
- if (BIO_write(bp, "\n Not After : ", 25) <= 0)
180
- goto err;
181
- if (!ASN1_TIME_print(bp, X509_get_notAfter(x)))
182
- goto err;
183
- if (BIO_write(bp, "\n", 1) <= 0)
184
- goto err;
167
+ if (X509_NAME_print_ex(bp, X509_get_issuer_name(x), nmindent, nmflags) <
168
+ 0) {
169
+ goto err;
185
170
  }
186
- if (!(cflag & X509_FLAG_NO_SUBJECT)) {
187
- if (BIO_printf(bp, " Subject:%c", mlch) <= 0)
188
- goto err;
189
- if (X509_NAME_print_ex
190
- (bp, X509_get_subject_name(x), nmindent, nmflags) < 0)
191
- goto err;
192
- if (BIO_write(bp, "\n", 1) <= 0)
193
- goto err;
171
+ if (BIO_write(bp, "\n", 1) <= 0) {
172
+ goto err;
194
173
  }
195
- if (!(cflag & X509_FLAG_NO_PUBKEY)) {
196
- if (BIO_write(bp, " Subject Public Key Info:\n", 33) <= 0)
197
- goto err;
198
- if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0)
199
- goto err;
200
- if (i2a_ASN1_OBJECT(bp, ci->key->algor->algorithm) <= 0)
201
- goto err;
202
- if (BIO_puts(bp, "\n") <= 0)
203
- goto err;
204
-
205
- pkey = X509_get_pubkey(x);
206
- if (pkey == NULL) {
207
- BIO_printf(bp, "%12sUnable to load Public Key\n", "");
208
- ERR_print_errors(bp);
209
- } else {
210
- EVP_PKEY_print_public(bp, pkey, 16, NULL);
211
- EVP_PKEY_free(pkey);
212
- }
174
+ }
175
+ if (!(cflag & X509_FLAG_NO_VALIDITY)) {
176
+ if (BIO_write(bp, " Validity\n", 17) <= 0) {
177
+ goto err;
213
178
  }
214
-
215
- if (!(cflag & X509_FLAG_NO_IDS)) {
216
- if (ci->issuerUID) {
217
- if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0)
218
- goto err;
219
- if (!X509_signature_dump(bp, ci->issuerUID, 12))
220
- goto err;
221
- }
222
- if (ci->subjectUID) {
223
- if (BIO_printf(bp, "%8sSubject Unique ID: ", "") <= 0)
224
- goto err;
225
- if (!X509_signature_dump(bp, ci->subjectUID, 12))
226
- goto err;
227
- }
179
+ if (BIO_write(bp, " Not Before: ", 24) <= 0) {
180
+ goto err;
228
181
  }
229
-
230
- if (!(cflag & X509_FLAG_NO_EXTENSIONS))
231
- X509V3_extensions_print(bp, "X509v3 extensions",
232
- ci->extensions, cflag, 8);
233
-
234
- if (!(cflag & X509_FLAG_NO_SIGDUMP)) {
235
- if (X509_signature_print(bp, x->sig_alg, x->signature) <= 0)
236
- goto err;
182
+ if (!ASN1_TIME_print(bp, X509_get_notBefore(x))) {
183
+ goto err;
237
184
  }
238
- if (!(cflag & X509_FLAG_NO_AUX)) {
239
- if (!X509_CERT_AUX_print(bp, x->aux, 0))
240
- goto err;
185
+ if (BIO_write(bp, "\n Not After : ", 25) <= 0) {
186
+ goto err;
187
+ }
188
+ if (!ASN1_TIME_print(bp, X509_get_notAfter(x))) {
189
+ goto err;
190
+ }
191
+ if (BIO_write(bp, "\n", 1) <= 0) {
192
+ goto err;
193
+ }
194
+ }
195
+ if (!(cflag & X509_FLAG_NO_SUBJECT)) {
196
+ if (BIO_printf(bp, " Subject:%c", mlch) <= 0) {
197
+ goto err;
198
+ }
199
+ if (X509_NAME_print_ex(bp, X509_get_subject_name(x), nmindent, nmflags) <
200
+ 0) {
201
+ goto err;
202
+ }
203
+ if (BIO_write(bp, "\n", 1) <= 0) {
204
+ goto err;
205
+ }
206
+ }
207
+ if (!(cflag & X509_FLAG_NO_PUBKEY)) {
208
+ if (BIO_write(bp, " Subject Public Key Info:\n", 33) <= 0) {
209
+ goto err;
210
+ }
211
+ if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0) {
212
+ goto err;
213
+ }
214
+ if (i2a_ASN1_OBJECT(bp, ci->key->algor->algorithm) <= 0) {
215
+ goto err;
216
+ }
217
+ if (BIO_puts(bp, "\n") <= 0) {
218
+ goto err;
241
219
  }
242
- ret = 1;
243
- err:
244
- if (m != NULL)
245
- OPENSSL_free(m);
246
- return (ret);
247
- }
248
220
 
249
- int X509_ocspid_print(BIO *bp, X509 *x)
250
- {
251
- unsigned char *der = NULL;
252
- unsigned char *dertmp;
253
- int derlen;
254
- int i;
255
- unsigned char SHA1md[SHA_DIGEST_LENGTH];
256
-
257
- /*
258
- * display the hash of the subject as it would appear in OCSP requests
259
- */
260
- if (BIO_printf(bp, " Subject OCSP hash: ") <= 0)
261
- goto err;
262
- derlen = i2d_X509_NAME(x->cert_info->subject, NULL);
263
- if ((der = dertmp = (unsigned char *)OPENSSL_malloc(derlen)) == NULL)
264
- goto err;
265
- i2d_X509_NAME(x->cert_info->subject, &dertmp);
221
+ pkey = X509_get_pubkey(x);
222
+ if (pkey == NULL) {
223
+ BIO_printf(bp, "%12sUnable to load Public Key\n", "");
224
+ ERR_print_errors(bp);
225
+ } else {
226
+ EVP_PKEY_print_public(bp, pkey, 16, NULL);
227
+ EVP_PKEY_free(pkey);
228
+ }
229
+ }
266
230
 
267
- if (!EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL))
231
+ if (!(cflag & X509_FLAG_NO_IDS)) {
232
+ if (ci->issuerUID) {
233
+ if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0) {
268
234
  goto err;
269
- for (i = 0; i < SHA_DIGEST_LENGTH; i++) {
270
- if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0)
271
- goto err;
235
+ }
236
+ if (!X509_signature_dump(bp, ci->issuerUID, 12)) {
237
+ goto err;
238
+ }
272
239
  }
273
- OPENSSL_free(der);
274
- der = NULL;
275
-
276
- /*
277
- * display the hash of the public key as it would appear in OCSP requests
278
- */
279
- if (BIO_printf(bp, "\n Public key OCSP hash: ") <= 0)
240
+ if (ci->subjectUID) {
241
+ if (BIO_printf(bp, "%8sSubject Unique ID: ", "") <= 0) {
280
242
  goto err;
281
-
282
- if (!EVP_Digest(x->cert_info->key->public_key->data,
283
- x->cert_info->key->public_key->length,
284
- SHA1md, NULL, EVP_sha1(), NULL))
243
+ }
244
+ if (!X509_signature_dump(bp, ci->subjectUID, 12)) {
285
245
  goto err;
286
- for (i = 0; i < SHA_DIGEST_LENGTH; i++) {
287
- if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0)
288
- goto err;
246
+ }
289
247
  }
290
- BIO_printf(bp, "\n");
248
+ }
249
+
250
+ if (!(cflag & X509_FLAG_NO_EXTENSIONS)) {
251
+ X509V3_extensions_print(bp, "X509v3 extensions", ci->extensions, cflag, 8);
252
+ }
291
253
 
292
- return (1);
293
- err:
294
- if (der != NULL)
295
- OPENSSL_free(der);
296
- return (0);
254
+ if (!(cflag & X509_FLAG_NO_SIGDUMP)) {
255
+ if (X509_signature_print(bp, x->sig_alg, x->signature) <= 0) {
256
+ goto err;
257
+ }
258
+ }
259
+ if (!(cflag & X509_FLAG_NO_AUX)) {
260
+ if (!X509_CERT_AUX_print(bp, x->aux, 0)) {
261
+ goto err;
262
+ }
263
+ }
264
+ ret = 1;
265
+ err:
266
+ if (m != NULL) {
267
+ OPENSSL_free(m);
268
+ }
269
+ return ret;
297
270
  }
298
271
 
299
- int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
300
- const ASN1_STRING *sig)
301
- {
302
- if (BIO_puts(bp, " Signature Algorithm: ") <= 0)
303
- return 0;
304
- if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0)
305
- return 0;
306
-
307
- /* RSA-PSS signatures have parameters to print. */
308
- int sig_nid = OBJ_obj2nid(sigalg->algorithm);
309
- if (sig_nid == NID_rsassaPss &&
310
- !x509_print_rsa_pss_params(bp, sigalg, 9, 0)) {
311
- return 0;
272
+ int X509_ocspid_print(BIO *bp, X509 *x) {
273
+ unsigned char *der = NULL;
274
+ unsigned char *dertmp;
275
+ int derlen;
276
+ int i;
277
+ unsigned char SHA1md[SHA_DIGEST_LENGTH];
278
+
279
+ // display the hash of the subject as it would appear in OCSP requests
280
+ if (BIO_printf(bp, " Subject OCSP hash: ") <= 0) {
281
+ goto err;
282
+ }
283
+ derlen = i2d_X509_NAME(x->cert_info->subject, NULL);
284
+ if ((der = dertmp = (unsigned char *)OPENSSL_malloc(derlen)) == NULL) {
285
+ goto err;
286
+ }
287
+ i2d_X509_NAME(x->cert_info->subject, &dertmp);
288
+
289
+ if (!EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL)) {
290
+ goto err;
291
+ }
292
+ for (i = 0; i < SHA_DIGEST_LENGTH; i++) {
293
+ if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) {
294
+ goto err;
295
+ }
296
+ }
297
+ OPENSSL_free(der);
298
+ der = NULL;
299
+
300
+ // display the hash of the public key as it would appear in OCSP requests
301
+ if (BIO_printf(bp, "\n Public key OCSP hash: ") <= 0) {
302
+ goto err;
303
+ }
304
+
305
+ if (!EVP_Digest(x->cert_info->key->public_key->data,
306
+ x->cert_info->key->public_key->length, SHA1md, NULL,
307
+ EVP_sha1(), NULL)) {
308
+ goto err;
309
+ }
310
+ for (i = 0; i < SHA_DIGEST_LENGTH; i++) {
311
+ if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) {
312
+ goto err;
312
313
  }
314
+ }
315
+ BIO_printf(bp, "\n");
313
316
 
314
- if (sig)
315
- return X509_signature_dump(bp, sig, 9);
316
- else if (BIO_puts(bp, "\n") <= 0)
317
- return 0;
318
- return 1;
317
+ return 1;
318
+ err:
319
+ if (der != NULL) {
320
+ OPENSSL_free(der);
321
+ }
322
+ return 0;
319
323
  }
320
324
 
321
- int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
322
- {
323
- char *s, *c, *b;
324
- int ret = 0, i;
325
-
326
- b = X509_NAME_oneline(name, NULL, 0);
327
- if (!b)
328
- return 0;
329
- if (!*b) {
330
- OPENSSL_free(b);
331
- return 1;
332
- }
333
- s = b + 1; /* skip the first slash */
334
-
335
- c = s;
336
- for (;;) {
337
- if (((*s == '/') &&
338
- ((s[1] >= 'A') && (s[1] <= 'Z') && ((s[2] == '=') ||
339
- ((s[2] >= 'A')
340
- && (s[2] <= 'Z')
341
- && (s[3] == '='))
342
- ))) || (*s == '\0')) {
343
- i = s - c;
344
- if (BIO_write(bp, c, i) != i)
345
- goto err;
346
- c = s + 1; /* skip following slash */
347
- if (*s != '\0') {
348
- if (BIO_write(bp, ", ", 2) != 2)
349
- goto err;
350
- }
325
+ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
326
+ const ASN1_STRING *sig) {
327
+ if (BIO_puts(bp, " Signature Algorithm: ") <= 0) {
328
+ return 0;
329
+ }
330
+ if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0) {
331
+ return 0;
332
+ }
333
+
334
+ // RSA-PSS signatures have parameters to print.
335
+ int sig_nid = OBJ_obj2nid(sigalg->algorithm);
336
+ if (sig_nid == NID_rsassaPss &&
337
+ !x509_print_rsa_pss_params(bp, sigalg, 9, 0)) {
338
+ return 0;
339
+ }
340
+
341
+ if (sig) {
342
+ return X509_signature_dump(bp, sig, 9);
343
+ } else if (BIO_puts(bp, "\n") <= 0) {
344
+ return 0;
345
+ }
346
+ return 1;
347
+ }
348
+
349
+ int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) {
350
+ char *s, *c, *b;
351
+ int ret = 0, i;
352
+
353
+ b = X509_NAME_oneline(name, NULL, 0);
354
+ if (!b) {
355
+ return 0;
356
+ }
357
+ if (!*b) {
358
+ OPENSSL_free(b);
359
+ return 1;
360
+ }
361
+ s = b + 1; // skip the first slash
362
+
363
+ c = s;
364
+ for (;;) {
365
+ if (((*s == '/') && ((s[1] >= 'A') && (s[1] <= 'Z') &&
366
+ ((s[2] == '=') || ((s[2] >= 'A') && (s[2] <= 'Z') &&
367
+ (s[3] == '='))))) ||
368
+ (*s == '\0')) {
369
+ i = s - c;
370
+ if (BIO_write(bp, c, i) != i) {
371
+ goto err;
372
+ }
373
+ c = s + 1; // skip following slash
374
+ if (*s != '\0') {
375
+ if (BIO_write(bp, ", ", 2) != 2) {
376
+ goto err;
351
377
  }
352
- if (*s == '\0')
353
- break;
354
- s++;
378
+ }
355
379
  }
356
-
357
- ret = 1;
358
- if (0) {
359
- err:
360
- OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB);
380
+ if (*s == '\0') {
381
+ break;
361
382
  }
362
- OPENSSL_free(b);
363
- return (ret);
383
+ s++;
384
+ }
385
+
386
+ ret = 1;
387
+ if (0) {
388
+ err:
389
+ OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB);
390
+ }
391
+ OPENSSL_free(b);
392
+ return ret;
364
393
  }