@fails-components/webtransport 0.0.1-rc.0 → 0.0.1-rc.1
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/.github/workflows/npm-publish-packages.yml +0 -0
- package/CMakeLists.txt +2 -0
- package/package.json +1 -1
- package/readme.md +0 -0
- package/src/http3serversession.h +1 -1
- package/src/webtransport.js +4 -2
- package/third_party/boringssl/src/CMakeLists.txt +9 -12
- package/third_party/boringssl/src/crypto/CMakeLists.txt +2 -3
- package/third_party/boringssl/src/crypto/asn1/time_support.c +206 -206
- package/third_party/boringssl/src/crypto/bio/socket_helper.c +124 -122
- package/third_party/boringssl/src/crypto/evp/digestsign.c +268 -231
- package/third_party/boringssl/src/crypto/evp/p_ec.c +286 -286
- package/third_party/boringssl/src/crypto/fipsmodule/aes/key_wrap.c +246 -236
- package/third_party/boringssl/src/crypto/fipsmodule/aes/mode_wrappers.c +124 -122
- package/third_party/boringssl/src/crypto/fipsmodule/bcm.c +3 -0
- package/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c +246 -230
- package/third_party/boringssl/src/crypto/fipsmodule/bn/internal.h +734 -715
- package/third_party/boringssl/src/crypto/fipsmodule/bn/random.c +349 -341
- package/third_party/boringssl/src/crypto/fipsmodule/cipher/cipher.c +670 -648
- package/third_party/boringssl/src/crypto/fipsmodule/cipher/e_aes.c +1504 -1472
- package/third_party/boringssl/src/crypto/{cipher_extra → fipsmodule/cipher}/e_aesccm.c +435 -446
- package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_3des_cmac_tests.txt +0 -0
- package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_aes128_cmac_tests.txt +0 -0
- package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_aes192_cmac_tests.txt +0 -0
- package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cavp_aes256_cmac_tests.txt +0 -0
- package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cmac.c +318 -278
- package/third_party/boringssl/src/crypto/{cmac → fipsmodule/cmac}/cmac_test.cc +268 -267
- package/third_party/boringssl/src/crypto/fipsmodule/dh/dh.c +5 -1
- package/third_party/boringssl/src/crypto/fipsmodule/ec/ec.c +11 -17
- package/third_party/boringssl/src/crypto/fipsmodule/ec/ec_key.c +15 -4
- package/third_party/boringssl/src/crypto/fipsmodule/ec/internal.h +2 -6
- package/third_party/boringssl/src/crypto/fipsmodule/ec/p224-64.c +1164 -1180
- package/third_party/boringssl/src/crypto/fipsmodule/ec/p256-nistz.c +3 -3
- package/third_party/boringssl/src/crypto/fipsmodule/ec/p256-nistz_test.cc +2 -2
- package/third_party/boringssl/src/crypto/fipsmodule/ec/p256.c +44 -33
- package/third_party/boringssl/src/crypto/fipsmodule/ec/scalar.c +169 -175
- package/third_party/boringssl/src/crypto/fipsmodule/ec/simple.c +352 -357
- package/third_party/boringssl/src/crypto/fipsmodule/ecdh/ecdh.c +4 -0
- package/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c +14 -9
- package/third_party/boringssl/src/crypto/fipsmodule/hmac/hmac.c +256 -235
- package/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c +204 -202
- package/third_party/boringssl/src/crypto/fipsmodule/rsa/padding.c +702 -695
- package/third_party/boringssl/src/crypto/fipsmodule/rsa/rsa_impl.c +7 -2
- package/third_party/boringssl/src/crypto/fipsmodule/self_check/self_check.c +7 -0
- package/third_party/boringssl/src/crypto/fipsmodule/service_indicator/internal.h +89 -0
- package/third_party/boringssl/src/crypto/fipsmodule/service_indicator/service_indicator.c +333 -0
- package/third_party/boringssl/src/crypto/fipsmodule/service_indicator/service_indicator_test.cc +2410 -0
- package/third_party/boringssl/src/crypto/fipsmodule/sha/sha1.c +359 -357
- package/third_party/boringssl/src/crypto/fipsmodule/sha/sha256.c +325 -321
- package/third_party/boringssl/src/crypto/fipsmodule/sha/sha512.c +510 -508
- package/third_party/boringssl/src/crypto/fipsmodule/tls/kdf.c +177 -165
- package/third_party/boringssl/src/crypto/internal.h +13 -0
- package/third_party/boringssl/src/crypto/trust_token/trust_token_test.cc +884 -884
- package/third_party/boringssl/src/crypto/x509/internal.h +0 -2
- package/third_party/boringssl/src/crypto/x509/t_crl.c +148 -148
- package/third_party/boringssl/src/crypto/x509/t_req.c +249 -250
- package/third_party/boringssl/src/crypto/x509/t_x509.c +2 -3
- package/third_party/boringssl/src/crypto/x509/x509_req.c +262 -304
- package/third_party/boringssl/src/crypto/x509/x509_set.c +250 -240
- package/third_party/boringssl/src/crypto/x509/x509_test.cc +466 -4
- package/third_party/boringssl/src/crypto/x509/x509cset.c +292 -279
- package/third_party/boringssl/src/crypto/x509/x509rset.c +89 -86
- package/third_party/boringssl/src/crypto/x509/x_crl.c +37 -125
- package/third_party/boringssl/src/crypto/x509/x_req.c +114 -109
- package/third_party/boringssl/src/crypto/x509/x_x509.c +394 -394
- package/third_party/boringssl/src/crypto/x509v3/v3_akey.c +11 -16
- package/third_party/boringssl/src/crypto/x509v3/v3_alt.c +644 -642
- package/third_party/boringssl/src/crypto/x509v3/v3_bcons.c +130 -133
- package/third_party/boringssl/src/crypto/x509v3/v3_bitst.c +149 -144
- package/third_party/boringssl/src/crypto/x509v3/v3_cpols.c +496 -500
- package/third_party/boringssl/src/crypto/x509v3/v3_enum.c +105 -106
- package/third_party/boringssl/src/crypto/x509v3/v3_ia5.c +126 -121
- package/third_party/boringssl/src/crypto/x509v3/v3_info.c +206 -218
- package/third_party/boringssl/src/crypto/x509v3/v3_int.c +97 -91
- package/third_party/boringssl/src/crypto/x509v3/v3_pci.c +290 -289
- package/third_party/boringssl/src/crypto/x509v3/v3_skey.c +161 -156
- package/third_party/boringssl/src/crypto/x509v3/v3_utl.c +5 -3
- package/third_party/boringssl/src/include/openssl/aead.h +480 -480
- package/third_party/boringssl/src/include/openssl/asn1.h +2 -0
- package/third_party/boringssl/src/include/openssl/base.h +1 -1
- package/third_party/boringssl/src/include/openssl/service_indicator.h +96 -0
- package/third_party/boringssl/src/include/openssl/ssl.h +7 -0
- package/third_party/boringssl/src/include/openssl/x509.h +11 -33
- package/third_party/boringssl/src/include/openssl/x509v3.h +990 -1018
- package/third_party/boringssl/src/sources.cmake +4 -4
- package/third_party/boringssl/src/ssl/internal.h +10 -0
- package/third_party/boringssl/src/ssl/ssl_lib.cc +3081 -3072
- package/third_party/boringssl/src/ssl/ssl_test.cc +46 -0
- package/third_party/boringssl/src/ssl/tls13_server.cc +4 -6
- package/third_party/boringssl/src/util/bot/DEPS +14 -27
- package/third_party/boringssl/src/util/bot/UPDATING +3 -9
- package/third_party/boringssl/src/util/bot/update_clang.py +172 -172
- package/third_party/boringssl/src/util/bot/vs_toolchain.py +3 -3
- package/third_party/quiche/.bazelrc +8 -0
- package/third_party/quiche/BUILD.bazel +7 -0
- package/third_party/quiche/WHITESPACE +3 -1
- package/third_party/quiche/WORKSPACE.bazel +87 -0
- package/third_party/quiche/build/BUILD.bazel +7 -0
- package/third_party/quiche/build/source_list.bzl +1511 -0
- package/third_party/quiche/build/source_list.gni +1511 -0
- package/third_party/quiche/build/source_list.json +1511 -0
- package/third_party/quiche/build/test.bzl +26 -0
- package/third_party/quiche/build/zlib.BUILD +25 -0
- package/third_party/quiche/quiche/BUILD.bazel +270 -0
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_enums.cc +3 -3
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_enums.h +7 -7
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_frame.cc +39 -18
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_frame.h +11 -10
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_frame_test.cc +67 -63
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_headers.cc +13 -12
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_headers.h +16 -8
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_headers_test.cc +9 -9
- package/third_party/quiche/quiche/{common/balsa → balsa}/balsa_visitor_interface.h +4 -4
- package/third_party/quiche/quiche/{common/balsa → balsa}/framer_interface.h +3 -3
- package/third_party/quiche/quiche/{common/balsa → balsa}/header_api.h +3 -3
- package/third_party/quiche/quiche/{common/balsa → balsa}/header_properties.cc +1 -1
- package/third_party/quiche/quiche/{common/balsa → balsa}/header_properties.h +3 -3
- package/third_party/quiche/quiche/{common/balsa → balsa}/header_properties_test.cc +1 -1
- package/third_party/quiche/quiche/{common/balsa → balsa}/http_validation_policy.cc +1 -1
- package/third_party/quiche/quiche/{common/balsa → balsa}/http_validation_policy.h +3 -3
- package/third_party/quiche/quiche/{common/balsa → balsa}/noop_balsa_visitor.h +4 -4
- package/third_party/quiche/quiche/{common/balsa → balsa}/simple_buffer.cc +22 -29
- package/third_party/quiche/quiche/{common/balsa → balsa}/simple_buffer.h +18 -16
- package/third_party/quiche/quiche/{common/balsa → balsa}/simple_buffer_test.cc +79 -32
- package/third_party/quiche/quiche/{common/balsa → balsa}/standard_header_map.cc +1 -1
- package/third_party/quiche/quiche/{common/balsa → balsa}/standard_header_map.h +3 -3
- package/third_party/quiche/quiche/common/platform/api/quiche_command_line_flags.h +6 -1
- package/third_party/quiche/quiche/common/platform/api/quiche_flags.h +8 -0
- package/third_party/quiche/quiche/common/platform/api/quiche_logging.h +0 -3
- package/third_party/quiche/quiche/common/platform/api/quiche_lower_case_string_test.cc +29 -0
- package/third_party/quiche/quiche/common/platform/api/quiche_test.h +5 -7
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quic_flags_impl.h +1 -1
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_bug_tracker_impl.h +3 -2
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_command_line_flags_impl.cc +41 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_command_line_flags_impl.h +33 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_expect_bug_impl.h +15 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_logging_impl.h +84 -50
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_lower_case_string_impl.h +25 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_stack_trace_impl.cc +1 -1
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_test_impl.cc +25 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_test_impl.h +56 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_test_output_impl.h +27 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_thread_impl.h +26 -0
- package/third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_url_utils_impl.cc +1 -0
- package/third_party/quiche/quiche/common/quiche_buffer_allocator_test.cc +1 -1
- package/third_party/quiche/quiche/common/quiche_mem_slice_storage.h +2 -3
- package/third_party/quiche/quiche/common/structured_headers.cc +14 -12
- package/third_party/quiche/quiche/http2/adapter/event_forwarder.cc +7 -5
- package/third_party/quiche/quiche/http2/adapter/event_forwarder.h +4 -2
- package/third_party/quiche/quiche/http2/adapter/event_forwarder_test.cc +14 -9
- package/third_party/quiche/quiche/http2/adapter/header_validator.cc +43 -19
- package/third_party/quiche/quiche/http2/adapter/header_validator.h +11 -40
- package/third_party/quiche/quiche/http2/adapter/header_validator_base.h +69 -0
- package/third_party/quiche/quiche/http2/adapter/header_validator_test.cc +73 -1
- package/third_party/quiche/quiche/http2/adapter/nghttp2_adapter_test.cc +66 -0
- package/third_party/quiche/quiche/http2/adapter/nghttp2_session_test.cc +8 -5
- package/third_party/quiche/quiche/http2/adapter/nghttp2_test.cc +1 -1
- package/third_party/quiche/quiche/http2/adapter/noop_header_validator.cc +22 -0
- package/third_party/quiche/quiche/http2/adapter/noop_header_validator.h +25 -0
- package/third_party/quiche/quiche/http2/adapter/noop_header_validator_test.cc +523 -0
- package/third_party/quiche/quiche/http2/adapter/oghttp2_adapter_test.cc +186 -5
- package/third_party/quiche/quiche/http2/adapter/oghttp2_session.cc +37 -43
- package/third_party/quiche/quiche/http2/adapter/oghttp2_session.h +22 -23
- package/third_party/quiche/quiche/http2/adapter/test_utils.cc +1 -1
- package/third_party/quiche/quiche/http2/adapter/window_manager_test.cc +11 -5
- package/third_party/quiche/quiche/http2/core/http2_trace_logging.cc +13 -11
- package/third_party/quiche/quiche/http2/core/http2_trace_logging.h +5 -4
- package/third_party/quiche/quiche/http2/core/priority_write_scheduler.h +42 -36
- package/third_party/quiche/quiche/http2/core/priority_write_scheduler_test.cc +2 -2
- package/third_party/quiche/quiche/http2/decoder/decode_buffer_test.cc +9 -9
- package/third_party/quiche/quiche/http2/decoder/decode_http2_structures_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/http2_frame_decoder_test.cc +14 -14
- package/third_party/quiche/quiche/http2/decoder/http2_structure_decoder_test.cc +17 -17
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/data_payload_decoder_test.cc +2 -2
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/headers_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/ping_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/priority_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/priority_update_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/settings_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_block_decoder_test.cc +2 -2
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_state_test.cc +8 -8
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc +4 -3
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_tables_test.cc +17 -17
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_decoder_test.cc +25 -25
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_entry_decoder_test.cc +2 -2
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_entry_type_decoder_test.cc +7 -6
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_string_decoder_test.cc +6 -6
- package/third_party/quiche/quiche/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc +1 -1
- package/third_party/quiche/quiche/http2/hpack/huffman/hpack_huffman_decoder_test.cc +2 -2
- package/third_party/quiche/quiche/http2/hpack/huffman/hpack_huffman_encoder_test.cc +1 -1
- package/third_party/quiche/quiche/http2/hpack/huffman/hpack_huffman_transcoder_test.cc +5 -5
- package/third_party/quiche/quiche/http2/hpack/varint/hpack_varint_decoder_test.cc +4 -4
- package/third_party/quiche/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc +1 -1
- package/third_party/quiche/quiche/http2/http2_constants_test.cc +1 -1
- package/third_party/quiche/quiche/http2/http2_structures_test.cc +23 -22
- package/third_party/quiche/quiche/http2/test_tools/frame_decoder_state_test_util.cc +1 -1
- package/third_party/quiche/quiche/http2/test_tools/frame_decoder_state_test_util.h +1 -1
- package/third_party/quiche/quiche/http2/test_tools/frame_parts.cc +38 -38
- package/third_party/quiche/quiche/http2/test_tools/hpack_block_collector.cc +15 -15
- package/third_party/quiche/quiche/http2/test_tools/hpack_entry_collector.cc +24 -22
- package/third_party/quiche/quiche/http2/test_tools/hpack_string_collector.cc +5 -5
- package/third_party/quiche/quiche/http2/test_tools/http2_frame_builder_test.cc +70 -89
- package/third_party/quiche/quiche/http2/test_tools/payload_decoder_base_test_util.cc +1 -1
- package/third_party/quiche/quiche/http2/test_tools/payload_decoder_base_test_util.h +29 -26
- package/third_party/quiche/quiche/http2/test_tools/{random_decoder_test.cc → random_decoder_test_base.cc} +13 -10
- package/third_party/quiche/quiche/http2/test_tools/{random_decoder_test.h → random_decoder_test_base.h} +15 -17
- package/third_party/quiche/quiche/http2/test_tools/{random_decoder_test_test.cc → random_decoder_test_base_test.cc} +1 -1
- package/third_party/quiche/quiche/http2/test_tools/verify_macros.h +32 -0
- package/third_party/quiche/quiche/quic/core/congestion_control/bbr2_sender.cc +2 -1
- package/third_party/quiche/quiche/quic/core/congestion_control/bbr2_simulator_test.cc +3 -2
- package/third_party/quiche/quiche/quic/core/congestion_control/bbr_sender_test.cc +3 -2
- package/third_party/quiche/quiche/quic/core/congestion_control/rtt_stats.cc +3 -2
- package/third_party/quiche/quiche/quic/core/congestion_control/rtt_stats.h +2 -1
- package/third_party/quiche/quiche/quic/core/congestion_control/rtt_stats_test.cc +2 -13
- package/third_party/quiche/quiche/quic/core/crypto/certificate_view.cc +15 -0
- package/third_party/quiche/quiche/quic/core/crypto/certificate_view.h +7 -0
- package/third_party/quiche/quiche/quic/core/crypto/certificate_view_test.cc +16 -0
- package/third_party/quiche/quiche/quic/core/crypto/crypto_protocol.h +1 -0
- package/third_party/quiche/quiche/quic/core/crypto/proof_source.h +2 -2
- package/third_party/quiche/quiche/quic/core/crypto/proof_source_x509.cc +3 -5
- package/third_party/quiche/quiche/quic/core/crypto/proof_source_x509.h +1 -2
- package/third_party/quiche/quiche/quic/core/crypto/quic_crypto_server_config.cc +1 -1
- package/third_party/quiche/quiche/quic/core/crypto/quic_crypto_server_config.h +3 -3
- package/third_party/quiche/quiche/quic/core/frames/quic_blocked_frame.cc +2 -8
- package/third_party/quiche/quiche/quic/core/frames/quic_blocked_frame.h +0 -1
- package/third_party/quiche/quiche/quic/core/frames/quic_crypto_frame.h +2 -0
- package/third_party/quiche/quiche/quic/core/frames/quic_frames_test.cc +2 -1
- package/third_party/quiche/quiche/quic/core/http/capsule.cc +2 -22
- package/third_party/quiche/quiche/quic/core/http/capsule.h +0 -2
- package/third_party/quiche/quiche/quic/core/http/capsule_test.cc +1 -2
- package/third_party/quiche/quiche/quic/core/http/end_to_end_test.cc +148 -57
- package/third_party/quiche/quiche/quic/core/http/http_constants.cc +1 -1
- package/third_party/quiche/quiche/quic/core/http/http_constants.h +2 -2
- package/third_party/quiche/quiche/quic/core/http/quic_header_list_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/http/quic_headers_stream_test.cc +18 -14
- package/third_party/quiche/quiche/quic/core/http/quic_send_control_stream.h +2 -1
- package/third_party/quiche/quiche/quic/core/http/quic_send_control_stream_test.cc +3 -7
- package/third_party/quiche/quiche/quic/core/http/quic_server_session_base.h +4 -0
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_session.cc +47 -65
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_session.h +5 -17
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_session_test.cc +63 -54
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.cc +34 -91
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream.h +1 -9
- package/third_party/quiche/quiche/quic/core/http/quic_spdy_stream_test.cc +27 -134
- package/third_party/quiche/quiche/quic/core/http/spdy_utils.cc +0 -41
- package/third_party/quiche/quiche/quic/core/http/spdy_utils.h +0 -9
- package/third_party/quiche/quiche/quic/core/http/spdy_utils_test.cc +0 -32
- package/third_party/quiche/quiche/quic/core/http/web_transport_http3.cc +0 -1
- package/third_party/quiche/quiche/quic/core/packet_number_indexed_queue_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/qpack/qpack_header_table.cc +2 -1
- package/third_party/quiche/quiche/quic/core/qpack/qpack_send_stream.h +2 -1
- package/third_party/quiche/quiche/quic/core/quic_arena_scoped_ptr_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_connection.cc +68 -46
- package/third_party/quiche/quiche/quic/core/quic_connection.h +7 -6
- package/third_party/quiche/quiche/quic/core/quic_connection_context_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_connection_id_manager_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_connection_id_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_connection_test.cc +45 -132
- package/third_party/quiche/quiche/quic/core/quic_constants.h +0 -7
- package/third_party/quiche/quiche/quic/core/quic_control_frame_manager.cc +11 -3
- package/third_party/quiche/quiche/quic/core/quic_control_frame_manager.h +1 -1
- package/third_party/quiche/quiche/quic/core/quic_control_frame_manager_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_crypto_client_handshaker.cc +13 -1
- package/third_party/quiche/quiche/quic/core/quic_crypto_client_handshaker.h +3 -0
- package/third_party/quiche/quiche/quic/core/quic_crypto_client_handshaker_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_crypto_client_stream.cc +6 -0
- package/third_party/quiche/quiche/quic/core/quic_crypto_client_stream.h +8 -0
- package/third_party/quiche/quiche/quic/core/quic_crypto_server_stream.cc +26 -13
- package/third_party/quiche/quiche/quic/core/quic_crypto_server_stream.h +5 -2
- package/third_party/quiche/quiche/quic/core/quic_crypto_stream.cc +55 -47
- package/third_party/quiche/quiche/quic/core/quic_crypto_stream.h +15 -10
- package/third_party/quiche/quiche/quic/core/quic_crypto_stream_test.cc +34 -5
- package/third_party/quiche/quiche/quic/core/quic_dispatcher.cc +20 -11
- package/third_party/quiche/quiche/quic/core/quic_dispatcher_test.cc +37 -13
- package/third_party/quiche/quiche/quic/core/quic_flags_list.h +6 -10
- package/third_party/quiche/quiche/quic/core/quic_flow_controller.cc +3 -3
- package/third_party/quiche/quiche/quic/core/quic_flow_controller.h +2 -2
- package/third_party/quiche/quiche/quic/core/quic_flow_controller_test.cc +15 -10
- package/third_party/quiche/quiche/quic/core/quic_framer.cc +1 -1
- package/third_party/quiche/quiche/quic/core/quic_one_block_arena.h +3 -2
- package/third_party/quiche/quiche/quic/core/quic_one_block_arena_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_packet_creator.cc +3 -11
- package/third_party/quiche/quiche/quic/core/quic_packet_creator.h +0 -8
- package/third_party/quiche/quiche/quic/core/quic_ping_manager.cc +14 -14
- package/third_party/quiche/quiche/quic/core/quic_ping_manager_test.cc +48 -0
- package/third_party/quiche/quiche/quic/core/quic_received_packet_manager.cc +3 -18
- package/third_party/quiche/quiche/quic/core/quic_received_packet_manager_test.cc +4 -14
- package/third_party/quiche/quiche/quic/core/quic_server_id_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_session.cc +4 -4
- package/third_party/quiche/quiche/quic/core/quic_session.h +1 -1
- package/third_party/quiche/quiche/quic/core/quic_session_test.cc +21 -1
- package/third_party/quiche/quiche/quic/core/quic_stream.cc +4 -7
- package/third_party/quiche/quiche/quic/core/quic_stream_test.cc +2 -4
- package/third_party/quiche/quiche/quic/core/quic_trace_visitor_test.cc +2 -2
- package/third_party/quiche/quiche/quic/core/quic_types.h +3 -8
- package/third_party/quiche/quiche/quic/core/quic_udp_socket_posix.cc +5 -4
- package/third_party/quiche/quiche/quic/core/quic_unacked_packet_map_test.cc +1 -1
- package/third_party/quiche/quiche/quic/core/quic_utils.cc +1 -1
- package/third_party/quiche/quiche/quic/core/quic_utils.h +2 -2
- package/third_party/quiche/quiche/quic/core/quic_versions_test.cc +0 -1
- package/third_party/quiche/quiche/quic/core/tls_client_handshaker.cc +13 -0
- package/third_party/quiche/quiche/quic/core/tls_client_handshaker.h +2 -0
- package/third_party/quiche/quiche/quic/core/tls_server_handshaker.cc +17 -3
- package/third_party/quiche/quiche/quic/core/tls_server_handshaker.h +3 -1
- package/third_party/quiche/quiche/quic/core/uber_received_packet_manager_test.cc +18 -10
- package/third_party/quiche/quiche/quic/masque/masque_client_bin.cc +6 -4
- package/third_party/quiche/quiche/quic/masque/masque_client_session.cc +23 -7
- package/third_party/quiche/quiche/quic/masque/masque_client_session.h +1 -1
- package/third_party/quiche/quiche/quic/masque/masque_server_backend.cc +13 -0
- package/third_party/quiche/quiche/quic/masque/masque_server_backend.h +2 -0
- package/third_party/quiche/quiche/quic/masque/masque_server_bin.cc +5 -4
- package/third_party/quiche/quiche/quic/masque/masque_server_session.cc +30 -40
- package/third_party/quiche/quiche/quic/masque/masque_server_session.h +1 -1
- package/third_party/quiche/quiche/quic/platform/api/quic_export.h +4 -4
- package/third_party/quiche/quiche/quic/platform/api/quic_flags.h +0 -1
- package/third_party/quiche/quiche/quic/platform/api/quic_logging.h +0 -6
- package/third_party/quiche/quiche/quic/platform/api/quic_test.h +6 -5
- package/third_party/quiche/quiche/quic/qbone/bonnet/icmp_reachable_test.cc +2 -2
- package/third_party/quiche/quiche/quic/qbone/bonnet/mock_qbone_tunnel.h +2 -0
- package/third_party/quiche/quiche/quic/qbone/bonnet/qbone_tunnel_interface.h +2 -0
- package/third_party/quiche/quiche/quic/qbone/bonnet/tun_device_controller_test.cc +2 -2
- package/third_party/quiche/quiche/quic/qbone/bonnet/tun_device_packet_exchanger_test.cc +2 -2
- package/third_party/quiche/quiche/quic/qbone/bonnet/tun_device_test.cc +2 -2
- package/third_party/quiche/quiche/quic/qbone/platform/netlink_test.cc +2 -2
- package/third_party/quiche/quiche/quic/qbone/platform/tcp_packet.cc +5 -4
- package/third_party/quiche/quiche/quic/qbone/qbone_client_session.cc +4 -2
- package/third_party/quiche/quiche/quic/qbone/qbone_packet_processor.cc +2 -1
- package/third_party/quiche/quiche/quic/qbone/qbone_packet_processor_test.cc +2 -2
- package/third_party/quiche/quiche/quic/qbone/qbone_server_session.cc +4 -2
- package/third_party/quiche/quiche/quic/qbone/qbone_session_base.cc +3 -2
- package/third_party/quiche/quiche/quic/qbone/qbone_stream.cc +4 -4
- package/third_party/quiche/quiche/quic/test_tools/quic_connection_peer.cc +1 -1
- package/third_party/quiche/quiche/quic/test_tools/quic_http_response_cache_data/test.example.com/index.html +63 -0
- package/third_party/quiche/quiche/quic/test_tools/quic_http_response_cache_data/test.example.com/map.html +65 -0
- package/third_party/quiche/quiche/quic/test_tools/quic_test_utils.cc +4 -3
- package/third_party/quiche/quiche/quic/test_tools/quic_test_utils.h +18 -1
- package/third_party/quiche/quiche/quic/test_tools/simulator/quic_endpoint_test.cc +1 -1
- package/third_party/quiche/quiche/quic/test_tools/simulator/simulator_test.cc +1 -1
- package/third_party/quiche/quiche/quic/test_tools/test_ticket_crypter.cc +1 -1
- package/third_party/quiche/quiche/quic/test_tools/test_ticket_crypter.h +2 -2
- package/third_party/quiche/quiche/quic/{core/crypto → tools}/crypto_message_printer_bin.cc +0 -0
- package/third_party/quiche/quiche/quic/{core/qpack → tools}/qpack_offline_decoder_bin.cc +0 -0
- package/third_party/quiche/quiche/quic/tools/quic_client_interop_test_bin.cc +4 -3
- package/third_party/quiche/quiche/quic/tools/quic_memory_cache_backend_test.cc +3 -31
- package/third_party/quiche/quiche/quic/tools/quic_packet_printer_bin.cc +2 -2
- package/third_party/quiche/quiche/quic/tools/quic_simple_server_session.h +1 -1
- package/third_party/quiche/quiche/quic/tools/quic_simple_server_session_test.cc +1 -1
- package/third_party/quiche/quiche/quic/tools/quic_toy_client.cc +52 -38
- package/third_party/quiche/quiche/quic/tools/quic_toy_server.cc +10 -7
- package/third_party/quiche/quiche/quic/tools/simple_ticket_crypter.cc +1 -1
- package/third_party/quiche/quiche/quic/tools/simple_ticket_crypter.h +1 -1
- package/third_party/quiche/quiche/quic/tools/web_transport_test_visitors.h +3 -2
- package/third_party/quiche/quiche/spdy/core/array_output_buffer.h +1 -1
- package/third_party/quiche/quiche/spdy/core/hpack/hpack_decoder_adapter_test.cc +1 -1
- package/third_party/quiche/quiche/spdy/core/hpack/hpack_encoder_test.cc +2 -1
- package/third_party/quiche/quiche/spdy/core/hpack/hpack_header_table_test.cc +1 -1
- package/third_party/quiche/quiche/spdy/core/hpack/hpack_round_trip_test.cc +2 -1
- package/third_party/quiche/quiche/spdy/core/hpack/hpack_static_table_test.cc +1 -1
- package/third_party/quiche/quiche/spdy/core/http2_frame_decoder_adapter.cc +8 -6
- package/third_party/quiche/quiche/spdy/core/http2_frame_decoder_adapter.h +17 -6
- package/third_party/quiche/quiche/spdy/core/metadata_extension.cc +1 -1
- package/third_party/quiche/quiche/spdy/core/metadata_extension_test.cc +1 -1
- package/third_party/quiche/quiche/spdy/core/spdy_framer_test.cc +21 -17
- package/third_party/quiche/quiche/spdy/core/spdy_intrusive_list_test.cc +3 -3
- package/third_party/quiche/quiche/spdy/core/spdy_no_op_visitor.h +6 -4
- package/third_party/quiche/quiche/spdy/core/spdy_pinnable_buffer_piece_test.cc +1 -1
- package/third_party/quiche/quiche/spdy/core/spdy_prefixed_buffer_reader_test.cc +1 -1
- package/third_party/quiche/quiche/spdy/core/spdy_protocol_test.cc +1 -1
- package/third_party/quiche/quiche/spdy/test_tools/mock_spdy_framer_visitor.h +5 -4
- package/third_party/boringssl/src/util/bot/cmake-win32.zip.sha1 +0 -1
- package/third_party/quiche/quiche/common/platform/api/quiche_mock_log.h +0 -18
- package/third_party/quiche/quiche/common/platform/api/quiche_test_helpers.h +0 -8
- package/third_party/quiche/quiche/quic/platform/api/quic_mock_log.h +0 -19
- package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_dispatcher.cc +0 -51
- package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_dispatcher.h +0 -41
- package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_session.cc +0 -168
- package/third_party/quiche/quiche/quic/tools/quic_transport_simple_server_session.h +0 -78
|
@@ -1047,7 +1047,7 @@ TXHOSQQD8Dl4BK0wOet+TP6LBEjHlRFjAqK4bu9xpxV2
|
|
|
1047
1047
|
-----END CERTIFICATE-----
|
|
1048
1048
|
)";
|
|
1049
1049
|
|
|
1050
|
-
// CertFromPEM parses the given, NUL-terminated
|
|
1050
|
+
// CertFromPEM parses the given, NUL-terminated PEM block and returns an
|
|
1051
1051
|
// |X509*|.
|
|
1052
1052
|
static bssl::UniquePtr<X509> CertFromPEM(const char *pem) {
|
|
1053
1053
|
bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(pem, strlen(pem)));
|
|
@@ -1055,7 +1055,7 @@ static bssl::UniquePtr<X509> CertFromPEM(const char *pem) {
|
|
|
1055
1055
|
PEM_read_bio_X509(bio.get(), nullptr, nullptr, nullptr));
|
|
1056
1056
|
}
|
|
1057
1057
|
|
|
1058
|
-
// CRLFromPEM parses the given, NUL-terminated
|
|
1058
|
+
// CRLFromPEM parses the given, NUL-terminated PEM block and returns an
|
|
1059
1059
|
// |X509_CRL*|.
|
|
1060
1060
|
static bssl::UniquePtr<X509_CRL> CRLFromPEM(const char *pem) {
|
|
1061
1061
|
bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(pem, strlen(pem)));
|
|
@@ -1063,7 +1063,15 @@ static bssl::UniquePtr<X509_CRL> CRLFromPEM(const char *pem) {
|
|
|
1063
1063
|
PEM_read_bio_X509_CRL(bio.get(), nullptr, nullptr, nullptr));
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
|
-
//
|
|
1066
|
+
// CSRFromPEM parses the given, NUL-terminated PEM block and returns an
|
|
1067
|
+
// |X509_REQ*|.
|
|
1068
|
+
static bssl::UniquePtr<X509_REQ> CSRFromPEM(const char *pem) {
|
|
1069
|
+
bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(pem, strlen(pem)));
|
|
1070
|
+
return bssl::UniquePtr<X509_REQ>(
|
|
1071
|
+
PEM_read_bio_X509_REQ(bio.get(), nullptr, nullptr, nullptr));
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
// PrivateKeyFromPEM parses the given, NUL-terminated PEM block and returns an
|
|
1067
1075
|
// |EVP_PKEY*|.
|
|
1068
1076
|
static bssl::UniquePtr<EVP_PKEY> PrivateKeyFromPEM(const char *pem) {
|
|
1069
1077
|
bssl::UniquePtr<BIO> bio(
|
|
@@ -2871,12 +2879,70 @@ MlJhXnXJFA==
|
|
|
2871
2879
|
-----END CERTIFICATE-----
|
|
2872
2880
|
)";
|
|
2873
2881
|
|
|
2874
|
-
//
|
|
2882
|
+
// kV1CRLWithExtensionsPEM is a v1 CRL with extensions.
|
|
2883
|
+
static const char kV1CRLWithExtensionsPEM[] = R"(
|
|
2884
|
+
-----BEGIN X509 CRL-----
|
|
2885
|
+
MIIBpDCBjTANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJVUzETMBEGA1UECAwK
|
|
2886
|
+
Q2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzESMBAGA1UECgwJQm9y
|
|
2887
|
+
aW5nU1NMFw0xNjA5MjYxNTEwNTVaFw0xNjEwMjYxNTEwNTVaoA4wDDAKBgNVHRQE
|
|
2888
|
+
AwIBATANBgkqhkiG9w0BAQsFAAOCAQEAnrBKKgvd9x9zwK9rtUvVeFeJ7+LNZEAc
|
|
2889
|
+
+a5oxpPNEsJx6hXoApYEbzXMxuWBQoCs5iEBycSGudct21L+MVf27M38KrWoeOkq
|
|
2890
|
+
0a2siqViQZO2Fb/SUFR0k9zb8xl86Zf65lgPplALun0bV/HT7MJcl04Tc4osdsAR
|
|
2891
|
+
eBs5nqTGNEd5AlC1iKHvQZkM//MD51DspKnDpsDiUVi54h9C1SpfZmX8H2Vvdiyu
|
|
2892
|
+
0fZ/bPAM3VAGawatf/SyWfBMyKpoPXEG39oAzmjjOj8en82psn7m474IGaho/vBb
|
|
2893
|
+
hl1ms5qQiLYPjm4YELtnXQoFyC72tBjbdFd/ZE9k4CNKDbxFUXFbkw==
|
|
2894
|
+
-----END X509 CRL-----
|
|
2895
|
+
)";
|
|
2896
|
+
|
|
2897
|
+
// kExplicitDefaultVersionCRLPEM is a v1 CRL with an explicitly-encoded version
|
|
2898
|
+
// field.
|
|
2899
|
+
static const char kExplicitDefaultVersionCRLPEM[] = R"(
|
|
2900
|
+
-----BEGIN X509 CRL-----
|
|
2901
|
+
MIIBlzCBgAIBADANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJVUzETMBEGA1UE
|
|
2902
|
+
CAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzESMBAGA1UECgwJ
|
|
2903
|
+
Qm9yaW5nU1NMFw0xNjA5MjYxNTEwNTVaFw0xNjEwMjYxNTEwNTVaMA0GCSqGSIb3
|
|
2904
|
+
DQEBCwUAA4IBAQCesEoqC933H3PAr2u1S9V4V4nv4s1kQBz5rmjGk80SwnHqFegC
|
|
2905
|
+
lgRvNczG5YFCgKzmIQHJxIa51y3bUv4xV/bszfwqtah46SrRrayKpWJBk7YVv9JQ
|
|
2906
|
+
VHST3NvzGXzpl/rmWA+mUAu6fRtX8dPswlyXThNziix2wBF4GzmepMY0R3kCULWI
|
|
2907
|
+
oe9BmQz/8wPnUOykqcOmwOJRWLniH0LVKl9mZfwfZW92LK7R9n9s8AzdUAZrBq1/
|
|
2908
|
+
9LJZ8EzIqmg9cQbf2gDOaOM6Px6fzamyfubjvggZqGj+8FuGXWazmpCItg+ObhgQ
|
|
2909
|
+
u2ddCgXILva0GNt0V39kT2TgI0oNvEVRcVuT
|
|
2910
|
+
-----END X509 CRL-----
|
|
2911
|
+
)";
|
|
2912
|
+
|
|
2913
|
+
// kV3CRLPEM is a v3 CRL. CRL versions only go up to v2.
|
|
2914
|
+
static const char kV3CRLPEM[] = R"(
|
|
2915
|
+
-----BEGIN X509 CRL-----
|
|
2916
|
+
MIIBpzCBkAIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJVUzETMBEGA1UE
|
|
2917
|
+
CAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzESMBAGA1UECgwJ
|
|
2918
|
+
Qm9yaW5nU1NMFw0xNjA5MjYxNTEwNTVaFw0xNjEwMjYxNTEwNTVaoA4wDDAKBgNV
|
|
2919
|
+
HRQEAwIBATANBgkqhkiG9w0BAQsFAAOCAQEAnrBKKgvd9x9zwK9rtUvVeFeJ7+LN
|
|
2920
|
+
ZEAc+a5oxpPNEsJx6hXoApYEbzXMxuWBQoCs5iEBycSGudct21L+MVf27M38KrWo
|
|
2921
|
+
eOkq0a2siqViQZO2Fb/SUFR0k9zb8xl86Zf65lgPplALun0bV/HT7MJcl04Tc4os
|
|
2922
|
+
dsAReBs5nqTGNEd5AlC1iKHvQZkM//MD51DspKnDpsDiUVi54h9C1SpfZmX8H2Vv
|
|
2923
|
+
diyu0fZ/bPAM3VAGawatf/SyWfBMyKpoPXEG39oAzmjjOj8en82psn7m474IGaho
|
|
2924
|
+
/vBbhl1ms5qQiLYPjm4YELtnXQoFyC72tBjbdFd/ZE9k4CNKDbxFUXFbkw==
|
|
2925
|
+
-----END X509 CRL-----
|
|
2926
|
+
)";
|
|
2927
|
+
|
|
2928
|
+
// kV2CSRPEM is a v2 CSR. CSR versions only go up to v1.
|
|
2929
|
+
static const char kV2CSRPEM[] = R"(
|
|
2930
|
+
-----BEGIN CERTIFICATE REQUEST-----
|
|
2931
|
+
MIHJMHECAQEwDzENMAsGA1UEAwwEVGVzdDBZMBMGByqGSM49AgEGCCqGSM49AwEH
|
|
2932
|
+
A0IABJjsayyAQod1J7UJYNT8AH4WWxLdKV0ozhrIz6hCzBAze7AqXWOSH8G+1EWC
|
|
2933
|
+
pSfL3oMQNtBdJS0kpXXaUqEAgTSgADAKBggqhkjOPQQDAgNIADBFAiAUXVaEYATg
|
|
2934
|
+
4Cc917T73KBImxh6xyhsA5pKuYpq1S4m9wIhAK+G93HR4ur7Ghel6+zUTvIAsj9e
|
|
2935
|
+
rsn4lSYsqI4OI4ei
|
|
2936
|
+
-----END CERTIFICATE REQUEST-----
|
|
2937
|
+
)";
|
|
2938
|
+
|
|
2939
|
+
// Test that the library enforces versions are valid and match the fields
|
|
2875
2940
|
// present.
|
|
2876
2941
|
TEST(X509Test, InvalidVersion) {
|
|
2877
2942
|
// kExplicitDefaultVersionPEM is invalid but, for now, we accept it. See
|
|
2878
2943
|
// https://crbug.com/boringssl/364.
|
|
2879
2944
|
EXPECT_TRUE(CertFromPEM(kExplicitDefaultVersionPEM));
|
|
2945
|
+
EXPECT_TRUE(CRLFromPEM(kExplicitDefaultVersionCRLPEM));
|
|
2880
2946
|
|
|
2881
2947
|
EXPECT_FALSE(CertFromPEM(kNegativeVersionPEM));
|
|
2882
2948
|
EXPECT_FALSE(CertFromPEM(kFutureVersionPEM));
|
|
@@ -2885,6 +2951,27 @@ TEST(X509Test, InvalidVersion) {
|
|
|
2885
2951
|
EXPECT_FALSE(CertFromPEM(kV2WithExtensionsPEM));
|
|
2886
2952
|
EXPECT_FALSE(CertFromPEM(kV1WithIssuerUniqueIDPEM));
|
|
2887
2953
|
EXPECT_FALSE(CertFromPEM(kV1WithSubjectUniqueIDPEM));
|
|
2954
|
+
EXPECT_FALSE(CRLFromPEM(kV1CRLWithExtensionsPEM));
|
|
2955
|
+
EXPECT_FALSE(CRLFromPEM(kV3CRLPEM));
|
|
2956
|
+
EXPECT_FALSE(CSRFromPEM(kV2CSRPEM));
|
|
2957
|
+
|
|
2958
|
+
bssl::UniquePtr<X509> x509(X509_new());
|
|
2959
|
+
ASSERT_TRUE(x509);
|
|
2960
|
+
EXPECT_FALSE(X509_set_version(x509.get(), -1));
|
|
2961
|
+
EXPECT_FALSE(X509_set_version(x509.get(), X509_VERSION_3 + 1));
|
|
2962
|
+
EXPECT_FALSE(X509_set_version(x509.get(), 9999));
|
|
2963
|
+
|
|
2964
|
+
bssl::UniquePtr<X509_CRL> crl(X509_CRL_new());
|
|
2965
|
+
ASSERT_TRUE(crl);
|
|
2966
|
+
EXPECT_FALSE(X509_CRL_set_version(crl.get(), -1));
|
|
2967
|
+
EXPECT_FALSE(X509_CRL_set_version(crl.get(), X509_CRL_VERSION_2 + 1));
|
|
2968
|
+
EXPECT_FALSE(X509_CRL_set_version(crl.get(), 9999));
|
|
2969
|
+
|
|
2970
|
+
bssl::UniquePtr<X509_REQ> req(X509_REQ_new());
|
|
2971
|
+
ASSERT_TRUE(req);
|
|
2972
|
+
EXPECT_FALSE(X509_REQ_set_version(req.get(), -1));
|
|
2973
|
+
EXPECT_FALSE(X509_REQ_set_version(req.get(), X509_REQ_VERSION_1 + 1));
|
|
2974
|
+
EXPECT_FALSE(X509_REQ_set_version(req.get(), 9999));
|
|
2888
2975
|
}
|
|
2889
2976
|
|
|
2890
2977
|
// Unlike upstream OpenSSL, we require a non-null store in
|
|
@@ -3911,3 +3998,378 @@ TEST(X509Test, BytesToHex) {
|
|
|
3911
3998
|
EXPECT_STREQ(hex.get(), t.hex);
|
|
3912
3999
|
}
|
|
3913
4000
|
}
|
|
4001
|
+
|
|
4002
|
+
TEST(X509Test, NamePrint) {
|
|
4003
|
+
// kTestName is a DER-encoded X.509 that covers many cases.
|
|
4004
|
+
//
|
|
4005
|
+
// SEQUENCE {
|
|
4006
|
+
// SET {
|
|
4007
|
+
// SEQUENCE {
|
|
4008
|
+
// # countryName
|
|
4009
|
+
// OBJECT_IDENTIFIER { 2.5.4.6 }
|
|
4010
|
+
// PrintableString { "US" }
|
|
4011
|
+
// }
|
|
4012
|
+
// }
|
|
4013
|
+
// # Sets may be multi-valued, with different attributes. Try to keep this
|
|
4014
|
+
// # in DER set order, in case we ever enforce this in the parser.
|
|
4015
|
+
// SET {
|
|
4016
|
+
// SEQUENCE {
|
|
4017
|
+
// # stateOrProvinceName
|
|
4018
|
+
// OBJECT_IDENTIFIER { 2.5.4.8 }
|
|
4019
|
+
// PrintableString { "Some State" }
|
|
4020
|
+
// }
|
|
4021
|
+
// SEQUENCE {
|
|
4022
|
+
// # stateOrProvinceName
|
|
4023
|
+
// OBJECT_IDENTIFIER { 2.5.4.8 }
|
|
4024
|
+
// UTF8String { "Some Other State \xe2\x98\x83" }
|
|
4025
|
+
// }
|
|
4026
|
+
// SEQUENCE {
|
|
4027
|
+
// # stateOrProvinceName
|
|
4028
|
+
// OBJECT_IDENTIFIER { 2.5.4.8 }
|
|
4029
|
+
// BMPString { u"Another State \u2603" }
|
|
4030
|
+
// }
|
|
4031
|
+
// SEQUENCE {
|
|
4032
|
+
// # A custom OID
|
|
4033
|
+
// OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2 }
|
|
4034
|
+
// UniversalString { U"\u2603" }
|
|
4035
|
+
// }
|
|
4036
|
+
// }
|
|
4037
|
+
// # Custom OIDs may have non-string values.
|
|
4038
|
+
// SET {
|
|
4039
|
+
// SEQUENCE {
|
|
4040
|
+
// OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.3 }
|
|
4041
|
+
// SEQUENCE { INTEGER { 1 } INTEGER { 2 } }
|
|
4042
|
+
// }
|
|
4043
|
+
// }
|
|
4044
|
+
// SET {
|
|
4045
|
+
// SEQUENCE {
|
|
4046
|
+
// # organizationName
|
|
4047
|
+
// OBJECT_IDENTIFIER { 2.5.4.10 }
|
|
4048
|
+
// PrintableString { "Org Name" }
|
|
4049
|
+
// }
|
|
4050
|
+
// }
|
|
4051
|
+
// SET {
|
|
4052
|
+
// SEQUENCE {
|
|
4053
|
+
// # commonName
|
|
4054
|
+
// OBJECT_IDENTIFIER { 2.5.4.3 }
|
|
4055
|
+
// # Embed common delimiter forms to test how well they get escaped.
|
|
4056
|
+
// UTF8String { "Common
|
|
4057
|
+
// Name/CN=A/CN=B,CN=A,CN=B+CN=A+CN=B;CN=A;CN=B\nCN=A\n" }
|
|
4058
|
+
// }
|
|
4059
|
+
// }
|
|
4060
|
+
// SET {
|
|
4061
|
+
// SEQUENCE {
|
|
4062
|
+
// # commonName
|
|
4063
|
+
// OBJECT_IDENTIFIER { 2.5.4.3 }
|
|
4064
|
+
// # Test escaping of leading and trailing spaces.
|
|
4065
|
+
// UTF8String { " spaces " }
|
|
4066
|
+
// }
|
|
4067
|
+
// }
|
|
4068
|
+
static const uint8_t kTestName[] = {
|
|
4069
|
+
0x30, 0x82, 0x01, 0x00, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
|
|
4070
|
+
0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x6d, 0x30, 0x11, 0x06, 0x03, 0x55,
|
|
4071
|
+
0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x20, 0x53, 0x74, 0x61,
|
|
4072
|
+
0x74, 0x65, 0x30, 0x1b, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x14, 0x53,
|
|
4073
|
+
0x6f, 0x6d, 0x65, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x53, 0x74,
|
|
4074
|
+
0x61, 0x74, 0x65, 0x20, 0xe2, 0x98, 0x83, 0x30, 0x25, 0x06, 0x03, 0x55,
|
|
4075
|
+
0x04, 0x08, 0x1e, 0x1e, 0x00, 0x41, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0x74,
|
|
4076
|
+
0x00, 0x68, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x53, 0x00, 0x74,
|
|
4077
|
+
0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x26, 0x03, 0x30, 0x14,
|
|
4078
|
+
0x06, 0x0c, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, 0x01, 0x84, 0xb7,
|
|
4079
|
+
0x09, 0x02, 0x1c, 0x04, 0x00, 0x00, 0x26, 0x03, 0x31, 0x18, 0x30, 0x16,
|
|
4080
|
+
0x06, 0x0c, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, 0x01, 0x84, 0xb7,
|
|
4081
|
+
0x09, 0x03, 0x30, 0x06, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x31, 0x11,
|
|
4082
|
+
0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x4f, 0x72, 0x67,
|
|
4083
|
+
0x20, 0x4e, 0x61, 0x6d, 0x65, 0x31, 0x42, 0x30, 0x40, 0x06, 0x03, 0x55,
|
|
4084
|
+
0x04, 0x03, 0x0c, 0x39, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x20, 0x4e,
|
|
4085
|
+
0x61, 0x6d, 0x65, 0x2f, 0x43, 0x4e, 0x3d, 0x41, 0x2f, 0x43, 0x4e, 0x3d,
|
|
4086
|
+
0x42, 0x2c, 0x43, 0x4e, 0x3d, 0x41, 0x2c, 0x43, 0x4e, 0x3d, 0x42, 0x2b,
|
|
4087
|
+
0x43, 0x4e, 0x3d, 0x41, 0x2b, 0x43, 0x4e, 0x3d, 0x42, 0x3b, 0x43, 0x4e,
|
|
4088
|
+
0x3d, 0x41, 0x3b, 0x43, 0x4e, 0x3d, 0x42, 0x0a, 0x43, 0x4e, 0x3d, 0x41,
|
|
4089
|
+
0x0a, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x08,
|
|
4090
|
+
0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x20};
|
|
4091
|
+
|
|
4092
|
+
const uint8_t *ptr = kTestName;
|
|
4093
|
+
bssl::UniquePtr<X509_NAME> name(
|
|
4094
|
+
d2i_X509_NAME(nullptr, &ptr, sizeof(kTestName)));
|
|
4095
|
+
ASSERT_TRUE(name);
|
|
4096
|
+
EXPECT_EQ(ptr, kTestName + sizeof(kTestName));
|
|
4097
|
+
|
|
4098
|
+
struct {
|
|
4099
|
+
int indent;
|
|
4100
|
+
unsigned long flags;
|
|
4101
|
+
std::string printed;
|
|
4102
|
+
} kTests[] = {
|
|
4103
|
+
// RFC 2253 uses , and + separators and encodes the RDNs in reverse.
|
|
4104
|
+
// OpenSSL's implementation additionally happens to reverse the values
|
|
4105
|
+
// within each RDN. RFC 2253 says any order is permissible.
|
|
4106
|
+
{/*indent=*/0,
|
|
4107
|
+
/*flags=*/XN_FLAG_RFC2253,
|
|
4108
|
+
"CN=\\ spaces\\ ,"
|
|
4109
|
+
"CN=Common "
|
|
4110
|
+
"Name/CN=A/CN=B\\,CN=A\\,CN=B\\+CN=A\\+CN=B\\;CN=A\\;CN=B\\0ACN=A\\0A,"
|
|
4111
|
+
"O=Org Name,"
|
|
4112
|
+
"1.2.840.113554.4.1.72585.3=#3006020101020102,"
|
|
4113
|
+
"1.2.840.113554.4.1.72585.2=#1C0400002603+"
|
|
4114
|
+
"ST=Another State \\E2\\98\\83+"
|
|
4115
|
+
"ST=Some Other State \\E2\\98\\83+"
|
|
4116
|
+
"ST=Some State,"
|
|
4117
|
+
"C=US"},
|
|
4118
|
+
{/*indent=*/2,
|
|
4119
|
+
/*flags=*/XN_FLAG_RFC2253,
|
|
4120
|
+
" "
|
|
4121
|
+
"CN=\\ spaces\\ ,"
|
|
4122
|
+
"CN=Common "
|
|
4123
|
+
"Name/CN=A/CN=B\\,CN=A\\,CN=B\\+CN=A\\+CN=B\\;CN=A\\;CN=B\\0ACN=A\\0A,"
|
|
4124
|
+
"O=Org Name,"
|
|
4125
|
+
"1.2.840.113554.4.1.72585.3=#3006020101020102,"
|
|
4126
|
+
"1.2.840.113554.4.1.72585.2=#1C0400002603+"
|
|
4127
|
+
"ST=Another State \\E2\\98\\83+"
|
|
4128
|
+
"ST=Some Other State \\E2\\98\\83+"
|
|
4129
|
+
"ST=Some State,"
|
|
4130
|
+
"C=US"},
|
|
4131
|
+
// |XN_FLAG_ONELINE| is an OpenSSL-specific single-line format. It also
|
|
4132
|
+
// omits |XN_FLAG_DUMP_UNKNOWN_FIELDS|, so unknown OIDs that use known
|
|
4133
|
+
// string types will still be decoded. (This may drop important
|
|
4134
|
+
// information if the unknown OID distinguishes between string types.) It
|
|
4135
|
+
// also passes |ASN1_STRFLGS_ESC_QUOTE|.
|
|
4136
|
+
{/*indent=*/0,
|
|
4137
|
+
/*flags=*/XN_FLAG_ONELINE,
|
|
4138
|
+
"C = US, "
|
|
4139
|
+
"ST = Some State + "
|
|
4140
|
+
"ST = Some Other State \\E2\\98\\83 + "
|
|
4141
|
+
"ST = Another State \\E2\\98\\83 + "
|
|
4142
|
+
"1.2.840.113554.4.1.72585.2 = \\E2\\98\\83, "
|
|
4143
|
+
"1.2.840.113554.4.1.72585.3 = #3006020101020102, "
|
|
4144
|
+
"O = Org Name, "
|
|
4145
|
+
"CN = \"Common "
|
|
4146
|
+
"Name/CN=A/CN=B,CN=A,CN=B+CN=A+CN=B;CN=A;CN=B\\0ACN=A\\0A\", "
|
|
4147
|
+
"CN = \" spaces \""},
|
|
4148
|
+
// |XN_FLAG_MULTILINE| is an OpenSSL-specific multi-line format that tries
|
|
4149
|
+
// to vertically align the equal sizes. The vertical alignment doesn't
|
|
4150
|
+
// quite handle multi-valued RDNs right and uses a non-RFC-2253 escaping.
|
|
4151
|
+
{/*indent=*/0,
|
|
4152
|
+
/*flags=*/XN_FLAG_MULTILINE,
|
|
4153
|
+
"countryName = US\n"
|
|
4154
|
+
"stateOrProvinceName = Some State + "
|
|
4155
|
+
"stateOrProvinceName = Some Other State \\U2603 + "
|
|
4156
|
+
"stateOrProvinceName = Another State \\U2603 + "
|
|
4157
|
+
"1.2.840.113554.4.1.72585.2 = \\U2603\n"
|
|
4158
|
+
"1.2.840.113554.4.1.72585.3 = 0\\06\\02\\01\\01\\02\\01\\02\n"
|
|
4159
|
+
"organizationName = Org Name\n"
|
|
4160
|
+
"commonName = Common "
|
|
4161
|
+
"Name/CN=A/CN=B,CN=A,CN=B+CN=A+CN=B;CN=A;CN=B\\0ACN=A\\0A\n"
|
|
4162
|
+
"commonName = spaces "},
|
|
4163
|
+
// The multiline format indents every line.
|
|
4164
|
+
{/*indent=*/2,
|
|
4165
|
+
/*flags=*/XN_FLAG_MULTILINE,
|
|
4166
|
+
" countryName = US\n"
|
|
4167
|
+
" stateOrProvinceName = Some State + "
|
|
4168
|
+
"stateOrProvinceName = Some Other State \\U2603 + "
|
|
4169
|
+
"stateOrProvinceName = Another State \\U2603 + "
|
|
4170
|
+
"1.2.840.113554.4.1.72585.2 = \\U2603\n"
|
|
4171
|
+
" 1.2.840.113554.4.1.72585.3 = 0\\06\\02\\01\\01\\02\\01\\02\n"
|
|
4172
|
+
" organizationName = Org Name\n"
|
|
4173
|
+
" commonName = Common "
|
|
4174
|
+
"Name/CN=A/CN=B,CN=A,CN=B+CN=A+CN=B;CN=A;CN=B\\0ACN=A\\0A\n"
|
|
4175
|
+
" commonName = spaces "},
|
|
4176
|
+
// Callers can also customize the output, wuith both |XN_FLAG_*| and
|
|
4177
|
+
// |ASN1_STRFLGS_*|. |XN_FLAG_SEP_SPLUS_SPC| uses semicolon separators and
|
|
4178
|
+
// |XN_FLAG_FN_OID| forces OIDs.
|
|
4179
|
+
{/*indent=*/0,
|
|
4180
|
+
/*flags=*/XN_FLAG_SEP_SPLUS_SPC | XN_FLAG_FN_OID | ASN1_STRFLGS_RFC2253 |
|
|
4181
|
+
ASN1_STRFLGS_ESC_QUOTE,
|
|
4182
|
+
"2.5.4.6=US; "
|
|
4183
|
+
"2.5.4.8=Some State + "
|
|
4184
|
+
"2.5.4.8=Some Other State \\E2\\98\\83 + "
|
|
4185
|
+
"2.5.4.8=Another State \\E2\\98\\83 + "
|
|
4186
|
+
"1.2.840.113554.4.1.72585.2=\\E2\\98\\83; "
|
|
4187
|
+
"1.2.840.113554.4.1.72585.3=#3006020101020102; "
|
|
4188
|
+
"2.5.4.10=Org Name; "
|
|
4189
|
+
"2.5.4.3=\"Common "
|
|
4190
|
+
"Name/CN=A/CN=B,CN=A,CN=B+CN=A+CN=B;CN=A;CN=B\\0ACN=A\\0A\"; "
|
|
4191
|
+
"2.5.4.3=\" spaces \""},
|
|
4192
|
+
// |XN_FLAG_COMPAT| matches |X509_NAME_print|, rather than
|
|
4193
|
+
// |X509_NAME_print_ex|.
|
|
4194
|
+
//
|
|
4195
|
+
// TODO(davidben): This works by post-processing the output of
|
|
4196
|
+
// |X509_NAME_oneline|, which uses "/"" separators, and replacing with
|
|
4197
|
+
// ", ". The escaping is ambiguous and the post-processing is buggy, so
|
|
4198
|
+
// some of the trailing slashes are still present and some internal
|
|
4199
|
+
// slashes are mis-converted.
|
|
4200
|
+
{/*indent=*/0,
|
|
4201
|
+
/*flags=*/XN_FLAG_COMPAT,
|
|
4202
|
+
"C=US, "
|
|
4203
|
+
"ST=Some State, "
|
|
4204
|
+
"ST=Some Other State \\xE2\\x98\\x83, "
|
|
4205
|
+
"ST=\\x00A\\x00n\\x00o\\x00t\\x00h\\x00e\\x00r\\x00 "
|
|
4206
|
+
"\\x00S\\x00t\\x00a\\x00t\\x00e\\x00 &\\x03/"
|
|
4207
|
+
"1.2.840.113554.4.1.72585.2=\\x00\\x00&\\x03/"
|
|
4208
|
+
"1.2.840.113554.4.1.72585.3=0\\x06\\x02\\x01\\x01\\x02\\x01\\x02, "
|
|
4209
|
+
"O=Org Name, "
|
|
4210
|
+
"CN=Common Name, "
|
|
4211
|
+
"CN=A, CN=B,CN=A,CN=B+CN=A+CN=B;CN=A;CN=B\\x0ACN=A\\x0A, "
|
|
4212
|
+
"CN= spaces "},
|
|
4213
|
+
};
|
|
4214
|
+
for (const auto &t : kTests) {
|
|
4215
|
+
SCOPED_TRACE(t.printed);
|
|
4216
|
+
bssl::UniquePtr<BIO> bio(BIO_new(BIO_s_mem()));
|
|
4217
|
+
ASSERT_TRUE(bio);
|
|
4218
|
+
int len = X509_NAME_print_ex(bio.get(), name.get(), t.indent, t.flags);
|
|
4219
|
+
ASSERT_GT(len, 0);
|
|
4220
|
+
|
|
4221
|
+
const uint8_t *printed;
|
|
4222
|
+
size_t printed_len;
|
|
4223
|
+
ASSERT_TRUE(BIO_mem_contents(bio.get(), &printed, &printed_len));
|
|
4224
|
+
EXPECT_EQ(std::string(printed, printed + printed_len), t.printed);
|
|
4225
|
+
if (t.flags != XN_FLAG_COMPAT) {
|
|
4226
|
+
// TODO(davidben): |XN_FLAG_COMPAT| does not return the length.
|
|
4227
|
+
EXPECT_EQ(static_cast<size_t>(len), printed_len);
|
|
4228
|
+
|
|
4229
|
+
// Passing a null |BIO| measures the output instead.
|
|
4230
|
+
len = X509_NAME_print_ex(nullptr, name.get(), t.indent, t.flags);
|
|
4231
|
+
EXPECT_GT(len, 0);
|
|
4232
|
+
EXPECT_EQ(static_cast<size_t>(len), printed_len);
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
// TODO(davidben): This escapes the underlying bytes in the string, but that
|
|
4237
|
+
// is ambiguous without capturing the type. Should this escape like
|
|
4238
|
+
// |ASN1_STRFLGS_UTF8_CONVERT| instead?
|
|
4239
|
+
static const char *kOnelineComponents[] = {
|
|
4240
|
+
"/C=US",
|
|
4241
|
+
"/ST=Some State",
|
|
4242
|
+
"/ST=Some Other State \\xE2\\x98\\x83",
|
|
4243
|
+
"/ST=\\x00A\\x00n\\x00o\\x00t\\x00h\\x00e\\x00r\\x00 "
|
|
4244
|
+
"\\x00S\\x00t\\x00a\\x00t\\x00e\\x00 &\\x03",
|
|
4245
|
+
"/1.2.840.113554.4.1.72585.2=\\x00\\x00&\\x03",
|
|
4246
|
+
"/1.2.840.113554.4.1.72585.3=0\\x06\\x02\\x01\\x01\\x02\\x01\\x02",
|
|
4247
|
+
"/O=Org Name",
|
|
4248
|
+
"/CN=Common Name/CN=A/CN=B,CN=A,CN=B+CN=A+CN=B;CN=A;CN=B\\x0ACN=A\\x0A",
|
|
4249
|
+
"/CN= spaces ",
|
|
4250
|
+
};
|
|
4251
|
+
std::string oneline_expected;
|
|
4252
|
+
for (const auto& component : kOnelineComponents) {
|
|
4253
|
+
oneline_expected += component;
|
|
4254
|
+
}
|
|
4255
|
+
|
|
4256
|
+
// Given null buffer, |X509_NAME_oneline| allocates a new output.
|
|
4257
|
+
bssl::UniquePtr<char> oneline(X509_NAME_oneline(name.get(), nullptr, 0));
|
|
4258
|
+
ASSERT_TRUE(oneline);
|
|
4259
|
+
EXPECT_EQ(oneline.get(), oneline_expected);
|
|
4260
|
+
|
|
4261
|
+
// Otherwise it writes to the specified buffer. Note one extra byte is needed
|
|
4262
|
+
// for the trailing NUL.
|
|
4263
|
+
char buf[1024];
|
|
4264
|
+
ASSERT_GE(sizeof(buf), oneline_expected.size() + 2);
|
|
4265
|
+
ASSERT_EQ(buf,
|
|
4266
|
+
X509_NAME_oneline(name.get(), buf, oneline_expected.size() + 1));
|
|
4267
|
+
EXPECT_EQ(buf, oneline_expected);
|
|
4268
|
+
|
|
4269
|
+
memset(buf, 'a', sizeof(buf));
|
|
4270
|
+
ASSERT_EQ(buf,
|
|
4271
|
+
X509_NAME_oneline(name.get(), buf, oneline_expected.size() + 2));
|
|
4272
|
+
EXPECT_EQ(buf, oneline_expected);
|
|
4273
|
+
|
|
4274
|
+
// If the length is too small, |X509_NAME_oneline| truncates at name
|
|
4275
|
+
// entry boundaries.
|
|
4276
|
+
EXPECT_EQ(nullptr, X509_NAME_oneline(name.get(), buf, 0));
|
|
4277
|
+
for (size_t len = 1; len < oneline_expected.size(); len++) {
|
|
4278
|
+
SCOPED_TRACE(len);
|
|
4279
|
+
memset(buf, 'a', sizeof(buf));
|
|
4280
|
+
EXPECT_EQ(buf, X509_NAME_oneline(name.get(), buf, len));
|
|
4281
|
+
|
|
4282
|
+
std::string truncated;
|
|
4283
|
+
for (const auto& component : kOnelineComponents) {
|
|
4284
|
+
if (truncated.size() + strlen(component) + 1 > len) {
|
|
4285
|
+
break;
|
|
4286
|
+
}
|
|
4287
|
+
truncated += component;
|
|
4288
|
+
}
|
|
4289
|
+
EXPECT_EQ(buf, truncated);
|
|
4290
|
+
}
|
|
4291
|
+
}
|
|
4292
|
+
|
|
4293
|
+
// kLargeSerialPEM is a certificate with a large serial number.
|
|
4294
|
+
static const char kLargeSerialPEM[] = R"(
|
|
4295
|
+
-----BEGIN CERTIFICATE-----
|
|
4296
|
+
MIICZjCCAc+gAwIBAgIQASNFZ4mrze8BI0VniavN7zANBgkqhkiG9w0BAQsFADA2
|
|
4297
|
+
MRowGAYDVQQKExFCb3JpbmdTU0wgVEVTVElORzEYMBYGA1UEAxMPSW50ZXJtZWRp
|
|
4298
|
+
YXRlIENBMCAXDTE1MDEwMTAwMDAwMFoYDzIxMDAwMTAxMDAwMDAwWjAyMRowGAYD
|
|
4299
|
+
VQQKExFCb3JpbmdTU0wgVEVTVElORzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wgZ8w
|
|
4300
|
+
DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMPRTRliCpKEnug6OzI0rJVcQep5p+aT
|
|
4301
|
+
9sCg+pj+HVyg/DYTwqZ6qJRKhM+MbkhdJuU7FyqlsBeCeM/OjwMjcY0yEB/xJg1i
|
|
4302
|
+
ygfuBztTLuPnHxtSuKwae5MeqSofp3j97sRMnuLcKlHxu8rXoOCAS9BO50uKnPwU
|
|
4303
|
+
Ee1iEVqR92FPAgMBAAGjdzB1MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggr
|
|
4304
|
+
BgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAZBgNVHQ4EEgQQo3mm9u6v
|
|
4305
|
+
uaVeN4wRgDTidTAbBgNVHSMEFDASgBCMGmiotXbbXVd7H40UsgajMA0GCSqGSIb3
|
|
4306
|
+
DQEBCwUAA4GBAGP+n4kKGn/8uddYLWTXbUsz+KLuEXNDMyu3vRufLjTpIbP2MCNo
|
|
4307
|
+
85fhLeC3fzKuGOk+6QGVLOBBcWDrrLqrmqnWdBMPULDo2QoF71a4GVjeJh+ax/tZ
|
|
4308
|
+
PyeGVPUK21TE0LDIxf2a11d1CJw582MgZQIPk4tXk+AcU9EqIceKgECG
|
|
4309
|
+
-----END CERTIFICATE-----
|
|
4310
|
+
)";
|
|
4311
|
+
|
|
4312
|
+
TEST(X509Test, Print) {
|
|
4313
|
+
bssl::UniquePtr<X509> cert(CertFromPEM(kLargeSerialPEM));
|
|
4314
|
+
ASSERT_TRUE(cert);
|
|
4315
|
+
|
|
4316
|
+
bssl::UniquePtr<BIO> bio(BIO_new(BIO_s_mem()));
|
|
4317
|
+
ASSERT_TRUE(bio);
|
|
4318
|
+
EXPECT_TRUE(X509_print_ex(bio.get(), cert.get(), 0, 0));
|
|
4319
|
+
// Nothing should be left in the error queue.
|
|
4320
|
+
EXPECT_EQ(0u, ERR_peek_error());
|
|
4321
|
+
|
|
4322
|
+
// This output is not guaranteed to be stable, but we assert on it to make
|
|
4323
|
+
// sure something is printed.
|
|
4324
|
+
const uint8_t *data;
|
|
4325
|
+
size_t data_len;
|
|
4326
|
+
ASSERT_TRUE(BIO_mem_contents(bio.get(), &data, &data_len));
|
|
4327
|
+
std::string print(reinterpret_cast<const char*>(data), data_len);
|
|
4328
|
+
EXPECT_EQ(print, R"(Certificate:
|
|
4329
|
+
Data:
|
|
4330
|
+
Version: 3 (0x2)
|
|
4331
|
+
Serial Number:
|
|
4332
|
+
01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef
|
|
4333
|
+
Signature Algorithm: sha256WithRSAEncryption
|
|
4334
|
+
Issuer: O=BoringSSL TESTING, CN=Intermediate CA
|
|
4335
|
+
Validity
|
|
4336
|
+
Not Before: Jan 1 00:00:00 2015 GMT
|
|
4337
|
+
Not After : Jan 1 00:00:00 2100 GMT
|
|
4338
|
+
Subject: O=BoringSSL TESTING, CN=example.com
|
|
4339
|
+
Subject Public Key Info:
|
|
4340
|
+
Public Key Algorithm: rsaEncryption
|
|
4341
|
+
Public-Key: (1024 bit)
|
|
4342
|
+
Modulus:
|
|
4343
|
+
00:c3:d1:4d:19:62:0a:92:84:9e:e8:3a:3b:32:34:
|
|
4344
|
+
ac:95:5c:41:ea:79:a7:e6:93:f6:c0:a0:fa:98:fe:
|
|
4345
|
+
1d:5c:a0:fc:36:13:c2:a6:7a:a8:94:4a:84:cf:8c:
|
|
4346
|
+
6e:48:5d:26:e5:3b:17:2a:a5:b0:17:82:78:cf:ce:
|
|
4347
|
+
8f:03:23:71:8d:32:10:1f:f1:26:0d:62:ca:07:ee:
|
|
4348
|
+
07:3b:53:2e:e3:e7:1f:1b:52:b8:ac:1a:7b:93:1e:
|
|
4349
|
+
a9:2a:1f:a7:78:fd:ee:c4:4c:9e:e2:dc:2a:51:f1:
|
|
4350
|
+
bb:ca:d7:a0:e0:80:4b:d0:4e:e7:4b:8a:9c:fc:14:
|
|
4351
|
+
11:ed:62:11:5a:91:f7:61:4f
|
|
4352
|
+
Exponent: 65537 (0x10001)
|
|
4353
|
+
X509v3 extensions:
|
|
4354
|
+
X509v3 Key Usage: critical
|
|
4355
|
+
Digital Signature, Key Encipherment
|
|
4356
|
+
X509v3 Extended Key Usage:
|
|
4357
|
+
TLS Web Server Authentication, TLS Web Client Authentication
|
|
4358
|
+
X509v3 Basic Constraints: critical
|
|
4359
|
+
CA:FALSE
|
|
4360
|
+
X509v3 Subject Key Identifier:
|
|
4361
|
+
A3:79:A6:F6:EE:AF:B9:A5:5E:37:8C:11:80:34:E2:75
|
|
4362
|
+
X509v3 Authority Key Identifier:
|
|
4363
|
+
keyid:8C:1A:68:A8:B5:76:DB:5D:57:7B:1F:8D:14:B2:06:A3
|
|
4364
|
+
|
|
4365
|
+
Signature Algorithm: sha256WithRSAEncryption
|
|
4366
|
+
63:fe:9f:89:0a:1a:7f:fc:b9:d7:58:2d:64:d7:6d:4b:33:f8:
|
|
4367
|
+
a2:ee:11:73:43:33:2b:b7:bd:1b:9f:2e:34:e9:21:b3:f6:30:
|
|
4368
|
+
23:68:f3:97:e1:2d:e0:b7:7f:32:ae:18:e9:3e:e9:01:95:2c:
|
|
4369
|
+
e0:41:71:60:eb:ac:ba:ab:9a:a9:d6:74:13:0f:50:b0:e8:d9:
|
|
4370
|
+
0a:05:ef:56:b8:19:58:de:26:1f:9a:c7:fb:59:3f:27:86:54:
|
|
4371
|
+
f5:0a:db:54:c4:d0:b0:c8:c5:fd:9a:d7:57:75:08:9c:39:f3:
|
|
4372
|
+
63:20:65:02:0f:93:8b:57:93:e0:1c:53:d1:2a:21:c7:8a:80:
|
|
4373
|
+
40:86
|
|
4374
|
+
)");
|
|
4375
|
+
}
|