@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
|
@@ -78,567 +78,563 @@ static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx);
|
|
|
78
78
|
static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx);
|
|
79
79
|
|
|
80
80
|
static STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES_cb(
|
|
81
|
-
const X509V3_EXT_METHOD *method, void *ext, STACK_OF(CONF_VALUE) *ret)
|
|
82
|
-
|
|
83
|
-
return i2v_GENERAL_NAMES(method, ext, ret);
|
|
81
|
+
const X509V3_EXT_METHOD *method, void *ext, STACK_OF(CONF_VALUE) *ret) {
|
|
82
|
+
return i2v_GENERAL_NAMES(method, ext, ret);
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
const X509V3_EXT_METHOD v3_alt[] = {
|
|
87
|
-
{NID_subject_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
0, 0, 0, 0,
|
|
96
|
-
0, 0,
|
|
97
|
-
i2v_GENERAL_NAMES_cb,
|
|
98
|
-
v2i_issuer_alt,
|
|
99
|
-
NULL, NULL, NULL},
|
|
100
|
-
|
|
101
|
-
{NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES),
|
|
102
|
-
0, 0, 0, 0,
|
|
103
|
-
0, 0,
|
|
104
|
-
i2v_GENERAL_NAMES_cb,
|
|
105
|
-
NULL, NULL, NULL, NULL},
|
|
86
|
+
{NID_subject_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES), 0, 0, 0, 0, 0, 0,
|
|
87
|
+
i2v_GENERAL_NAMES_cb, v2i_subject_alt, NULL, NULL, NULL},
|
|
88
|
+
|
|
89
|
+
{NID_issuer_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES), 0, 0, 0, 0, 0, 0,
|
|
90
|
+
i2v_GENERAL_NAMES_cb, v2i_issuer_alt, NULL, NULL, NULL},
|
|
91
|
+
|
|
92
|
+
{NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES), 0, 0, 0, 0, 0, 0,
|
|
93
|
+
i2v_GENERAL_NAMES_cb, NULL, NULL, NULL, NULL},
|
|
106
94
|
};
|
|
107
95
|
|
|
108
96
|
STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(const X509V3_EXT_METHOD *method,
|
|
109
97
|
GENERAL_NAMES *gens,
|
|
110
|
-
STACK_OF(CONF_VALUE) *ret)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return NULL;
|
|
121
|
-
}
|
|
122
|
-
ret = tmp;
|
|
98
|
+
STACK_OF(CONF_VALUE) *ret) {
|
|
99
|
+
int ret_was_null = ret == NULL;
|
|
100
|
+
for (size_t i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
|
|
101
|
+
GENERAL_NAME *gen = sk_GENERAL_NAME_value(gens, i);
|
|
102
|
+
STACK_OF(CONF_VALUE) *tmp = i2v_GENERAL_NAME(method, gen, ret);
|
|
103
|
+
if (tmp == NULL) {
|
|
104
|
+
if (ret_was_null) {
|
|
105
|
+
sk_CONF_VALUE_pop_free(ret, X509V3_conf_free);
|
|
106
|
+
}
|
|
107
|
+
return NULL;
|
|
123
108
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
109
|
+
ret = tmp;
|
|
110
|
+
}
|
|
111
|
+
if (!ret) {
|
|
112
|
+
return sk_CONF_VALUE_new_null();
|
|
113
|
+
}
|
|
114
|
+
return ret;
|
|
127
115
|
}
|
|
128
116
|
|
|
129
117
|
STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(const X509V3_EXT_METHOD *method,
|
|
130
118
|
GENERAL_NAME *gen,
|
|
131
|
-
STACK_OF(CONF_VALUE) *ret)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
switch (gen->type) {
|
|
119
|
+
STACK_OF(CONF_VALUE) *ret) {
|
|
120
|
+
// Note the error-handling for this function relies on there being at most
|
|
121
|
+
// one |X509V3_add_value| call. If there were two and the second failed, we
|
|
122
|
+
// would need to sometimes free the first call's result.
|
|
123
|
+
unsigned char *p;
|
|
124
|
+
char oline[256], htmp[5];
|
|
125
|
+
int i;
|
|
126
|
+
switch (gen->type) {
|
|
140
127
|
case GEN_OTHERNAME:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
128
|
+
if (!X509V3_add_value("othername", "<unsupported>", &ret)) {
|
|
129
|
+
return NULL;
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
144
132
|
|
|
145
133
|
case GEN_X400:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
134
|
+
if (!X509V3_add_value("X400Name", "<unsupported>", &ret)) {
|
|
135
|
+
return NULL;
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
149
138
|
|
|
150
139
|
case GEN_EDIPARTY:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
140
|
+
if (!X509V3_add_value("EdiPartyName", "<unsupported>", &ret)) {
|
|
141
|
+
return NULL;
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
154
144
|
|
|
155
145
|
case GEN_EMAIL:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
146
|
+
if (!x509V3_add_value_asn1_string("email", gen->d.ia5, &ret)) {
|
|
147
|
+
return NULL;
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
159
150
|
|
|
160
151
|
case GEN_DNS:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
152
|
+
if (!x509V3_add_value_asn1_string("DNS", gen->d.ia5, &ret)) {
|
|
153
|
+
return NULL;
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
164
156
|
|
|
165
157
|
case GEN_URI:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
158
|
+
if (!x509V3_add_value_asn1_string("URI", gen->d.ia5, &ret)) {
|
|
159
|
+
return NULL;
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
169
162
|
|
|
170
163
|
case GEN_DIRNAME:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
164
|
+
if (X509_NAME_oneline(gen->d.dirn, oline, 256) == NULL ||
|
|
165
|
+
!X509V3_add_value("DirName", oline, &ret)) {
|
|
166
|
+
return NULL;
|
|
167
|
+
}
|
|
168
|
+
break;
|
|
175
169
|
|
|
176
170
|
case GEN_IPADD:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
171
|
+
p = gen->d.ip->data;
|
|
172
|
+
if (gen->d.ip->length == 4) {
|
|
173
|
+
BIO_snprintf(oline, sizeof(oline), "%d.%d.%d.%d", p[0], p[1], p[2],
|
|
174
|
+
p[3]);
|
|
175
|
+
} else if (gen->d.ip->length == 16) {
|
|
176
|
+
oline[0] = 0;
|
|
177
|
+
for (i = 0; i < 8; i++) {
|
|
178
|
+
uint16_t v = ((uint16_t)p[0] << 8) | p[1];
|
|
179
|
+
BIO_snprintf(htmp, sizeof(htmp), "%X", v);
|
|
180
|
+
p += 2;
|
|
181
|
+
OPENSSL_strlcat(oline, htmp, sizeof(oline));
|
|
182
|
+
if (i != 7) {
|
|
183
|
+
OPENSSL_strlcat(oline, ":", sizeof(oline));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
if (!X509V3_add_value("IP Address", "<invalid>", &ret)) {
|
|
188
|
+
return NULL;
|
|
195
189
|
}
|
|
196
|
-
if (!X509V3_add_value("IP Address", oline, &ret))
|
|
197
|
-
return NULL;
|
|
198
190
|
break;
|
|
191
|
+
}
|
|
192
|
+
if (!X509V3_add_value("IP Address", oline, &ret)) {
|
|
193
|
+
return NULL;
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
199
196
|
|
|
200
197
|
case GEN_RID:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
198
|
+
i2t_ASN1_OBJECT(oline, 256, gen->d.rid);
|
|
199
|
+
if (!X509V3_add_value("Registered ID", oline, &ret)) {
|
|
200
|
+
return NULL;
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
return ret;
|
|
207
205
|
}
|
|
208
206
|
|
|
209
|
-
int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
switch (gen->type) {
|
|
207
|
+
int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen) {
|
|
208
|
+
unsigned char *p;
|
|
209
|
+
int i;
|
|
210
|
+
switch (gen->type) {
|
|
214
211
|
case GEN_OTHERNAME:
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
BIO_printf(out, "othername:<unsupported>");
|
|
213
|
+
break;
|
|
217
214
|
|
|
218
215
|
case GEN_X400:
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
BIO_printf(out, "X400Name:<unsupported>");
|
|
217
|
+
break;
|
|
221
218
|
|
|
222
219
|
case GEN_EDIPARTY:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
// Maybe fix this: it is supported now
|
|
221
|
+
BIO_printf(out, "EdiPartyName:<unsupported>");
|
|
222
|
+
break;
|
|
226
223
|
|
|
227
224
|
case GEN_EMAIL:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
BIO_printf(out, "email:");
|
|
226
|
+
ASN1_STRING_print(out, gen->d.ia5);
|
|
227
|
+
break;
|
|
231
228
|
|
|
232
229
|
case GEN_DNS:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
BIO_printf(out, "DNS:");
|
|
231
|
+
ASN1_STRING_print(out, gen->d.ia5);
|
|
232
|
+
break;
|
|
236
233
|
|
|
237
234
|
case GEN_URI:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
235
|
+
BIO_printf(out, "URI:");
|
|
236
|
+
ASN1_STRING_print(out, gen->d.ia5);
|
|
237
|
+
break;
|
|
241
238
|
|
|
242
239
|
case GEN_DIRNAME:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
240
|
+
BIO_printf(out, "DirName: ");
|
|
241
|
+
X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE);
|
|
242
|
+
break;
|
|
246
243
|
|
|
247
244
|
case GEN_IPADD:
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
BIO_puts(out, "\n");
|
|
259
|
-
} else {
|
|
260
|
-
BIO_printf(out, "IP Address:<invalid>");
|
|
261
|
-
break;
|
|
245
|
+
p = gen->d.ip->data;
|
|
246
|
+
if (gen->d.ip->length == 4) {
|
|
247
|
+
BIO_printf(out, "IP Address:%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
|
|
248
|
+
} else if (gen->d.ip->length == 16) {
|
|
249
|
+
BIO_printf(out, "IP Address");
|
|
250
|
+
for (i = 0; i < 8; i++) {
|
|
251
|
+
uint16_t v = ((uint16_t)p[0] << 8) | p[1];
|
|
252
|
+
BIO_printf(out, ":%X", v);
|
|
253
|
+
p += 2;
|
|
262
254
|
}
|
|
255
|
+
BIO_puts(out, "\n");
|
|
256
|
+
} else {
|
|
257
|
+
BIO_printf(out, "IP Address:<invalid>");
|
|
263
258
|
break;
|
|
259
|
+
}
|
|
260
|
+
break;
|
|
264
261
|
|
|
265
262
|
case GEN_RID:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
263
|
+
BIO_printf(out, "Registered ID");
|
|
264
|
+
i2a_ASN1_OBJECT(out, gen->d.rid);
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
return 1;
|
|
271
268
|
}
|
|
272
269
|
|
|
273
270
|
static void *v2i_issuer_alt(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
|
|
274
|
-
STACK_OF(CONF_VALUE) *nval)
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
281
|
-
return NULL;
|
|
282
|
-
}
|
|
283
|
-
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
|
|
284
|
-
cnf = sk_CONF_VALUE_value(nval, i);
|
|
285
|
-
if (!x509v3_name_cmp(cnf->name, "issuer") && cnf->value &&
|
|
286
|
-
!strcmp(cnf->value, "copy")) {
|
|
287
|
-
if (!copy_issuer(ctx, gens))
|
|
288
|
-
goto err;
|
|
289
|
-
} else {
|
|
290
|
-
GENERAL_NAME *gen;
|
|
291
|
-
if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf)))
|
|
292
|
-
goto err;
|
|
293
|
-
sk_GENERAL_NAME_push(gens, gen);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
return gens;
|
|
297
|
-
err:
|
|
298
|
-
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
|
|
271
|
+
STACK_OF(CONF_VALUE) *nval) {
|
|
272
|
+
GENERAL_NAMES *gens = NULL;
|
|
273
|
+
CONF_VALUE *cnf;
|
|
274
|
+
size_t i;
|
|
275
|
+
if (!(gens = sk_GENERAL_NAME_new_null())) {
|
|
276
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
299
277
|
return NULL;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
{
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
int i = X509_get_ext_by_NID(ctx->issuer_cert, NID_subject_alt_name, -1);
|
|
313
|
-
if (i < 0)
|
|
314
|
-
return 1;
|
|
315
|
-
|
|
316
|
-
int ret = 0;
|
|
317
|
-
GENERAL_NAMES *ialt = NULL;
|
|
318
|
-
X509_EXTENSION *ext;
|
|
319
|
-
if (!(ext = X509_get_ext(ctx->issuer_cert, i)) ||
|
|
320
|
-
!(ialt = X509V3_EXT_d2i(ext))) {
|
|
321
|
-
OPENSSL_PUT_ERROR(X509V3, X509V3_R_ISSUER_DECODE_ERROR);
|
|
278
|
+
}
|
|
279
|
+
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
|
|
280
|
+
cnf = sk_CONF_VALUE_value(nval, i);
|
|
281
|
+
if (!x509v3_name_cmp(cnf->name, "issuer") && cnf->value &&
|
|
282
|
+
!strcmp(cnf->value, "copy")) {
|
|
283
|
+
if (!copy_issuer(ctx, gens)) {
|
|
284
|
+
goto err;
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
GENERAL_NAME *gen;
|
|
288
|
+
if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) {
|
|
322
289
|
goto err;
|
|
290
|
+
}
|
|
291
|
+
sk_GENERAL_NAME_push(gens, gen);
|
|
323
292
|
}
|
|
293
|
+
}
|
|
294
|
+
return gens;
|
|
295
|
+
err:
|
|
296
|
+
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
|
|
297
|
+
return NULL;
|
|
298
|
+
}
|
|
324
299
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
300
|
+
// Append subject altname of issuer to issuer alt name of subject
|
|
301
|
+
|
|
302
|
+
static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens) {
|
|
303
|
+
if (ctx && (ctx->flags == CTX_TEST)) {
|
|
304
|
+
return 1;
|
|
305
|
+
}
|
|
306
|
+
if (!ctx || !ctx->issuer_cert) {
|
|
307
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_ISSUER_DETAILS);
|
|
308
|
+
return 0;
|
|
309
|
+
}
|
|
310
|
+
int i = X509_get_ext_by_NID(ctx->issuer_cert, NID_subject_alt_name, -1);
|
|
311
|
+
if (i < 0) {
|
|
312
|
+
return 1;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
int ret = 0;
|
|
316
|
+
GENERAL_NAMES *ialt = NULL;
|
|
317
|
+
X509_EXTENSION *ext;
|
|
318
|
+
if (!(ext = X509_get_ext(ctx->issuer_cert, i)) ||
|
|
319
|
+
!(ialt = X509V3_EXT_d2i(ext))) {
|
|
320
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_ISSUER_DECODE_ERROR);
|
|
321
|
+
goto err;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
for (size_t j = 0; j < sk_GENERAL_NAME_num(ialt); j++) {
|
|
325
|
+
GENERAL_NAME *gen = sk_GENERAL_NAME_value(ialt, j);
|
|
326
|
+
if (!sk_GENERAL_NAME_push(gens, gen)) {
|
|
327
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
328
|
+
goto err;
|
|
333
329
|
}
|
|
330
|
+
// Ownership of |gen| has moved from |ialt| to |gens|.
|
|
331
|
+
sk_GENERAL_NAME_set(ialt, j, NULL);
|
|
332
|
+
}
|
|
334
333
|
|
|
335
|
-
|
|
334
|
+
ret = 1;
|
|
336
335
|
|
|
337
336
|
err:
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
GENERAL_NAMES_free(ialt);
|
|
338
|
+
return ret;
|
|
340
339
|
}
|
|
341
340
|
|
|
342
341
|
static void *v2i_subject_alt(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
|
|
343
|
-
STACK_OF(CONF_VALUE) *nval)
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
350
|
-
return NULL;
|
|
351
|
-
}
|
|
352
|
-
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
|
|
353
|
-
cnf = sk_CONF_VALUE_value(nval, i);
|
|
354
|
-
if (!x509v3_name_cmp(cnf->name, "email") && cnf->value &&
|
|
355
|
-
!strcmp(cnf->value, "copy")) {
|
|
356
|
-
if (!copy_email(ctx, gens, 0))
|
|
357
|
-
goto err;
|
|
358
|
-
} else if (!x509v3_name_cmp(cnf->name, "email") && cnf->value &&
|
|
359
|
-
!strcmp(cnf->value, "move")) {
|
|
360
|
-
if (!copy_email(ctx, gens, 1))
|
|
361
|
-
goto err;
|
|
362
|
-
} else {
|
|
363
|
-
GENERAL_NAME *gen;
|
|
364
|
-
if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf)))
|
|
365
|
-
goto err;
|
|
366
|
-
sk_GENERAL_NAME_push(gens, gen);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
return gens;
|
|
370
|
-
err:
|
|
371
|
-
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
|
|
342
|
+
STACK_OF(CONF_VALUE) *nval) {
|
|
343
|
+
GENERAL_NAMES *gens = NULL;
|
|
344
|
+
CONF_VALUE *cnf;
|
|
345
|
+
size_t i;
|
|
346
|
+
if (!(gens = sk_GENERAL_NAME_new_null())) {
|
|
347
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
372
348
|
return NULL;
|
|
349
|
+
}
|
|
350
|
+
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
|
|
351
|
+
cnf = sk_CONF_VALUE_value(nval, i);
|
|
352
|
+
if (!x509v3_name_cmp(cnf->name, "email") && cnf->value &&
|
|
353
|
+
!strcmp(cnf->value, "copy")) {
|
|
354
|
+
if (!copy_email(ctx, gens, 0)) {
|
|
355
|
+
goto err;
|
|
356
|
+
}
|
|
357
|
+
} else if (!x509v3_name_cmp(cnf->name, "email") && cnf->value &&
|
|
358
|
+
!strcmp(cnf->value, "move")) {
|
|
359
|
+
if (!copy_email(ctx, gens, 1)) {
|
|
360
|
+
goto err;
|
|
361
|
+
}
|
|
362
|
+
} else {
|
|
363
|
+
GENERAL_NAME *gen;
|
|
364
|
+
if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) {
|
|
365
|
+
goto err;
|
|
366
|
+
}
|
|
367
|
+
sk_GENERAL_NAME_push(gens, gen);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return gens;
|
|
371
|
+
err:
|
|
372
|
+
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
|
|
373
|
+
return NULL;
|
|
373
374
|
}
|
|
374
375
|
|
|
375
|
-
|
|
376
|
-
* Copy any email addresses in a certificate or request to GENERAL_NAMES
|
|
377
|
-
*/
|
|
376
|
+
// Copy any email addresses in a certificate or request to GENERAL_NAMES
|
|
378
377
|
|
|
379
|
-
static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
378
|
+
static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p) {
|
|
379
|
+
X509_NAME *nm;
|
|
380
|
+
ASN1_IA5STRING *email = NULL;
|
|
381
|
+
X509_NAME_ENTRY *ne;
|
|
382
|
+
GENERAL_NAME *gen = NULL;
|
|
383
|
+
int i;
|
|
384
|
+
if (ctx != NULL && ctx->flags == CTX_TEST) {
|
|
385
|
+
return 1;
|
|
386
|
+
}
|
|
387
|
+
if (!ctx || (!ctx->subject_cert && !ctx->subject_req)) {
|
|
388
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_NO_SUBJECT_DETAILS);
|
|
389
|
+
goto err;
|
|
390
|
+
}
|
|
391
|
+
// Find the subject name
|
|
392
|
+
if (ctx->subject_cert) {
|
|
393
|
+
nm = X509_get_subject_name(ctx->subject_cert);
|
|
394
|
+
} else {
|
|
395
|
+
nm = X509_REQ_get_subject_name(ctx->subject_req);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Now add any email address(es) to STACK
|
|
399
|
+
i = -1;
|
|
400
|
+
while ((i = X509_NAME_get_index_by_NID(nm, NID_pkcs9_emailAddress, i)) >= 0) {
|
|
401
|
+
ne = X509_NAME_get_entry(nm, i);
|
|
402
|
+
email = ASN1_STRING_dup(X509_NAME_ENTRY_get_data(ne));
|
|
403
|
+
if (move_p) {
|
|
404
|
+
X509_NAME_delete_entry(nm, i);
|
|
405
|
+
X509_NAME_ENTRY_free(ne);
|
|
406
|
+
i--;
|
|
391
407
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
else
|
|
396
|
-
nm = X509_REQ_get_subject_name(ctx->subject_req);
|
|
397
|
-
|
|
398
|
-
/* Now add any email address(es) to STACK */
|
|
399
|
-
i = -1;
|
|
400
|
-
while ((i = X509_NAME_get_index_by_NID(nm,
|
|
401
|
-
NID_pkcs9_emailAddress, i)) >= 0) {
|
|
402
|
-
ne = X509_NAME_get_entry(nm, i);
|
|
403
|
-
email = ASN1_STRING_dup(X509_NAME_ENTRY_get_data(ne));
|
|
404
|
-
if (move_p) {
|
|
405
|
-
X509_NAME_delete_entry(nm, i);
|
|
406
|
-
X509_NAME_ENTRY_free(ne);
|
|
407
|
-
i--;
|
|
408
|
-
}
|
|
409
|
-
if (!email || !(gen = GENERAL_NAME_new())) {
|
|
410
|
-
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
411
|
-
goto err;
|
|
412
|
-
}
|
|
413
|
-
gen->d.ia5 = email;
|
|
414
|
-
email = NULL;
|
|
415
|
-
gen->type = GEN_EMAIL;
|
|
416
|
-
if (!sk_GENERAL_NAME_push(gens, gen)) {
|
|
417
|
-
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
418
|
-
goto err;
|
|
419
|
-
}
|
|
420
|
-
gen = NULL;
|
|
408
|
+
if (!email || !(gen = GENERAL_NAME_new())) {
|
|
409
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
410
|
+
goto err;
|
|
421
411
|
}
|
|
412
|
+
gen->d.ia5 = email;
|
|
413
|
+
email = NULL;
|
|
414
|
+
gen->type = GEN_EMAIL;
|
|
415
|
+
if (!sk_GENERAL_NAME_push(gens, gen)) {
|
|
416
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
417
|
+
goto err;
|
|
418
|
+
}
|
|
419
|
+
gen = NULL;
|
|
420
|
+
}
|
|
422
421
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
err:
|
|
426
|
-
GENERAL_NAME_free(gen);
|
|
427
|
-
ASN1_IA5STRING_free(email);
|
|
428
|
-
return 0;
|
|
422
|
+
return 1;
|
|
429
423
|
|
|
424
|
+
err:
|
|
425
|
+
GENERAL_NAME_free(gen);
|
|
426
|
+
ASN1_IA5STRING_free(email);
|
|
427
|
+
return 0;
|
|
430
428
|
}
|
|
431
429
|
|
|
432
430
|
GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method,
|
|
433
|
-
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
441
|
-
return NULL;
|
|
442
|
-
}
|
|
443
|
-
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
|
|
444
|
-
cnf = sk_CONF_VALUE_value(nval, i);
|
|
445
|
-
if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf)))
|
|
446
|
-
goto err;
|
|
447
|
-
sk_GENERAL_NAME_push(gens, gen);
|
|
448
|
-
}
|
|
449
|
-
return gens;
|
|
450
|
-
err:
|
|
451
|
-
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
|
|
431
|
+
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) {
|
|
432
|
+
GENERAL_NAME *gen;
|
|
433
|
+
GENERAL_NAMES *gens = NULL;
|
|
434
|
+
CONF_VALUE *cnf;
|
|
435
|
+
size_t i;
|
|
436
|
+
if (!(gens = sk_GENERAL_NAME_new_null())) {
|
|
437
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
452
438
|
return NULL;
|
|
439
|
+
}
|
|
440
|
+
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
|
|
441
|
+
cnf = sk_CONF_VALUE_value(nval, i);
|
|
442
|
+
if (!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) {
|
|
443
|
+
goto err;
|
|
444
|
+
}
|
|
445
|
+
sk_GENERAL_NAME_push(gens, gen);
|
|
446
|
+
}
|
|
447
|
+
return gens;
|
|
448
|
+
err:
|
|
449
|
+
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
|
|
450
|
+
return NULL;
|
|
453
451
|
}
|
|
454
452
|
|
|
455
|
-
GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0);
|
|
453
|
+
GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
|
|
454
|
+
CONF_VALUE *cnf) {
|
|
455
|
+
return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0);
|
|
459
456
|
}
|
|
460
457
|
|
|
461
458
|
GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
|
|
462
|
-
const X509V3_EXT_METHOD *method,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
char is_string = 0;
|
|
467
|
-
GENERAL_NAME *gen = NULL;
|
|
468
|
-
|
|
469
|
-
if (!value) {
|
|
470
|
-
OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE);
|
|
471
|
-
return NULL;
|
|
472
|
-
}
|
|
459
|
+
const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
|
|
460
|
+
int gen_type, const char *value, int is_nc) {
|
|
461
|
+
char is_string = 0;
|
|
462
|
+
GENERAL_NAME *gen = NULL;
|
|
473
463
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
464
|
+
if (!value) {
|
|
465
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE);
|
|
466
|
+
return NULL;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (out) {
|
|
470
|
+
gen = out;
|
|
471
|
+
} else {
|
|
472
|
+
gen = GENERAL_NAME_new();
|
|
473
|
+
if (gen == NULL) {
|
|
474
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
475
|
+
return NULL;
|
|
482
476
|
}
|
|
477
|
+
}
|
|
483
478
|
|
|
484
|
-
|
|
479
|
+
switch (gen_type) {
|
|
485
480
|
case GEN_URI:
|
|
486
481
|
case GEN_EMAIL:
|
|
487
482
|
case GEN_DNS:
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
case GEN_RID:
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
break;
|
|
483
|
+
is_string = 1;
|
|
484
|
+
break;
|
|
485
|
+
|
|
486
|
+
case GEN_RID: {
|
|
487
|
+
ASN1_OBJECT *obj;
|
|
488
|
+
if (!(obj = OBJ_txt2obj(value, 0))) {
|
|
489
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_OBJECT);
|
|
490
|
+
ERR_add_error_data(2, "value=", value);
|
|
491
|
+
goto err;
|
|
492
|
+
}
|
|
493
|
+
gen->d.rid = obj;
|
|
494
|
+
} break;
|
|
502
495
|
|
|
503
496
|
case GEN_IPADD:
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
497
|
+
if (is_nc) {
|
|
498
|
+
gen->d.ip = a2i_IPADDRESS_NC(value);
|
|
499
|
+
} else {
|
|
500
|
+
gen->d.ip = a2i_IPADDRESS(value);
|
|
501
|
+
}
|
|
502
|
+
if (gen->d.ip == NULL) {
|
|
503
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_IP_ADDRESS);
|
|
504
|
+
ERR_add_error_data(2, "value=", value);
|
|
505
|
+
goto err;
|
|
506
|
+
}
|
|
507
|
+
break;
|
|
514
508
|
|
|
515
509
|
case GEN_DIRNAME:
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
510
|
+
if (!do_dirname(gen, value, ctx)) {
|
|
511
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_DIRNAME_ERROR);
|
|
512
|
+
goto err;
|
|
513
|
+
}
|
|
514
|
+
break;
|
|
521
515
|
|
|
522
516
|
case GEN_OTHERNAME:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
goto err;
|
|
526
|
-
}
|
|
527
|
-
break;
|
|
528
|
-
default:
|
|
529
|
-
OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_TYPE);
|
|
517
|
+
if (!do_othername(gen, value, ctx)) {
|
|
518
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_OTHERNAME_ERROR);
|
|
530
519
|
goto err;
|
|
520
|
+
}
|
|
521
|
+
break;
|
|
522
|
+
default:
|
|
523
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_TYPE);
|
|
524
|
+
goto err;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
if (is_string) {
|
|
528
|
+
if (!(gen->d.ia5 = ASN1_IA5STRING_new()) ||
|
|
529
|
+
!ASN1_STRING_set(gen->d.ia5, (unsigned char *)value, strlen(value))) {
|
|
530
|
+
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
531
|
+
goto err;
|
|
531
532
|
}
|
|
533
|
+
}
|
|
532
534
|
|
|
533
|
-
|
|
534
|
-
if (!(gen->d.ia5 = ASN1_IA5STRING_new()) ||
|
|
535
|
-
!ASN1_STRING_set(gen->d.ia5, (unsigned char *)value,
|
|
536
|
-
strlen(value))) {
|
|
537
|
-
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
|
538
|
-
goto err;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
gen->type = gen_type;
|
|
535
|
+
gen->type = gen_type;
|
|
543
536
|
|
|
544
|
-
|
|
537
|
+
return gen;
|
|
545
538
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
539
|
+
err:
|
|
540
|
+
if (!out) {
|
|
541
|
+
GENERAL_NAME_free(gen);
|
|
542
|
+
}
|
|
543
|
+
return NULL;
|
|
550
544
|
}
|
|
551
545
|
|
|
552
546
|
GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,
|
|
553
547
|
const X509V3_EXT_METHOD *method,
|
|
554
|
-
X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc)
|
|
555
|
-
|
|
556
|
-
int type;
|
|
548
|
+
X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc) {
|
|
549
|
+
int type;
|
|
557
550
|
|
|
558
|
-
|
|
551
|
+
char *name, *value;
|
|
559
552
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (!value) {
|
|
564
|
-
OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE);
|
|
565
|
-
return NULL;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
if (!x509v3_name_cmp(name, "email"))
|
|
569
|
-
type = GEN_EMAIL;
|
|
570
|
-
else if (!x509v3_name_cmp(name, "URI"))
|
|
571
|
-
type = GEN_URI;
|
|
572
|
-
else if (!x509v3_name_cmp(name, "DNS"))
|
|
573
|
-
type = GEN_DNS;
|
|
574
|
-
else if (!x509v3_name_cmp(name, "RID"))
|
|
575
|
-
type = GEN_RID;
|
|
576
|
-
else if (!x509v3_name_cmp(name, "IP"))
|
|
577
|
-
type = GEN_IPADD;
|
|
578
|
-
else if (!x509v3_name_cmp(name, "dirName"))
|
|
579
|
-
type = GEN_DIRNAME;
|
|
580
|
-
else if (!x509v3_name_cmp(name, "otherName"))
|
|
581
|
-
type = GEN_OTHERNAME;
|
|
582
|
-
else {
|
|
583
|
-
OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_OPTION);
|
|
584
|
-
ERR_add_error_data(2, "name=", name);
|
|
585
|
-
return NULL;
|
|
586
|
-
}
|
|
553
|
+
name = cnf->name;
|
|
554
|
+
value = cnf->value;
|
|
587
555
|
|
|
588
|
-
|
|
556
|
+
if (!value) {
|
|
557
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_MISSING_VALUE);
|
|
558
|
+
return NULL;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if (!x509v3_name_cmp(name, "email")) {
|
|
562
|
+
type = GEN_EMAIL;
|
|
563
|
+
} else if (!x509v3_name_cmp(name, "URI")) {
|
|
564
|
+
type = GEN_URI;
|
|
565
|
+
} else if (!x509v3_name_cmp(name, "DNS")) {
|
|
566
|
+
type = GEN_DNS;
|
|
567
|
+
} else if (!x509v3_name_cmp(name, "RID")) {
|
|
568
|
+
type = GEN_RID;
|
|
569
|
+
} else if (!x509v3_name_cmp(name, "IP")) {
|
|
570
|
+
type = GEN_IPADD;
|
|
571
|
+
} else if (!x509v3_name_cmp(name, "dirName")) {
|
|
572
|
+
type = GEN_DIRNAME;
|
|
573
|
+
} else if (!x509v3_name_cmp(name, "otherName")) {
|
|
574
|
+
type = GEN_OTHERNAME;
|
|
575
|
+
} else {
|
|
576
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_OPTION);
|
|
577
|
+
ERR_add_error_data(2, "name=", name);
|
|
578
|
+
return NULL;
|
|
579
|
+
}
|
|
589
580
|
|
|
581
|
+
return a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc);
|
|
590
582
|
}
|
|
591
583
|
|
|
592
|
-
static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx)
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
return
|
|
584
|
+
static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) {
|
|
585
|
+
char *objtmp = NULL;
|
|
586
|
+
const char *p;
|
|
587
|
+
int objlen;
|
|
588
|
+
if (!(p = strchr(value, ';'))) {
|
|
589
|
+
return 0;
|
|
590
|
+
}
|
|
591
|
+
if (!(gen->d.otherName = OTHERNAME_new())) {
|
|
592
|
+
return 0;
|
|
593
|
+
}
|
|
594
|
+
// Free this up because we will overwrite it. no need to free type_id
|
|
595
|
+
// because it is static
|
|
596
|
+
ASN1_TYPE_free(gen->d.otherName->value);
|
|
597
|
+
if (!(gen->d.otherName->value = ASN1_generate_v3(p + 1, ctx))) {
|
|
598
|
+
return 0;
|
|
599
|
+
}
|
|
600
|
+
objlen = p - value;
|
|
601
|
+
objtmp = OPENSSL_malloc(objlen + 1);
|
|
602
|
+
if (objtmp == NULL) {
|
|
603
|
+
return 0;
|
|
604
|
+
}
|
|
605
|
+
OPENSSL_strlcpy(objtmp, value, objlen + 1);
|
|
606
|
+
gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);
|
|
607
|
+
OPENSSL_free(objtmp);
|
|
608
|
+
if (!gen->d.otherName->type_id) {
|
|
609
|
+
return 0;
|
|
610
|
+
}
|
|
611
|
+
return 1;
|
|
618
612
|
}
|
|
619
613
|
|
|
620
|
-
static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx)
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
614
|
+
static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) {
|
|
615
|
+
int ret = 0;
|
|
616
|
+
STACK_OF(CONF_VALUE) *sk = NULL;
|
|
617
|
+
X509_NAME *nm = X509_NAME_new();
|
|
618
|
+
if (nm == NULL) {
|
|
619
|
+
goto err;
|
|
620
|
+
}
|
|
621
|
+
sk = X509V3_get_section(ctx, value);
|
|
622
|
+
if (sk == NULL) {
|
|
623
|
+
OPENSSL_PUT_ERROR(X509V3, X509V3_R_SECTION_NOT_FOUND);
|
|
624
|
+
ERR_add_error_data(2, "section=", value);
|
|
625
|
+
goto err;
|
|
626
|
+
}
|
|
627
|
+
// FIXME: should allow other character types...
|
|
628
|
+
if (!X509V3_NAME_from_section(nm, sk, MBSTRING_ASC)) {
|
|
629
|
+
goto err;
|
|
630
|
+
}
|
|
631
|
+
gen->d.dirn = nm;
|
|
632
|
+
ret = 1;
|
|
633
|
+
|
|
634
|
+
err:
|
|
635
|
+
if (!ret) {
|
|
636
|
+
X509_NAME_free(nm);
|
|
637
|
+
}
|
|
638
|
+
X509V3_section_free(ctx, sk);
|
|
639
|
+
return ret;
|
|
644
640
|
}
|