@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.
- package/package.json +1 -1
- package/readme.md +1 -3
- package/src/http3eventloop.cc +83 -9
- package/src/http3eventloop.h +13 -3
- package/src/http3server.cc +22 -22
- package/src/http3server.h +7 -20
- package/src/http3wtstreamvisitor.cc +31 -10
- package/src/http3wtstreamvisitor.h +38 -11
- package/src/webtransport.js +91 -23
- package/test/echoserver.js +29 -5
- package/test/testsuite.js +242 -220
- package/third_party/boringssl/src/CMakeLists.txt +2 -0
- package/third_party/boringssl/src/crypto/CMakeLists.txt +1 -0
- package/third_party/boringssl/src/crypto/asn1/a_bitstr.c +174 -177
- package/third_party/boringssl/src/crypto/asn1/a_bool.c +46 -48
- package/third_party/boringssl/src/crypto/asn1/a_d2i_fp.c +21 -23
- package/third_party/boringssl/src/crypto/asn1/a_dup.c +21 -23
- package/third_party/boringssl/src/crypto/asn1/a_gentm.c +84 -187
- package/third_party/boringssl/src/crypto/asn1/a_i2d_fp.c +19 -21
- package/third_party/boringssl/src/crypto/asn1/a_int.c +305 -329
- package/third_party/boringssl/src/crypto/asn1/a_mbstr.c +190 -195
- package/third_party/boringssl/src/crypto/asn1/a_object.c +182 -189
- package/third_party/boringssl/src/crypto/asn1/a_octet.c +6 -9
- package/third_party/boringssl/src/crypto/asn1/a_print.c +15 -16
- package/third_party/boringssl/src/crypto/asn1/a_strex.c +386 -399
- package/third_party/boringssl/src/crypto/asn1/a_strnid.c +110 -131
- package/third_party/boringssl/src/crypto/asn1/a_time.c +118 -111
- package/third_party/boringssl/src/crypto/asn1/a_type.c +59 -60
- package/third_party/boringssl/src/crypto/asn1/a_utctm.c +114 -186
- package/third_party/boringssl/src/crypto/asn1/a_utf8.c +171 -159
- package/third_party/boringssl/src/crypto/asn1/asn1_lib.c +245 -260
- package/third_party/boringssl/src/crypto/asn1/asn1_par.c +41 -40
- package/third_party/boringssl/src/crypto/asn1/asn1_test.cc +31 -0
- package/third_party/boringssl/src/crypto/asn1/asn_pack.c +31 -33
- package/third_party/boringssl/src/crypto/asn1/f_int.c +36 -33
- package/third_party/boringssl/src/crypto/asn1/f_string.c +29 -26
- package/third_party/boringssl/src/crypto/asn1/internal.h +62 -61
- package/third_party/boringssl/src/crypto/asn1/tasn_dec.c +706 -702
- package/third_party/boringssl/src/crypto/asn1/tasn_enc.c +507 -524
- package/third_party/boringssl/src/crypto/asn1/tasn_fre.c +141 -133
- package/third_party/boringssl/src/crypto/asn1/tasn_new.c +207 -199
- package/third_party/boringssl/src/crypto/asn1/tasn_typ.c +19 -22
- package/third_party/boringssl/src/crypto/asn1/tasn_utl.c +24 -24
- package/third_party/boringssl/src/crypto/asn1/time_support.c +13 -13
- package/third_party/boringssl/src/crypto/bio/connect.c +9 -3
- package/third_party/boringssl/src/crypto/bytestring/bytestring_test.cc +125 -1
- package/third_party/boringssl/src/crypto/bytestring/cbb.c +4 -7
- package/third_party/boringssl/src/crypto/bytestring/cbs.c +167 -9
- package/third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c +0 -2
- package/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c +23 -54
- package/third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c +0 -2
- package/third_party/boringssl/src/crypto/cipher_extra/e_tls.c +0 -2
- package/third_party/boringssl/src/crypto/curve25519/curve25519.c +6 -8
- package/third_party/boringssl/src/crypto/evp/evp_ctx.c +25 -22
- package/third_party/boringssl/src/crypto/evp/internal.h +15 -9
- package/third_party/boringssl/src/crypto/evp/p_dsa_asn1.c +2 -0
- package/third_party/boringssl/src/crypto/evp/p_ec_asn1.c +2 -0
- package/third_party/boringssl/src/crypto/evp/p_ed25519.c +3 -3
- package/third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c +10 -7
- package/third_party/boringssl/src/crypto/evp/p_hkdf.c +241 -0
- package/third_party/boringssl/src/crypto/evp/p_rsa_asn1.c +2 -0
- package/third_party/boringssl/src/crypto/evp/p_x25519_asn1.c +1 -0
- package/third_party/boringssl/src/crypto/fipsmodule/aes/aes_nohw.c +9 -10
- package/third_party/boringssl/src/crypto/fipsmodule/aes/key_wrap.c +2 -6
- package/third_party/boringssl/src/crypto/fipsmodule/bn/exponentiation.c +5 -11
- package/third_party/boringssl/src/crypto/fipsmodule/bn/internal.h +1 -1
- package/third_party/boringssl/src/crypto/fipsmodule/bn/prime.c +2 -0
- package/third_party/boringssl/src/crypto/fipsmodule/cipher/e_aes.c +10 -26
- package/third_party/boringssl/src/crypto/fipsmodule/cipher/e_aesccm.c +2 -3
- package/third_party/boringssl/src/crypto/fipsmodule/digestsign/digestsign.c +1 -0
- package/third_party/boringssl/src/crypto/fipsmodule/ec/p256-nistz.c +44 -43
- package/third_party/boringssl/src/crypto/fipsmodule/modes/cbc.c +5 -9
- package/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c +14 -21
- package/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c +8 -8
- package/third_party/boringssl/src/crypto/fipsmodule/rand/internal.h +1 -4
- package/third_party/boringssl/src/crypto/hkdf/hkdf_test.cc +104 -0
- package/third_party/boringssl/src/crypto/internal.h +18 -4
- package/third_party/boringssl/src/crypto/lhash/internal.h +13 -1
- package/third_party/boringssl/src/crypto/obj/obj_dat.h +4 -1
- package/third_party/boringssl/src/crypto/obj/obj_mac.num +1 -0
- package/third_party/boringssl/src/crypto/obj/objects.txt +2 -0
- package/third_party/boringssl/src/crypto/pem/pem_all.c +77 -86
- package/third_party/boringssl/src/crypto/pem/pem_info.c +221 -233
- package/third_party/boringssl/src/crypto/pem/pem_lib.c +639 -608
- package/third_party/boringssl/src/crypto/pem/pem_oth.c +17 -16
- package/third_party/boringssl/src/crypto/pem/pem_pk8.c +133 -142
- package/third_party/boringssl/src/crypto/pem/pem_pkey.c +96 -92
- package/third_party/boringssl/src/crypto/poly1305/poly1305_vec.c +12 -28
- package/third_party/boringssl/src/crypto/siphash/siphash.c +8 -11
- package/third_party/boringssl/src/crypto/siphash/siphash_test.cc +5 -7
- package/third_party/boringssl/src/crypto/stack/stack.c +33 -16
- package/third_party/boringssl/src/crypto/thread_pthread.c +0 -2
- package/third_party/boringssl/src/crypto/thread_win.c +0 -2
- package/third_party/boringssl/src/crypto/trust_token/internal.h +14 -0
- package/third_party/boringssl/src/crypto/trust_token/pmbtoken.c +127 -30
- package/third_party/boringssl/src/crypto/trust_token/trust_token.c +40 -0
- package/third_party/boringssl/src/crypto/trust_token/trust_token_test.cc +165 -0
- package/third_party/boringssl/src/crypto/trust_token/voprf.c +55 -6
- package/third_party/boringssl/src/crypto/x509/a_digest.c +23 -24
- package/third_party/boringssl/src/crypto/x509/a_sign.c +52 -55
- package/third_party/boringssl/src/crypto/x509/a_verify.c +33 -34
- package/third_party/boringssl/src/crypto/x509/algorithm.c +17 -18
- package/third_party/boringssl/src/crypto/x509/asn1_gen.c +618 -612
- package/third_party/boringssl/src/crypto/x509/by_dir.c +320 -337
- package/third_party/boringssl/src/crypto/x509/by_file.c +186 -186
- package/third_party/boringssl/src/crypto/x509/i2d_pr.c +11 -14
- package/third_party/boringssl/src/crypto/x509/internal.h +22 -22
- package/third_party/boringssl/src/crypto/x509/name_print.c +155 -150
- package/third_party/boringssl/src/crypto/x509/rsa_pss.c +27 -29
- package/third_party/boringssl/src/crypto/x509/t_crl.c +67 -70
- package/third_party/boringssl/src/crypto/x509/t_req.c +3 -5
- package/third_party/boringssl/src/crypto/x509/t_x509.c +280 -251
- package/third_party/boringssl/src/crypto/x509/t_x509a.c +52 -47
- package/third_party/boringssl/src/crypto/x509/x509.c +3 -4
- package/third_party/boringssl/src/crypto/x509/x509_att.c +234 -223
- package/third_party/boringssl/src/crypto/x509/x509_cmp.c +286 -296
- package/third_party/boringssl/src/crypto/x509/x509_d2.c +37 -32
- package/third_party/boringssl/src/crypto/x509/x509_def.c +14 -30
- package/third_party/boringssl/src/crypto/x509/x509_ext.c +55 -84
- package/third_party/boringssl/src/crypto/x509/x509_lu.c +545 -581
- package/third_party/boringssl/src/crypto/x509/x509_obj.c +131 -121
- package/third_party/boringssl/src/crypto/x509/x509_req.c +120 -139
- package/third_party/boringssl/src/crypto/x509/x509_set.c +128 -142
- package/third_party/boringssl/src/crypto/x509/x509_trs.c +185 -193
- package/third_party/boringssl/src/crypto/x509/x509_txt.c +70 -72
- package/third_party/boringssl/src/crypto/x509/x509_v3.c +172 -161
- package/third_party/boringssl/src/crypto/x509/x509_vfy.c +2041 -2053
- package/third_party/boringssl/src/crypto/x509/x509_vpm.c +441 -461
- package/third_party/boringssl/src/crypto/x509/x509cset.c +152 -170
- package/third_party/boringssl/src/crypto/x509/x509name.c +274 -260
- package/third_party/boringssl/src/crypto/x509/x509rset.c +43 -20
- package/third_party/boringssl/src/crypto/x509/x509spki.c +62 -63
- package/third_party/boringssl/src/crypto/x509/x_algor.c +64 -62
- package/third_party/boringssl/src/crypto/x509/x_all.c +103 -133
- package/third_party/boringssl/src/crypto/x509/x_attrib.c +23 -24
- package/third_party/boringssl/src/crypto/x509/x_crl.c +310 -321
- package/third_party/boringssl/src/crypto/x509/x_exten.c +6 -5
- package/third_party/boringssl/src/crypto/x509/x_info.c +31 -28
- package/third_party/boringssl/src/crypto/x509/x_name.c +361 -365
- package/third_party/boringssl/src/crypto/x509/x_pkey.c +38 -32
- package/third_party/boringssl/src/crypto/x509/x_pubkey.c +114 -117
- package/third_party/boringssl/src/crypto/x509/x_req.c +27 -29
- package/third_party/boringssl/src/crypto/x509/x_sig.c +2 -2
- package/third_party/boringssl/src/crypto/x509/x_spki.c +8 -10
- package/third_party/boringssl/src/crypto/x509/x_val.c +2 -2
- package/third_party/boringssl/src/crypto/x509/x_x509.c +212 -226
- package/third_party/boringssl/src/crypto/x509/x_x509a.c +112 -109
- package/third_party/boringssl/src/crypto/x509v3/ext_dat.h +10 -13
- package/third_party/boringssl/src/crypto/x509v3/internal.h +72 -87
- package/third_party/boringssl/src/crypto/x509v3/pcy_cache.c +184 -176
- package/third_party/boringssl/src/crypto/x509v3/pcy_data.c +58 -56
- package/third_party/boringssl/src/crypto/x509v3/pcy_lib.c +71 -70
- package/third_party/boringssl/src/crypto/x509v3/pcy_map.c +56 -58
- package/third_party/boringssl/src/crypto/x509v3/pcy_node.c +89 -91
- package/third_party/boringssl/src/crypto/x509v3/pcy_tree.c +585 -590
- package/third_party/boringssl/src/crypto/x509v3/v3_akey.c +118 -112
- package/third_party/boringssl/src/crypto/x509v3/v3_akeya.c +3 -3
- package/third_party/boringssl/src/crypto/x509v3/v3_alt.c +447 -451
- package/third_party/boringssl/src/crypto/x509v3/v3_bcons.c +44 -38
- package/third_party/boringssl/src/crypto/x509v3/v3_bitst.c +39 -43
- package/third_party/boringssl/src/crypto/x509v3/v3_conf.c +321 -320
- package/third_party/boringssl/src/crypto/x509v3/v3_cpols.c +352 -327
- package/third_party/boringssl/src/crypto/x509v3/v3_crld.c +437 -383
- package/third_party/boringssl/src/crypto/x509v3/v3_enum.c +23 -16
- package/third_party/boringssl/src/crypto/x509v3/v3_extku.c +62 -53
- package/third_party/boringssl/src/crypto/x509v3/v3_genn.c +118 -115
- package/third_party/boringssl/src/crypto/x509v3/v3_ia5.c +30 -31
- package/third_party/boringssl/src/crypto/x509v3/v3_info.c +112 -98
- package/third_party/boringssl/src/crypto/x509v3/v3_int.c +40 -15
- package/third_party/boringssl/src/crypto/x509v3/v3_lib.c +248 -252
- package/third_party/boringssl/src/crypto/x509v3/v3_ncons.c +390 -386
- package/third_party/boringssl/src/crypto/x509v3/v3_ocsp.c +45 -32
- package/third_party/boringssl/src/crypto/x509v3/v3_pci.c +206 -209
- package/third_party/boringssl/src/crypto/x509v3/v3_pcia.c +6 -8
- package/third_party/boringssl/src/crypto/x509v3/v3_pcons.c +54 -50
- package/third_party/boringssl/src/crypto/x509v3/v3_pmaps.c +66 -65
- package/third_party/boringssl/src/crypto/x509v3/v3_prn.c +144 -133
- package/third_party/boringssl/src/crypto/x509v3/v3_purp.c +695 -709
- package/third_party/boringssl/src/crypto/x509v3/v3_skey.c +75 -69
- package/third_party/boringssl/src/crypto/x509v3/v3_utl.c +1102 -1082
- package/third_party/boringssl/src/include/openssl/base.h +3 -1
- package/third_party/boringssl/src/include/openssl/bn.h +3 -0
- package/third_party/boringssl/src/include/openssl/bytestring.h +20 -0
- package/third_party/boringssl/src/include/openssl/evp.h +6 -5
- package/third_party/boringssl/src/include/openssl/kdf.h +91 -0
- package/third_party/boringssl/src/include/openssl/nid.h +4 -0
- package/third_party/boringssl/src/include/openssl/ssl.h +6 -1
- package/third_party/boringssl/src/include/openssl/stack.h +47 -32
- package/third_party/boringssl/src/include/openssl/trust_token.h +18 -3
- package/third_party/boringssl/src/include/openssl/x509.h +18 -0
- package/third_party/boringssl/src/ssl/ssl_file.cc +61 -99
- package/third_party/boringssl/src/ssl/ssl_test.cc +101 -0
- package/third_party/boringssl/src/util/doc.config +2 -1
- package/third_party/boringssl/src/util/fipstools/acvp/acvptool/subprocess/subprocess.go +8 -0
- package/third_party/googleurl/AUTHORS +16 -2
- package/third_party/googleurl/base/BUILD +1 -0
- package/third_party/googleurl/base/compiler_specific.h +16 -17
- package/third_party/googleurl/base/containers/contiguous_iterator.h +13 -9
- package/third_party/googleurl/base/containers/span.h +23 -8
- package/third_party/googleurl/base/memory/raw_ptr.h +17 -25
- package/third_party/googleurl/base/memory/raw_ptr_exclusion.h +21 -0
- package/third_party/googleurl/base/strings/escape.cc +14 -2
- package/third_party/googleurl/base/strings/safe_sprintf.h +1 -1
- package/third_party/googleurl/base/strings/string_number_conversions.cc +5 -3
- package/third_party/googleurl/base/strings/string_number_conversions_internal.h +5 -5
- package/third_party/googleurl/base/strings/string_piece.h +3 -3
- package/third_party/googleurl/base/strings/string_util.cc +4 -27
- package/third_party/googleurl/base/strings/string_util.h +43 -8
- package/third_party/googleurl/base/strings/string_util_internal.h +11 -12
- package/third_party/googleurl/base/strings/string_util_unittest.cc +33 -0
- package/third_party/googleurl/base/strings/string_util_win.cc +0 -5
- package/third_party/googleurl/base/strings/string_util_win.h +9 -1
- package/third_party/googleurl/base/strings/utf_offset_string_conversions.cc +1 -1
- package/third_party/googleurl/base/strings/utf_string_conversion_utils.cc +5 -8
- package/third_party/googleurl/base/strings/utf_string_conversion_utils.h +13 -10
- package/third_party/googleurl/base/strings/utf_string_conversions.cc +32 -25
- package/third_party/googleurl/base/template_util.h +23 -35
- package/third_party/googleurl/build/build_config.h +14 -3
- package/third_party/googleurl/copy.bara.sky +1 -1
- package/third_party/googleurl/url/gurl.cc +8 -4
- package/third_party/googleurl/url/gurl.h +1 -0
- package/third_party/googleurl/url/gurl_unittest.cc +1 -0
- package/third_party/googleurl/url/origin.h +36 -26
- package/third_party/googleurl/url/scheme_host_port.h +4 -1
- package/third_party/googleurl/url/url_canon.h +2 -1
- package/third_party/googleurl/url/url_canon_internal.cc +9 -7
- package/third_party/googleurl/url/url_canon_internal.h +16 -16
- package/third_party/googleurl/url/url_canon_stdstring.h +2 -1
- package/third_party/googleurl/url/url_util.cc +9 -8
- package/third_party/quiche/build/source_list.bzl +7 -0
- package/third_party/quiche/build/source_list.gni +7 -0
- package/third_party/quiche/build/source_list.json +7 -0
- package/third_party/quiche/quiche/common/platform/api/quiche_mem_slice.h +7 -3
- package/third_party/quiche/quiche/http2/adapter/nghttp2_adapter_test.cc +86 -2
- package/third_party/quiche/quiche/http2/adapter/oghttp2_adapter_test.cc +104 -2
- package/third_party/quiche/quiche/http2/adapter/oghttp2_session.cc +23 -0
- package/third_party/quiche/quiche/http2/adapter/oghttp2_session.h +6 -1
- package/third_party/quiche/quiche/quic/core/congestion_control/send_algorithm_test.cc +0 -16
- package/third_party/quiche/quiche/quic/core/crypto/crypto_protocol.h +1 -1
- package/third_party/quiche/quiche/quic/core/http/end_to_end_test.cc +56 -2
- package/third_party/quiche/quiche/quic/core/http/http_constants.cc +1 -0
- package/third_party/quiche/quiche/quic/core/http/http_constants.h +1 -0
- package/third_party/quiche/quiche/quic/core/http/http_encoder.cc +28 -17
- package/third_party/quiche/quiche/quic/core/http/http_encoder.h +5 -0
- package/third_party/quiche/quiche/quic/core/http/http_encoder_test.cc +26 -30
- package/third_party/quiche/quiche/quic/core/http/http_frames.h +1 -0
- package/third_party/quiche/quiche/quic/core/http/quic_server_session_base.cc +4 -4
- package/third_party/quiche/quiche/quic/core/http/quic_server_session_base_test.cc +1 -1
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_client_session.cc +5 -1
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.cc +6 -33
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.h +0 -17
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream_test.cc +5 -20
- package/third_party/quiche/quiche/quic/core/io/quic_event_loop.h +81 -0
- package/third_party/quiche/quiche/quic/core/io/quic_poll_event_loop.cc +265 -0
- package/third_party/quiche/quiche/quic/core/io/quic_poll_event_loop.h +152 -0
- package/third_party/quiche/quiche/quic/core/io/quic_poll_event_loop_test.cc +341 -0
- package/third_party/quiche/quiche/quic/core/quic_buffered_packet_store.cc +3 -1
- package/third_party/quiche/quiche/quic/core/quic_buffered_packet_store.h +7 -7
- package/third_party/quiche/quiche/quic/core/quic_buffered_packet_store_test.cc +4 -3
- package/third_party/quiche/quiche/quic/core/quic_connection.cc +69 -19
- package/third_party/quiche/quiche/quic/core/quic_connection.h +9 -3
- package/third_party/quiche/quiche/quic/core/quic_connection_id_manager.cc +29 -10
- package/third_party/quiche/quiche/quic/core/quic_connection_id_manager.h +5 -3
- package/third_party/quiche/quiche/quic/core/quic_connection_id_manager_test.cc +85 -22
- package/third_party/quiche/quiche/quic/core/quic_connection_test.cc +186 -30
- package/third_party/quiche/quiche/quic/core/quic_crypto_stream.cc +2 -1
- package/third_party/quiche/quiche/quic/core/quic_default_clock.cc +31 -0
- package/third_party/quiche/quiche/quic/core/quic_default_clock.h +34 -0
- package/third_party/quiche/quiche/quic/core/quic_default_connection_helper.h +49 -0
- package/third_party/quiche/quiche/quic/core/quic_dispatcher.cc +53 -37
- package/third_party/quiche/quiche/quic/core/quic_dispatcher.h +19 -11
- package/third_party/quiche/quiche/quic/core/quic_dispatcher_test.cc +15 -2
- package/third_party/quiche/quiche/quic/core/quic_flags_list.h +10 -4
- package/third_party/quiche/quiche/quic/core/quic_idle_network_detector.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_idle_network_detector_test.cc +4 -4
- package/third_party/quiche/quiche/quic/core/quic_packet_creator.cc +14 -3
- package/third_party/quiche/quiche/quic/core/quic_packet_creator_test.cc +145 -2
- package/third_party/quiche/quiche/quic/core/quic_packets.cc +3 -1
- package/third_party/quiche/quiche/quic/core/quic_packets.h +4 -0
- package/third_party/quiche/quiche/quic/core/quic_sent_packet_manager.cc +13 -11
- package/third_party/quiche/quiche/quic/core/quic_sent_packet_manager.h +9 -0
- package/third_party/quiche/quiche/quic/core/quic_sent_packet_manager_test.cc +6 -0
- package/third_party/quiche/quiche/quic/core/quic_session.cc +3 -2
- package/third_party/quiche/quiche/quic/core/quic_session.h +8 -3
- package/third_party/quiche/quiche/quic/core/quic_types.cc +18 -0
- package/third_party/quiche/quiche/quic/core/quic_types.h +3 -0
- package/third_party/quiche/quiche/quic/core/tls_chlo_extractor.cc +3 -0
- package/third_party/quiche/quiche/quic/core/tls_chlo_extractor.h +10 -0
- package/third_party/quiche/quiche/quic/test_tools/mock_quic_session_visitor.h +1 -1
- package/third_party/quiche/quiche/quic/test_tools/quic_test_utils.h +1 -1
- package/third_party/quiche/quiche/quic/test_tools/server_thread.cc +3 -2
- package/third_party/quiche/quiche/quic/test_tools/simple_session_notifier.cc +7 -1
- package/third_party/quiche/quiche/quic/test_tools/simple_session_notifier.h +3 -0
- package/third_party/quiche/quiche/quic/test_tools/simulator/quic_endpoint.h +4 -2
- package/certs/ca.cnf +0 -69
- package/certs/generate_certs.sh +0 -53
- package/certs/generate_certs_leaf.sh +0 -53
- package/certs/leaf.cnf +0 -24
- package/certs/readme.txt +0 -2
- package/third_party/quiche/build/BUILD.bazel +0 -7
|
@@ -68,220 +68,228 @@ static int policy_data_cmp(const X509_POLICY_DATA **a,
|
|
|
68
68
|
const X509_POLICY_DATA **b);
|
|
69
69
|
static int policy_cache_set_int(long *out, ASN1_INTEGER *value);
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
goto bad_policy;
|
|
94
|
-
/*
|
|
95
|
-
* Duplicate policy OIDs are illegal: reject if matches found.
|
|
96
|
-
*/
|
|
97
|
-
sk_X509_POLICY_DATA_sort(cache->data);
|
|
98
|
-
if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) {
|
|
99
|
-
if (cache->anyPolicy) {
|
|
100
|
-
ret = -1;
|
|
101
|
-
goto bad_policy;
|
|
102
|
-
}
|
|
103
|
-
cache->anyPolicy = data;
|
|
104
|
-
} else if (sk_X509_POLICY_DATA_find(cache->data, NULL, data)) {
|
|
105
|
-
ret = -1;
|
|
106
|
-
goto bad_policy;
|
|
107
|
-
} else if (!sk_X509_POLICY_DATA_push(cache->data, data))
|
|
108
|
-
goto bad_policy;
|
|
109
|
-
data = NULL;
|
|
71
|
+
// Set cache entry according to CertificatePolicies extension. Note: this
|
|
72
|
+
// destroys the passed CERTIFICATEPOLICIES structure.
|
|
73
|
+
|
|
74
|
+
static int policy_cache_create(X509 *x, CERTIFICATEPOLICIES *policies,
|
|
75
|
+
int crit) {
|
|
76
|
+
size_t i;
|
|
77
|
+
int ret = 0;
|
|
78
|
+
X509_POLICY_CACHE *cache = x->policy_cache;
|
|
79
|
+
X509_POLICY_DATA *data = NULL;
|
|
80
|
+
POLICYINFO *policy;
|
|
81
|
+
if (sk_POLICYINFO_num(policies) == 0) {
|
|
82
|
+
goto bad_policy;
|
|
83
|
+
}
|
|
84
|
+
cache->data = sk_X509_POLICY_DATA_new(policy_data_cmp);
|
|
85
|
+
if (!cache->data) {
|
|
86
|
+
goto bad_policy;
|
|
87
|
+
}
|
|
88
|
+
for (i = 0; i < sk_POLICYINFO_num(policies); i++) {
|
|
89
|
+
policy = sk_POLICYINFO_value(policies, i);
|
|
90
|
+
data = policy_data_new(policy, NULL, crit);
|
|
91
|
+
if (!data) {
|
|
92
|
+
goto bad_policy;
|
|
110
93
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
94
|
+
// Duplicate policy OIDs are illegal: reject if matches found.
|
|
95
|
+
sk_X509_POLICY_DATA_sort(cache->data);
|
|
96
|
+
if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) {
|
|
97
|
+
if (cache->anyPolicy) {
|
|
98
|
+
ret = -1;
|
|
99
|
+
goto bad_policy;
|
|
100
|
+
}
|
|
101
|
+
cache->anyPolicy = data;
|
|
102
|
+
} else if (sk_X509_POLICY_DATA_find(cache->data, NULL, data)) {
|
|
103
|
+
ret = -1;
|
|
104
|
+
goto bad_policy;
|
|
105
|
+
} else if (!sk_X509_POLICY_DATA_push(cache->data, data)) {
|
|
106
|
+
goto bad_policy;
|
|
121
107
|
}
|
|
122
|
-
|
|
108
|
+
data = NULL;
|
|
109
|
+
}
|
|
110
|
+
ret = 1;
|
|
111
|
+
bad_policy:
|
|
112
|
+
if (ret == -1) {
|
|
113
|
+
x->ex_flags |= EXFLAG_INVALID_POLICY;
|
|
114
|
+
}
|
|
115
|
+
if (data) {
|
|
116
|
+
policy_data_free(data);
|
|
117
|
+
}
|
|
118
|
+
sk_POLICYINFO_pop_free(policies, POLICYINFO_free);
|
|
119
|
+
if (ret <= 0) {
|
|
120
|
+
sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free);
|
|
121
|
+
cache->data = NULL;
|
|
122
|
+
}
|
|
123
|
+
return ret;
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
static int policy_cache_new(X509 *x)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
126
|
+
static int policy_cache_new(X509 *x) {
|
|
127
|
+
X509_POLICY_CACHE *cache;
|
|
128
|
+
ASN1_INTEGER *ext_any = NULL;
|
|
129
|
+
POLICY_CONSTRAINTS *ext_pcons = NULL;
|
|
130
|
+
CERTIFICATEPOLICIES *ext_cpols = NULL;
|
|
131
|
+
POLICY_MAPPINGS *ext_pmaps = NULL;
|
|
132
|
+
int i;
|
|
133
|
+
cache = OPENSSL_malloc(sizeof(X509_POLICY_CACHE));
|
|
134
|
+
if (!cache) {
|
|
135
|
+
return 0;
|
|
136
|
+
}
|
|
137
|
+
cache->anyPolicy = NULL;
|
|
138
|
+
cache->data = NULL;
|
|
139
|
+
cache->any_skip = -1;
|
|
140
|
+
cache->explicit_skip = -1;
|
|
141
|
+
cache->map_skip = -1;
|
|
142
|
+
|
|
143
|
+
x->policy_cache = cache;
|
|
144
|
+
|
|
145
|
+
// Handle requireExplicitPolicy *first*. Need to process this even if we
|
|
146
|
+
// don't have any policies.
|
|
147
|
+
ext_pcons = X509_get_ext_d2i(x, NID_policy_constraints, &i, NULL);
|
|
148
|
+
|
|
149
|
+
if (!ext_pcons) {
|
|
150
|
+
if (i != -1) {
|
|
151
|
+
goto bad_cache;
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
if (!ext_pcons->requireExplicitPolicy && !ext_pcons->inhibitPolicyMapping) {
|
|
155
|
+
goto bad_cache;
|
|
156
|
+
}
|
|
157
|
+
if (!policy_cache_set_int(&cache->explicit_skip,
|
|
158
|
+
ext_pcons->requireExplicitPolicy)) {
|
|
159
|
+
goto bad_cache;
|
|
160
|
+
}
|
|
161
|
+
if (!policy_cache_set_int(&cache->map_skip,
|
|
162
|
+
ext_pcons->inhibitPolicyMapping)) {
|
|
163
|
+
goto bad_cache;
|
|
163
164
|
}
|
|
165
|
+
}
|
|
164
166
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
-
if (i != -1)
|
|
175
|
-
goto bad_cache;
|
|
176
|
-
return 1;
|
|
167
|
+
// Process CertificatePolicies
|
|
168
|
+
|
|
169
|
+
ext_cpols = X509_get_ext_d2i(x, NID_certificate_policies, &i, NULL);
|
|
170
|
+
// If no CertificatePolicies extension or problem decoding then there is
|
|
171
|
+
// no point continuing because the valid policies will be NULL.
|
|
172
|
+
if (!ext_cpols) {
|
|
173
|
+
// If not absent some problem with extension
|
|
174
|
+
if (i != -1) {
|
|
175
|
+
goto bad_cache;
|
|
177
176
|
}
|
|
177
|
+
return 1;
|
|
178
|
+
}
|
|
178
179
|
|
|
179
|
-
|
|
180
|
+
i = policy_cache_create(x, ext_cpols, i);
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
// NB: ext_cpols freed by policy_cache_set_policies
|
|
182
183
|
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
if (i <= 0) {
|
|
185
|
+
return i;
|
|
186
|
+
}
|
|
185
187
|
|
|
186
|
-
|
|
188
|
+
ext_pmaps = X509_get_ext_d2i(x, NID_policy_mappings, &i, NULL);
|
|
187
189
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
} else {
|
|
193
|
-
i = policy_cache_set_mapping(x, ext_pmaps);
|
|
194
|
-
if (i <= 0)
|
|
195
|
-
goto bad_cache;
|
|
190
|
+
if (!ext_pmaps) {
|
|
191
|
+
// If not absent some problem with extension
|
|
192
|
+
if (i != -1) {
|
|
193
|
+
goto bad_cache;
|
|
196
194
|
}
|
|
195
|
+
} else {
|
|
196
|
+
i = policy_cache_set_mapping(x, ext_pmaps);
|
|
197
|
+
if (i <= 0) {
|
|
198
|
+
goto bad_cache;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
197
201
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (!ext_any) {
|
|
201
|
-
if (i != -1)
|
|
202
|
-
goto bad_cache;
|
|
203
|
-
} else if (!policy_cache_set_int(&cache->any_skip, ext_any))
|
|
204
|
-
goto bad_cache;
|
|
202
|
+
ext_any = X509_get_ext_d2i(x, NID_inhibit_any_policy, &i, NULL);
|
|
205
203
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
if (!ext_any) {
|
|
205
|
+
if (i != -1) {
|
|
206
|
+
goto bad_cache;
|
|
209
207
|
}
|
|
208
|
+
} else if (!policy_cache_set_int(&cache->any_skip, ext_any)) {
|
|
209
|
+
goto bad_cache;
|
|
210
|
+
}
|
|
210
211
|
|
|
211
|
-
|
|
212
|
-
|
|
212
|
+
if (0) {
|
|
213
|
+
bad_cache:
|
|
214
|
+
x->ex_flags |= EXFLAG_INVALID_POLICY;
|
|
215
|
+
}
|
|
213
216
|
|
|
214
|
-
|
|
215
|
-
|
|
217
|
+
if (ext_pcons) {
|
|
218
|
+
POLICY_CONSTRAINTS_free(ext_pcons);
|
|
219
|
+
}
|
|
216
220
|
|
|
217
|
-
|
|
221
|
+
if (ext_any) {
|
|
222
|
+
ASN1_INTEGER_free(ext_any);
|
|
223
|
+
}
|
|
218
224
|
|
|
225
|
+
return 1;
|
|
219
226
|
}
|
|
220
227
|
|
|
221
|
-
void policy_cache_free(X509_POLICY_CACHE *cache)
|
|
222
|
-
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
void policy_cache_free(X509_POLICY_CACHE *cache) {
|
|
229
|
+
if (!cache) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (cache->anyPolicy) {
|
|
233
|
+
policy_data_free(cache->anyPolicy);
|
|
234
|
+
}
|
|
235
|
+
if (cache->data) {
|
|
236
|
+
sk_X509_POLICY_DATA_pop_free(cache->data, policy_data_free);
|
|
237
|
+
}
|
|
238
|
+
OPENSSL_free(cache);
|
|
230
239
|
}
|
|
231
240
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
* the |X509| structure, but |CRYPTO_once_t| isn't public.
|
|
236
|
-
*/
|
|
241
|
+
// g_x509_policy_cache_lock is used to protect against concurrent calls to
|
|
242
|
+
// |policy_cache_new|. Ideally this would be done with a |CRYPTO_once_t| in
|
|
243
|
+
// the |X509| structure, but |CRYPTO_once_t| isn't public.
|
|
237
244
|
static struct CRYPTO_STATIC_MUTEX g_x509_policy_cache_lock =
|
|
238
245
|
CRYPTO_STATIC_MUTEX_INIT;
|
|
239
246
|
|
|
240
|
-
const X509_POLICY_CACHE *policy_cache_set(X509 *x)
|
|
241
|
-
|
|
242
|
-
X509_POLICY_CACHE *cache;
|
|
247
|
+
const X509_POLICY_CACHE *policy_cache_set(X509 *x) {
|
|
248
|
+
X509_POLICY_CACHE *cache;
|
|
243
249
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
250
|
+
CRYPTO_STATIC_MUTEX_lock_read(&g_x509_policy_cache_lock);
|
|
251
|
+
cache = x->policy_cache;
|
|
252
|
+
CRYPTO_STATIC_MUTEX_unlock_read(&g_x509_policy_cache_lock);
|
|
247
253
|
|
|
248
|
-
|
|
249
|
-
|
|
254
|
+
if (cache != NULL) {
|
|
255
|
+
return cache;
|
|
256
|
+
}
|
|
250
257
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
258
|
+
CRYPTO_STATIC_MUTEX_lock_write(&g_x509_policy_cache_lock);
|
|
259
|
+
if (x->policy_cache == NULL) {
|
|
260
|
+
policy_cache_new(x);
|
|
261
|
+
}
|
|
262
|
+
cache = x->policy_cache;
|
|
263
|
+
CRYPTO_STATIC_MUTEX_unlock_write(&g_x509_policy_cache_lock);
|
|
256
264
|
|
|
257
|
-
|
|
265
|
+
return cache;
|
|
258
266
|
}
|
|
259
267
|
|
|
260
268
|
X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache,
|
|
261
|
-
const ASN1_OBJECT *id)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
const ASN1_OBJECT *id) {
|
|
270
|
+
size_t idx;
|
|
271
|
+
X509_POLICY_DATA tmp;
|
|
272
|
+
|
|
273
|
+
tmp.valid_policy = (ASN1_OBJECT *)id;
|
|
274
|
+
sk_X509_POLICY_DATA_sort(cache->data);
|
|
275
|
+
if (!sk_X509_POLICY_DATA_find(cache->data, &idx, &tmp)) {
|
|
276
|
+
return NULL;
|
|
277
|
+
}
|
|
278
|
+
return sk_X509_POLICY_DATA_value(cache->data, idx);
|
|
271
279
|
}
|
|
272
280
|
|
|
273
281
|
static int policy_data_cmp(const X509_POLICY_DATA **a,
|
|
274
|
-
const X509_POLICY_DATA **b)
|
|
275
|
-
|
|
276
|
-
return OBJ_cmp((*a)->valid_policy, (*b)->valid_policy);
|
|
282
|
+
const X509_POLICY_DATA **b) {
|
|
283
|
+
return OBJ_cmp((*a)->valid_policy, (*b)->valid_policy);
|
|
277
284
|
}
|
|
278
285
|
|
|
279
|
-
static int policy_cache_set_int(long *out, ASN1_INTEGER *value)
|
|
280
|
-
{
|
|
281
|
-
if (value == NULL)
|
|
282
|
-
return 1;
|
|
283
|
-
if (value->type == V_ASN1_NEG_INTEGER)
|
|
284
|
-
return 0;
|
|
285
|
-
*out = ASN1_INTEGER_get(value);
|
|
286
|
+
static int policy_cache_set_int(long *out, ASN1_INTEGER *value) {
|
|
287
|
+
if (value == NULL) {
|
|
286
288
|
return 1;
|
|
289
|
+
}
|
|
290
|
+
if (value->type == V_ASN1_NEG_INTEGER) {
|
|
291
|
+
return 0;
|
|
292
|
+
}
|
|
293
|
+
*out = ASN1_INTEGER_get(value);
|
|
294
|
+
return 1;
|
|
287
295
|
}
|
|
@@ -64,69 +64,71 @@
|
|
|
64
64
|
|
|
65
65
|
#include "internal.h"
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
// Policy Node routines
|
|
68
68
|
|
|
69
|
-
void policy_data_free(X509_POLICY_DATA *data)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
void policy_data_free(X509_POLICY_DATA *data) {
|
|
70
|
+
ASN1_OBJECT_free(data->valid_policy);
|
|
71
|
+
// Don't free qualifiers if shared
|
|
72
|
+
if (!(data->flags & POLICY_DATA_FLAG_SHARED_QUALIFIERS)) {
|
|
73
|
+
sk_POLICYQUALINFO_pop_free(data->qualifier_set, POLICYQUALINFO_free);
|
|
74
|
+
}
|
|
75
|
+
sk_ASN1_OBJECT_pop_free(data->expected_policy_set, ASN1_OBJECT_free);
|
|
76
|
+
OPENSSL_free(data);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
* source.
|
|
85
|
-
*/
|
|
79
|
+
// Create a data based on an existing policy. If 'id' is NULL use the oid in
|
|
80
|
+
// the policy, otherwise use 'id'. This behaviour covers the two types of
|
|
81
|
+
// data in RFC 3280: data with from a CertificatePolcies extension and
|
|
82
|
+
// additional data with just the qualifiers of anyPolicy and ID from another
|
|
83
|
+
// source.
|
|
86
84
|
|
|
87
|
-
X509_POLICY_DATA *policy_data_new(POLICYINFO *policy,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
} else
|
|
99
|
-
id = NULL;
|
|
100
|
-
ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA));
|
|
101
|
-
if (!ret) {
|
|
102
|
-
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
103
|
-
ASN1_OBJECT_free(id);
|
|
104
|
-
return NULL;
|
|
105
|
-
}
|
|
106
|
-
ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
|
|
107
|
-
if (!ret->expected_policy_set) {
|
|
108
|
-
OPENSSL_free(ret);
|
|
109
|
-
ASN1_OBJECT_free(id);
|
|
110
|
-
return NULL;
|
|
85
|
+
X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, const ASN1_OBJECT *cid,
|
|
86
|
+
int crit) {
|
|
87
|
+
X509_POLICY_DATA *ret;
|
|
88
|
+
ASN1_OBJECT *id;
|
|
89
|
+
if (!policy && !cid) {
|
|
90
|
+
return NULL;
|
|
91
|
+
}
|
|
92
|
+
if (cid) {
|
|
93
|
+
id = OBJ_dup(cid);
|
|
94
|
+
if (!id) {
|
|
95
|
+
return NULL;
|
|
111
96
|
}
|
|
97
|
+
} else {
|
|
98
|
+
id = NULL;
|
|
99
|
+
}
|
|
100
|
+
ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA));
|
|
101
|
+
if (!ret) {
|
|
102
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
103
|
+
ASN1_OBJECT_free(id);
|
|
104
|
+
return NULL;
|
|
105
|
+
}
|
|
106
|
+
ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
|
|
107
|
+
if (!ret->expected_policy_set) {
|
|
108
|
+
OPENSSL_free(ret);
|
|
109
|
+
ASN1_OBJECT_free(id);
|
|
110
|
+
return NULL;
|
|
111
|
+
}
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
if (crit) {
|
|
114
|
+
ret->flags = POLICY_DATA_FLAG_CRITICAL;
|
|
115
|
+
} else {
|
|
116
|
+
ret->flags = 0;
|
|
117
|
+
}
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
if (id) {
|
|
120
|
+
ret->valid_policy = id;
|
|
121
|
+
} else {
|
|
122
|
+
ret->valid_policy = policy->policyid;
|
|
123
|
+
policy->policyid = NULL;
|
|
124
|
+
}
|
|
124
125
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
if (policy) {
|
|
127
|
+
ret->qualifier_set = policy->qualifiers;
|
|
128
|
+
policy->qualifiers = NULL;
|
|
129
|
+
} else {
|
|
130
|
+
ret->qualifier_set = NULL;
|
|
131
|
+
}
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
return ret;
|
|
132
134
|
}
|