@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
|
@@ -8159,5 +8159,106 @@ TEST(SSLTest, NumTickets) {
|
|
|
8159
8159
|
EXPECT_EQ(count_tickets(), 16u);
|
|
8160
8160
|
}
|
|
8161
8161
|
|
|
8162
|
+
TEST(SSLTest, CertSubjectsToStack) {
|
|
8163
|
+
const std::string kCert1 = R"(
|
|
8164
|
+
-----BEGIN CERTIFICATE-----
|
|
8165
|
+
MIIBzzCCAXagAwIBAgIJANlMBNpJfb/rMAkGByqGSM49BAEwRTELMAkGA1UEBhMC
|
|
8166
|
+
QVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp
|
|
8167
|
+
dHMgUHR5IEx0ZDAeFw0xNDA0MjMyMzIxNTdaFw0xNDA1MjMyMzIxNTdaMEUxCzAJ
|
|
8168
|
+
BgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5l
|
|
8169
|
+
dCBXaWRnaXRzIFB0eSBMdGQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATmK2ni
|
|
8170
|
+
v2Wfl74vHg2UikzVl2u3qR4NRvvdqakendy6WgHn1peoChj5w8SjHlbifINI2xYa
|
|
8171
|
+
HPUdfvGULUvPciLBo1AwTjAdBgNVHQ4EFgQUq4TSrKuV8IJOFngHVVdf5CaNgtEw
|
|
8172
|
+
HwYDVR0jBBgwFoAUq4TSrKuV8IJOFngHVVdf5CaNgtEwDAYDVR0TBAUwAwEB/zAJ
|
|
8173
|
+
BgcqhkjOPQQBA0gAMEUCIQDyoDVeUTo2w4J5m+4nUIWOcAZ0lVfSKXQA9L4Vh13E
|
|
8174
|
+
BwIgfB55FGohg/B6dGh5XxSZmmi08cueFV7mHzJSYV51yRQ=
|
|
8175
|
+
-----END CERTIFICATE-----
|
|
8176
|
+
)";
|
|
8177
|
+
const std::vector<uint8_t> kName1 = {
|
|
8178
|
+
0x30, 0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
|
|
8179
|
+
0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
|
|
8180
|
+
0x0c, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
|
|
8181
|
+
0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x18, 0x49,
|
|
8182
|
+
0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
|
|
8183
|
+
0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64};
|
|
8184
|
+
const std::string kCert2 = R"(
|
|
8185
|
+
-----BEGIN CERTIFICATE-----
|
|
8186
|
+
MIICXjCCAcegAwIBAgIIWjO48ufpunYwDQYJKoZIhvcNAQELBQAwNjEaMBgGA1UE
|
|
8187
|
+
ChMRQm9yaW5nU1NMIFRFU1RJTkcxGDAWBgNVBAMTD0ludGVybWVkaWF0ZSBDQTAg
|
|
8188
|
+
Fw0xNTAxMDEwMDAwMDBaGA8yMTAwMDEwMTAwMDAwMFowMjEaMBgGA1UEChMRQm9y
|
|
8189
|
+
aW5nU1NMIFRFU1RJTkcxFDASBgNVBAMTC2V4YW1wbGUuY29tMIGfMA0GCSqGSIb3
|
|
8190
|
+
DQEBAQUAA4GNADCBiQKBgQDD0U0ZYgqShJ7oOjsyNKyVXEHqeafmk/bAoPqY/h1c
|
|
8191
|
+
oPw2E8KmeqiUSoTPjG5IXSblOxcqpbAXgnjPzo8DI3GNMhAf8SYNYsoH7gc7Uy7j
|
|
8192
|
+
5x8bUrisGnuTHqkqH6d4/e7ETJ7i3CpR8bvK16DggEvQTudLipz8FBHtYhFakfdh
|
|
8193
|
+
TwIDAQABo3cwdTAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG
|
|
8194
|
+
CCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwGQYDVR0OBBIEEKN5pvbur7mlXjeMEYA0
|
|
8195
|
+
4nUwGwYDVR0jBBQwEoAQjBpoqLV2211Xex+NFLIGozANBgkqhkiG9w0BAQsFAAOB
|
|
8196
|
+
gQBj/p+JChp//LnXWC1k121LM/ii7hFzQzMrt70bny406SGz9jAjaPOX4S3gt38y
|
|
8197
|
+
rhjpPukBlSzgQXFg66y6q5qp1nQTD1Cw6NkKBe9WuBlY3iYfmsf7WT8nhlT1CttU
|
|
8198
|
+
xNCwyMX9mtdXdQicOfNjIGUCD5OLV5PgHFPRKiHHioBAhg==
|
|
8199
|
+
-----END CERTIFICATE-----
|
|
8200
|
+
)";
|
|
8201
|
+
const std::vector<uint8_t> kName2 = {
|
|
8202
|
+
0x30, 0x32, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x0a,
|
|
8203
|
+
0x13, 0x11, 0x42, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x53, 0x4c,
|
|
8204
|
+
0x20, 0x54, 0x45, 0x53, 0x54, 0x49, 0x4e, 0x47, 0x31, 0x14, 0x30,
|
|
8205
|
+
0x12, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0b, 0x65, 0x78, 0x61,
|
|
8206
|
+
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d};
|
|
8207
|
+
|
|
8208
|
+
const struct {
|
|
8209
|
+
std::vector<std::vector<uint8_t>> existing;
|
|
8210
|
+
std::string pem;
|
|
8211
|
+
std::vector<std::vector<uint8_t>> expected;
|
|
8212
|
+
} kTests[] = {
|
|
8213
|
+
// Do nothing.
|
|
8214
|
+
{{}, "", {}},
|
|
8215
|
+
// Append to an empty list, skipping duplicates.
|
|
8216
|
+
{{}, kCert1 + kCert2 + kCert1, {kName1, kName2}},
|
|
8217
|
+
// One of the names was already present.
|
|
8218
|
+
{{kName1}, kCert1 + kCert2, {kName1, kName2}},
|
|
8219
|
+
// Both names were already present.
|
|
8220
|
+
{{kName1, kName2}, kCert1 + kCert2, {kName1, kName2}},
|
|
8221
|
+
// Preserve existing duplicates.
|
|
8222
|
+
{{kName1, kName2, kName2}, kCert1 + kCert2, {kName1, kName2, kName2}},
|
|
8223
|
+
};
|
|
8224
|
+
for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kTests); i++) {
|
|
8225
|
+
SCOPED_TRACE(i);
|
|
8226
|
+
const auto &t = kTests[i];
|
|
8227
|
+
|
|
8228
|
+
bssl::UniquePtr<STACK_OF(X509_NAME)> stack(sk_X509_NAME_new_null());
|
|
8229
|
+
ASSERT_TRUE(stack);
|
|
8230
|
+
for (const auto& name : t.existing) {
|
|
8231
|
+
const uint8_t *inp = name.data();
|
|
8232
|
+
bssl::UniquePtr<X509_NAME> name_obj(
|
|
8233
|
+
d2i_X509_NAME(nullptr, &inp, name.size()));
|
|
8234
|
+
ASSERT_TRUE(name_obj);
|
|
8235
|
+
EXPECT_EQ(inp, name.data() + name.size());
|
|
8236
|
+
ASSERT_TRUE(bssl::PushToStack(stack.get(), std::move(name_obj)));
|
|
8237
|
+
}
|
|
8238
|
+
|
|
8239
|
+
bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(t.pem.data(), t.pem.size()));
|
|
8240
|
+
ASSERT_TRUE(bio);
|
|
8241
|
+
ASSERT_TRUE(SSL_add_bio_cert_subjects_to_stack(stack.get(), bio.get()));
|
|
8242
|
+
|
|
8243
|
+
// The function should have left |stack|'s comparison function alone.
|
|
8244
|
+
EXPECT_EQ(nullptr, sk_X509_NAME_set_cmp_func(stack.get(), nullptr));
|
|
8245
|
+
|
|
8246
|
+
std::vector<std::vector<uint8_t>> expected = t.expected, result;
|
|
8247
|
+
for (X509_NAME *name : stack.get()) {
|
|
8248
|
+
uint8_t *der = nullptr;
|
|
8249
|
+
int der_len = i2d_X509_NAME(name, &der);
|
|
8250
|
+
ASSERT_GE(der_len, 0);
|
|
8251
|
+
result.push_back(std::vector<uint8_t>(der, der + der_len));
|
|
8252
|
+
OPENSSL_free(der);
|
|
8253
|
+
}
|
|
8254
|
+
|
|
8255
|
+
// |SSL_add_bio_cert_subjects_to_stack| does not return the output in a
|
|
8256
|
+
// well-defined order.
|
|
8257
|
+
std::sort(expected.begin(), expected.end());
|
|
8258
|
+
std::sort(result.begin(), result.end());
|
|
8259
|
+
EXPECT_EQ(result, expected);
|
|
8260
|
+
}
|
|
8261
|
+
}
|
|
8262
|
+
|
|
8162
8263
|
} // namespace
|
|
8163
8264
|
BSSL_NAMESPACE_END
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"include/openssl/cipher.h",
|
|
49
49
|
"include/openssl/aead.h",
|
|
50
50
|
"include/openssl/evp.h",
|
|
51
|
-
"include/openssl/hpke.h"
|
|
51
|
+
"include/openssl/hpke.h",
|
|
52
|
+
"include/openssl/kdf.h"
|
|
52
53
|
]
|
|
53
54
|
},{
|
|
54
55
|
"Name": "Legacy ASN.1 and X.509 implementation (documentation in progress)",
|
|
@@ -77,6 +77,10 @@ func NewWithIO(cmd *exec.Cmd, in io.WriteCloser, out io.ReadCloser) *Subprocess
|
|
|
77
77
|
"SHA2-384": &hashPrimitive{"SHA2-384", 48},
|
|
78
78
|
"SHA2-512": &hashPrimitive{"SHA2-512", 64},
|
|
79
79
|
"SHA2-512/256": &hashPrimitive{"SHA2-512/256", 32},
|
|
80
|
+
"SHA3-224": &hashPrimitive{"SHA3-224", 28},
|
|
81
|
+
"SHA3-256": &hashPrimitive{"SHA3-256", 32},
|
|
82
|
+
"SHA3-384": &hashPrimitive{"SHA3-384", 48},
|
|
83
|
+
"SHA3-512": &hashPrimitive{"SHA3-512", 64},
|
|
80
84
|
"ACVP-AES-ECB": &blockCipher{"AES", 16, 2, true, false, iterateAES},
|
|
81
85
|
"ACVP-AES-CBC": &blockCipher{"AES-CBC", 16, 2, true, true, iterateAESCBC},
|
|
82
86
|
"ACVP-AES-CBC-CS3": &blockCipher{"AES-CBC-CS3", 16, 1, false, true, iterateAESCBC},
|
|
@@ -93,6 +97,10 @@ func NewWithIO(cmd *exec.Cmd, in io.WriteCloser, out io.ReadCloser) *Subprocess
|
|
|
93
97
|
"HMAC-SHA2-384": &hmacPrimitive{"HMAC-SHA2-384", 48},
|
|
94
98
|
"HMAC-SHA2-512": &hmacPrimitive{"HMAC-SHA2-512", 64},
|
|
95
99
|
"HMAC-SHA2-512/256": &hmacPrimitive{"HMAC-SHA2-512/256", 32},
|
|
100
|
+
"HMAC-SHA3-224": &hmacPrimitive{"HMAC-SHA3-224", 28},
|
|
101
|
+
"HMAC-SHA3-256": &hmacPrimitive{"HMAC-SHA3-256", 32},
|
|
102
|
+
"HMAC-SHA3-384": &hmacPrimitive{"HMAC-SHA3-384", 48},
|
|
103
|
+
"HMAC-SHA3-512": &hmacPrimitive{"HMAC-SHA3-512", 64},
|
|
96
104
|
"ctrDRBG": &drbg{"ctrDRBG", map[string]bool{"AES-128": true, "AES-192": true, "AES-256": true}},
|
|
97
105
|
"hmacDRBG": &drbg{"hmacDRBG", map[string]bool{"SHA-1": true, "SHA2-224": true, "SHA2-256": true, "SHA2-384": true, "SHA2-512": true}},
|
|
98
106
|
"KDF": &kdfPrimitive{},
|
|
@@ -236,6 +236,7 @@ Claudio DeSouza <claudiomdsjr@gmail.com>
|
|
|
236
236
|
Clemens Fruhwirth <clemens@endorphin.org>
|
|
237
237
|
Clement Scheelfeldt Skau <clementskau@gmail.com>
|
|
238
238
|
Clinton Staley <clintstaley@gmail.com>
|
|
239
|
+
Cong Zuo <zckevinzc@gmail.com>
|
|
239
240
|
Connor Pearson <cjp822@gmail.com>
|
|
240
241
|
Conrad Irwin <conrad.irwin@gmail.com>
|
|
241
242
|
Craig Schlenter <craig.schlenter@gmail.com>
|
|
@@ -269,6 +270,7 @@ Darshan Sen <raisinten@gmail.com>
|
|
|
269
270
|
Darshini KN <kn.darshini@samsung.com>
|
|
270
271
|
Dave Vandyke <kzar@kzar.co.uk>
|
|
271
272
|
David Benjamin <davidben@mit.edu>
|
|
273
|
+
David Brown <develop.david.brown@gmail.com>
|
|
272
274
|
David Davidovic <david@davidovic.io>
|
|
273
275
|
David Erceg <erceg.david@gmail.com>
|
|
274
276
|
David Fox <david@davidjfox.com>
|
|
@@ -296,6 +298,7 @@ Derek Halman <d.halman@gmail.com>
|
|
|
296
298
|
Devlin Cronin <rdevlin.cronin@gmail.com>
|
|
297
299
|
Dhi Aurrahman <dio@rockybars.com>
|
|
298
300
|
Di Wu <meetwudi@gmail.com>
|
|
301
|
+
Di Zhang <dizhangg@chromium.org>
|
|
299
302
|
Diana Suvorova <diana.suvorova@gmail.com>
|
|
300
303
|
Diego Fernández Santos <agujaydedal@gmail.com>
|
|
301
304
|
Diego Ferreiro Val <elfogris@gmail.com>
|
|
@@ -470,6 +473,7 @@ Isaac Reilly <reillyi@amazon.com>
|
|
|
470
473
|
Ivan Naydonov <samogot@gmail.com>
|
|
471
474
|
Ivan Sham <ivansham@amazon.com>
|
|
472
475
|
Jack Bates <jack@nottheoilrig.com>
|
|
476
|
+
Jacky Hu <flameddd@gmail.com>
|
|
473
477
|
Jacob Clark <jacob.jh.clark@googlemail.com>
|
|
474
478
|
Jacob Mandelson <jacob@mandelson.org>
|
|
475
479
|
Jaehun Lim <ljaehun.lim@samsung.com>
|
|
@@ -571,6 +575,7 @@ Johnson Lin <johnson.lin@intel.com>
|
|
|
571
575
|
Jonathan Frazer <listedegarde@gmail.com>
|
|
572
576
|
Jonathan Garbee <jonathan@garbee.me>
|
|
573
577
|
Jonathan Hacker <jhacker@arcanefour.com>
|
|
578
|
+
Jonathan Johnson <johnsonjonathan593@gmail.com>
|
|
574
579
|
Jonathan Kingston <kingstonmailbox@gmail.com>
|
|
575
580
|
Jonathan Shimonovich <jonathans@talon-sec.com>
|
|
576
581
|
Jongdeok Kim <jongdeok.kim@navercorp.com>
|
|
@@ -733,12 +738,14 @@ Manish Chhajer <chhajer.m@samsung.com>
|
|
|
733
738
|
Manish Jethani <m.jethani@eyeo.com>
|
|
734
739
|
Manojkumar Bhosale <manojkumar.bhosale@imgtec.com>
|
|
735
740
|
Manuel Braun <thembrown@gmail.com>
|
|
741
|
+
Manuel Lagana <manuel.lagana.dev@gmail.com>
|
|
736
742
|
Mao Yujie <maojie0924@gmail.com>
|
|
737
743
|
Mao Yujie <yujie.mao@intel.com>
|
|
738
744
|
Marc des Garets <marc.desgarets@googlemail.com>
|
|
739
745
|
Marcin Wiacek <marcin@mwiacek.com>
|
|
740
746
|
Marco Rodrigues <gothicx@gmail.com>
|
|
741
747
|
Marcos Caceres <marcos@marcosc.com>
|
|
748
|
+
Marek Behún <kabel@kernel.org>
|
|
742
749
|
Mariam Ali <alimariam@noogler.google.com>
|
|
743
750
|
Mario Pistrich <m.pistrich@gmail.com>
|
|
744
751
|
Mario Sanchez Prada <mario.prada@samsung.com>
|
|
@@ -936,6 +943,7 @@ Qiang Zeng <zengqiang1@huawei.com>
|
|
|
936
943
|
Qiankun Miao <qiankun.miao@intel.com>
|
|
937
944
|
Qing Zhang <qing.zhang@intel.com>
|
|
938
945
|
Qingmei Li <qingmei.li@vivo.com>
|
|
946
|
+
Qiyao Yuan <qiyaoyuan@tencent.com>
|
|
939
947
|
Radu Stavila <stavila@adobe.com>
|
|
940
948
|
Radu Velea <radu.velea@intel.com>
|
|
941
949
|
Rafael Antognolli <rafael.antognolli@intel.com>
|
|
@@ -975,6 +983,7 @@ Robert Bear Travis <bear.travis@gmail.com>
|
|
|
975
983
|
Robert Bear Travis <betravis@adobe.com>
|
|
976
984
|
Robert Bradford <robert.bradford@intel.com>
|
|
977
985
|
Robert Goldberg <goldberg@adobe.com>
|
|
986
|
+
Robert Günzler <r@gnzler.io>
|
|
978
987
|
Robert Hogan <robhogan@gmail.com>
|
|
979
988
|
Robert O'Callahan <rocallahan@gmail.com>
|
|
980
989
|
Robert Nagy <robert.nagy@gmail.com>
|
|
@@ -1001,6 +1010,7 @@ Ryan Gonzalez <rymg19@gmail.com>
|
|
|
1001
1010
|
Ryan Norton <rnorton10@gmail.com>
|
|
1002
1011
|
Ryan Sleevi <ryan-chromium-dev@sleevi.com>
|
|
1003
1012
|
Ryan Yoakum <ryoakum@skobalt.com>
|
|
1013
|
+
Rye Zhang <ryezhang@tencent.com>
|
|
1004
1014
|
Ryo Ogawa <negibokken@gmail.com>
|
|
1005
1015
|
Ryuan Choi <ryuan.choi@samsung.com>
|
|
1006
1016
|
Saikrishna Arcot <saiarcot895@gmail.com>
|
|
@@ -1090,8 +1100,10 @@ Simon Arlott <simon.arlott@gmail.com>
|
|
|
1090
1100
|
Simon Jackson <simon.jackson@sonocent.com>
|
|
1091
1101
|
Simon La Macchia <smacchia@amazon.com>
|
|
1092
1102
|
Siva Kumar Gunturi <siva.gunturi@samsung.com>
|
|
1093
|
-
|
|
1094
|
-
Sohan Jyoti Ghosh <
|
|
1103
|
+
Slava Aseev <nullptrnine@gmail.com>
|
|
1104
|
+
Sohan Jyoti Ghosh <sohanjg@chromium.org>
|
|
1105
|
+
Sohom Datta <sohom.datta@learner.manipal.edu>
|
|
1106
|
+
Sohom Datta <dattasohom1@gmail.com>
|
|
1095
1107
|
Song Fangzhen <songfangzhen@bytedance.com>
|
|
1096
1108
|
Song YeWen <ffmpeg@gmail.com>
|
|
1097
1109
|
Sooho Park <sooho1000@gmail.com>
|
|
@@ -1174,6 +1186,7 @@ Tim Steiner <twsteiner@gmail.com>
|
|
|
1174
1186
|
Timo Gurr <timo.gurr@gmail.com>
|
|
1175
1187
|
Timo Reimann <ttr314@googlemail.com>
|
|
1176
1188
|
Timo Witte <timo.witte@gmail.com>
|
|
1189
|
+
Timothy Pearson <tpearson@raptorcs.com>
|
|
1177
1190
|
Ting Shao <ting.shao@intel.com>
|
|
1178
1191
|
Tobias Lippert <tobias.lippert@fastmail.com>
|
|
1179
1192
|
Tobias Soppa <tobias@soppa.me>
|
|
@@ -1316,6 +1329,7 @@ Zhengkun Li <zhengkli@amazon.com>
|
|
|
1316
1329
|
Zhenyu Liang <zhenyu.liang@intel.com>
|
|
1317
1330
|
Zhenyu Shan <zhenyu.shan@intel.com>
|
|
1318
1331
|
Zhifei Fang <facetothefate@gmail.com>
|
|
1332
|
+
Zhiyuan Ye <zhiyuanye@tencent.com>
|
|
1319
1333
|
Zhuoyu Qian <zhuoyu.qian@samsung.com>
|
|
1320
1334
|
Ziran Sun <ziran.sun@samsung.com>
|
|
1321
1335
|
Zoltan Czirkos <czirkos.zoltan@gmail.com>
|
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
#define HAS_CPP_ATTRIBUTE(x) 0
|
|
25
25
|
#endif
|
|
26
26
|
|
|
27
|
+
// A wrapper around `__has_attribute`, similar to HAS_CPP_ATTRIBUTE.
|
|
28
|
+
#if defined(__has_attribute)
|
|
29
|
+
#define HAS_ATTRIBUTE(x) __has_attribute(x)
|
|
30
|
+
#else
|
|
31
|
+
#define HAS_ATTRIBUTE(x) 0
|
|
32
|
+
#endif
|
|
33
|
+
|
|
27
34
|
// A wrapper around `__has_builtin`, similar to HAS_CPP_ATTRIBUTE.
|
|
28
35
|
#if defined(__has_builtin)
|
|
29
36
|
#define HAS_BUILTIN(x) __has_builtin(x)
|
|
@@ -58,7 +65,7 @@
|
|
|
58
65
|
// prevent code folding, see NO_CODE_FOLDING() in base/debug/alias.h.
|
|
59
66
|
// Use like:
|
|
60
67
|
// void NOT_TAIL_CALLED FooBar();
|
|
61
|
-
#if defined(__clang__) &&
|
|
68
|
+
#if defined(__clang__) && HAS_ATTRIBUTE(not_tail_called)
|
|
62
69
|
#define NOT_TAIL_CALLED __attribute__((not_tail_called))
|
|
63
70
|
#else
|
|
64
71
|
#define NOT_TAIL_CALLED
|
|
@@ -126,11 +133,9 @@
|
|
|
126
133
|
// __attribute__((format(wprintf, format_param, dots_param)))
|
|
127
134
|
|
|
128
135
|
// Sanitizers annotations.
|
|
129
|
-
#if
|
|
130
|
-
#if __has_attribute(no_sanitize)
|
|
136
|
+
#if HAS_ATTRIBUTE(no_sanitize)
|
|
131
137
|
#define NO_SANITIZE(what) __attribute__((no_sanitize(what)))
|
|
132
138
|
#endif
|
|
133
|
-
#endif
|
|
134
139
|
#if !defined(NO_SANITIZE)
|
|
135
140
|
#define NO_SANITIZE(what)
|
|
136
141
|
#endif
|
|
@@ -238,7 +243,7 @@
|
|
|
238
243
|
#endif
|
|
239
244
|
#endif
|
|
240
245
|
|
|
241
|
-
#if defined(__clang__) &&
|
|
246
|
+
#if defined(__clang__) && HAS_ATTRIBUTE(uninitialized)
|
|
242
247
|
// Attribute "uninitialized" disables -ftrivial-auto-var-init=pattern for
|
|
243
248
|
// the specified variable.
|
|
244
249
|
// Library-wide alternative is
|
|
@@ -285,13 +290,9 @@
|
|
|
285
290
|
// In some cases it's desirable to remove this, e.g. on hot functions, or if
|
|
286
291
|
// we have purposely changed the reference canary.
|
|
287
292
|
#if defined(COMPILER_GCC) || defined(__clang__)
|
|
288
|
-
#if
|
|
289
|
-
#if __has_attribute(__no_stack_protector__)
|
|
293
|
+
#if HAS_ATTRIBUTE(__no_stack_protector__)
|
|
290
294
|
#define NO_STACK_PROTECTOR __attribute__((__no_stack_protector__))
|
|
291
|
-
#else
|
|
292
|
-
#define NO_STACK_PROTECTOR __attribute__((__optimize__("-fno-stack-protector")))
|
|
293
|
-
#endif
|
|
294
|
-
#else // defined(__has_attribute)
|
|
295
|
+
#else
|
|
295
296
|
#define NO_STACK_PROTECTOR __attribute__((__optimize__("-fno-stack-protector")))
|
|
296
297
|
#endif
|
|
297
298
|
#else
|
|
@@ -328,7 +329,7 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
|
|
|
328
329
|
#endif // defined(__clang_analyzer__)
|
|
329
330
|
|
|
330
331
|
// Use nomerge attribute to disable optimization of merging multiple same calls.
|
|
331
|
-
#if defined(__clang__) &&
|
|
332
|
+
#if defined(__clang__) && HAS_ATTRIBUTE(nomerge)
|
|
332
333
|
#define NOMERGE [[clang::nomerge]]
|
|
333
334
|
#else
|
|
334
335
|
#define NOMERGE
|
|
@@ -355,7 +356,7 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
|
|
|
355
356
|
// See also:
|
|
356
357
|
// https://clang.llvm.org/docs/AttributeReference.html#trivial-abi
|
|
357
358
|
// https://libcxx.llvm.org/docs/DesignDocs/UniquePtrTrivialAbi.html
|
|
358
|
-
#if defined(__clang__) &&
|
|
359
|
+
#if defined(__clang__) && HAS_ATTRIBUTE(trivial_abi)
|
|
359
360
|
#define TRIVIAL_ABI [[clang::trivial_abi]]
|
|
360
361
|
#else
|
|
361
362
|
#define TRIVIAL_ABI
|
|
@@ -364,7 +365,7 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
|
|
|
364
365
|
// Marks a member function as reinitializing a moved-from variable.
|
|
365
366
|
// See also
|
|
366
367
|
// https://clang.llvm.org/extra/clang-tidy/checks/bugprone-use-after-move.html#reinitialization
|
|
367
|
-
#if defined(__clang__) &&
|
|
368
|
+
#if defined(__clang__) && HAS_ATTRIBUTE(reinitializes)
|
|
368
369
|
#define REINITIALIZES_AFTER_MOVE [[clang::reinitializes]]
|
|
369
370
|
#else
|
|
370
371
|
#define REINITIALIZES_AFTER_MOVE
|
|
@@ -373,11 +374,9 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
|
|
|
373
374
|
// Requires constant initialization. See constinit in C++20. Allows to rely on a
|
|
374
375
|
// variable being initialized before execution, and not requiring a global
|
|
375
376
|
// constructor.
|
|
376
|
-
#if
|
|
377
|
-
#if __has_attribute(require_constant_initialization)
|
|
377
|
+
#if HAS_ATTRIBUTE(require_constant_initialization)
|
|
378
378
|
#define CONSTINIT __attribute__((require_constant_initialization))
|
|
379
379
|
#endif
|
|
380
|
-
#endif
|
|
381
380
|
#if !defined(CONSTINIT)
|
|
382
381
|
#define CONSTINIT
|
|
383
382
|
#endif
|
|
@@ -18,7 +18,10 @@ namespace gurl_base {
|
|
|
18
18
|
namespace internal {
|
|
19
19
|
|
|
20
20
|
template <typename T>
|
|
21
|
-
struct PointsToObject : std::
|
|
21
|
+
struct PointsToObject : std::true_type {};
|
|
22
|
+
// std::iter_value_t is not defined for `T*` where T is not an object type.
|
|
23
|
+
template <typename T>
|
|
24
|
+
struct PointsToObject<T*> : std::is_object<T> {};
|
|
22
25
|
|
|
23
26
|
// A pointer is a contiguous iterator.
|
|
24
27
|
// Reference: https://wg21.link/iterator.traits#5
|
|
@@ -74,15 +77,16 @@ struct IsCheckedContiguousIter
|
|
|
74
77
|
|
|
75
78
|
// Check that the iterator points to an actual object, and is one of the
|
|
76
79
|
// iterator types mentioned above.
|
|
80
|
+
template <typename T, bool B = PointsToObject<T>::value>
|
|
81
|
+
struct IsContiguousIteratorImpl : std::false_type {};
|
|
77
82
|
template <typename T>
|
|
78
|
-
struct IsContiguousIteratorImpl
|
|
79
|
-
: std::
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
IsCheckedContiguousIter<T>>> {};
|
|
83
|
+
struct IsContiguousIteratorImpl<T, true>
|
|
84
|
+
: std::disjunction<IsPointer<T>,
|
|
85
|
+
IsStringIter<T>,
|
|
86
|
+
IsArrayIter<T>,
|
|
87
|
+
IsVectorIter<T>,
|
|
88
|
+
IsValueArrayIter<T>,
|
|
89
|
+
IsCheckedContiguousIter<T>> {};
|
|
86
90
|
|
|
87
91
|
} // namespace internal
|
|
88
92
|
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
#include <stddef.h>
|
|
9
9
|
|
|
10
|
-
#include <algorithm>
|
|
11
10
|
#include <array>
|
|
12
11
|
#include <iterator>
|
|
13
12
|
#include <limits>
|
|
@@ -470,10 +469,19 @@ as_writable_bytes(span<T, X> s) noexcept {
|
|
|
470
469
|
}
|
|
471
470
|
|
|
472
471
|
// Type-deducing helpers for constructing a span.
|
|
473
|
-
template <int&... ExplicitArgumentBarrier, typename It
|
|
474
|
-
constexpr auto make_span(It it,
|
|
472
|
+
template <int&... ExplicitArgumentBarrier, typename It>
|
|
473
|
+
constexpr auto make_span(It it, size_t size) noexcept {
|
|
475
474
|
using T = std::remove_reference_t<iter_reference_t<It>>;
|
|
476
|
-
return span<T>(it,
|
|
475
|
+
return span<T>(it, size);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
template <int&... ExplicitArgumentBarrier,
|
|
479
|
+
typename It,
|
|
480
|
+
typename End,
|
|
481
|
+
typename = std::enable_if_t<!std::is_convertible_v<End, size_t>>>
|
|
482
|
+
constexpr auto make_span(It it, End end) noexcept {
|
|
483
|
+
using T = std::remove_reference_t<iter_reference_t<It>>;
|
|
484
|
+
return span<T>(it, end);
|
|
477
485
|
}
|
|
478
486
|
|
|
479
487
|
// make_span utility function that deduces both the span's value_type and extent
|
|
@@ -488,7 +496,7 @@ constexpr auto make_span(Container&& container) noexcept {
|
|
|
488
496
|
return span<T, Extent::value>(std::forward<Container>(container));
|
|
489
497
|
}
|
|
490
498
|
|
|
491
|
-
// make_span utility
|
|
499
|
+
// make_span utility functions that allow callers to explicit specify the span's
|
|
492
500
|
// extent, the value_type is deduced automatically. This is useful when passing
|
|
493
501
|
// a dynamically sized container to a method expecting static spans, when the
|
|
494
502
|
// container is known to have the correct size.
|
|
@@ -496,13 +504,20 @@ constexpr auto make_span(Container&& container) noexcept {
|
|
|
496
504
|
// Note: This will GURL_CHECK that N indeed matches size(container).
|
|
497
505
|
//
|
|
498
506
|
// Usage: auto static_span = gurl_base::make_span<N>(...);
|
|
507
|
+
template <size_t N, int&... ExplicitArgumentBarrier, typename It>
|
|
508
|
+
constexpr auto make_span(It it, size_t size) noexcept {
|
|
509
|
+
using T = std::remove_reference_t<iter_reference_t<It>>;
|
|
510
|
+
return span<T, N>(it, size);
|
|
511
|
+
}
|
|
512
|
+
|
|
499
513
|
template <size_t N,
|
|
500
514
|
int&... ExplicitArgumentBarrier,
|
|
501
515
|
typename It,
|
|
502
|
-
typename
|
|
503
|
-
|
|
516
|
+
typename End,
|
|
517
|
+
typename = std::enable_if_t<!std::is_convertible_v<End, size_t>>>
|
|
518
|
+
constexpr auto make_span(It it, End end) noexcept {
|
|
504
519
|
using T = std::remove_reference_t<iter_reference_t<It>>;
|
|
505
|
-
return span<T, N>(it,
|
|
520
|
+
return span<T, N>(it, end);
|
|
506
521
|
}
|
|
507
522
|
|
|
508
523
|
template <size_t N, int&... ExplicitArgumentBarrier, typename Container>
|
|
@@ -36,21 +36,11 @@
|
|
|
36
36
|
#if defined(PA_USE_MTE_CHECKED_PTR_WITH_64_BITS_POINTERS)
|
|
37
37
|
#include "base/allocator/partition_allocator/partition_tag.h"
|
|
38
38
|
#include "base/allocator/partition_allocator/tagging.h"
|
|
39
|
+
#include "polyfills/base/check_op.h"
|
|
39
40
|
#endif // defined(PA_USE_MTE_CHECKED_PTR_WITH_64_BITS_POINTERS)
|
|
40
41
|
|
|
41
42
|
#if BUILDFLAG(IS_WIN)
|
|
42
|
-
#include
|
|
43
|
-
#endif
|
|
44
|
-
|
|
45
|
-
#if defined(OFFICIAL_BUILD)
|
|
46
|
-
// The annotation changed compiler output and increased binary size so disable
|
|
47
|
-
// for official builds.
|
|
48
|
-
// TODO(crbug.com/1320670): Remove when issue is resolved.
|
|
49
|
-
#define RAW_PTR_EXCLUSION
|
|
50
|
-
#else
|
|
51
|
-
// Marks a field as excluded from the raw_ptr usage enforcement clang plugin.
|
|
52
|
-
// Example: RAW_PTR_EXCLUSION Foo* foo_;
|
|
53
|
-
#define RAW_PTR_EXCLUSION __attribute__((annotate("raw_ptr_exclusion")))
|
|
43
|
+
#include "base/win/win_handle_types.h"
|
|
54
44
|
#endif
|
|
55
45
|
|
|
56
46
|
namespace cc {
|
|
@@ -114,7 +104,7 @@ struct RawPtrNoOpImpl {
|
|
|
114
104
|
return wrapped_ptr;
|
|
115
105
|
}
|
|
116
106
|
|
|
117
|
-
// Advance the wrapped pointer by
|
|
107
|
+
// Advance the wrapped pointer by `delta_elems`.
|
|
118
108
|
template <typename T>
|
|
119
109
|
static ALWAYS_INLINE T* Advance(T* wrapped_ptr, ptrdiff_t delta_elems) {
|
|
120
110
|
return wrapped_ptr + delta_elems;
|
|
@@ -161,8 +151,8 @@ struct MTECheckedPtrImplPartitionAllocSupport {
|
|
|
161
151
|
// allocated by PartitionAlloc, from normal buckets pool.
|
|
162
152
|
//
|
|
163
153
|
// TODO(crbug.com/1307514): Allow direct-map buckets.
|
|
164
|
-
return IsManagedByPartitionAlloc(as_uintptr) &&
|
|
165
|
-
IsManagedByNormalBuckets(as_uintptr);
|
|
154
|
+
return partition_alloc::IsManagedByPartitionAlloc(as_uintptr) &&
|
|
155
|
+
partition_alloc::internal::IsManagedByNormalBuckets(as_uintptr);
|
|
166
156
|
}
|
|
167
157
|
|
|
168
158
|
// Returns pointer to the tag that protects are pointed by |ptr|.
|
|
@@ -255,10 +245,10 @@ struct MTECheckedPtrImpl {
|
|
|
255
245
|
return static_cast<To*>(wrapped_ptr);
|
|
256
246
|
}
|
|
257
247
|
|
|
258
|
-
// Advance the wrapped pointer by
|
|
248
|
+
// Advance the wrapped pointer by `delta_elems`.
|
|
259
249
|
template <typename T>
|
|
260
|
-
static ALWAYS_INLINE T* Advance(T* wrapped_ptr, ptrdiff_t
|
|
261
|
-
return wrapped_ptr +
|
|
250
|
+
static ALWAYS_INLINE T* Advance(T* wrapped_ptr, ptrdiff_t delta_elems) {
|
|
251
|
+
return wrapped_ptr + delta_elems;
|
|
262
252
|
}
|
|
263
253
|
|
|
264
254
|
// Returns a copy of a wrapped pointer, without making an assertion
|
|
@@ -305,7 +295,8 @@ struct BackupRefPtrImpl {
|
|
|
305
295
|
|
|
306
296
|
static ALWAYS_INLINE bool IsSupportedAndNotNull(uintptr_t address) {
|
|
307
297
|
// This covers the nullptr case, as address 0 is never in GigaCage.
|
|
308
|
-
bool is_in_brp_pool =
|
|
298
|
+
bool is_in_brp_pool =
|
|
299
|
+
partition_alloc::IsManagedByPartitionAllocBRPPool(address);
|
|
309
300
|
|
|
310
301
|
// There are many situations where the compiler can prove that
|
|
311
302
|
// ReleaseWrappedPtr is called on a value that is always nullptr, but the
|
|
@@ -366,7 +357,8 @@ struct BackupRefPtrImpl {
|
|
|
366
357
|
}
|
|
367
358
|
#if !defined(PA_HAS_64_BITS_POINTERS)
|
|
368
359
|
else {
|
|
369
|
-
AddressPoolManagerBitmap::
|
|
360
|
+
partition_alloc::internal::AddressPoolManagerBitmap::
|
|
361
|
+
BanSuperPageFromBRPPool(address);
|
|
370
362
|
}
|
|
371
363
|
#endif
|
|
372
364
|
|
|
@@ -430,15 +422,15 @@ struct BackupRefPtrImpl {
|
|
|
430
422
|
return wrapped_ptr;
|
|
431
423
|
}
|
|
432
424
|
|
|
433
|
-
// Advance the wrapped pointer by
|
|
425
|
+
// Advance the wrapped pointer by `delta_elems`.
|
|
434
426
|
template <typename T>
|
|
435
|
-
static ALWAYS_INLINE T* Advance(T* wrapped_ptr, ptrdiff_t
|
|
427
|
+
static ALWAYS_INLINE T* Advance(T* wrapped_ptr, ptrdiff_t delta_elems) {
|
|
436
428
|
#if GURL_DCHECK_IS_ON() || BUILDFLAG(ENABLE_BACKUP_REF_PTR_SLOW_CHECKS)
|
|
437
429
|
uintptr_t address = reinterpret_cast<uintptr_t>(wrapped_ptr);
|
|
438
430
|
if (IsSupportedAndNotNull(address))
|
|
439
|
-
GURL_CHECK(IsValidDelta(address,
|
|
431
|
+
GURL_CHECK(IsValidDelta(address, delta_elems * sizeof(T)));
|
|
440
432
|
#endif
|
|
441
|
-
T* new_wrapped_ptr = WrapRawPtr(wrapped_ptr +
|
|
433
|
+
T* new_wrapped_ptr = WrapRawPtr(wrapped_ptr + delta_elems);
|
|
442
434
|
ReleaseWrappedPtr(wrapped_ptr);
|
|
443
435
|
return new_wrapped_ptr;
|
|
444
436
|
}
|
|
@@ -517,7 +509,7 @@ struct AsanBackupRefPtrImpl {
|
|
|
517
509
|
return wrapped_ptr;
|
|
518
510
|
}
|
|
519
511
|
|
|
520
|
-
// Advance the wrapped pointer by
|
|
512
|
+
// Advance the wrapped pointer by `delta_elems`.
|
|
521
513
|
template <typename T>
|
|
522
514
|
static ALWAYS_INLINE T* Advance(T* wrapped_ptr, ptrdiff_t delta_elems) {
|
|
523
515
|
return wrapped_ptr + delta_elems;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#ifndef BASE_MEMORY_RAW_PTR_EXCLUSION_H_
|
|
6
|
+
#define BASE_MEMORY_RAW_PTR_EXCLUSION_H_
|
|
7
|
+
|
|
8
|
+
#include "build/build_config.h"
|
|
9
|
+
|
|
10
|
+
#if defined(OFFICIAL_BUILD)
|
|
11
|
+
// The annotation changed compiler output and increased binary size so disable
|
|
12
|
+
// for official builds.
|
|
13
|
+
// TODO(crbug.com/1320670): Remove when issue is resolved.
|
|
14
|
+
#define RAW_PTR_EXCLUSION
|
|
15
|
+
#else
|
|
16
|
+
// Marks a field as excluded from the raw_ptr usage enforcement clang plugin.
|
|
17
|
+
// Example: RAW_PTR_EXCLUSION Foo* foo_;
|
|
18
|
+
#define RAW_PTR_EXCLUSION __attribute__((annotate("raw_ptr_exclusion")))
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#endif // BASE_MEMORY_RAW_PTR_EXCLUSION_H_
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
#include <ostream>
|
|
8
8
|
|
|
9
9
|
#include "polyfills/base/check_op.h"
|
|
10
|
+
#include "base/feature_list.h"
|
|
11
|
+
#include "base/features.h"
|
|
10
12
|
#include "base/strings/string_piece.h"
|
|
11
13
|
#include "base/strings/string_util.h"
|
|
12
14
|
#include "base/strings/utf_string_conversion_utils.h"
|
|
@@ -210,7 +212,7 @@ bool UnescapeUnsignedByteAtIndex(StringPiece escaped_text,
|
|
|
210
212
|
// |escaped_text| that corresponds to the unescaped character.
|
|
211
213
|
bool UnescapeUTF8CharacterAtIndex(StringPiece escaped_text,
|
|
212
214
|
size_t index,
|
|
213
|
-
|
|
215
|
+
base_icu::UChar32* code_point_out,
|
|
214
216
|
std::string* unescaped_out) {
|
|
215
217
|
GURL_DCHECK(unescaped_out->empty());
|
|
216
218
|
|
|
@@ -404,7 +406,7 @@ std::string UnescapeURLWithAdjustmentsImpl(
|
|
|
404
406
|
// Locations of adjusted text.
|
|
405
407
|
for (size_t i = 0, max = escaped_text.size(); i < max;) {
|
|
406
408
|
// Try to unescape the character.
|
|
407
|
-
|
|
409
|
+
base_icu::UChar32 code_point;
|
|
408
410
|
std::string unescaped;
|
|
409
411
|
if (!UnescapeUTF8CharacterAtIndex(escaped_text, i, &code_point,
|
|
410
412
|
&unescaped)) {
|
|
@@ -540,6 +542,16 @@ std::string UnescapeBinaryURLComponent(StringPiece escaped_text,
|
|
|
540
542
|
GURL_DCHECK(!(rules &
|
|
541
543
|
~(UnescapeRule::NORMAL | UnescapeRule::REPLACE_PLUS_WITH_SPACE)));
|
|
542
544
|
|
|
545
|
+
// If there are no '%' characters in the string, there will be nothing to
|
|
546
|
+
// unescape, so we can take the fast path.
|
|
547
|
+
if (gurl_base::FeatureList::IsEnabled(features::kOptimizeDataUrls) &&
|
|
548
|
+
escaped_text.find('%') == StringPiece::npos) {
|
|
549
|
+
std::string unescaped_text(escaped_text);
|
|
550
|
+
if (rules & UnescapeRule::REPLACE_PLUS_WITH_SPACE)
|
|
551
|
+
std::replace(unescaped_text.begin(), unescaped_text.end(), '+', ' ');
|
|
552
|
+
return unescaped_text;
|
|
553
|
+
}
|
|
554
|
+
|
|
543
555
|
std::string unescaped_text;
|
|
544
556
|
|
|
545
557
|
// The output of the unescaping is always smaller than the input, so we can
|
|
@@ -155,19 +155,21 @@ bool HexStringToUInt64(StringPiece input, uint64_t* output) {
|
|
|
155
155
|
|
|
156
156
|
bool HexStringToBytes(StringPiece input, std::vector<uint8_t>* output) {
|
|
157
157
|
GURL_DCHECK(output->empty());
|
|
158
|
-
return internal::HexStringToByteContainer(
|
|
158
|
+
return internal::HexStringToByteContainer<uint8_t>(
|
|
159
|
+
input, std::back_inserter(*output));
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
bool HexStringToString(StringPiece input, std::string* output) {
|
|
162
163
|
GURL_DCHECK(output->empty());
|
|
163
|
-
return internal::HexStringToByteContainer(input,
|
|
164
|
+
return internal::HexStringToByteContainer<char>(input,
|
|
165
|
+
std::back_inserter(*output));
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
bool HexStringToSpan(StringPiece input, gurl_base::span<uint8_t> output) {
|
|
167
169
|
if (input.size() / 2 != output.size())
|
|
168
170
|
return false;
|
|
169
171
|
|
|
170
|
-
return internal::HexStringToByteContainer(input, output.begin());
|
|
172
|
+
return internal::HexStringToByteContainer<uint8_t>(input, output.begin());
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
} // namespace base
|