@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
|
@@ -62,590 +62,570 @@
|
|
|
62
62
|
#include <openssl/x509.h>
|
|
63
63
|
#include <openssl/x509v3.h>
|
|
64
64
|
|
|
65
|
-
#include "internal.h"
|
|
66
65
|
#include "../internal.h"
|
|
67
66
|
#include "../x509v3/internal.h"
|
|
67
|
+
#include "internal.h"
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// X509_VERIFY_PARAM functions
|
|
71
71
|
|
|
72
72
|
#define SET_HOST 0
|
|
73
73
|
#define ADD_HOST 1
|
|
74
74
|
|
|
75
|
-
static char *str_copy(char *s)
|
|
76
|
-
{
|
|
77
|
-
return OPENSSL_strdup(s);
|
|
78
|
-
}
|
|
75
|
+
static char *str_copy(char *s) { return OPENSSL_strdup(s); }
|
|
79
76
|
|
|
80
|
-
static void str_free(char *s)
|
|
81
|
-
{
|
|
82
|
-
OPENSSL_free(s);
|
|
83
|
-
}
|
|
77
|
+
static void str_free(char *s) { OPENSSL_free(s); }
|
|
84
78
|
|
|
85
79
|
#define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free)
|
|
86
80
|
|
|
87
81
|
static int int_x509_param_set_hosts(X509_VERIFY_PARAM *param, int mode,
|
|
88
|
-
const char *name, size_t namelen)
|
|
89
|
-
|
|
90
|
-
char *copy;
|
|
82
|
+
const char *name, size_t namelen) {
|
|
83
|
+
char *copy;
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
if (name == NULL || namelen == 0) {
|
|
86
|
+
// Unlike OpenSSL, we reject trying to set or add an empty name.
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
96
89
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return 0;
|
|
90
|
+
// Refuse names with embedded NUL bytes.
|
|
91
|
+
// XXX: Do we need to push an error onto the error stack?
|
|
92
|
+
if (name && OPENSSL_memchr(name, '\0', namelen)) {
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
103
95
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
if (mode == SET_HOST && param->hosts) {
|
|
97
|
+
string_stack_free(param->hosts);
|
|
98
|
+
param->hosts = NULL;
|
|
99
|
+
}
|
|
108
100
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
copy = OPENSSL_strndup(name, namelen);
|
|
102
|
+
if (copy == NULL) {
|
|
103
|
+
return 0;
|
|
104
|
+
}
|
|
112
105
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
if (param->hosts == NULL &&
|
|
107
|
+
(param->hosts = sk_OPENSSL_STRING_new_null()) == NULL) {
|
|
108
|
+
OPENSSL_free(copy);
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
118
111
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
return 0;
|
|
112
|
+
if (!sk_OPENSSL_STRING_push(param->hosts, copy)) {
|
|
113
|
+
OPENSSL_free(copy);
|
|
114
|
+
if (sk_OPENSSL_STRING_num(param->hosts) == 0) {
|
|
115
|
+
sk_OPENSSL_STRING_free(param->hosts);
|
|
116
|
+
param->hosts = NULL;
|
|
126
117
|
}
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static void x509_verify_param_zero(X509_VERIFY_PARAM *param) {
|
|
125
|
+
if (!param) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
param->name = NULL;
|
|
129
|
+
param->purpose = 0;
|
|
130
|
+
param->trust = 0;
|
|
131
|
+
// param->inh_flags = X509_VP_FLAG_DEFAULT;
|
|
132
|
+
param->inh_flags = 0;
|
|
133
|
+
param->flags = 0;
|
|
134
|
+
param->depth = -1;
|
|
135
|
+
if (param->policies) {
|
|
136
|
+
sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free);
|
|
137
|
+
param->policies = NULL;
|
|
138
|
+
}
|
|
139
|
+
if (param->hosts) {
|
|
140
|
+
string_stack_free(param->hosts);
|
|
141
|
+
param->hosts = NULL;
|
|
142
|
+
}
|
|
143
|
+
if (param->peername) {
|
|
144
|
+
OPENSSL_free(param->peername);
|
|
145
|
+
param->peername = NULL;
|
|
146
|
+
}
|
|
147
|
+
if (param->email) {
|
|
148
|
+
OPENSSL_free(param->email);
|
|
149
|
+
param->email = NULL;
|
|
150
|
+
param->emaillen = 0;
|
|
151
|
+
}
|
|
152
|
+
if (param->ip) {
|
|
153
|
+
OPENSSL_free(param->ip);
|
|
154
|
+
param->ip = NULL;
|
|
155
|
+
param->iplen = 0;
|
|
156
|
+
}
|
|
157
|
+
param->poison = 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void) {
|
|
161
|
+
X509_VERIFY_PARAM *param;
|
|
162
|
+
param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
|
|
163
|
+
if (!param) {
|
|
164
|
+
return NULL;
|
|
165
|
+
}
|
|
166
|
+
OPENSSL_memset(param, 0, sizeof(X509_VERIFY_PARAM));
|
|
167
|
+
x509_verify_param_zero(param);
|
|
168
|
+
return param;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param) {
|
|
172
|
+
if (param == NULL) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
x509_verify_param_zero(param);
|
|
176
|
+
OPENSSL_free(param);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
//-
|
|
180
|
+
// This function determines how parameters are "inherited" from one structure
|
|
181
|
+
// to another. There are several different ways this can happen.
|
|
182
|
+
//
|
|
183
|
+
// 1. If a child structure needs to have its values initialized from a parent
|
|
184
|
+
// they are simply copied across. For example SSL_CTX copied to SSL.
|
|
185
|
+
// 2. If the structure should take on values only if they are currently unset.
|
|
186
|
+
// For example the values in an SSL structure will take appropriate value
|
|
187
|
+
// for SSL servers or clients but only if the application has not set new
|
|
188
|
+
// ones.
|
|
189
|
+
//
|
|
190
|
+
// The "inh_flags" field determines how this function behaves.
|
|
191
|
+
//
|
|
192
|
+
// Normally any values which are set in the default are not copied from the
|
|
193
|
+
// destination and verify flags are ORed together.
|
|
194
|
+
//
|
|
195
|
+
// If X509_VP_FLAG_DEFAULT is set then anything set in the source is copied
|
|
196
|
+
// to the destination. Effectively the values in "to" become default values
|
|
197
|
+
// which will be used only if nothing new is set in "from".
|
|
198
|
+
//
|
|
199
|
+
// If X509_VP_FLAG_OVERWRITE is set then all value are copied across whether
|
|
200
|
+
// they are set or not. Flags is still Ored though.
|
|
201
|
+
//
|
|
202
|
+
// If X509_VP_FLAG_RESET_FLAGS is set then the flags value is copied instead
|
|
203
|
+
// of ORed.
|
|
204
|
+
//
|
|
205
|
+
// If X509_VP_FLAG_LOCKED is set then no values are copied.
|
|
206
|
+
//
|
|
207
|
+
// If X509_VP_FLAG_ONCE is set then the current inh_flags setting is zeroed
|
|
208
|
+
// after the next call.
|
|
209
|
+
|
|
210
|
+
// Macro to test if a field should be copied from src to dest
|
|
127
211
|
|
|
128
|
-
|
|
129
|
-
|
|
212
|
+
#define test_x509_verify_param_copy(field, def) \
|
|
213
|
+
(to_overwrite || \
|
|
214
|
+
((src->field != (def)) && (to_default || (dest->field == (def)))))
|
|
130
215
|
|
|
131
|
-
|
|
132
|
-
{
|
|
133
|
-
if (!param)
|
|
134
|
-
return;
|
|
135
|
-
param->name = NULL;
|
|
136
|
-
param->purpose = 0;
|
|
137
|
-
param->trust = 0;
|
|
138
|
-
/*
|
|
139
|
-
* param->inh_flags = X509_VP_FLAG_DEFAULT;
|
|
140
|
-
*/
|
|
141
|
-
param->inh_flags = 0;
|
|
142
|
-
param->flags = 0;
|
|
143
|
-
param->depth = -1;
|
|
144
|
-
if (param->policies) {
|
|
145
|
-
sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free);
|
|
146
|
-
param->policies = NULL;
|
|
147
|
-
}
|
|
148
|
-
if (param->hosts) {
|
|
149
|
-
string_stack_free(param->hosts);
|
|
150
|
-
param->hosts = NULL;
|
|
151
|
-
}
|
|
152
|
-
if (param->peername) {
|
|
153
|
-
OPENSSL_free(param->peername);
|
|
154
|
-
param->peername = NULL;
|
|
155
|
-
}
|
|
156
|
-
if (param->email) {
|
|
157
|
-
OPENSSL_free(param->email);
|
|
158
|
-
param->email = NULL;
|
|
159
|
-
param->emaillen = 0;
|
|
160
|
-
}
|
|
161
|
-
if (param->ip) {
|
|
162
|
-
OPENSSL_free(param->ip);
|
|
163
|
-
param->ip = NULL;
|
|
164
|
-
param->iplen = 0;
|
|
165
|
-
}
|
|
166
|
-
param->poison = 0;
|
|
167
|
-
}
|
|
216
|
+
// Macro to test and copy a field if necessary
|
|
168
217
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
|
|
173
|
-
if (!param)
|
|
174
|
-
return NULL;
|
|
175
|
-
OPENSSL_memset(param, 0, sizeof(X509_VERIFY_PARAM));
|
|
176
|
-
x509_verify_param_zero(param);
|
|
177
|
-
return param;
|
|
178
|
-
}
|
|
218
|
+
#define x509_verify_param_copy(field, def) \
|
|
219
|
+
if (test_x509_verify_param_copy(field, def)) \
|
|
220
|
+
dest->field = src->field
|
|
179
221
|
|
|
180
|
-
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
222
|
+
int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *dest,
|
|
223
|
+
const X509_VERIFY_PARAM *src) {
|
|
224
|
+
unsigned long inh_flags;
|
|
225
|
+
int to_default, to_overwrite;
|
|
226
|
+
if (!src) {
|
|
227
|
+
return 1;
|
|
228
|
+
}
|
|
229
|
+
inh_flags = dest->inh_flags | src->inh_flags;
|
|
187
230
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
*
|
|
192
|
-
* 1. If a child structure needs to have its values initialized from a parent
|
|
193
|
-
* they are simply copied across. For example SSL_CTX copied to SSL.
|
|
194
|
-
* 2. If the structure should take on values only if they are currently unset.
|
|
195
|
-
* For example the values in an SSL structure will take appropriate value
|
|
196
|
-
* for SSL servers or clients but only if the application has not set new
|
|
197
|
-
* ones.
|
|
198
|
-
*
|
|
199
|
-
* The "inh_flags" field determines how this function behaves.
|
|
200
|
-
*
|
|
201
|
-
* Normally any values which are set in the default are not copied from the
|
|
202
|
-
* destination and verify flags are ORed together.
|
|
203
|
-
*
|
|
204
|
-
* If X509_VP_FLAG_DEFAULT is set then anything set in the source is copied
|
|
205
|
-
* to the destination. Effectively the values in "to" become default values
|
|
206
|
-
* which will be used only if nothing new is set in "from".
|
|
207
|
-
*
|
|
208
|
-
* If X509_VP_FLAG_OVERWRITE is set then all value are copied across whether
|
|
209
|
-
* they are set or not. Flags is still Ored though.
|
|
210
|
-
*
|
|
211
|
-
* If X509_VP_FLAG_RESET_FLAGS is set then the flags value is copied instead
|
|
212
|
-
* of ORed.
|
|
213
|
-
*
|
|
214
|
-
* If X509_VP_FLAG_LOCKED is set then no values are copied.
|
|
215
|
-
*
|
|
216
|
-
* If X509_VP_FLAG_ONCE is set then the current inh_flags setting is zeroed
|
|
217
|
-
* after the next call.
|
|
218
|
-
*/
|
|
231
|
+
if (inh_flags & X509_VP_FLAG_ONCE) {
|
|
232
|
+
dest->inh_flags = 0;
|
|
233
|
+
}
|
|
219
234
|
|
|
220
|
-
|
|
235
|
+
if (inh_flags & X509_VP_FLAG_LOCKED) {
|
|
236
|
+
return 1;
|
|
237
|
+
}
|
|
221
238
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
239
|
+
if (inh_flags & X509_VP_FLAG_DEFAULT) {
|
|
240
|
+
to_default = 1;
|
|
241
|
+
} else {
|
|
242
|
+
to_default = 0;
|
|
243
|
+
}
|
|
225
244
|
|
|
226
|
-
|
|
245
|
+
if (inh_flags & X509_VP_FLAG_OVERWRITE) {
|
|
246
|
+
to_overwrite = 1;
|
|
247
|
+
} else {
|
|
248
|
+
to_overwrite = 0;
|
|
249
|
+
}
|
|
227
250
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
251
|
+
x509_verify_param_copy(purpose, 0);
|
|
252
|
+
x509_verify_param_copy(trust, 0);
|
|
253
|
+
x509_verify_param_copy(depth, -1);
|
|
231
254
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
{
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
inh_flags = dest->inh_flags | src->inh_flags;
|
|
240
|
-
|
|
241
|
-
if (inh_flags & X509_VP_FLAG_ONCE)
|
|
242
|
-
dest->inh_flags = 0;
|
|
243
|
-
|
|
244
|
-
if (inh_flags & X509_VP_FLAG_LOCKED)
|
|
245
|
-
return 1;
|
|
246
|
-
|
|
247
|
-
if (inh_flags & X509_VP_FLAG_DEFAULT)
|
|
248
|
-
to_default = 1;
|
|
249
|
-
else
|
|
250
|
-
to_default = 0;
|
|
251
|
-
|
|
252
|
-
if (inh_flags & X509_VP_FLAG_OVERWRITE)
|
|
253
|
-
to_overwrite = 1;
|
|
254
|
-
else
|
|
255
|
-
to_overwrite = 0;
|
|
256
|
-
|
|
257
|
-
x509_verify_param_copy(purpose, 0);
|
|
258
|
-
x509_verify_param_copy(trust, 0);
|
|
259
|
-
x509_verify_param_copy(depth, -1);
|
|
260
|
-
|
|
261
|
-
/* If overwrite or check time not set, copy across */
|
|
262
|
-
|
|
263
|
-
if (to_overwrite || !(dest->flags & X509_V_FLAG_USE_CHECK_TIME)) {
|
|
264
|
-
dest->check_time = src->check_time;
|
|
265
|
-
dest->flags &= ~X509_V_FLAG_USE_CHECK_TIME;
|
|
266
|
-
/* Don't need to copy flag: that is done below */
|
|
267
|
-
}
|
|
255
|
+
// If overwrite or check time not set, copy across
|
|
256
|
+
|
|
257
|
+
if (to_overwrite || !(dest->flags & X509_V_FLAG_USE_CHECK_TIME)) {
|
|
258
|
+
dest->check_time = src->check_time;
|
|
259
|
+
dest->flags &= ~X509_V_FLAG_USE_CHECK_TIME;
|
|
260
|
+
// Don't need to copy flag: that is done below
|
|
261
|
+
}
|
|
268
262
|
|
|
269
|
-
|
|
270
|
-
|
|
263
|
+
if (inh_flags & X509_VP_FLAG_RESET_FLAGS) {
|
|
264
|
+
dest->flags = 0;
|
|
265
|
+
}
|
|
271
266
|
|
|
272
|
-
|
|
267
|
+
dest->flags |= src->flags;
|
|
273
268
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
269
|
+
if (test_x509_verify_param_copy(policies, NULL)) {
|
|
270
|
+
if (!X509_VERIFY_PARAM_set1_policies(dest, src->policies)) {
|
|
271
|
+
return 0;
|
|
277
272
|
}
|
|
273
|
+
}
|
|
278
274
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
if (src->hosts) {
|
|
286
|
-
dest->hosts =
|
|
287
|
-
sk_OPENSSL_STRING_deep_copy(src->hosts, str_copy, str_free);
|
|
288
|
-
if (dest->hosts == NULL)
|
|
289
|
-
return 0;
|
|
290
|
-
dest->hostflags = src->hostflags;
|
|
291
|
-
}
|
|
275
|
+
// Copy the host flags if and only if we're copying the host list
|
|
276
|
+
if (test_x509_verify_param_copy(hosts, NULL)) {
|
|
277
|
+
if (dest->hosts) {
|
|
278
|
+
string_stack_free(dest->hosts);
|
|
279
|
+
dest->hosts = NULL;
|
|
292
280
|
}
|
|
281
|
+
if (src->hosts) {
|
|
282
|
+
dest->hosts = sk_OPENSSL_STRING_deep_copy(src->hosts, str_copy, str_free);
|
|
283
|
+
if (dest->hosts == NULL) {
|
|
284
|
+
return 0;
|
|
285
|
+
}
|
|
286
|
+
dest->hostflags = src->hostflags;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
293
289
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
290
|
+
if (test_x509_verify_param_copy(email, NULL)) {
|
|
291
|
+
if (!X509_VERIFY_PARAM_set1_email(dest, src->email, src->emaillen)) {
|
|
292
|
+
return 0;
|
|
297
293
|
}
|
|
294
|
+
}
|
|
298
295
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
296
|
+
if (test_x509_verify_param_copy(ip, NULL)) {
|
|
297
|
+
if (!X509_VERIFY_PARAM_set1_ip(dest, src->ip, src->iplen)) {
|
|
298
|
+
return 0;
|
|
302
299
|
}
|
|
300
|
+
}
|
|
303
301
|
|
|
304
|
-
|
|
302
|
+
dest->poison = src->poison;
|
|
305
303
|
|
|
306
|
-
|
|
304
|
+
return 1;
|
|
307
305
|
}
|
|
308
306
|
|
|
309
307
|
int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
|
|
310
|
-
const X509_VERIFY_PARAM *from)
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
{
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return 0;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
tmp = OPENSSL_memdup(src, srclen);
|
|
331
|
-
if (!tmp) {
|
|
332
|
-
return 0;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
if (*pdest)
|
|
336
|
-
OPENSSL_free(*pdest);
|
|
337
|
-
*pdest = tmp;
|
|
338
|
-
if (pdestlen)
|
|
339
|
-
*pdestlen = srclen;
|
|
340
|
-
return 1;
|
|
341
|
-
}
|
|
308
|
+
const X509_VERIFY_PARAM *from) {
|
|
309
|
+
unsigned long save_flags = to->inh_flags;
|
|
310
|
+
int ret;
|
|
311
|
+
to->inh_flags |= X509_VP_FLAG_DEFAULT;
|
|
312
|
+
ret = X509_VERIFY_PARAM_inherit(to, from);
|
|
313
|
+
to->inh_flags = save_flags;
|
|
314
|
+
return ret;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
static int int_x509_param_set1(char **pdest, size_t *pdestlen, const char *src,
|
|
318
|
+
size_t srclen) {
|
|
319
|
+
void *tmp;
|
|
320
|
+
if (src == NULL || srclen == 0) {
|
|
321
|
+
// Unlike OpenSSL, we do not allow an empty string to disable previously
|
|
322
|
+
// configured checks.
|
|
323
|
+
return 0;
|
|
324
|
+
}
|
|
342
325
|
|
|
343
|
-
|
|
344
|
-
{
|
|
345
|
-
if (param->name)
|
|
346
|
-
OPENSSL_free(param->name);
|
|
347
|
-
param->name = OPENSSL_strdup(name);
|
|
348
|
-
if (param->name)
|
|
349
|
-
return 1;
|
|
326
|
+
tmp = OPENSSL_memdup(src, srclen);
|
|
327
|
+
if (!tmp) {
|
|
350
328
|
return 0;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (*pdest) {
|
|
332
|
+
OPENSSL_free(*pdest);
|
|
333
|
+
}
|
|
334
|
+
*pdest = tmp;
|
|
335
|
+
if (pdestlen) {
|
|
336
|
+
*pdestlen = srclen;
|
|
337
|
+
}
|
|
338
|
+
return 1;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name) {
|
|
342
|
+
if (param->name) {
|
|
343
|
+
OPENSSL_free(param->name);
|
|
344
|
+
}
|
|
345
|
+
param->name = OPENSSL_strdup(name);
|
|
346
|
+
if (param->name) {
|
|
347
|
+
return 1;
|
|
348
|
+
}
|
|
349
|
+
return 0;
|
|
351
350
|
}
|
|
352
351
|
|
|
353
|
-
int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags)
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
352
|
+
int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags) {
|
|
353
|
+
param->flags |= flags;
|
|
354
|
+
if (flags & X509_V_FLAG_POLICY_MASK) {
|
|
355
|
+
param->flags |= X509_V_FLAG_POLICY_CHECK;
|
|
356
|
+
}
|
|
357
|
+
return 1;
|
|
359
358
|
}
|
|
360
359
|
|
|
361
360
|
int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
|
|
362
|
-
unsigned long flags)
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
return 1;
|
|
361
|
+
unsigned long flags) {
|
|
362
|
+
param->flags &= ~flags;
|
|
363
|
+
return 1;
|
|
366
364
|
}
|
|
367
365
|
|
|
368
|
-
unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param)
|
|
369
|
-
|
|
370
|
-
return param->flags;
|
|
366
|
+
unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param) {
|
|
367
|
+
return param->flags;
|
|
371
368
|
}
|
|
372
369
|
|
|
373
|
-
int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose)
|
|
374
|
-
|
|
375
|
-
return X509_PURPOSE_set(¶m->purpose, purpose);
|
|
370
|
+
int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose) {
|
|
371
|
+
return X509_PURPOSE_set(¶m->purpose, purpose);
|
|
376
372
|
}
|
|
377
373
|
|
|
378
|
-
int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust)
|
|
379
|
-
|
|
380
|
-
return X509_TRUST_set(¶m->trust, trust);
|
|
374
|
+
int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust) {
|
|
375
|
+
return X509_TRUST_set(¶m->trust, trust);
|
|
381
376
|
}
|
|
382
377
|
|
|
383
|
-
void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth)
|
|
384
|
-
|
|
385
|
-
param->depth = depth;
|
|
378
|
+
void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth) {
|
|
379
|
+
param->depth = depth;
|
|
386
380
|
}
|
|
387
381
|
|
|
388
|
-
void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t)
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
param->flags |= X509_V_FLAG_USE_CHECK_TIME;
|
|
382
|
+
void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t) {
|
|
383
|
+
param->check_time = t;
|
|
384
|
+
param->flags |= X509_V_FLAG_USE_CHECK_TIME;
|
|
392
385
|
}
|
|
393
386
|
|
|
394
387
|
int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
|
|
395
|
-
ASN1_OBJECT *policy)
|
|
396
|
-
{
|
|
388
|
+
ASN1_OBJECT *policy) {
|
|
389
|
+
if (!param->policies) {
|
|
390
|
+
param->policies = sk_ASN1_OBJECT_new_null();
|
|
397
391
|
if (!param->policies) {
|
|
398
|
-
|
|
399
|
-
if (!param->policies)
|
|
400
|
-
return 0;
|
|
392
|
+
return 0;
|
|
401
393
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
return
|
|
394
|
+
}
|
|
395
|
+
if (!sk_ASN1_OBJECT_push(param->policies, policy)) {
|
|
396
|
+
return 0;
|
|
397
|
+
}
|
|
398
|
+
return 1;
|
|
405
399
|
}
|
|
406
400
|
|
|
407
401
|
int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
|
|
408
|
-
STACK_OF(ASN1_OBJECT) *policies)
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
402
|
+
STACK_OF(ASN1_OBJECT) *policies) {
|
|
403
|
+
size_t i;
|
|
404
|
+
ASN1_OBJECT *oid, *doid;
|
|
405
|
+
if (!param) {
|
|
406
|
+
return 0;
|
|
407
|
+
}
|
|
408
|
+
if (param->policies) {
|
|
409
|
+
sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free);
|
|
410
|
+
}
|
|
416
411
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
412
|
+
if (!policies) {
|
|
413
|
+
param->policies = NULL;
|
|
414
|
+
return 1;
|
|
415
|
+
}
|
|
421
416
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
417
|
+
param->policies = sk_ASN1_OBJECT_new_null();
|
|
418
|
+
if (!param->policies) {
|
|
419
|
+
return 0;
|
|
420
|
+
}
|
|
425
421
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
if (!sk_ASN1_OBJECT_push(param->policies, doid)) {
|
|
432
|
-
ASN1_OBJECT_free(doid);
|
|
433
|
-
return 0;
|
|
434
|
-
}
|
|
422
|
+
for (i = 0; i < sk_ASN1_OBJECT_num(policies); i++) {
|
|
423
|
+
oid = sk_ASN1_OBJECT_value(policies, i);
|
|
424
|
+
doid = OBJ_dup(oid);
|
|
425
|
+
if (!doid) {
|
|
426
|
+
return 0;
|
|
435
427
|
}
|
|
436
|
-
param->
|
|
437
|
-
|
|
428
|
+
if (!sk_ASN1_OBJECT_push(param->policies, doid)) {
|
|
429
|
+
ASN1_OBJECT_free(doid);
|
|
430
|
+
return 0;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
param->flags |= X509_V_FLAG_POLICY_CHECK;
|
|
434
|
+
return 1;
|
|
438
435
|
}
|
|
439
436
|
|
|
440
|
-
int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
|
|
441
|
-
|
|
442
|
-
{
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
return 1;
|
|
437
|
+
int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name,
|
|
438
|
+
size_t namelen) {
|
|
439
|
+
if (!int_x509_param_set_hosts(param, SET_HOST, name, namelen)) {
|
|
440
|
+
param->poison = 1;
|
|
441
|
+
return 0;
|
|
442
|
+
}
|
|
443
|
+
return 1;
|
|
448
444
|
}
|
|
449
445
|
|
|
450
|
-
int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
|
|
451
|
-
|
|
452
|
-
{
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
return 1;
|
|
446
|
+
int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name,
|
|
447
|
+
size_t namelen) {
|
|
448
|
+
if (!int_x509_param_set_hosts(param, ADD_HOST, name, namelen)) {
|
|
449
|
+
param->poison = 1;
|
|
450
|
+
return 0;
|
|
451
|
+
}
|
|
452
|
+
return 1;
|
|
458
453
|
}
|
|
459
454
|
|
|
460
455
|
void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
|
|
461
|
-
unsigned int flags)
|
|
462
|
-
|
|
463
|
-
param->hostflags = flags;
|
|
456
|
+
unsigned int flags) {
|
|
457
|
+
param->hostflags = flags;
|
|
464
458
|
}
|
|
465
459
|
|
|
466
|
-
char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param)
|
|
467
|
-
|
|
468
|
-
return param->peername;
|
|
460
|
+
char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param) {
|
|
461
|
+
return param->peername;
|
|
469
462
|
}
|
|
470
463
|
|
|
471
|
-
int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
return 0;
|
|
479
|
-
}
|
|
464
|
+
int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, const char *email,
|
|
465
|
+
size_t emaillen) {
|
|
466
|
+
if (OPENSSL_memchr(email, '\0', emaillen) != NULL ||
|
|
467
|
+
!int_x509_param_set1(¶m->email, ¶m->emaillen, email, emaillen)) {
|
|
468
|
+
param->poison = 1;
|
|
469
|
+
return 0;
|
|
470
|
+
}
|
|
480
471
|
|
|
481
|
-
|
|
472
|
+
return 1;
|
|
482
473
|
}
|
|
483
474
|
|
|
484
|
-
int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
475
|
+
int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, const unsigned char *ip,
|
|
476
|
+
size_t iplen) {
|
|
477
|
+
if ((iplen != 4 && iplen != 16) ||
|
|
478
|
+
!int_x509_param_set1((char **)¶m->ip, ¶m->iplen, (char *)ip,
|
|
479
|
+
iplen)) {
|
|
480
|
+
param->poison = 1;
|
|
481
|
+
return 0;
|
|
482
|
+
}
|
|
493
483
|
|
|
494
|
-
|
|
484
|
+
return 1;
|
|
495
485
|
}
|
|
496
486
|
|
|
497
|
-
int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc)
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
size_t iplen;
|
|
487
|
+
int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc) {
|
|
488
|
+
unsigned char ipout[16];
|
|
489
|
+
size_t iplen;
|
|
501
490
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
491
|
+
iplen = (size_t)x509v3_a2i_ipadd(ipout, ipasc);
|
|
492
|
+
if (iplen == 0) {
|
|
493
|
+
return 0;
|
|
494
|
+
}
|
|
495
|
+
return X509_VERIFY_PARAM_set1_ip(param, ipout, iplen);
|
|
506
496
|
}
|
|
507
497
|
|
|
508
|
-
int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param)
|
|
509
|
-
|
|
510
|
-
return param->depth;
|
|
498
|
+
int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param) {
|
|
499
|
+
return param->depth;
|
|
511
500
|
}
|
|
512
501
|
|
|
513
|
-
const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param)
|
|
514
|
-
|
|
515
|
-
return param->name;
|
|
502
|
+
const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param) {
|
|
503
|
+
return param->name;
|
|
516
504
|
}
|
|
517
505
|
|
|
518
506
|
#define vpm_empty_id NULL, 0U, NULL, NULL, 0, NULL, 0, 0
|
|
519
507
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
* in alphabetical order because it will be searched using OBJ_search.
|
|
524
|
-
*/
|
|
508
|
+
// Default verify parameters: these are used for various applications and can
|
|
509
|
+
// be overridden by the user specified table. NB: the 'name' field *must* be
|
|
510
|
+
// in alphabetical order because it will be searched using OBJ_search.
|
|
525
511
|
|
|
526
512
|
static const X509_VERIFY_PARAM default_table[] = {
|
|
527
|
-
{
|
|
528
|
-
|
|
529
|
-
0,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
0,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
NULL, /* policies */
|
|
513
|
+
{(char *)"default", // X509 default parameters
|
|
514
|
+
0, // Check time
|
|
515
|
+
0, // internal flags
|
|
516
|
+
X509_V_FLAG_TRUSTED_FIRST, // flags
|
|
517
|
+
0, // purpose
|
|
518
|
+
0, // trust
|
|
519
|
+
100, // depth
|
|
520
|
+
NULL, // policies
|
|
536
521
|
vpm_empty_id},
|
|
537
|
-
{
|
|
538
|
-
|
|
539
|
-
0,
|
|
540
|
-
0,
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
NULL, /* policies */
|
|
522
|
+
{(char *)"pkcs7", // S/MIME sign parameters
|
|
523
|
+
0, // Check time
|
|
524
|
+
0, // internal flags
|
|
525
|
+
0, // flags
|
|
526
|
+
X509_PURPOSE_SMIME_SIGN, // purpose
|
|
527
|
+
X509_TRUST_EMAIL, // trust
|
|
528
|
+
-1, // depth
|
|
529
|
+
NULL, // policies
|
|
546
530
|
vpm_empty_id},
|
|
547
|
-
{
|
|
548
|
-
|
|
549
|
-
0,
|
|
550
|
-
0,
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
NULL, /* policies */
|
|
531
|
+
{(char *)"smime_sign", // S/MIME sign parameters
|
|
532
|
+
0, // Check time
|
|
533
|
+
0, // internal flags
|
|
534
|
+
0, // flags
|
|
535
|
+
X509_PURPOSE_SMIME_SIGN, // purpose
|
|
536
|
+
X509_TRUST_EMAIL, // trust
|
|
537
|
+
-1, // depth
|
|
538
|
+
NULL, // policies
|
|
556
539
|
vpm_empty_id},
|
|
557
|
-
{
|
|
558
|
-
|
|
559
|
-
0,
|
|
560
|
-
0,
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
NULL, /* policies */
|
|
540
|
+
{(char *)"ssl_client", // SSL/TLS client parameters
|
|
541
|
+
0, // Check time
|
|
542
|
+
0, // internal flags
|
|
543
|
+
0, // flags
|
|
544
|
+
X509_PURPOSE_SSL_CLIENT, // purpose
|
|
545
|
+
X509_TRUST_SSL_CLIENT, // trust
|
|
546
|
+
-1, // depth
|
|
547
|
+
NULL, // policies
|
|
566
548
|
vpm_empty_id},
|
|
567
|
-
{
|
|
568
|
-
|
|
569
|
-
0,
|
|
570
|
-
0,
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
vpm_empty_id}
|
|
577
|
-
};
|
|
549
|
+
{(char *)"ssl_server", // SSL/TLS server parameters
|
|
550
|
+
0, // Check time
|
|
551
|
+
0, // internal flags
|
|
552
|
+
0, // flags
|
|
553
|
+
X509_PURPOSE_SSL_SERVER, // purpose
|
|
554
|
+
X509_TRUST_SSL_SERVER, // trust
|
|
555
|
+
-1, // depth
|
|
556
|
+
NULL, // policies
|
|
557
|
+
vpm_empty_id}};
|
|
578
558
|
|
|
579
559
|
static STACK_OF(X509_VERIFY_PARAM) *param_table = NULL;
|
|
580
560
|
|
|
581
|
-
static int param_cmp(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b)
|
|
582
|
-
|
|
583
|
-
return strcmp((*a)->name, (*b)->name);
|
|
561
|
+
static int param_cmp(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b) {
|
|
562
|
+
return strcmp((*a)->name, (*b)->name);
|
|
584
563
|
}
|
|
585
564
|
|
|
586
|
-
int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param)
|
|
587
|
-
|
|
588
|
-
|
|
565
|
+
int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param) {
|
|
566
|
+
X509_VERIFY_PARAM *ptmp;
|
|
567
|
+
if (!param_table) {
|
|
568
|
+
param_table = sk_X509_VERIFY_PARAM_new(param_cmp);
|
|
589
569
|
if (!param_table) {
|
|
590
|
-
|
|
591
|
-
if (!param_table)
|
|
592
|
-
return 0;
|
|
593
|
-
} else {
|
|
594
|
-
size_t idx;
|
|
595
|
-
|
|
596
|
-
sk_X509_VERIFY_PARAM_sort(param_table);
|
|
597
|
-
if (sk_X509_VERIFY_PARAM_find(param_table, &idx, param)) {
|
|
598
|
-
ptmp = sk_X509_VERIFY_PARAM_value(param_table, idx);
|
|
599
|
-
X509_VERIFY_PARAM_free(ptmp);
|
|
600
|
-
(void)sk_X509_VERIFY_PARAM_delete(param_table, idx);
|
|
601
|
-
}
|
|
570
|
+
return 0;
|
|
602
571
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
572
|
+
} else {
|
|
573
|
+
size_t idx;
|
|
574
|
+
|
|
575
|
+
sk_X509_VERIFY_PARAM_sort(param_table);
|
|
576
|
+
if (sk_X509_VERIFY_PARAM_find(param_table, &idx, param)) {
|
|
577
|
+
ptmp = sk_X509_VERIFY_PARAM_value(param_table, idx);
|
|
578
|
+
X509_VERIFY_PARAM_free(ptmp);
|
|
579
|
+
(void)sk_X509_VERIFY_PARAM_delete(param_table, idx);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
if (!sk_X509_VERIFY_PARAM_push(param_table, param)) {
|
|
583
|
+
return 0;
|
|
584
|
+
}
|
|
585
|
+
return 1;
|
|
606
586
|
}
|
|
607
587
|
|
|
608
|
-
int X509_VERIFY_PARAM_get_count(void)
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
588
|
+
int X509_VERIFY_PARAM_get_count(void) {
|
|
589
|
+
int num = sizeof(default_table) / sizeof(X509_VERIFY_PARAM);
|
|
590
|
+
if (param_table) {
|
|
591
|
+
num += sk_X509_VERIFY_PARAM_num(param_table);
|
|
592
|
+
}
|
|
593
|
+
return num;
|
|
614
594
|
}
|
|
615
595
|
|
|
616
|
-
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id)
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
596
|
+
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id) {
|
|
597
|
+
int num = sizeof(default_table) / sizeof(X509_VERIFY_PARAM);
|
|
598
|
+
if (id < num) {
|
|
599
|
+
return default_table + id;
|
|
600
|
+
}
|
|
601
|
+
return sk_X509_VERIFY_PARAM_value(param_table, id - num);
|
|
622
602
|
}
|
|
623
603
|
|
|
624
|
-
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name)
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
unsigned i, limit;
|
|
604
|
+
const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name) {
|
|
605
|
+
X509_VERIFY_PARAM pm;
|
|
606
|
+
unsigned i, limit;
|
|
628
607
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
608
|
+
pm.name = (char *)name;
|
|
609
|
+
if (param_table) {
|
|
610
|
+
size_t idx;
|
|
611
|
+
sk_X509_VERIFY_PARAM_sort(param_table);
|
|
612
|
+
if (sk_X509_VERIFY_PARAM_find(param_table, &idx, &pm)) {
|
|
613
|
+
return sk_X509_VERIFY_PARAM_value(param_table, idx);
|
|
635
614
|
}
|
|
615
|
+
}
|
|
636
616
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}
|
|
617
|
+
limit = sizeof(default_table) / sizeof(X509_VERIFY_PARAM);
|
|
618
|
+
for (i = 0; i < limit; i++) {
|
|
619
|
+
if (strcmp(default_table[i].name, name) == 0) {
|
|
620
|
+
return &default_table[i];
|
|
642
621
|
}
|
|
643
|
-
|
|
622
|
+
}
|
|
623
|
+
return NULL;
|
|
644
624
|
}
|
|
645
625
|
|
|
646
|
-
void X509_VERIFY_PARAM_table_cleanup(void)
|
|
647
|
-
{
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
626
|
+
void X509_VERIFY_PARAM_table_cleanup(void) {
|
|
627
|
+
if (param_table) {
|
|
628
|
+
sk_X509_VERIFY_PARAM_pop_free(param_table, X509_VERIFY_PARAM_free);
|
|
629
|
+
}
|
|
630
|
+
param_table = NULL;
|
|
651
631
|
}
|