@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
@@ -66,119 +66,137 @@
66
66
  #include <openssl/obj.h>
67
67
  #include <openssl/x509v3.h>
68
68
 
69
- #include "internal.h"
70
69
  #include "../x509/internal.h"
70
+ #include "internal.h"
71
71
 
72
72
 
73
- static void *v2i_crld(const X509V3_EXT_METHOD *method,
74
- X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
73
+ static void *v2i_crld(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
74
+ STACK_OF(CONF_VALUE) *nval);
75
75
  static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
76
76
  int indent);
77
77
 
78
78
  const X509V3_EXT_METHOD v3_crld = {
79
- NID_crl_distribution_points, 0, ASN1_ITEM_ref(CRL_DIST_POINTS),
80
- 0, 0, 0, 0,
81
- 0, 0,
79
+ NID_crl_distribution_points,
80
+ 0,
81
+ ASN1_ITEM_ref(CRL_DIST_POINTS),
82
+ 0,
83
+ 0,
84
+ 0,
85
+ 0,
86
+ 0,
87
+ 0,
82
88
  0,
83
89
  v2i_crld,
84
- i2r_crldp, 0,
90
+ i2r_crldp,
91
+ 0,
85
92
  NULL,
86
93
  };
87
94
 
88
95
  const X509V3_EXT_METHOD v3_freshest_crl = {
89
- NID_freshest_crl, 0, ASN1_ITEM_ref(CRL_DIST_POINTS),
90
- 0, 0, 0, 0,
91
- 0, 0,
96
+ NID_freshest_crl,
97
+ 0,
98
+ ASN1_ITEM_ref(CRL_DIST_POINTS),
99
+ 0,
100
+ 0,
101
+ 0,
102
+ 0,
103
+ 0,
104
+ 0,
92
105
  0,
93
106
  v2i_crld,
94
- i2r_crldp, 0,
107
+ i2r_crldp,
108
+ 0,
95
109
  NULL,
96
110
  };
97
111
 
98
112
  static STACK_OF(GENERAL_NAME) *gnames_from_sectname(X509V3_CTX *ctx,
99
- char *sect)
100
- {
101
- STACK_OF(CONF_VALUE) *gnsect;
102
- STACK_OF(GENERAL_NAME) *gens;
103
- if (*sect == '@')
104
- gnsect = X509V3_get_section(ctx, sect + 1);
105
- else
106
- gnsect = X509V3_parse_list(sect);
107
- if (!gnsect) {
108
- OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND);
109
- return NULL;
110
- }
111
- gens = v2i_GENERAL_NAMES(NULL, ctx, gnsect);
112
- if (*sect == '@')
113
- X509V3_section_free(ctx, gnsect);
114
- else
115
- sk_CONF_VALUE_pop_free(gnsect, X509V3_conf_free);
116
- return gens;
113
+ char *sect) {
114
+ STACK_OF(CONF_VALUE) *gnsect;
115
+ STACK_OF(GENERAL_NAME) *gens;
116
+ if (*sect == '@') {
117
+ gnsect = X509V3_get_section(ctx, sect + 1);
118
+ } else {
119
+ gnsect = X509V3_parse_list(sect);
120
+ }
121
+ if (!gnsect) {
122
+ OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND);
123
+ return NULL;
124
+ }
125
+ gens = v2i_GENERAL_NAMES(NULL, ctx, gnsect);
126
+ if (*sect == '@') {
127
+ X509V3_section_free(ctx, gnsect);
128
+ } else {
129
+ sk_CONF_VALUE_pop_free(gnsect, X509V3_conf_free);
130
+ }
131
+ return gens;
117
132
  }
118
133
 
119
134
  static int set_dist_point_name(DIST_POINT_NAME **pdp, X509V3_CTX *ctx,
120
- CONF_VALUE *cnf)
121
- {
122
- STACK_OF(GENERAL_NAME) *fnm = NULL;
123
- STACK_OF(X509_NAME_ENTRY) *rnm = NULL;
124
- if (!strncmp(cnf->name, "fullname", 9)) {
125
- fnm = gnames_from_sectname(ctx, cnf->value);
126
- if (!fnm)
127
- goto err;
128
- } else if (!strcmp(cnf->name, "relativename")) {
129
- int ret;
130
- STACK_OF(CONF_VALUE) *dnsect;
131
- X509_NAME *nm;
132
- nm = X509_NAME_new();
133
- if (!nm)
134
- return -1;
135
- dnsect = X509V3_get_section(ctx, cnf->value);
136
- if (!dnsect) {
137
- OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND);
138
- return -1;
139
- }
140
- ret = X509V3_NAME_from_section(nm, dnsect, MBSTRING_ASC);
141
- X509V3_section_free(ctx, dnsect);
142
- rnm = nm->entries;
143
- nm->entries = NULL;
144
- X509_NAME_free(nm);
145
- if (!ret || sk_X509_NAME_ENTRY_num(rnm) <= 0)
146
- goto err;
147
- /*
148
- * Since its a name fragment can't have more than one RDNSequence
149
- */
150
- if (sk_X509_NAME_ENTRY_value(rnm,
151
- sk_X509_NAME_ENTRY_num(rnm) - 1)->set) {
152
- OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_MULTIPLE_RDNS);
153
- goto err;
154
- }
155
- } else
156
- return 0;
157
-
158
- if (*pdp) {
159
- OPENSSL_PUT_ERROR(X509V3, X509V3_R_DISTPOINT_ALREADY_SET);
160
- goto err;
135
+ CONF_VALUE *cnf) {
136
+ STACK_OF(GENERAL_NAME) *fnm = NULL;
137
+ STACK_OF(X509_NAME_ENTRY) *rnm = NULL;
138
+ if (!strncmp(cnf->name, "fullname", 9)) {
139
+ fnm = gnames_from_sectname(ctx, cnf->value);
140
+ if (!fnm) {
141
+ goto err;
161
142
  }
162
-
163
- *pdp = DIST_POINT_NAME_new();
164
- if (!*pdp)
165
- goto err;
166
- if (fnm) {
167
- (*pdp)->type = 0;
168
- (*pdp)->name.fullname = fnm;
169
- } else {
170
- (*pdp)->type = 1;
171
- (*pdp)->name.relativename = rnm;
143
+ } else if (!strcmp(cnf->name, "relativename")) {
144
+ int ret;
145
+ STACK_OF(CONF_VALUE) *dnsect;
146
+ X509_NAME *nm;
147
+ nm = X509_NAME_new();
148
+ if (!nm) {
149
+ return -1;
172
150
  }
173
-
174
- return 1;
175
-
176
- err:
177
- if (fnm)
178
- sk_GENERAL_NAME_pop_free(fnm, GENERAL_NAME_free);
179
- if (rnm)
180
- sk_X509_NAME_ENTRY_pop_free(rnm, X509_NAME_ENTRY_free);
181
- return -1;
151
+ dnsect = X509V3_get_section(ctx, cnf->value);
152
+ if (!dnsect) {
153
+ OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND);
154
+ return -1;
155
+ }
156
+ ret = X509V3_NAME_from_section(nm, dnsect, MBSTRING_ASC);
157
+ X509V3_section_free(ctx, dnsect);
158
+ rnm = nm->entries;
159
+ nm->entries = NULL;
160
+ X509_NAME_free(nm);
161
+ if (!ret || sk_X509_NAME_ENTRY_num(rnm) <= 0) {
162
+ goto err;
163
+ }
164
+ // Since its a name fragment can't have more than one RDNSequence
165
+ if (sk_X509_NAME_ENTRY_value(rnm, sk_X509_NAME_ENTRY_num(rnm) - 1)->set) {
166
+ OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_MULTIPLE_RDNS);
167
+ goto err;
168
+ }
169
+ } else {
170
+ return 0;
171
+ }
172
+
173
+ if (*pdp) {
174
+ OPENSSL_PUT_ERROR(X509V3, X509V3_R_DISTPOINT_ALREADY_SET);
175
+ goto err;
176
+ }
177
+
178
+ *pdp = DIST_POINT_NAME_new();
179
+ if (!*pdp) {
180
+ goto err;
181
+ }
182
+ if (fnm) {
183
+ (*pdp)->type = 0;
184
+ (*pdp)->name.fullname = fnm;
185
+ } else {
186
+ (*pdp)->type = 1;
187
+ (*pdp)->name.relativename = rnm;
188
+ }
189
+
190
+ return 1;
191
+
192
+ err:
193
+ if (fnm) {
194
+ sk_GENERAL_NAME_pop_free(fnm, GENERAL_NAME_free);
195
+ }
196
+ if (rnm) {
197
+ sk_X509_NAME_ENTRY_pop_free(rnm, X509_NAME_ENTRY_free);
198
+ }
199
+ return -1;
182
200
  }
183
201
 
184
202
  static const BIT_STRING_BITNAME reason_flags[] = {
@@ -191,208 +209,225 @@ static const BIT_STRING_BITNAME reason_flags[] = {
191
209
  {6, "Certificate Hold", "certificateHold"},
192
210
  {7, "Privilege Withdrawn", "privilegeWithdrawn"},
193
211
  {8, "AA Compromise", "AACompromise"},
194
- {-1, NULL, NULL}
195
- };
196
-
197
- static int set_reasons(ASN1_BIT_STRING **preas, char *value)
198
- {
199
- STACK_OF(CONF_VALUE) *rsk = NULL;
200
- const BIT_STRING_BITNAME *pbn;
201
- const char *bnam;
202
- size_t i;
203
- int ret = 0;
204
- rsk = X509V3_parse_list(value);
205
- if (!rsk)
206
- return 0;
207
- if (*preas)
208
- return 0;
209
- for (i = 0; i < sk_CONF_VALUE_num(rsk); i++) {
210
- bnam = sk_CONF_VALUE_value(rsk, i)->name;
211
- if (!*preas) {
212
- *preas = ASN1_BIT_STRING_new();
213
- if (!*preas)
214
- goto err;
215
- }
216
- for (pbn = reason_flags; pbn->lname; pbn++) {
217
- if (!strcmp(pbn->sname, bnam)) {
218
- if (!ASN1_BIT_STRING_set_bit(*preas, pbn->bitnum, 1))
219
- goto err;
220
- break;
221
- }
212
+ {-1, NULL, NULL}};
213
+
214
+ static int set_reasons(ASN1_BIT_STRING **preas, char *value) {
215
+ STACK_OF(CONF_VALUE) *rsk = NULL;
216
+ const BIT_STRING_BITNAME *pbn;
217
+ const char *bnam;
218
+ size_t i;
219
+ int ret = 0;
220
+ rsk = X509V3_parse_list(value);
221
+ if (!rsk) {
222
+ return 0;
223
+ }
224
+ if (*preas) {
225
+ return 0;
226
+ }
227
+ for (i = 0; i < sk_CONF_VALUE_num(rsk); i++) {
228
+ bnam = sk_CONF_VALUE_value(rsk, i)->name;
229
+ if (!*preas) {
230
+ *preas = ASN1_BIT_STRING_new();
231
+ if (!*preas) {
232
+ goto err;
233
+ }
234
+ }
235
+ for (pbn = reason_flags; pbn->lname; pbn++) {
236
+ if (!strcmp(pbn->sname, bnam)) {
237
+ if (!ASN1_BIT_STRING_set_bit(*preas, pbn->bitnum, 1)) {
238
+ goto err;
222
239
  }
223
- if (!pbn->lname)
224
- goto err;
240
+ break;
241
+ }
225
242
  }
226
- ret = 1;
243
+ if (!pbn->lname) {
244
+ goto err;
245
+ }
246
+ }
247
+ ret = 1;
227
248
 
228
- err:
229
- sk_CONF_VALUE_pop_free(rsk, X509V3_conf_free);
230
- return ret;
249
+ err:
250
+ sk_CONF_VALUE_pop_free(rsk, X509V3_conf_free);
251
+ return ret;
231
252
  }
232
253
 
233
- static int print_reasons(BIO *out, const char *rname,
234
- ASN1_BIT_STRING *rflags, int indent)
235
- {
236
- int first = 1;
237
- const BIT_STRING_BITNAME *pbn;
238
- BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, "");
239
- for (pbn = reason_flags; pbn->lname; pbn++) {
240
- if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) {
241
- if (first)
242
- first = 0;
243
- else
244
- BIO_puts(out, ", ");
245
- BIO_puts(out, pbn->lname);
246
- }
254
+ static int print_reasons(BIO *out, const char *rname, ASN1_BIT_STRING *rflags,
255
+ int indent) {
256
+ int first = 1;
257
+ const BIT_STRING_BITNAME *pbn;
258
+ BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, "");
259
+ for (pbn = reason_flags; pbn->lname; pbn++) {
260
+ if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) {
261
+ if (first) {
262
+ first = 0;
263
+ } else {
264
+ BIO_puts(out, ", ");
265
+ }
266
+ BIO_puts(out, pbn->lname);
247
267
  }
248
- if (first)
249
- BIO_puts(out, "<EMPTY>\n");
250
- else
251
- BIO_puts(out, "\n");
252
- return 1;
268
+ }
269
+ if (first) {
270
+ BIO_puts(out, "<EMPTY>\n");
271
+ } else {
272
+ BIO_puts(out, "\n");
273
+ }
274
+ return 1;
253
275
  }
254
276
 
255
277
  static DIST_POINT *crldp_from_section(X509V3_CTX *ctx,
256
- STACK_OF(CONF_VALUE) *nval)
257
- {
258
- size_t i;
259
- CONF_VALUE *cnf;
260
- DIST_POINT *point = NULL;
261
- point = DIST_POINT_new();
262
- if (!point)
278
+ STACK_OF(CONF_VALUE) *nval) {
279
+ size_t i;
280
+ CONF_VALUE *cnf;
281
+ DIST_POINT *point = NULL;
282
+ point = DIST_POINT_new();
283
+ if (!point) {
284
+ goto err;
285
+ }
286
+ for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
287
+ int ret;
288
+ cnf = sk_CONF_VALUE_value(nval, i);
289
+ ret = set_dist_point_name(&point->distpoint, ctx, cnf);
290
+ if (ret > 0) {
291
+ continue;
292
+ }
293
+ if (ret < 0) {
294
+ goto err;
295
+ }
296
+ if (!strcmp(cnf->name, "reasons")) {
297
+ if (!set_reasons(&point->reasons, cnf->value)) {
263
298
  goto err;
264
- for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
265
- int ret;
266
- cnf = sk_CONF_VALUE_value(nval, i);
267
- ret = set_dist_point_name(&point->distpoint, ctx, cnf);
268
- if (ret > 0)
269
- continue;
270
- if (ret < 0)
271
- goto err;
272
- if (!strcmp(cnf->name, "reasons")) {
273
- if (!set_reasons(&point->reasons, cnf->value))
274
- goto err;
275
- } else if (!strcmp(cnf->name, "CRLissuer")) {
276
- point->CRLissuer = gnames_from_sectname(ctx, cnf->value);
277
- if (!point->CRLissuer)
278
- goto err;
279
- }
299
+ }
300
+ } else if (!strcmp(cnf->name, "CRLissuer")) {
301
+ point->CRLissuer = gnames_from_sectname(ctx, cnf->value);
302
+ if (!point->CRLissuer) {
303
+ goto err;
304
+ }
280
305
  }
306
+ }
281
307
 
282
- return point;
308
+ return point;
283
309
 
284
- err:
285
- if (point)
286
- DIST_POINT_free(point);
287
- return NULL;
310
+ err:
311
+ if (point) {
312
+ DIST_POINT_free(point);
313
+ }
314
+ return NULL;
288
315
  }
289
316
 
290
- static void *v2i_crld(const X509V3_EXT_METHOD *method,
291
- X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
292
- {
293
- STACK_OF(DIST_POINT) *crld = NULL;
294
- GENERAL_NAMES *gens = NULL;
295
- GENERAL_NAME *gen = NULL;
296
- CONF_VALUE *cnf;
297
- size_t i;
298
- if (!(crld = sk_DIST_POINT_new_null()))
317
+ static void *v2i_crld(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
318
+ STACK_OF(CONF_VALUE) *nval) {
319
+ STACK_OF(DIST_POINT) *crld = NULL;
320
+ GENERAL_NAMES *gens = NULL;
321
+ GENERAL_NAME *gen = NULL;
322
+ CONF_VALUE *cnf;
323
+ size_t i;
324
+ if (!(crld = sk_DIST_POINT_new_null())) {
325
+ goto merr;
326
+ }
327
+ for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
328
+ DIST_POINT *point;
329
+ cnf = sk_CONF_VALUE_value(nval, i);
330
+ if (!cnf->value) {
331
+ STACK_OF(CONF_VALUE) *dpsect;
332
+ dpsect = X509V3_get_section(ctx, cnf->name);
333
+ if (!dpsect) {
334
+ goto err;
335
+ }
336
+ point = crldp_from_section(ctx, dpsect);
337
+ X509V3_section_free(ctx, dpsect);
338
+ if (!point) {
339
+ goto err;
340
+ }
341
+ if (!sk_DIST_POINT_push(crld, point)) {
342
+ DIST_POINT_free(point);
299
343
  goto merr;
300
- for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
301
- DIST_POINT *point;
302
- cnf = sk_CONF_VALUE_value(nval, i);
303
- if (!cnf->value) {
304
- STACK_OF(CONF_VALUE) *dpsect;
305
- dpsect = X509V3_get_section(ctx, cnf->name);
306
- if (!dpsect)
307
- goto err;
308
- point = crldp_from_section(ctx, dpsect);
309
- X509V3_section_free(ctx, dpsect);
310
- if (!point)
311
- goto err;
312
- if (!sk_DIST_POINT_push(crld, point)) {
313
- DIST_POINT_free(point);
314
- goto merr;
315
- }
316
- } else {
317
- if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf)))
318
- goto err;
319
- if (!(gens = GENERAL_NAMES_new()))
320
- goto merr;
321
- if (!sk_GENERAL_NAME_push(gens, gen))
322
- goto merr;
323
- gen = NULL;
324
- if (!(point = DIST_POINT_new()))
325
- goto merr;
326
- if (!sk_DIST_POINT_push(crld, point)) {
327
- DIST_POINT_free(point);
328
- goto merr;
329
- }
330
- if (!(point->distpoint = DIST_POINT_NAME_new()))
331
- goto merr;
332
- point->distpoint->name.fullname = gens;
333
- point->distpoint->type = 0;
334
- gens = NULL;
335
- }
344
+ }
345
+ } else {
346
+ if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) {
347
+ goto err;
348
+ }
349
+ if (!(gens = GENERAL_NAMES_new())) {
350
+ goto merr;
351
+ }
352
+ if (!sk_GENERAL_NAME_push(gens, gen)) {
353
+ goto merr;
354
+ }
355
+ gen = NULL;
356
+ if (!(point = DIST_POINT_new())) {
357
+ goto merr;
358
+ }
359
+ if (!sk_DIST_POINT_push(crld, point)) {
360
+ DIST_POINT_free(point);
361
+ goto merr;
362
+ }
363
+ if (!(point->distpoint = DIST_POINT_NAME_new())) {
364
+ goto merr;
365
+ }
366
+ point->distpoint->name.fullname = gens;
367
+ point->distpoint->type = 0;
368
+ gens = NULL;
336
369
  }
337
- return crld;
338
-
339
- merr:
340
- OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
341
- err:
342
- GENERAL_NAME_free(gen);
343
- GENERAL_NAMES_free(gens);
344
- sk_DIST_POINT_pop_free(crld, DIST_POINT_free);
345
- return NULL;
370
+ }
371
+ return crld;
372
+
373
+ merr:
374
+ OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
375
+ err:
376
+ GENERAL_NAME_free(gen);
377
+ GENERAL_NAMES_free(gens);
378
+ sk_DIST_POINT_pop_free(crld, DIST_POINT_free);
379
+ return NULL;
346
380
  }
347
381
 
348
382
  static int dpn_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
349
- void *exarg)
350
- {
351
- DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
383
+ void *exarg) {
384
+ DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
352
385
 
353
- switch (operation) {
386
+ switch (operation) {
354
387
  case ASN1_OP_NEW_POST:
355
- dpn->dpname = NULL;
356
- break;
388
+ dpn->dpname = NULL;
389
+ break;
357
390
 
358
391
  case ASN1_OP_FREE_POST:
359
- if (dpn->dpname)
360
- X509_NAME_free(dpn->dpname);
361
- break;
362
- }
363
- return 1;
392
+ if (dpn->dpname) {
393
+ X509_NAME_free(dpn->dpname);
394
+ }
395
+ break;
396
+ }
397
+ return 1;
364
398
  }
365
399
 
366
400
 
367
- ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) = {
401
+ ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) =
402
+ {
368
403
  ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0),
369
404
  ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1),
370
405
  } ASN1_CHOICE_END_cb(DIST_POINT_NAME, DIST_POINT_NAME, type)
371
406
 
372
407
 
373
- IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME)
408
+ IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME)
374
409
 
375
410
  ASN1_SEQUENCE(DIST_POINT) = {
376
- ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0),
377
- ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1),
378
- ASN1_IMP_SEQUENCE_OF_OPT(DIST_POINT, CRLissuer, GENERAL_NAME, 2),
411
+ ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0),
412
+ ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1),
413
+ ASN1_IMP_SEQUENCE_OF_OPT(DIST_POINT, CRLissuer, GENERAL_NAME, 2),
379
414
  } ASN1_SEQUENCE_END(DIST_POINT)
380
415
 
381
416
  IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT)
382
417
 
383
- ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) =
384
- ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CRLDistributionPoints, DIST_POINT)
418
+ ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) = ASN1_EX_TEMPLATE_TYPE(
419
+ ASN1_TFLG_SEQUENCE_OF, 0, CRLDistributionPoints, DIST_POINT)
385
420
  ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS)
386
421
 
387
422
  IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS)
388
423
 
389
424
  ASN1_SEQUENCE(ISSUING_DIST_POINT) = {
390
- ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0),
391
- ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1),
392
- ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2),
393
- ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3),
394
- ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4),
395
- ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyattr, ASN1_FBOOLEAN, 5),
425
+ ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0),
426
+ ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1),
427
+ ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2),
428
+ ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3),
429
+ ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4),
430
+ ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyattr, ASN1_FBOOLEAN, 5),
396
431
  } ASN1_SEQUENCE_END(ISSUING_DIST_POINT)
397
432
 
398
433
  IMPLEMENT_ASN1_FUNCTIONS(ISSUING_DIST_POINT)
@@ -403,161 +438,180 @@ static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
403
438
  STACK_OF(CONF_VALUE) *nval);
404
439
 
405
440
  const X509V3_EXT_METHOD v3_idp = {
406
- NID_issuing_distribution_point, X509V3_EXT_MULTILINE,
441
+ NID_issuing_distribution_point,
442
+ X509V3_EXT_MULTILINE,
407
443
  ASN1_ITEM_ref(ISSUING_DIST_POINT),
408
- 0, 0, 0, 0,
409
- 0, 0,
444
+ 0,
445
+ 0,
446
+ 0,
447
+ 0,
448
+ 0,
449
+ 0,
410
450
  0,
411
451
  v2i_idp,
412
- i2r_idp, 0,
452
+ i2r_idp,
453
+ 0,
413
454
  NULL,
414
455
  };
415
456
 
416
457
  static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
417
- STACK_OF(CONF_VALUE) *nval)
418
- {
419
- ISSUING_DIST_POINT *idp = NULL;
420
- CONF_VALUE *cnf;
421
- char *name, *val;
422
- size_t i;
423
- int ret;
424
- idp = ISSUING_DIST_POINT_new();
425
- if (!idp)
426
- goto merr;
427
- for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
428
- cnf = sk_CONF_VALUE_value(nval, i);
429
- name = cnf->name;
430
- val = cnf->value;
431
- ret = set_dist_point_name(&idp->distpoint, ctx, cnf);
432
- if (ret > 0)
433
- continue;
434
- if (ret < 0)
435
- goto err;
436
- if (!strcmp(name, "onlyuser")) {
437
- if (!X509V3_get_value_bool(cnf, &idp->onlyuser))
438
- goto err;
439
- } else if (!strcmp(name, "onlyCA")) {
440
- if (!X509V3_get_value_bool(cnf, &idp->onlyCA))
441
- goto err;
442
- } else if (!strcmp(name, "onlyAA")) {
443
- if (!X509V3_get_value_bool(cnf, &idp->onlyattr))
444
- goto err;
445
- } else if (!strcmp(name, "indirectCRL")) {
446
- if (!X509V3_get_value_bool(cnf, &idp->indirectCRL))
447
- goto err;
448
- } else if (!strcmp(name, "onlysomereasons")) {
449
- if (!set_reasons(&idp->onlysomereasons, val))
450
- goto err;
451
- } else {
452
- OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME);
453
- X509V3_conf_err(cnf);
454
- goto err;
455
- }
458
+ STACK_OF(CONF_VALUE) *nval) {
459
+ ISSUING_DIST_POINT *idp = NULL;
460
+ CONF_VALUE *cnf;
461
+ char *name, *val;
462
+ size_t i;
463
+ int ret;
464
+ idp = ISSUING_DIST_POINT_new();
465
+ if (!idp) {
466
+ goto merr;
467
+ }
468
+ for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
469
+ cnf = sk_CONF_VALUE_value(nval, i);
470
+ name = cnf->name;
471
+ val = cnf->value;
472
+ ret = set_dist_point_name(&idp->distpoint, ctx, cnf);
473
+ if (ret > 0) {
474
+ continue;
456
475
  }
457
- return idp;
458
-
459
- merr:
460
- OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
461
- err:
462
- ISSUING_DIST_POINT_free(idp);
463
- return NULL;
476
+ if (ret < 0) {
477
+ goto err;
478
+ }
479
+ if (!strcmp(name, "onlyuser")) {
480
+ if (!X509V3_get_value_bool(cnf, &idp->onlyuser)) {
481
+ goto err;
482
+ }
483
+ } else if (!strcmp(name, "onlyCA")) {
484
+ if (!X509V3_get_value_bool(cnf, &idp->onlyCA)) {
485
+ goto err;
486
+ }
487
+ } else if (!strcmp(name, "onlyAA")) {
488
+ if (!X509V3_get_value_bool(cnf, &idp->onlyattr)) {
489
+ goto err;
490
+ }
491
+ } else if (!strcmp(name, "indirectCRL")) {
492
+ if (!X509V3_get_value_bool(cnf, &idp->indirectCRL)) {
493
+ goto err;
494
+ }
495
+ } else if (!strcmp(name, "onlysomereasons")) {
496
+ if (!set_reasons(&idp->onlysomereasons, val)) {
497
+ goto err;
498
+ }
499
+ } else {
500
+ OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NAME);
501
+ X509V3_conf_err(cnf);
502
+ goto err;
503
+ }
504
+ }
505
+ return idp;
506
+
507
+ merr:
508
+ OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
509
+ err:
510
+ ISSUING_DIST_POINT_free(idp);
511
+ return NULL;
464
512
  }
465
513
 
466
- static int print_gens(BIO *out, STACK_OF(GENERAL_NAME) *gens, int indent)
467
- {
468
- size_t i;
469
- for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
470
- BIO_printf(out, "%*s", indent + 2, "");
471
- GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i));
472
- BIO_puts(out, "\n");
473
- }
474
- return 1;
514
+ static int print_gens(BIO *out, STACK_OF(GENERAL_NAME) *gens, int indent) {
515
+ size_t i;
516
+ for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
517
+ BIO_printf(out, "%*s", indent + 2, "");
518
+ GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i));
519
+ BIO_puts(out, "\n");
520
+ }
521
+ return 1;
475
522
  }
476
523
 
477
- static int print_distpoint(BIO *out, DIST_POINT_NAME *dpn, int indent)
478
- {
479
- if (dpn->type == 0) {
480
- BIO_printf(out, "%*sFull Name:\n", indent, "");
481
- print_gens(out, dpn->name.fullname, indent);
482
- } else {
483
- X509_NAME ntmp;
484
- ntmp.entries = dpn->name.relativename;
485
- BIO_printf(out, "%*sRelative Name:\n%*s", indent, "", indent + 2, "");
486
- X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE);
487
- BIO_puts(out, "\n");
488
- }
489
- return 1;
524
+ static int print_distpoint(BIO *out, DIST_POINT_NAME *dpn, int indent) {
525
+ if (dpn->type == 0) {
526
+ BIO_printf(out, "%*sFull Name:\n", indent, "");
527
+ print_gens(out, dpn->name.fullname, indent);
528
+ } else {
529
+ X509_NAME ntmp;
530
+ ntmp.entries = dpn->name.relativename;
531
+ BIO_printf(out, "%*sRelative Name:\n%*s", indent, "", indent + 2, "");
532
+ X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE);
533
+ BIO_puts(out, "\n");
534
+ }
535
+ return 1;
490
536
  }
491
537
 
492
538
  static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out,
493
- int indent)
494
- {
495
- ISSUING_DIST_POINT *idp = pidp;
496
- if (idp->distpoint)
497
- print_distpoint(out, idp->distpoint, indent);
498
- if (idp->onlyuser > 0)
499
- BIO_printf(out, "%*sOnly User Certificates\n", indent, "");
500
- if (idp->onlyCA > 0)
501
- BIO_printf(out, "%*sOnly CA Certificates\n", indent, "");
502
- if (idp->indirectCRL > 0)
503
- BIO_printf(out, "%*sIndirect CRL\n", indent, "");
504
- if (idp->onlysomereasons)
505
- print_reasons(out, "Only Some Reasons", idp->onlysomereasons, indent);
506
- if (idp->onlyattr > 0)
507
- BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, "");
508
- if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0)
509
- && (idp->indirectCRL <= 0) && !idp->onlysomereasons
510
- && (idp->onlyattr <= 0))
511
- BIO_printf(out, "%*s<EMPTY>\n", indent, "");
512
-
513
- return 1;
539
+ int indent) {
540
+ ISSUING_DIST_POINT *idp = pidp;
541
+ if (idp->distpoint) {
542
+ print_distpoint(out, idp->distpoint, indent);
543
+ }
544
+ if (idp->onlyuser > 0) {
545
+ BIO_printf(out, "%*sOnly User Certificates\n", indent, "");
546
+ }
547
+ if (idp->onlyCA > 0) {
548
+ BIO_printf(out, "%*sOnly CA Certificates\n", indent, "");
549
+ }
550
+ if (idp->indirectCRL > 0) {
551
+ BIO_printf(out, "%*sIndirect CRL\n", indent, "");
552
+ }
553
+ if (idp->onlysomereasons) {
554
+ print_reasons(out, "Only Some Reasons", idp->onlysomereasons, indent);
555
+ }
556
+ if (idp->onlyattr > 0) {
557
+ BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, "");
558
+ }
559
+ if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0) &&
560
+ (idp->indirectCRL <= 0) && !idp->onlysomereasons &&
561
+ (idp->onlyattr <= 0)) {
562
+ BIO_printf(out, "%*s<EMPTY>\n", indent, "");
563
+ }
564
+
565
+ return 1;
514
566
  }
515
567
 
516
568
  static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
517
- int indent)
518
- {
519
- STACK_OF(DIST_POINT) *crld = pcrldp;
520
- DIST_POINT *point;
521
- size_t i;
522
- for (i = 0; i < sk_DIST_POINT_num(crld); i++) {
523
- BIO_puts(out, "\n");
524
- point = sk_DIST_POINT_value(crld, i);
525
- if (point->distpoint)
526
- print_distpoint(out, point->distpoint, indent);
527
- if (point->reasons)
528
- print_reasons(out, "Reasons", point->reasons, indent);
529
- if (point->CRLissuer) {
530
- BIO_printf(out, "%*sCRL Issuer:\n", indent, "");
531
- print_gens(out, point->CRLissuer, indent);
532
- }
569
+ int indent) {
570
+ STACK_OF(DIST_POINT) *crld = pcrldp;
571
+ DIST_POINT *point;
572
+ size_t i;
573
+ for (i = 0; i < sk_DIST_POINT_num(crld); i++) {
574
+ BIO_puts(out, "\n");
575
+ point = sk_DIST_POINT_value(crld, i);
576
+ if (point->distpoint) {
577
+ print_distpoint(out, point->distpoint, indent);
533
578
  }
534
- return 1;
535
- }
536
-
537
- int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname)
538
- {
539
- size_t i;
540
- STACK_OF(X509_NAME_ENTRY) *frag;
541
- X509_NAME_ENTRY *ne;
542
- if (!dpn || (dpn->type != 1))
543
- return 1;
544
- frag = dpn->name.relativename;
545
- dpn->dpname = X509_NAME_dup(iname);
546
- if (!dpn->dpname)
547
- return 0;
548
- for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) {
549
- ne = sk_X509_NAME_ENTRY_value(frag, i);
550
- if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1)) {
551
- X509_NAME_free(dpn->dpname);
552
- dpn->dpname = NULL;
553
- return 0;
554
- }
579
+ if (point->reasons) {
580
+ print_reasons(out, "Reasons", point->reasons, indent);
555
581
  }
556
- /* generate cached encoding of name */
557
- if (i2d_X509_NAME(dpn->dpname, NULL) < 0) {
558
- X509_NAME_free(dpn->dpname);
559
- dpn->dpname = NULL;
560
- return 0;
582
+ if (point->CRLissuer) {
583
+ BIO_printf(out, "%*sCRL Issuer:\n", indent, "");
584
+ print_gens(out, point->CRLissuer, indent);
561
585
  }
586
+ }
587
+ return 1;
588
+ }
589
+
590
+ int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname) {
591
+ size_t i;
592
+ STACK_OF(X509_NAME_ENTRY) *frag;
593
+ X509_NAME_ENTRY *ne;
594
+ if (!dpn || (dpn->type != 1)) {
562
595
  return 1;
596
+ }
597
+ frag = dpn->name.relativename;
598
+ dpn->dpname = X509_NAME_dup(iname);
599
+ if (!dpn->dpname) {
600
+ return 0;
601
+ }
602
+ for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) {
603
+ ne = sk_X509_NAME_ENTRY_value(frag, i);
604
+ if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1)) {
605
+ X509_NAME_free(dpn->dpname);
606
+ dpn->dpname = NULL;
607
+ return 0;
608
+ }
609
+ }
610
+ // generate cached encoding of name
611
+ if (i2d_X509_NAME(dpn->dpname, NULL) < 0) {
612
+ X509_NAME_free(dpn->dpname);
613
+ dpn->dpname = NULL;
614
+ return 0;
615
+ }
616
+ return 1;
563
617
  }