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