@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
|
@@ -63,22 +63,19 @@
|
|
|
63
63
|
#include <openssl/err.h>
|
|
64
64
|
#include <openssl/mem.h>
|
|
65
65
|
|
|
66
|
-
#include "internal.h"
|
|
67
66
|
#include "../bytestring/internal.h"
|
|
67
|
+
#include "internal.h"
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
* size limits too.
|
|
76
|
-
*/
|
|
69
|
+
// These functions take a string in UTF8, ASCII or multibyte form and a mask
|
|
70
|
+
// of permissible ASN1 string types. It then works out the minimal type
|
|
71
|
+
// (using the order Printable < IA5 < T61 < BMP < Universal < UTF8) and
|
|
72
|
+
// creates a string of the correct type with the supplied data. Yes this is
|
|
73
|
+
// horrible: it has to be :-( The 'ncopy' form checks minimum and maximum
|
|
74
|
+
// size limits too.
|
|
77
75
|
|
|
78
76
|
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
|
|
79
|
-
int inform, unsigned long mask)
|
|
80
|
-
|
|
81
|
-
return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
|
|
77
|
+
int inform, unsigned long mask) {
|
|
78
|
+
return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_BMPSTRING)
|
|
@@ -86,213 +83,211 @@ OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_UNIVERSALSTRING)
|
|
|
86
83
|
OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_UTF8STRING)
|
|
87
84
|
|
|
88
85
|
int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
|
|
89
|
-
int inform, unsigned long mask,
|
|
90
|
-
long
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
int inform, unsigned long mask, long minsize,
|
|
87
|
+
long maxsize) {
|
|
88
|
+
int str_type;
|
|
89
|
+
char free_out;
|
|
90
|
+
ASN1_STRING *dest;
|
|
91
|
+
size_t nchar = 0;
|
|
92
|
+
char strbuf[32];
|
|
93
|
+
if (len == -1) {
|
|
94
|
+
len = strlen((const char *)in);
|
|
95
|
+
}
|
|
96
|
+
if (!mask) {
|
|
97
|
+
mask = DIRSTRING_TYPE;
|
|
98
|
+
}
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
int (*decode_func)(CBS *, uint32_t *);
|
|
101
|
+
int error;
|
|
102
|
+
switch (inform) {
|
|
105
103
|
case MBSTRING_BMP:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
decode_func = cbs_get_ucs2_be;
|
|
105
|
+
error = ASN1_R_INVALID_BMPSTRING;
|
|
106
|
+
break;
|
|
109
107
|
|
|
110
108
|
case MBSTRING_UNIV:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
decode_func = cbs_get_utf32_be;
|
|
110
|
+
error = ASN1_R_INVALID_UNIVERSALSTRING;
|
|
111
|
+
break;
|
|
114
112
|
|
|
115
113
|
case MBSTRING_UTF8:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
decode_func = cbs_get_utf8;
|
|
115
|
+
error = ASN1_R_INVALID_UTF8STRING;
|
|
116
|
+
break;
|
|
119
117
|
|
|
120
118
|
case MBSTRING_ASC:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
decode_func = cbs_get_latin1;
|
|
120
|
+
error = ERR_R_INTERNAL_ERROR; // Latin-1 inputs are never invalid.
|
|
121
|
+
break;
|
|
124
122
|
|
|
125
123
|
default:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT);
|
|
125
|
+
return -1;
|
|
126
|
+
}
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
if (nchar == 0 &&
|
|
141
|
-
(inform == MBSTRING_BMP || inform == MBSTRING_UNIV) &&
|
|
142
|
-
c == 0xfeff) {
|
|
143
|
-
/* Reject byte-order mark. We could drop it but that would mean
|
|
144
|
-
* adding ambiguity around whether a BOM was included or not when
|
|
145
|
-
* matching strings.
|
|
146
|
-
*
|
|
147
|
-
* For a little-endian UCS-2 string, the BOM will appear as 0xfffe
|
|
148
|
-
* and will be rejected as noncharacter, below. */
|
|
149
|
-
OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS);
|
|
150
|
-
return -1;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/* Update which output formats are still possible. */
|
|
154
|
-
if ((mask & B_ASN1_PRINTABLESTRING) && !asn1_is_printable(c)) {
|
|
155
|
-
mask &= ~B_ASN1_PRINTABLESTRING;
|
|
156
|
-
}
|
|
157
|
-
if ((mask & B_ASN1_IA5STRING) && (c > 127)) {
|
|
158
|
-
mask &= ~B_ASN1_IA5STRING;
|
|
159
|
-
}
|
|
160
|
-
if ((mask & B_ASN1_T61STRING) && (c > 0xff)) {
|
|
161
|
-
mask &= ~B_ASN1_T61STRING;
|
|
162
|
-
}
|
|
163
|
-
if ((mask & B_ASN1_BMPSTRING) && (c > 0xffff)) {
|
|
164
|
-
mask &= ~B_ASN1_BMPSTRING;
|
|
165
|
-
}
|
|
166
|
-
if (!mask) {
|
|
167
|
-
OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS);
|
|
168
|
-
return -1;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
nchar++;
|
|
172
|
-
utf8_len += cbb_get_utf8_len(c);
|
|
128
|
+
// Check |minsize| and |maxsize| and work out the minimal type, if any.
|
|
129
|
+
CBS cbs;
|
|
130
|
+
CBS_init(&cbs, in, len);
|
|
131
|
+
size_t utf8_len = 0;
|
|
132
|
+
while (CBS_len(&cbs) != 0) {
|
|
133
|
+
uint32_t c;
|
|
134
|
+
if (!decode_func(&cbs, &c)) {
|
|
135
|
+
OPENSSL_PUT_ERROR(ASN1, error);
|
|
136
|
+
return -1;
|
|
173
137
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
138
|
+
if (nchar == 0 && (inform == MBSTRING_BMP || inform == MBSTRING_UNIV) &&
|
|
139
|
+
c == 0xfeff) {
|
|
140
|
+
// Reject byte-order mark. We could drop it but that would mean
|
|
141
|
+
// adding ambiguity around whether a BOM was included or not when
|
|
142
|
+
// matching strings.
|
|
143
|
+
//
|
|
144
|
+
// For a little-endian UCS-2 string, the BOM will appear as 0xfffe
|
|
145
|
+
// and will be rejected as noncharacter, below.
|
|
146
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS);
|
|
147
|
+
return -1;
|
|
180
148
|
}
|
|
181
149
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
ERR_add_error_data(2, "maxsize=", strbuf);
|
|
186
|
-
return -1;
|
|
150
|
+
// Update which output formats are still possible.
|
|
151
|
+
if ((mask & B_ASN1_PRINTABLESTRING) && !asn1_is_printable(c)) {
|
|
152
|
+
mask &= ~B_ASN1_PRINTABLESTRING;
|
|
187
153
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
int (*encode_func)(CBB *, uint32_t) = cbb_add_latin1;
|
|
191
|
-
size_t size_estimate = nchar;
|
|
192
|
-
int outform = MBSTRING_ASC;
|
|
193
|
-
if (mask & B_ASN1_PRINTABLESTRING) {
|
|
194
|
-
str_type = V_ASN1_PRINTABLESTRING;
|
|
195
|
-
} else if (mask & B_ASN1_IA5STRING) {
|
|
196
|
-
str_type = V_ASN1_IA5STRING;
|
|
197
|
-
} else if (mask & B_ASN1_T61STRING) {
|
|
198
|
-
str_type = V_ASN1_T61STRING;
|
|
199
|
-
} else if (mask & B_ASN1_BMPSTRING) {
|
|
200
|
-
str_type = V_ASN1_BMPSTRING;
|
|
201
|
-
outform = MBSTRING_BMP;
|
|
202
|
-
encode_func = cbb_add_ucs2_be;
|
|
203
|
-
size_estimate = 2 * nchar;
|
|
204
|
-
} else if (mask & B_ASN1_UNIVERSALSTRING) {
|
|
205
|
-
str_type = V_ASN1_UNIVERSALSTRING;
|
|
206
|
-
encode_func = cbb_add_utf32_be;
|
|
207
|
-
size_estimate = 4 * nchar;
|
|
208
|
-
outform = MBSTRING_UNIV;
|
|
209
|
-
} else if (mask & B_ASN1_UTF8STRING) {
|
|
210
|
-
str_type = V_ASN1_UTF8STRING;
|
|
211
|
-
outform = MBSTRING_UTF8;
|
|
212
|
-
encode_func = cbb_add_utf8;
|
|
213
|
-
size_estimate = utf8_len;
|
|
214
|
-
} else {
|
|
215
|
-
OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS);
|
|
216
|
-
return -1;
|
|
154
|
+
if ((mask & B_ASN1_IA5STRING) && (c > 127)) {
|
|
155
|
+
mask &= ~B_ASN1_IA5STRING;
|
|
217
156
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return str_type;
|
|
221
|
-
if (*out) {
|
|
222
|
-
free_out = 0;
|
|
223
|
-
dest = *out;
|
|
224
|
-
if (dest->data) {
|
|
225
|
-
dest->length = 0;
|
|
226
|
-
OPENSSL_free(dest->data);
|
|
227
|
-
dest->data = NULL;
|
|
228
|
-
}
|
|
229
|
-
dest->type = str_type;
|
|
230
|
-
} else {
|
|
231
|
-
free_out = 1;
|
|
232
|
-
dest = ASN1_STRING_type_new(str_type);
|
|
233
|
-
if (!dest) {
|
|
234
|
-
OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE);
|
|
235
|
-
return -1;
|
|
236
|
-
}
|
|
237
|
-
*out = dest;
|
|
157
|
+
if ((mask & B_ASN1_T61STRING) && (c > 0xff)) {
|
|
158
|
+
mask &= ~B_ASN1_T61STRING;
|
|
238
159
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (inform == outform) {
|
|
242
|
-
if (!ASN1_STRING_set(dest, in, len)) {
|
|
243
|
-
OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE);
|
|
244
|
-
return -1;
|
|
245
|
-
}
|
|
246
|
-
return str_type;
|
|
160
|
+
if ((mask & B_ASN1_BMPSTRING) && (c > 0xffff)) {
|
|
161
|
+
mask &= ~B_ASN1_BMPSTRING;
|
|
247
162
|
}
|
|
163
|
+
if (!mask) {
|
|
164
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS);
|
|
165
|
+
return -1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
nchar++;
|
|
169
|
+
utf8_len += cbb_get_utf8_len(c);
|
|
170
|
+
}
|
|
248
171
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
172
|
+
if (minsize > 0 && nchar < (size_t)minsize) {
|
|
173
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT);
|
|
174
|
+
BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
|
|
175
|
+
ERR_add_error_data(2, "minsize=", strbuf);
|
|
176
|
+
return -1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (maxsize > 0 && nchar > (size_t)maxsize) {
|
|
180
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG);
|
|
181
|
+
BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
|
|
182
|
+
ERR_add_error_data(2, "maxsize=", strbuf);
|
|
183
|
+
return -1;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Now work out output format and string type
|
|
187
|
+
int (*encode_func)(CBB *, uint32_t) = cbb_add_latin1;
|
|
188
|
+
size_t size_estimate = nchar;
|
|
189
|
+
int outform = MBSTRING_ASC;
|
|
190
|
+
if (mask & B_ASN1_PRINTABLESTRING) {
|
|
191
|
+
str_type = V_ASN1_PRINTABLESTRING;
|
|
192
|
+
} else if (mask & B_ASN1_IA5STRING) {
|
|
193
|
+
str_type = V_ASN1_IA5STRING;
|
|
194
|
+
} else if (mask & B_ASN1_T61STRING) {
|
|
195
|
+
str_type = V_ASN1_T61STRING;
|
|
196
|
+
} else if (mask & B_ASN1_BMPSTRING) {
|
|
197
|
+
str_type = V_ASN1_BMPSTRING;
|
|
198
|
+
outform = MBSTRING_BMP;
|
|
199
|
+
encode_func = cbb_add_ucs2_be;
|
|
200
|
+
size_estimate = 2 * nchar;
|
|
201
|
+
} else if (mask & B_ASN1_UNIVERSALSTRING) {
|
|
202
|
+
str_type = V_ASN1_UNIVERSALSTRING;
|
|
203
|
+
encode_func = cbb_add_utf32_be;
|
|
204
|
+
size_estimate = 4 * nchar;
|
|
205
|
+
outform = MBSTRING_UNIV;
|
|
206
|
+
} else if (mask & B_ASN1_UTF8STRING) {
|
|
207
|
+
str_type = V_ASN1_UTF8STRING;
|
|
208
|
+
outform = MBSTRING_UTF8;
|
|
209
|
+
encode_func = cbb_add_utf8;
|
|
210
|
+
size_estimate = utf8_len;
|
|
211
|
+
} else {
|
|
212
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS);
|
|
213
|
+
return -1;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (!out) {
|
|
217
|
+
return str_type;
|
|
218
|
+
}
|
|
219
|
+
if (*out) {
|
|
220
|
+
free_out = 0;
|
|
221
|
+
dest = *out;
|
|
222
|
+
if (dest->data) {
|
|
223
|
+
dest->length = 0;
|
|
224
|
+
OPENSSL_free(dest->data);
|
|
225
|
+
dest->data = NULL;
|
|
253
226
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
227
|
+
dest->type = str_type;
|
|
228
|
+
} else {
|
|
229
|
+
free_out = 1;
|
|
230
|
+
dest = ASN1_STRING_type_new(str_type);
|
|
231
|
+
if (!dest) {
|
|
232
|
+
OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE);
|
|
233
|
+
return -1;
|
|
262
234
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
OPENSSL_PUT_ERROR(ASN1, ERR_R_INTERNAL_ERROR);
|
|
272
|
-
OPENSSL_free(data);
|
|
273
|
-
goto err;
|
|
235
|
+
*out = dest;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// If both the same type just copy across
|
|
239
|
+
if (inform == outform) {
|
|
240
|
+
if (!ASN1_STRING_set(dest, in, len)) {
|
|
241
|
+
OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE);
|
|
242
|
+
return -1;
|
|
274
243
|
}
|
|
275
|
-
dest->length = (int)(data_len - 1);
|
|
276
|
-
dest->data = data;
|
|
277
244
|
return str_type;
|
|
245
|
+
}
|
|
278
246
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
247
|
+
CBB cbb;
|
|
248
|
+
if (!CBB_init(&cbb, size_estimate + 1)) {
|
|
249
|
+
OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE);
|
|
250
|
+
goto err;
|
|
251
|
+
}
|
|
252
|
+
CBS_init(&cbs, in, len);
|
|
253
|
+
while (CBS_len(&cbs) != 0) {
|
|
254
|
+
uint32_t c;
|
|
255
|
+
if (!decode_func(&cbs, &c) || !encode_func(&cbb, c)) {
|
|
256
|
+
OPENSSL_PUT_ERROR(ASN1, ERR_R_INTERNAL_ERROR);
|
|
257
|
+
goto err;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
uint8_t *data = NULL;
|
|
261
|
+
size_t data_len;
|
|
262
|
+
if (// OpenSSL historically NUL-terminated this value with a single byte,
|
|
263
|
+
// even for |MBSTRING_BMP| and |MBSTRING_UNIV|.
|
|
264
|
+
!CBB_add_u8(&cbb, 0) || !CBB_finish(&cbb, &data, &data_len) ||
|
|
265
|
+
data_len < 1 || data_len > INT_MAX) {
|
|
266
|
+
OPENSSL_PUT_ERROR(ASN1, ERR_R_INTERNAL_ERROR);
|
|
267
|
+
OPENSSL_free(data);
|
|
268
|
+
goto err;
|
|
269
|
+
}
|
|
270
|
+
dest->length = (int)(data_len - 1);
|
|
271
|
+
dest->data = data;
|
|
272
|
+
return str_type;
|
|
273
|
+
|
|
274
|
+
err:
|
|
275
|
+
if (free_out) {
|
|
276
|
+
ASN1_STRING_free(dest);
|
|
277
|
+
}
|
|
278
|
+
CBB_cleanup(&cbb);
|
|
279
|
+
return -1;
|
|
284
280
|
}
|
|
285
281
|
|
|
286
|
-
int asn1_is_printable(uint32_t value)
|
|
287
|
-
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
value == '/' || value == ':' || value == '=' || value == '?';
|
|
282
|
+
int asn1_is_printable(uint32_t value) {
|
|
283
|
+
if (value > 0x7f) {
|
|
284
|
+
return 0;
|
|
285
|
+
}
|
|
286
|
+
// Note we cannot use |isalnum| because it is locale-dependent.
|
|
287
|
+
return ('a' <= value && value <= 'z') || //
|
|
288
|
+
('A' <= value && value <= 'Z') || //
|
|
289
|
+
('0' <= value && value <= '9') || //
|
|
290
|
+
value == ' ' || value == '\'' || value == '(' || value == ')' ||
|
|
291
|
+
value == '+' || value == ',' || value == '-' || value == '.' ||
|
|
292
|
+
value == '/' || value == ':' || value == '=' || value == '?';
|
|
298
293
|
}
|