grpc 1.10.0 → 1.11.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +2098 -501
- data/include/grpc/byte_buffer.h +2 -0
- data/include/grpc/byte_buffer_reader.h +2 -0
- data/include/grpc/census.h +2 -0
- data/include/grpc/fork.h +2 -0
- data/include/grpc/grpc.h +10 -0
- data/include/grpc/grpc_cronet.h +2 -0
- data/include/grpc/grpc_posix.h +2 -1
- data/include/grpc/grpc_security.h +21 -0
- data/include/grpc/grpc_security_constants.h +1 -0
- data/include/grpc/impl/codegen/byte_buffer.h +2 -0
- data/include/grpc/impl/codegen/grpc_types.h +24 -0
- data/include/grpc/impl/codegen/slice.h +1 -1
- data/include/grpc/impl/codegen/sync.h +1 -0
- data/include/grpc/impl/codegen/sync_custom.h +2 -0
- data/include/grpc/impl/codegen/sync_generic.h +2 -0
- data/include/grpc/impl/codegen/sync_posix.h +2 -0
- data/include/grpc/impl/codegen/sync_windows.h +2 -0
- data/include/grpc/slice.h +2 -0
- data/include/grpc/slice_buffer.h +2 -0
- data/include/grpc/status.h +2 -0
- data/include/grpc/support/alloc.h +2 -2
- data/include/grpc/support/atm.h +2 -0
- data/include/grpc/support/atm_gcc_atomic.h +2 -0
- data/include/grpc/support/atm_gcc_sync.h +2 -0
- data/include/grpc/support/atm_windows.h +2 -0
- data/include/grpc/support/log.h +1 -1
- data/include/grpc/support/sync.h +2 -0
- data/include/grpc/support/sync_custom.h +2 -0
- data/include/grpc/support/sync_generic.h +2 -0
- data/include/grpc/support/sync_posix.h +2 -0
- data/include/grpc/support/sync_windows.h +2 -0
- data/include/grpc/support/time.h +2 -0
- data/src/boringssl/err_data.c +444 -438
- data/src/core/ext/census/grpc_context.cc +2 -0
- data/src/core/ext/filters/client_channel/backup_poller.cc +13 -8
- data/src/core/ext/filters/client_channel/backup_poller.h +3 -2
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +2 -0
- data/src/core/ext/filters/client_channel/client_channel.cc +1988 -433
- data/src/core/ext/filters/client_channel/client_channel.h +2 -0
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -0
- data/src/core/ext/filters/client_channel/client_channel_factory.h +2 -0
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +2 -27
- data/src/core/ext/filters/client_channel/connector.cc +2 -0
- data/src/core/ext/filters/client_channel/connector.h +2 -0
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +2 -0
- data/src/core/ext/filters/client_channel/http_proxy.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +96 -78
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +9 -17
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +70 -62
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +4 -2
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +4 -2
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy_factory.cc +3 -1
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -1
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +2 -1
- data/src/core/ext/filters/client_channel/method_params.cc +178 -0
- data/src/core/ext/filters/client_channel/method_params.h +74 -0
- data/src/core/ext/filters/client_channel/parse_address.cc +17 -13
- data/src/core/ext/filters/client_channel/parse_address.h +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper.cc +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper.h +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +2 -0
- data/src/core/ext/filters/client_channel/resolver.cc +2 -0
- data/src/core/ext/filters/client_channel/resolver.h +6 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +24 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +55 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +8 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +30 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +2 -1
- data/src/core/ext/filters/client_channel/resolver_factory.h +2 -0
- data/src/core/ext/filters/client_channel/resolver_registry.cc +2 -0
- data/src/core/ext/filters/client_channel/resolver_registry.h +2 -0
- data/src/core/ext/filters/client_channel/retry_throttle.cc +102 -120
- data/src/core/ext/filters/client_channel/retry_throttle.h +52 -25
- data/src/core/ext/filters/client_channel/subchannel.cc +14 -4
- data/src/core/ext/filters/client_channel/subchannel.h +10 -1
- data/src/core/ext/filters/client_channel/subchannel_index.cc +2 -0
- data/src/core/ext/filters/client_channel/subchannel_index.h +2 -0
- data/src/core/ext/filters/client_channel/uri_parser.cc +2 -1
- data/src/core/ext/filters/client_channel/uri_parser.h +2 -1
- data/src/core/ext/filters/deadline/deadline_filter.cc +2 -1
- data/src/core/ext/filters/deadline/deadline_filter.h +2 -0
- data/src/core/ext/filters/http/client/http_client_filter.cc +27 -25
- data/src/core/ext/filters/http/client/http_client_filter.h +2 -0
- data/src/core/ext/filters/http/client_authority_filter.cc +156 -0
- data/src/core/ext/filters/http/client_authority_filter.h +34 -0
- data/src/core/ext/filters/http/http_filters_plugin.cc +2 -0
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +21 -22
- data/src/core/ext/filters/http/message_compress/message_compress_filter.h +2 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +11 -8
- data/src/core/ext/filters/http/server/http_server_filter.h +2 -0
- data/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +2 -0
- data/src/core/ext/filters/load_reporting/server_load_reporting_filter.h +2 -0
- data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h +2 -0
- data/src/core/ext/filters/max_age/max_age_filter.cc +2 -0
- data/src/core/ext/filters/max_age/max_age_filter.h +2 -0
- data/src/core/ext/filters/message_size/message_size_filter.cc +52 -49
- data/src/core/ext/filters/message_size/message_size_filter.h +2 -0
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +5 -1
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +2 -0
- data/src/core/ext/filters/workarounds/workaround_utils.cc +2 -0
- data/src/core/ext/filters/workarounds/workaround_utils.h +2 -0
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +3 -1
- data/src/core/ext/transport/chttp2/alpn/alpn.h +2 -0
- data/src/core/ext/transport/chttp2/client/authority.cc +42 -0
- data/src/core/ext/transport/chttp2/client/authority.h +36 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +2 -0
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +10 -3
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +2 -2
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +37 -25
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +2 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +3 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +2 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +2 -1
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +3 -1
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +2 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +152 -182
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +15 -19
- data/src/core/ext/transport/chttp2/transport/frame_data.h +7 -5
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +2 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +2 -0
- data/src/core/ext/transport/chttp2/transport/huffsyms.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +2 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +60 -24
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/varint.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +10 -6
- data/src/core/ext/transport/inproc/inproc_plugin.cc +2 -0
- data/src/core/ext/transport/inproc/inproc_transport.cc +20 -23
- data/src/core/ext/transport/inproc/inproc_transport.h +2 -0
- data/src/core/lib/avl/avl.cc +2 -0
- data/src/core/lib/avl/avl.h +2 -0
- data/src/core/lib/backoff/backoff.cc +2 -0
- data/src/core/lib/backoff/backoff.h +2 -0
- data/src/core/lib/channel/channel_args.h +2 -0
- data/src/core/lib/channel/channel_stack.cc +3 -1
- data/src/core/lib/channel/channel_stack.h +2 -0
- data/src/core/lib/channel/channel_stack_builder.cc +2 -0
- data/src/core/lib/channel/channel_stack_builder.h +2 -0
- data/src/core/lib/channel/channel_trace.cc +239 -0
- data/src/core/lib/channel/channel_trace.h +133 -0
- data/src/core/lib/channel/channel_trace_registry.cc +80 -0
- data/src/core/lib/channel/channel_trace_registry.h +43 -0
- data/src/core/lib/channel/connected_channel.cc +2 -0
- data/src/core/lib/channel/connected_channel.h +2 -0
- data/src/core/lib/channel/handshaker.cc +2 -0
- data/src/core/lib/channel/handshaker.h +2 -0
- data/src/core/lib/channel/handshaker_factory.cc +2 -0
- data/src/core/lib/channel/handshaker_factory.h +2 -1
- data/src/core/lib/channel/handshaker_registry.cc +2 -0
- data/src/core/lib/channel/handshaker_registry.h +2 -1
- data/src/core/lib/channel/status_util.cc +100 -0
- data/src/core/lib/channel/status_util.h +58 -0
- data/src/core/lib/compression/algorithm_metadata.h +2 -0
- data/src/core/lib/compression/compression.cc +2 -0
- data/src/core/lib/compression/compression_internal.cc +2 -0
- data/src/core/lib/compression/compression_internal.h +2 -0
- data/src/core/lib/compression/message_compress.cc +2 -0
- data/src/core/lib/compression/message_compress.h +2 -0
- data/src/core/lib/compression/stream_compression.cc +2 -0
- data/src/core/lib/compression/stream_compression.h +2 -0
- data/src/core/lib/compression/stream_compression_gzip.cc +2 -0
- data/src/core/lib/compression/stream_compression_gzip.h +2 -0
- data/src/core/lib/compression/stream_compression_identity.cc +2 -1
- data/src/core/lib/compression/stream_compression_identity.h +2 -0
- data/src/core/lib/debug/stats.cc +2 -0
- data/src/core/lib/debug/stats.h +2 -0
- data/src/core/lib/debug/stats_data.cc +3 -1
- data/src/core/lib/debug/stats_data.h +2 -0
- data/src/core/lib/debug/trace.cc +2 -0
- data/src/core/lib/debug/trace.h +2 -1
- data/src/core/lib/gpr/alloc.cc +2 -1
- data/src/core/lib/gpr/arena.cc +47 -0
- data/src/core/lib/gpr/arena.h +2 -0
- data/src/core/lib/gpr/atm.cc +2 -0
- data/src/core/lib/gpr/cpu_linux.cc +5 -1
- data/src/core/lib/gpr/cpu_posix.cc +1 -1
- data/src/core/lib/gpr/env.h +2 -0
- data/src/core/lib/gpr/fork.cc +2 -0
- data/src/core/lib/gpr/host_port.cc +2 -0
- data/src/core/lib/gpr/log.cc +2 -1
- data/src/core/lib/gpr/log_linux.cc +1 -0
- data/src/core/lib/gpr/mpscq.cc +2 -0
- data/src/core/lib/gpr/mpscq.h +2 -0
- data/src/core/lib/gpr/murmur_hash.cc +2 -0
- data/src/core/lib/gpr/spinlock.h +2 -0
- data/src/core/lib/gpr/string.cc +2 -1
- data/src/core/lib/gpr/string.h +2 -2
- data/src/core/lib/gpr/sync.cc +2 -0
- data/src/core/lib/gpr/time.cc +2 -0
- data/src/core/lib/gpr/time_posix.cc +1 -0
- data/src/core/lib/gpr/time_precise.cc +2 -0
- data/src/core/lib/gpr/time_precise.h +2 -0
- data/src/core/lib/gpr/tls_gcc.h +2 -0
- data/src/core/lib/gpr/tls_msvc.h +2 -0
- data/src/core/lib/gpr/tls_pthread.h +2 -0
- data/src/core/lib/gpr/tmpfile.h +2 -0
- data/src/core/lib/gprpp/atomic_with_atm.h +2 -0
- data/src/core/lib/gprpp/atomic_with_std.h +2 -0
- data/src/core/lib/gprpp/inlined_vector.h +2 -0
- data/src/core/lib/gprpp/manual_constructor.h +3 -1
- data/src/core/lib/gprpp/memory.h +5 -3
- data/src/core/lib/gprpp/orphanable.h +3 -0
- data/src/core/lib/gprpp/ref_counted.h +4 -0
- data/src/core/lib/gprpp/ref_counted_ptr.h +3 -0
- data/src/core/lib/gprpp/thd.h +135 -0
- data/src/core/lib/gprpp/thd_posix.cc +209 -0
- data/src/core/lib/gprpp/thd_windows.cc +162 -0
- data/src/core/lib/http/format_request.cc +2 -0
- data/src/core/lib/http/format_request.h +2 -0
- data/src/core/lib/http/httpcli.cc +2 -0
- data/src/core/lib/http/httpcli.h +2 -0
- data/src/core/lib/http/httpcli_security_connector.cc +16 -7
- data/src/core/lib/http/parser.cc +2 -0
- data/src/core/lib/http/parser.h +2 -1
- data/src/core/lib/iomgr/call_combiner.cc +2 -0
- data/src/core/lib/iomgr/call_combiner.h +2 -1
- data/src/core/lib/iomgr/combiner.cc +2 -0
- data/src/core/lib/iomgr/combiner.h +2 -0
- data/src/core/lib/iomgr/endpoint.cc +4 -0
- data/src/core/lib/iomgr/endpoint.h +2 -0
- data/src/core/lib/iomgr/endpoint_pair.h +2 -0
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -0
- data/src/core/lib/iomgr/endpoint_pair_uv.cc +2 -0
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +7 -4
- data/src/core/lib/iomgr/error.h +2 -0
- data/src/core/lib/iomgr/error_internal.h +2 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +2 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.h +2 -0
- data/src/core/lib/iomgr/ev_epollex_linux.cc +4 -18
- data/src/core/lib/iomgr/ev_epollex_linux.h +2 -0
- data/src/core/lib/iomgr/ev_epollsig_linux.cc +2 -0
- data/src/core/lib/iomgr/ev_epollsig_linux.h +2 -0
- data/src/core/lib/iomgr/ev_poll_posix.cc +61 -31
- data/src/core/lib/iomgr/ev_poll_posix.h +2 -0
- data/src/core/lib/iomgr/ev_posix.cc +35 -19
- data/src/core/lib/iomgr/ev_posix.h +2 -0
- data/src/core/lib/iomgr/ev_windows.cc +2 -0
- data/src/core/lib/iomgr/exec_ctx.cc +3 -1
- data/src/core/lib/iomgr/exec_ctx.h +21 -9
- data/src/core/lib/iomgr/executor.cc +13 -11
- data/src/core/lib/iomgr/executor.h +2 -0
- data/src/core/lib/iomgr/fork_posix.cc +4 -2
- data/src/core/lib/iomgr/fork_windows.cc +2 -0
- data/src/core/lib/iomgr/gethostname_fallback.cc +2 -0
- data/src/core/lib/iomgr/gethostname_host_name_max.cc +2 -0
- data/src/core/lib/iomgr/gethostname_sysconf.cc +2 -0
- data/src/core/lib/iomgr/iocp_windows.cc +3 -1
- data/src/core/lib/iomgr/iocp_windows.h +3 -0
- data/src/core/lib/iomgr/iomgr.cc +2 -1
- data/src/core/lib/iomgr/iomgr.h +2 -0
- data/src/core/lib/iomgr/iomgr_custom.cc +63 -0
- data/src/core/lib/iomgr/iomgr_custom.h +47 -0
- data/src/core/lib/iomgr/iomgr_internal.cc +43 -0
- data/src/core/lib/iomgr/iomgr_internal.h +14 -0
- data/src/core/lib/iomgr/iomgr_posix.cc +30 -3
- data/src/core/lib/iomgr/iomgr_posix.h +2 -0
- data/src/core/lib/iomgr/iomgr_uv.cc +17 -20
- data/src/core/lib/iomgr/iomgr_windows.cc +29 -3
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +2 -0
- data/src/core/lib/iomgr/is_epollexclusive_available.h +2 -0
- data/src/core/lib/iomgr/load_file.cc +2 -0
- data/src/core/lib/iomgr/load_file.h +2 -0
- data/src/core/lib/iomgr/lockfree_event.cc +2 -0
- data/src/core/lib/iomgr/lockfree_event.h +14 -1
- data/src/core/lib/iomgr/nameser.h +2 -0
- data/src/core/lib/iomgr/network_status_tracker.cc +3 -1
- data/src/core/lib/iomgr/network_status_tracker.h +2 -0
- data/src/core/lib/iomgr/polling_entity.cc +2 -0
- data/src/core/lib/iomgr/polling_entity.h +2 -0
- data/src/core/lib/iomgr/pollset.cc +56 -0
- data/src/core/lib/iomgr/pollset.h +19 -0
- data/src/core/lib/iomgr/pollset_custom.cc +106 -0
- data/src/core/lib/iomgr/{timer_generic.h → pollset_custom.h} +15 -17
- data/src/core/lib/iomgr/pollset_set.cc +55 -0
- data/src/core/lib/iomgr/pollset_set.h +13 -0
- data/src/core/lib/iomgr/pollset_set_custom.cc +48 -0
- data/src/core/lib/iomgr/{pollset_uv.h → pollset_set_custom.h} +6 -7
- data/src/core/lib/iomgr/pollset_set_windows.cc +17 -10
- data/src/core/lib/iomgr/pollset_set_windows.h +2 -0
- data/src/core/lib/iomgr/pollset_uv.cc +42 -105
- data/src/core/lib/iomgr/pollset_windows.cc +20 -12
- data/src/core/lib/iomgr/pollset_windows.h +2 -0
- data/src/core/lib/iomgr/port.h +10 -19
- data/src/core/lib/iomgr/resolve_address.cc +50 -0
- data/src/core/lib/iomgr/resolve_address.h +39 -10
- data/src/core/lib/iomgr/resolve_address_custom.cc +187 -0
- data/src/core/lib/iomgr/resolve_address_custom.h +43 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +10 -22
- data/src/core/lib/iomgr/resolve_address_windows.cc +10 -22
- data/src/core/lib/iomgr/resource_quota.cc +2 -0
- data/src/core/lib/iomgr/resource_quota.h +3 -5
- data/src/core/lib/iomgr/sockaddr.h +3 -11
- data/src/core/lib/iomgr/sockaddr_custom.h +54 -0
- data/src/core/lib/iomgr/sockaddr_posix.h +26 -0
- data/src/core/lib/iomgr/sockaddr_utils.cc +91 -71
- data/src/core/lib/iomgr/sockaddr_utils.h +4 -0
- data/src/core/lib/iomgr/sockaddr_windows.h +21 -0
- data/src/core/lib/iomgr/socket_factory_posix.cc +2 -0
- data/src/core/lib/iomgr/socket_factory_posix.h +2 -0
- data/src/core/lib/iomgr/socket_mutator.cc +2 -0
- data/src/core/lib/iomgr/socket_mutator.h +2 -0
- data/src/core/lib/iomgr/socket_utils.h +11 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +15 -6
- data/src/core/lib/iomgr/socket_utils_linux.cc +4 -4
- data/src/core/lib/iomgr/socket_utils_posix.cc +3 -2
- data/src/core/lib/iomgr/socket_utils_posix.h +2 -0
- data/src/core/lib/iomgr/socket_utils_uv.cc +13 -2
- data/src/core/lib/iomgr/socket_utils_windows.cc +10 -0
- data/src/core/lib/iomgr/socket_windows.cc +2 -0
- data/src/core/lib/iomgr/socket_windows.h +2 -1
- data/src/core/lib/iomgr/sys_epoll_wrapper.h +2 -0
- data/src/core/lib/iomgr/tcp_client.cc +36 -0
- data/src/core/lib/iomgr/tcp_client.h +13 -0
- data/src/core/lib/iomgr/tcp_client_custom.cc +151 -0
- data/src/core/lib/iomgr/tcp_client_posix.cc +11 -24
- data/src/core/lib/iomgr/tcp_client_posix.h +2 -0
- data/src/core/lib/iomgr/tcp_client_windows.cc +10 -23
- data/src/core/lib/iomgr/tcp_custom.cc +365 -0
- data/src/core/lib/iomgr/tcp_custom.h +81 -0
- data/src/core/lib/iomgr/tcp_posix.cc +3 -1
- data/src/core/lib/iomgr/tcp_posix.h +2 -0
- data/src/core/lib/iomgr/tcp_server.cc +73 -0
- data/src/core/lib/iomgr/tcp_server.h +24 -0
- data/src/core/lib/iomgr/tcp_server_custom.cc +472 -0
- data/src/core/lib/iomgr/tcp_server_posix.cc +41 -23
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +2 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +7 -7
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +8 -6
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +2 -0
- data/src/core/lib/iomgr/tcp_server_windows.cc +43 -21
- data/src/core/lib/iomgr/tcp_uv.cc +308 -314
- data/src/core/lib/iomgr/tcp_windows.cc +3 -1
- data/src/core/lib/iomgr/tcp_windows.h +2 -0
- data/src/core/lib/iomgr/time_averaged_stats.cc +2 -0
- data/src/core/lib/iomgr/timer.cc +45 -0
- data/src/core/lib/iomgr/timer.h +36 -15
- data/src/core/lib/iomgr/timer_custom.cc +93 -0
- data/src/core/lib/iomgr/timer_custom.h +43 -0
- data/src/core/lib/iomgr/timer_generic.cc +12 -10
- data/src/core/lib/iomgr/timer_heap.cc +2 -4
- data/src/core/lib/iomgr/timer_heap.h +2 -0
- data/src/core/lib/iomgr/timer_manager.cc +12 -20
- data/src/core/lib/iomgr/timer_manager.h +2 -0
- data/src/core/lib/iomgr/timer_uv.cc +15 -49
- data/src/core/lib/iomgr/udp_server.cc +271 -230
- data/src/core/lib/iomgr/udp_server.h +44 -20
- data/src/core/lib/iomgr/unix_sockets_posix.cc +10 -7
- data/src/core/lib/iomgr/unix_sockets_posix.h +2 -0
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_cv.cc +3 -1
- data/src/core/lib/iomgr/wakeup_fd_cv.h +2 -0
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +2 -0
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_posix.h +2 -0
- data/src/core/lib/json/json.cc +38 -0
- data/src/core/lib/json/json.h +22 -1
- data/src/core/lib/json/json_reader.cc +2 -2
- data/src/core/lib/json/json_reader.h +1 -0
- data/src/core/lib/json/json_string.cc +2 -0
- data/src/core/lib/json/json_writer.cc +2 -2
- data/src/core/lib/json/json_writer.h +2 -0
- data/src/core/lib/profiling/basic_timers.cc +11 -9
- data/src/core/lib/profiling/timers.h +6 -3
- data/src/core/lib/security/context/security_context.cc +2 -0
- data/src/core/lib/security/context/security_context.h +2 -0
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +119 -0
- data/src/core/lib/security/credentials/alts/alts_credentials.h +102 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +72 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +57 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +67 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +33 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +114 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +126 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc +46 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +112 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +58 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +2 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.h +2 -0
- data/src/core/lib/security/credentials/credentials.cc +2 -0
- data/src/core/lib/security/credentials/credentials.h +2 -0
- data/src/core/lib/security/credentials/credentials_metadata.cc +2 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +2 -3
- data/src/core/lib/security/credentials/fake/fake_credentials.h +5 -0
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +2 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +2 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +2 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +2 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +2 -0
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -0
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +2 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +2 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +2 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +2 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +2 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +11 -2
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +2 -0
- data/src/core/lib/security/security_connector/alts_security_connector.cc +287 -0
- data/src/core/lib/security/security_connector/alts_security_connector.h +69 -0
- data/src/core/lib/security/security_connector/security_connector.cc +174 -74
- data/src/core/lib/security/security_connector/security_connector.h +41 -7
- data/src/core/lib/security/transport/auth_filters.h +2 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +14 -28
- data/src/core/lib/security/transport/secure_endpoint.cc +2 -0
- data/src/core/lib/security/transport/secure_endpoint.h +2 -0
- data/src/core/lib/security/transport/security_handshaker.cc +2 -0
- data/src/core/lib/security/transport/security_handshaker.h +2 -1
- data/src/core/lib/security/transport/server_auth_filter.cc +2 -0
- data/src/core/lib/security/transport/target_authority_table.cc +75 -0
- data/src/core/lib/security/transport/{lb_targets_info.h → target_authority_table.h} +16 -8
- data/src/core/lib/security/transport/tsi_error.cc +2 -0
- data/src/core/lib/security/transport/tsi_error.h +2 -0
- data/src/core/lib/security/util/json_util.cc +2 -0
- data/src/core/lib/security/util/json_util.h +2 -0
- data/src/core/lib/slice/b64.cc +2 -0
- data/src/core/lib/slice/b64.h +2 -0
- data/src/core/lib/slice/percent_encoding.cc +2 -0
- data/src/core/lib/slice/percent_encoding.h +2 -0
- data/src/core/lib/slice/slice.cc +2 -0
- data/src/core/lib/slice/slice_buffer.cc +3 -1
- data/src/core/lib/slice/slice_hash_table.h +178 -45
- data/src/core/lib/slice/slice_intern.cc +2 -0
- data/src/core/lib/slice/slice_internal.h +2 -2
- data/src/core/lib/slice/slice_string_helpers.cc +2 -0
- data/src/core/lib/slice/slice_string_helpers.h +2 -1
- data/src/core/lib/slice/slice_weak_hash_table.h +105 -0
- data/src/core/lib/surface/api_trace.cc +3 -1
- data/src/core/lib/surface/api_trace.h +2 -0
- data/src/core/lib/surface/byte_buffer.cc +3 -0
- data/src/core/lib/surface/byte_buffer_reader.cc +3 -0
- data/src/core/lib/surface/call.cc +46 -80
- data/src/core/lib/surface/call.h +2 -0
- data/src/core/lib/surface/call_details.cc +2 -0
- data/src/core/lib/surface/call_log_batch.cc +2 -0
- data/src/core/lib/surface/call_test_only.h +2 -0
- data/src/core/lib/surface/channel.cc +72 -41
- data/src/core/lib/surface/channel.h +2 -0
- data/src/core/lib/surface/channel_init.cc +2 -0
- data/src/core/lib/surface/channel_init.h +2 -0
- data/src/core/lib/surface/channel_ping.cc +2 -0
- data/src/core/lib/surface/channel_stack_type.cc +3 -2
- data/src/core/lib/surface/channel_stack_type.h +2 -0
- data/src/core/lib/surface/completion_queue.h +2 -0
- data/src/core/lib/surface/completion_queue_factory.cc +3 -1
- data/src/core/lib/surface/completion_queue_factory.h +2 -0
- data/src/core/lib/surface/event_string.cc +2 -0
- data/src/core/lib/surface/event_string.h +2 -0
- data/src/core/lib/surface/init.cc +5 -2
- data/src/core/lib/surface/init_secure.cc +5 -2
- data/src/core/lib/surface/lame_client.cc +7 -5
- data/src/core/lib/surface/lame_client.h +2 -0
- data/src/core/lib/surface/metadata_array.cc +2 -0
- data/src/core/lib/surface/server.cc +2 -0
- data/src/core/lib/surface/server.h +2 -0
- data/src/core/lib/surface/validate_metadata.cc +2 -1
- data/src/core/lib/surface/validate_metadata.h +2 -0
- data/src/core/lib/surface/version.cc +4 -2
- data/src/core/lib/transport/bdp_estimator.cc +2 -0
- data/src/core/lib/transport/byte_stream.cc +94 -116
- data/src/core/lib/transport/byte_stream.h +111 -78
- data/src/core/lib/transport/connectivity_state.cc +2 -0
- data/src/core/lib/transport/connectivity_state.h +3 -1
- data/src/core/lib/transport/error_utils.cc +2 -0
- data/src/core/lib/transport/error_utils.h +2 -0
- data/src/core/lib/transport/metadata.cc +2 -0
- data/src/core/lib/transport/metadata.h +3 -1
- data/src/core/lib/transport/metadata_batch.cc +26 -0
- data/src/core/lib/transport/metadata_batch.h +12 -1
- data/src/core/lib/transport/pid_controller.cc +2 -0
- data/src/core/lib/transport/pid_controller.h +2 -0
- data/src/core/lib/transport/service_config.cc +21 -175
- data/src/core/lib/transport/service_config.h +223 -35
- data/src/core/lib/transport/static_metadata.cc +310 -294
- data/src/core/lib/transport/static_metadata.h +96 -82
- data/src/core/lib/transport/status_conversion.cc +2 -0
- data/src/core/lib/transport/status_conversion.h +3 -0
- data/src/core/lib/transport/status_metadata.cc +54 -0
- data/src/core/lib/{iomgr/timer_uv.h → transport/status_metadata.h} +10 -12
- data/src/core/lib/transport/timeout_encoding.cc +2 -1
- data/src/core/lib/transport/timeout_encoding.h +2 -0
- data/src/core/lib/transport/transport.cc +3 -1
- data/src/core/lib/transport/transport.h +33 -7
- data/src/core/lib/transport/transport_impl.h +2 -0
- data/src/core/lib/transport/transport_op_string.cc +10 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +10 -4
- data/src/core/tsi/alts/crypt/aes_gcm.cc +687 -0
- data/src/core/tsi/alts/crypt/gsec.cc +189 -0
- data/src/core/tsi/alts/crypt/gsec.h +454 -0
- data/src/core/tsi/alts/frame_protector/alts_counter.cc +118 -0
- data/src/core/tsi/alts/frame_protector/alts_counter.h +98 -0
- data/src/core/tsi/alts/frame_protector/alts_crypter.cc +66 -0
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +255 -0
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +407 -0
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +55 -0
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc +114 -0
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +114 -0
- data/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc +105 -0
- data/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc +103 -0
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +218 -0
- data/src/core/tsi/alts/frame_protector/frame_handler.h +236 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +316 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +137 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc +520 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api.h +323 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc +143 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h +149 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_event.cc +73 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_event.h +93 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +483 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +83 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +52 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +58 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +52 -0
- data/src/core/tsi/alts/handshaker/altscontext.pb.c +48 -0
- data/src/core/tsi/alts/handshaker/altscontext.pb.h +64 -0
- data/src/core/tsi/alts/handshaker/handshaker.pb.c +123 -0
- data/src/core/tsi/alts/handshaker/handshaker.pb.h +255 -0
- data/src/core/tsi/alts/handshaker/transport_security_common.pb.c +50 -0
- data/src/core/tsi/alts/handshaker/transport_security_common.pb.h +78 -0
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +196 -0
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +163 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +180 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +52 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +144 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +49 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +91 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +174 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +100 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +476 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +199 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +296 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +52 -0
- data/src/core/tsi/alts_transport_security.cc +3 -1
- data/src/core/tsi/alts_transport_security.h +4 -2
- data/src/core/tsi/fake_transport_security.cc +2 -1
- data/src/core/tsi/fake_transport_security.h +2 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +73 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +58 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +211 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +93 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +76 -0
- data/src/core/tsi/ssl_transport_security.cc +266 -62
- data/src/core/tsi/ssl_transport_security.h +128 -6
- data/src/core/tsi/ssl_types.h +2 -0
- data/src/core/tsi/transport_security.cc +2 -0
- data/src/core/tsi/transport_security.h +2 -0
- data/src/core/tsi/transport_security_adapter.cc +2 -0
- data/src/core/tsi/transport_security_adapter.h +2 -0
- data/src/core/tsi/transport_security_grpc.cc +2 -0
- data/src/core/tsi/transport_security_grpc.h +2 -0
- data/src/core/tsi/transport_security_interface.h +2 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -2
- data/src/ruby/ext/grpc/rb_call.c +1 -13
- data/src/ruby/ext/grpc/rb_channel.c +6 -6
- data/src/ruby/ext/grpc/rb_compression_options.c +1 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +10 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +15 -0
- data/src/ruby/lib/grpc/core/time_consts.rb +1 -1
- data/src/ruby/lib/grpc/generic/bidi_call.rb +19 -8
- data/src/ruby/lib/grpc/generic/client_stub.rb +6 -10
- data/src/ruby/lib/grpc/generic/interceptors.rb +1 -1
- data/src/ruby/lib/grpc/generic/rpc_server.rb +2 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/generic/client_stub_spec.rb +133 -0
- data/src/ruby/spec/pb/package_with_underscore/checker_spec.rb +54 -0
- data/src/ruby/spec/pb/package_with_underscore/data.proto +23 -0
- data/src/ruby/spec/pb/package_with_underscore/service.proto +23 -0
- data/third_party/address_sorting/address_sorting.c +369 -0
- data/third_party/address_sorting/address_sorting_internal.h +70 -0
- data/third_party/address_sorting/address_sorting_posix.c +97 -0
- data/third_party/address_sorting/address_sorting_windows.c +55 -0
- data/third_party/address_sorting/include/address_sorting/address_sorting.h +110 -0
- data/third_party/boringssl/crypto/asn1/a_enum.c +20 -9
- data/third_party/boringssl/crypto/asn1/a_i2d_fp.c +3 -0
- data/third_party/boringssl/crypto/asn1/a_int.c +19 -8
- data/third_party/boringssl/crypto/asn1/a_object.c +0 -128
- data/third_party/boringssl/crypto/asn1/asn1_locl.h +3 -0
- data/third_party/boringssl/crypto/asn1/tasn_fre.c +2 -4
- data/third_party/boringssl/crypto/asn1/tasn_new.c +3 -2
- data/third_party/boringssl/crypto/bn_extra/bn_asn1.c +0 -16
- data/third_party/boringssl/crypto/buf/buf.c +14 -0
- data/third_party/boringssl/crypto/bytestring/cbb.c +93 -0
- data/third_party/boringssl/crypto/conf/conf.c +2 -2
- data/third_party/boringssl/crypto/cpu-intel.c +17 -17
- data/third_party/boringssl/crypto/crypto.c +16 -4
- data/third_party/boringssl/crypto/curve25519/spake25519.c +11 -11
- data/third_party/boringssl/crypto/curve25519/x25519-x86_64.c +1 -1
- data/third_party/boringssl/crypto/dsa/dsa.c +9 -21
- data/third_party/boringssl/crypto/ec_extra/ec_asn1.c +2 -2
- data/third_party/boringssl/crypto/ecdsa_extra/ecdsa_asn1.c +1 -8
- data/third_party/boringssl/crypto/evp/p_rsa_asn1.c +2 -23
- data/third_party/boringssl/crypto/ex_data.c +0 -1
- data/third_party/boringssl/crypto/fipsmodule/bn/add.c +7 -11
- data/third_party/boringssl/crypto/fipsmodule/bn/asm/x86_64-gcc.c +19 -16
- data/third_party/boringssl/crypto/fipsmodule/bn/cmp.c +15 -0
- data/third_party/boringssl/crypto/fipsmodule/bn/div.c +53 -46
- data/third_party/boringssl/crypto/fipsmodule/bn/exponentiation.c +242 -85
- data/third_party/boringssl/crypto/fipsmodule/bn/generic.c +42 -47
- data/third_party/boringssl/crypto/fipsmodule/bn/internal.h +176 -34
- data/third_party/boringssl/crypto/fipsmodule/bn/montgomery.c +118 -65
- data/third_party/boringssl/crypto/fipsmodule/bn/mul.c +94 -61
- data/third_party/boringssl/crypto/fipsmodule/bn/random.c +79 -63
- data/third_party/boringssl/crypto/fipsmodule/bn/shift.c +26 -28
- data/third_party/boringssl/crypto/fipsmodule/cipher/cipher.c +2 -0
- data/third_party/boringssl/crypto/fipsmodule/ec/ec.c +250 -149
- data/third_party/boringssl/crypto/fipsmodule/ec/ec_montgomery.c +0 -27
- data/third_party/boringssl/crypto/fipsmodule/ec/internal.h +54 -20
- data/third_party/boringssl/crypto/fipsmodule/ec/oct.c +3 -3
- data/third_party/boringssl/crypto/fipsmodule/ec/p224-64.c +7 -41
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-64.c +6 -40
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.c +17 -122
- data/third_party/boringssl/crypto/fipsmodule/ec/simple.c +3 -64
- data/third_party/boringssl/crypto/fipsmodule/ec/wnaf.c +27 -9
- data/third_party/boringssl/crypto/fipsmodule/ecdsa/ecdsa.c +203 -205
- data/third_party/boringssl/crypto/fipsmodule/modes/cbc.c +14 -15
- data/third_party/boringssl/crypto/fipsmodule/modes/cfb.c +12 -8
- data/third_party/boringssl/crypto/fipsmodule/modes/ctr.c +4 -3
- data/third_party/boringssl/crypto/fipsmodule/modes/gcm.c +25 -36
- data/third_party/boringssl/crypto/fipsmodule/modes/internal.h +10 -0
- data/third_party/boringssl/crypto/fipsmodule/rsa/internal.h +0 -4
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa.c +2 -0
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa_impl.c +9 -19
- data/third_party/boringssl/crypto/lhash/lhash.c +19 -0
- data/third_party/boringssl/crypto/obj/obj.c +29 -69
- data/third_party/boringssl/crypto/pem/pem_lib.c +2 -2
- data/third_party/boringssl/crypto/poly1305/poly1305_vec.c +4 -55
- data/third_party/boringssl/crypto/rsa_extra/rsa_asn1.c +3 -22
- data/third_party/boringssl/crypto/x509/by_dir.c +1 -3
- data/third_party/boringssl/crypto/x509/by_file.c +0 -1
- data/third_party/boringssl/crypto/x509/x509_lu.c +0 -1
- data/third_party/boringssl/crypto/x509/x509_obj.c +1 -3
- data/third_party/boringssl/crypto/x509/x509_txt.c +0 -6
- data/third_party/boringssl/crypto/x509/x509_vfy.c +0 -1
- data/third_party/boringssl/crypto/x509/x509_vpm.c +0 -1
- data/third_party/boringssl/crypto/x509/x_algor.c +2 -2
- data/third_party/boringssl/crypto/x509v3/v3_alt.c +3 -4
- data/third_party/boringssl/crypto/x509v3/v3_genn.c +1 -0
- data/third_party/boringssl/crypto/x509v3/v3_info.c +1 -2
- data/third_party/boringssl/crypto/x509v3/v3_lib.c +15 -7
- data/third_party/boringssl/crypto/x509v3/v3_utl.c +41 -2
- data/third_party/boringssl/include/openssl/asn1.h +0 -1
- data/third_party/boringssl/include/openssl/base.h +1 -1
- data/third_party/boringssl/include/openssl/bio.h +5 -2
- data/third_party/boringssl/include/openssl/bn.h +2 -17
- data/third_party/boringssl/include/openssl/buf.h +4 -0
- data/third_party/boringssl/include/openssl/bytestring.h +11 -0
- data/third_party/boringssl/include/openssl/chacha.h +5 -1
- data/third_party/boringssl/include/openssl/cipher.h +10 -0
- data/third_party/boringssl/include/openssl/conf.h +4 -8
- data/third_party/boringssl/include/openssl/dsa.h +2 -18
- data/third_party/boringssl/include/openssl/ec.h +5 -5
- data/third_party/boringssl/include/openssl/ecdsa.h +10 -28
- data/third_party/boringssl/include/openssl/evp.h +0 -4
- data/third_party/boringssl/include/openssl/lhash.h +1 -18
- data/third_party/boringssl/include/openssl/obj.h +1 -0
- data/third_party/boringssl/include/openssl/rsa.h +3 -4
- data/third_party/boringssl/include/openssl/ssl.h +35 -54
- data/third_party/boringssl/include/openssl/ssl3.h +2 -0
- data/third_party/boringssl/include/openssl/stack.h +1 -1
- data/third_party/boringssl/include/openssl/tls1.h +1 -16
- data/third_party/boringssl/include/openssl/x509.h +3 -2
- data/third_party/boringssl/include/openssl/x509_vfy.h +0 -2
- data/third_party/boringssl/include/openssl/x509v3.h +1 -0
- data/third_party/boringssl/ssl/custom_extensions.cc +1 -1
- data/third_party/boringssl/ssl/d1_both.cc +120 -129
- data/third_party/boringssl/ssl/d1_lib.cc +23 -21
- data/third_party/boringssl/ssl/d1_pkt.cc +39 -143
- data/third_party/boringssl/ssl/dtls_method.cc +16 -23
- data/third_party/boringssl/ssl/dtls_record.cc +11 -4
- data/third_party/boringssl/ssl/handshake.cc +109 -40
- data/third_party/boringssl/ssl/handshake_client.cc +104 -96
- data/third_party/boringssl/ssl/handshake_server.cc +62 -72
- data/third_party/boringssl/ssl/internal.h +397 -318
- data/third_party/boringssl/ssl/s3_both.cc +173 -191
- data/third_party/boringssl/ssl/s3_lib.cc +26 -34
- data/third_party/boringssl/ssl/s3_pkt.cc +105 -247
- data/third_party/boringssl/ssl/ssl_asn1.cc +22 -22
- data/third_party/boringssl/ssl/ssl_buffer.cc +98 -108
- data/third_party/boringssl/ssl/ssl_cert.cc +12 -1
- data/third_party/boringssl/ssl/ssl_cipher.cc +23 -28
- data/third_party/boringssl/ssl/ssl_key_share.cc +11 -6
- data/third_party/boringssl/ssl/ssl_lib.cc +190 -113
- data/third_party/boringssl/ssl/ssl_privkey.cc +76 -106
- data/third_party/boringssl/ssl/ssl_session.cc +3 -3
- data/third_party/boringssl/ssl/ssl_stat.cc +3 -3
- data/third_party/boringssl/ssl/ssl_transcript.cc +38 -22
- data/third_party/boringssl/ssl/ssl_versions.cc +64 -31
- data/third_party/boringssl/ssl/t1_enc.cc +137 -154
- data/third_party/boringssl/ssl/t1_lib.cc +463 -478
- data/third_party/boringssl/ssl/tls13_both.cc +57 -58
- data/third_party/boringssl/ssl/tls13_client.cc +256 -121
- data/third_party/boringssl/ssl/tls13_enc.cc +187 -72
- data/third_party/boringssl/ssl/tls13_server.cc +187 -86
- data/third_party/boringssl/ssl/tls_method.cc +20 -30
- data/third_party/boringssl/ssl/tls_record.cc +77 -40
- data/third_party/boringssl/third_party/fiat/curve25519.c +5062 -0
- data/third_party/boringssl/{crypto/curve25519 → third_party/fiat}/internal.h +40 -27
- data/third_party/nanopb/pb.h +1 -1
- metadata +147 -45
- data/src/core/lib/gpr/thd.cc +0 -49
- data/src/core/lib/gpr/thd.h +0 -71
- data/src/core/lib/gpr/thd_posix.cc +0 -154
- data/src/core/lib/gpr/thd_windows.cc +0 -107
- data/src/core/lib/iomgr/iomgr_uv.h +0 -37
- data/src/core/lib/iomgr/pollset_set_uv.cc +0 -43
- data/src/core/lib/iomgr/resolve_address_uv.cc +0 -284
- data/src/core/lib/iomgr/tcp_client_uv.cc +0 -175
- data/src/core/lib/iomgr/tcp_server_uv.cc +0 -471
- data/src/core/lib/iomgr/tcp_uv.h +0 -51
- data/src/core/lib/security/transport/lb_targets_info.cc +0 -59
- data/src/core/lib/slice/slice_hash_table.cc +0 -145
- data/third_party/boringssl/crypto/curve25519/curve25519.c +0 -4938
@@ -171,13 +171,13 @@ class X25519KeyShare : public SSLKeyShare {
|
|
171
171
|
CONSTEXPR_ARRAY struct {
|
172
172
|
int nid;
|
173
173
|
uint16_t group_id;
|
174
|
-
const char name[8];
|
174
|
+
const char name[8], alias[11];
|
175
175
|
} kNamedGroups[] = {
|
176
|
-
{NID_secp224r1, SSL_CURVE_SECP224R1, "P-224"},
|
177
|
-
{NID_X9_62_prime256v1, SSL_CURVE_SECP256R1, "P-256"},
|
178
|
-
{NID_secp384r1, SSL_CURVE_SECP384R1, "P-384"},
|
179
|
-
{NID_secp521r1, SSL_CURVE_SECP521R1, "P-521"},
|
180
|
-
{NID_X25519, SSL_CURVE_X25519, "X25519"},
|
176
|
+
{NID_secp224r1, SSL_CURVE_SECP224R1, "P-224", "secp224r1"},
|
177
|
+
{NID_X9_62_prime256v1, SSL_CURVE_SECP256R1, "P-256", "prime256v1"},
|
178
|
+
{NID_secp384r1, SSL_CURVE_SECP384R1, "P-384", "secp384r1"},
|
179
|
+
{NID_secp521r1, SSL_CURVE_SECP521R1, "P-521", "secp521r1"},
|
180
|
+
{NID_X25519, SSL_CURVE_X25519, "X25519", "x25519"},
|
181
181
|
};
|
182
182
|
|
183
183
|
} // namespace
|
@@ -227,6 +227,11 @@ int ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len) {
|
|
227
227
|
*out_group_id = group.group_id;
|
228
228
|
return 1;
|
229
229
|
}
|
230
|
+
if (len == strlen(group.alias) &&
|
231
|
+
!strncmp(group.alias, name, len)) {
|
232
|
+
*out_group_id = group.group_id;
|
233
|
+
return 1;
|
234
|
+
}
|
230
235
|
}
|
231
236
|
return 0;
|
232
237
|
}
|
@@ -201,11 +201,24 @@ bool CBBFinishArray(CBB *cbb, Array<uint8_t> *out) {
|
|
201
201
|
void ssl_reset_error_state(SSL *ssl) {
|
202
202
|
// Functions which use |SSL_get_error| must reset I/O and error state on
|
203
203
|
// entry.
|
204
|
-
ssl->rwstate = SSL_NOTHING;
|
204
|
+
ssl->s3->rwstate = SSL_NOTHING;
|
205
205
|
ERR_clear_error();
|
206
206
|
ERR_clear_system_error();
|
207
207
|
}
|
208
208
|
|
209
|
+
void ssl_set_read_error(SSL* ssl) {
|
210
|
+
ssl->s3->read_shutdown = ssl_shutdown_error;
|
211
|
+
ssl->s3->read_error.reset(ERR_save_state());
|
212
|
+
}
|
213
|
+
|
214
|
+
static bool check_read_error(const SSL *ssl) {
|
215
|
+
if (ssl->s3->read_shutdown == ssl_shutdown_error) {
|
216
|
+
ERR_restore_state(ssl->s3->read_error.get());
|
217
|
+
return false;
|
218
|
+
}
|
219
|
+
return true;
|
220
|
+
}
|
221
|
+
|
209
222
|
int ssl_can_write(const SSL *ssl) {
|
210
223
|
return !SSL_in_init(ssl) || ssl->s3->hs->can_early_write;
|
211
224
|
}
|
@@ -214,6 +227,51 @@ int ssl_can_read(const SSL *ssl) {
|
|
214
227
|
return !SSL_in_init(ssl) || ssl->s3->hs->can_early_read;
|
215
228
|
}
|
216
229
|
|
230
|
+
ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed,
|
231
|
+
uint8_t *out_alert, Span<uint8_t> in) {
|
232
|
+
*out_consumed = 0;
|
233
|
+
if (!check_read_error(ssl)) {
|
234
|
+
*out_alert = 0;
|
235
|
+
return ssl_open_record_error;
|
236
|
+
}
|
237
|
+
auto ret = ssl->method->open_handshake(ssl, out_consumed, out_alert, in);
|
238
|
+
if (ret == ssl_open_record_error) {
|
239
|
+
ssl_set_read_error(ssl);
|
240
|
+
}
|
241
|
+
return ret;
|
242
|
+
}
|
243
|
+
|
244
|
+
ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed,
|
245
|
+
uint8_t *out_alert,
|
246
|
+
Span<uint8_t> in) {
|
247
|
+
*out_consumed = 0;
|
248
|
+
if (!check_read_error(ssl)) {
|
249
|
+
*out_alert = 0;
|
250
|
+
return ssl_open_record_error;
|
251
|
+
}
|
252
|
+
auto ret =
|
253
|
+
ssl->method->open_change_cipher_spec(ssl, out_consumed, out_alert, in);
|
254
|
+
if (ret == ssl_open_record_error) {
|
255
|
+
ssl_set_read_error(ssl);
|
256
|
+
}
|
257
|
+
return ret;
|
258
|
+
}
|
259
|
+
|
260
|
+
ssl_open_record_t ssl_open_app_data(SSL *ssl, Span<uint8_t> *out,
|
261
|
+
size_t *out_consumed, uint8_t *out_alert,
|
262
|
+
Span<uint8_t> in) {
|
263
|
+
*out_consumed = 0;
|
264
|
+
if (!check_read_error(ssl)) {
|
265
|
+
*out_alert = 0;
|
266
|
+
return ssl_open_record_error;
|
267
|
+
}
|
268
|
+
auto ret = ssl->method->open_app_data(ssl, out, out_consumed, out_alert, in);
|
269
|
+
if (ret == ssl_open_record_error) {
|
270
|
+
ssl_set_read_error(ssl);
|
271
|
+
}
|
272
|
+
return ret;
|
273
|
+
}
|
274
|
+
|
217
275
|
void ssl_cipher_preference_list_free(
|
218
276
|
struct ssl_cipher_preference_list_st *cipher_list) {
|
219
277
|
if (cipher_list == NULL) {
|
@@ -241,16 +299,16 @@ void ssl_update_cache(SSL_HANDSHAKE *hs, int mode) {
|
|
241
299
|
// A client may see new sessions on abbreviated handshakes if the server
|
242
300
|
// decides to renew the ticket. Once the handshake is completed, it should be
|
243
301
|
// inserted into the cache.
|
244
|
-
if (ssl->s3->established_session != ssl->session ||
|
302
|
+
if (ssl->s3->established_session.get() != ssl->session ||
|
245
303
|
(!ssl->server && hs->ticket_expected)) {
|
246
304
|
if (use_internal_cache) {
|
247
|
-
SSL_CTX_add_session(ctx, ssl->s3->established_session);
|
305
|
+
SSL_CTX_add_session(ctx, ssl->s3->established_session.get());
|
248
306
|
}
|
249
307
|
if (ctx->new_session_cb != NULL) {
|
250
|
-
SSL_SESSION_up_ref(ssl->s3->established_session);
|
251
|
-
if (!ctx->new_session_cb(ssl, ssl->s3->established_session)) {
|
308
|
+
SSL_SESSION_up_ref(ssl->s3->established_session.get());
|
309
|
+
if (!ctx->new_session_cb(ssl, ssl->s3->established_session.get())) {
|
252
310
|
// |new_session_cb|'s return value signals whether it took ownership.
|
253
|
-
SSL_SESSION_free(ssl->s3->established_session);
|
311
|
+
SSL_SESSION_free(ssl->s3->established_session.get());
|
254
312
|
}
|
255
313
|
}
|
256
314
|
}
|
@@ -317,19 +375,6 @@ int ssl_log_secret(const SSL *ssl, const char *label, const uint8_t *secret,
|
|
317
375
|
return 1;
|
318
376
|
}
|
319
377
|
|
320
|
-
int ssl3_can_false_start(const SSL *ssl) {
|
321
|
-
const SSL_CIPHER *const cipher = SSL_get_current_cipher(ssl);
|
322
|
-
|
323
|
-
// False Start only for TLS 1.2 with an ECDHE+AEAD cipher and ALPN or NPN.
|
324
|
-
return !SSL_is_dtls(ssl) &&
|
325
|
-
SSL_version(ssl) == TLS1_2_VERSION &&
|
326
|
-
(ssl->s3->alpn_selected != NULL ||
|
327
|
-
ssl->s3->next_proto_negotiated != NULL) &&
|
328
|
-
cipher != NULL &&
|
329
|
-
cipher->algorithm_mkey == SSL_kECDHE &&
|
330
|
-
cipher->algorithm_mac == SSL_AEAD;
|
331
|
-
}
|
332
|
-
|
333
378
|
void ssl_do_info_callback(const SSL *ssl, int type, int value) {
|
334
379
|
void (*cb)(const SSL *ssl, int type, int value) = NULL;
|
335
380
|
if (ssl->info_callback != NULL) {
|
@@ -671,8 +716,6 @@ SSL *SSL_new(SSL_CTX *ctx) {
|
|
671
716
|
goto err;
|
672
717
|
}
|
673
718
|
|
674
|
-
ssl->rwstate = SSL_NOTHING;
|
675
|
-
|
676
719
|
CRYPTO_new_ex_data(&ssl->ex_data);
|
677
720
|
|
678
721
|
ssl->psk_identity_hint = NULL;
|
@@ -717,8 +760,6 @@ void SSL_free(SSL *ssl) {
|
|
717
760
|
BIO_free_all(ssl->rbio);
|
718
761
|
BIO_free_all(ssl->wbio);
|
719
762
|
|
720
|
-
BUF_MEM_free(ssl->init_buf);
|
721
|
-
|
722
763
|
// add extra stuff
|
723
764
|
ssl_cipher_preference_list_free(ssl->cipher_list);
|
724
765
|
|
@@ -744,12 +785,12 @@ void SSL_free(SSL *ssl) {
|
|
744
785
|
}
|
745
786
|
|
746
787
|
void SSL_set_connect_state(SSL *ssl) {
|
747
|
-
ssl->server =
|
788
|
+
ssl->server = false;
|
748
789
|
ssl->do_handshake = ssl_client_handshake;
|
749
790
|
}
|
750
791
|
|
751
792
|
void SSL_set_accept_state(SSL *ssl) {
|
752
|
-
ssl->server =
|
793
|
+
ssl->server = true;
|
753
794
|
ssl->do_handshake = ssl_server_handshake;
|
754
795
|
}
|
755
796
|
|
@@ -814,7 +855,7 @@ int SSL_do_handshake(SSL *ssl) {
|
|
814
855
|
}
|
815
856
|
|
816
857
|
// Run the handshake.
|
817
|
-
SSL_HANDSHAKE *hs = ssl->s3->hs;
|
858
|
+
SSL_HANDSHAKE *hs = ssl->s3->hs.get();
|
818
859
|
|
819
860
|
bool early_return = false;
|
820
861
|
int ret = ssl_run_handshake(hs, &early_return);
|
@@ -826,8 +867,7 @@ int SSL_do_handshake(SSL *ssl) {
|
|
826
867
|
|
827
868
|
// Destroy the handshake object if the handshake has completely finished.
|
828
869
|
if (!early_return) {
|
829
|
-
|
830
|
-
ssl->s3->hs = NULL;
|
870
|
+
ssl->s3->hs.reset();
|
831
871
|
}
|
832
872
|
|
833
873
|
return 1;
|
@@ -852,7 +892,7 @@ int SSL_accept(SSL *ssl) {
|
|
852
892
|
}
|
853
893
|
|
854
894
|
static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) {
|
855
|
-
if (
|
895
|
+
if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) {
|
856
896
|
return tls13_post_handshake(ssl, msg);
|
857
897
|
}
|
858
898
|
|
@@ -864,7 +904,7 @@ static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) {
|
|
864
904
|
}
|
865
905
|
|
866
906
|
if (msg.type != SSL3_MT_HELLO_REQUEST || CBS_len(&msg.body) != 0) {
|
867
|
-
|
907
|
+
ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR);
|
868
908
|
OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HELLO_REQUEST);
|
869
909
|
return 0;
|
870
910
|
}
|
@@ -891,17 +931,18 @@ static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) {
|
|
891
931
|
// protocol, namely in HTTPS, just before reading the HTTP response. Require
|
892
932
|
// the record-layer be idle and avoid complexities of sending a handshake
|
893
933
|
// record while an application_data record is being written.
|
894
|
-
if (
|
934
|
+
if (!ssl->s3->write_buffer.empty() ||
|
935
|
+
ssl->s3->write_shutdown != ssl_shutdown_none) {
|
895
936
|
goto no_renegotiation;
|
896
937
|
}
|
897
938
|
|
898
939
|
// Begin a new handshake.
|
899
|
-
if (ssl->s3->hs !=
|
940
|
+
if (ssl->s3->hs != nullptr) {
|
900
941
|
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
|
901
942
|
return 0;
|
902
943
|
}
|
903
944
|
ssl->s3->hs = ssl_handshake_new(ssl);
|
904
|
-
if (ssl->s3->hs ==
|
945
|
+
if (ssl->s3->hs == nullptr) {
|
905
946
|
return 0;
|
906
947
|
}
|
907
948
|
|
@@ -909,12 +950,12 @@ static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) {
|
|
909
950
|
return 1;
|
910
951
|
|
911
952
|
no_renegotiation:
|
912
|
-
ssl3_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION);
|
913
953
|
OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION);
|
954
|
+
ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION);
|
914
955
|
return 0;
|
915
956
|
}
|
916
957
|
|
917
|
-
static int ssl_read_impl(SSL *ssl
|
958
|
+
static int ssl_read_impl(SSL *ssl) {
|
918
959
|
ssl_reset_error_state(ssl);
|
919
960
|
|
920
961
|
if (ssl->do_handshake == NULL) {
|
@@ -922,7 +963,12 @@ static int ssl_read_impl(SSL *ssl, void *buf, int num, int peek) {
|
|
922
963
|
return -1;
|
923
964
|
}
|
924
965
|
|
925
|
-
|
966
|
+
// Replay post-handshake message errors.
|
967
|
+
if (!check_read_error(ssl)) {
|
968
|
+
return -1;
|
969
|
+
}
|
970
|
+
|
971
|
+
while (ssl->s3->pending_app_data.empty()) {
|
926
972
|
// Complete the current handshake, if any. False Start will cause
|
927
973
|
// |SSL_do_handshake| to return mid-handshake, so this may require multiple
|
928
974
|
// iterations.
|
@@ -937,37 +983,70 @@ static int ssl_read_impl(SSL *ssl, void *buf, int num, int peek) {
|
|
937
983
|
}
|
938
984
|
}
|
939
985
|
|
940
|
-
|
941
|
-
int ret = ssl->method->read_app_data(ssl, &got_handshake, (uint8_t *)buf,
|
942
|
-
num, peek);
|
943
|
-
if (ret > 0 || !got_handshake) {
|
944
|
-
ssl->s3->key_update_count = 0;
|
945
|
-
return ret;
|
946
|
-
}
|
947
|
-
|
948
|
-
// If we received an interrupt in early read (the end_of_early_data alert),
|
949
|
-
// loop again for the handshake to process it.
|
950
|
-
if (SSL_in_init(ssl)) {
|
951
|
-
continue;
|
952
|
-
}
|
953
|
-
|
986
|
+
// Process any buffered post-handshake messages.
|
954
987
|
SSLMessage msg;
|
955
|
-
|
988
|
+
if (ssl->method->get_message(ssl, &msg)) {
|
989
|
+
// If we received an interrupt in early read (EndOfEarlyData), loop again
|
990
|
+
// for the handshake to process it.
|
991
|
+
if (SSL_in_init(ssl)) {
|
992
|
+
ssl->s3->hs->can_early_read = false;
|
993
|
+
continue;
|
994
|
+
}
|
995
|
+
|
956
996
|
// Handle the post-handshake message and try again.
|
957
997
|
if (!ssl_do_post_handshake(ssl, msg)) {
|
998
|
+
ssl_set_read_error(ssl);
|
958
999
|
return -1;
|
959
1000
|
}
|
960
1001
|
ssl->method->next_message(ssl);
|
1002
|
+
continue; // Loop again. We may have begun a new handshake.
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
uint8_t alert = SSL_AD_DECODE_ERROR;
|
1006
|
+
size_t consumed = 0;
|
1007
|
+
auto ret = ssl_open_app_data(ssl, &ssl->s3->pending_app_data, &consumed,
|
1008
|
+
&alert, ssl->s3->read_buffer.span());
|
1009
|
+
bool retry;
|
1010
|
+
int bio_ret = ssl_handle_open_record(ssl, &retry, ret, consumed, alert);
|
1011
|
+
if (bio_ret <= 0) {
|
1012
|
+
return bio_ret;
|
1013
|
+
}
|
1014
|
+
if (!retry) {
|
1015
|
+
assert(!ssl->s3->pending_app_data.empty());
|
1016
|
+
ssl->s3->key_update_count = 0;
|
961
1017
|
}
|
962
1018
|
}
|
1019
|
+
|
1020
|
+
return 1;
|
963
1021
|
}
|
964
1022
|
|
965
1023
|
int SSL_read(SSL *ssl, void *buf, int num) {
|
966
|
-
|
1024
|
+
int ret = SSL_peek(ssl, buf, num);
|
1025
|
+
if (ret <= 0) {
|
1026
|
+
return ret;
|
1027
|
+
}
|
1028
|
+
// TODO(davidben): In DTLS, should the rest of the record be discarded? DTLS
|
1029
|
+
// is not a stream. See https://crbug.com/boringssl/65.
|
1030
|
+
ssl->s3->pending_app_data =
|
1031
|
+
ssl->s3->pending_app_data.subspan(static_cast<size_t>(ret));
|
1032
|
+
if (ssl->s3->pending_app_data.empty()) {
|
1033
|
+
ssl->s3->read_buffer.DiscardConsumed();
|
1034
|
+
}
|
1035
|
+
return ret;
|
967
1036
|
}
|
968
1037
|
|
969
1038
|
int SSL_peek(SSL *ssl, void *buf, int num) {
|
970
|
-
|
1039
|
+
int ret = ssl_read_impl(ssl);
|
1040
|
+
if (ret <= 0) {
|
1041
|
+
return ret;
|
1042
|
+
}
|
1043
|
+
if (num <= 0) {
|
1044
|
+
return num;
|
1045
|
+
}
|
1046
|
+
size_t todo =
|
1047
|
+
std::min(ssl->s3->pending_app_data.size(), static_cast<size_t>(num));
|
1048
|
+
OPENSSL_memcpy(buf, ssl->s3->pending_app_data.data(), todo);
|
1049
|
+
return static_cast<int>(todo);
|
971
1050
|
}
|
972
1051
|
|
973
1052
|
int SSL_write(SSL *ssl, const void *buf, int num) {
|
@@ -1032,7 +1111,7 @@ int SSL_shutdown(SSL *ssl) {
|
|
1032
1111
|
|
1033
1112
|
if (ssl->s3->write_shutdown != ssl_shutdown_close_notify) {
|
1034
1113
|
// Send a close_notify.
|
1035
|
-
if (
|
1114
|
+
if (ssl_send_alert(ssl, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY) <= 0) {
|
1036
1115
|
return -1;
|
1037
1116
|
}
|
1038
1117
|
} else if (ssl->s3->alert_dispatch) {
|
@@ -1041,10 +1120,28 @@ int SSL_shutdown(SSL *ssl) {
|
|
1041
1120
|
return -1;
|
1042
1121
|
}
|
1043
1122
|
} else if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) {
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1123
|
+
if (SSL_is_dtls(ssl)) {
|
1124
|
+
// Bidirectional shutdown doesn't make sense for an unordered
|
1125
|
+
// transport. DTLS alerts also aren't delivered reliably, so we may even
|
1126
|
+
// time out because the peer never received our close_notify. Report to
|
1127
|
+
// the caller that the channel has fully shut down.
|
1128
|
+
if (ssl->s3->read_shutdown == ssl_shutdown_error) {
|
1129
|
+
ERR_restore_state(ssl->s3->read_error.get());
|
1130
|
+
return -1;
|
1131
|
+
}
|
1132
|
+
ssl->s3->read_shutdown = ssl_shutdown_close_notify;
|
1133
|
+
} else {
|
1134
|
+
// Keep discarding data until we see a close_notify.
|
1135
|
+
for (;;) {
|
1136
|
+
ssl->s3->pending_app_data = Span<uint8_t>();
|
1137
|
+
int ret = ssl_read_impl(ssl);
|
1138
|
+
if (ret <= 0) {
|
1139
|
+
break;
|
1140
|
+
}
|
1141
|
+
}
|
1142
|
+
if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) {
|
1143
|
+
return -1;
|
1144
|
+
}
|
1048
1145
|
}
|
1049
1146
|
}
|
1050
1147
|
|
@@ -1063,7 +1160,7 @@ int SSL_send_fatal_alert(SSL *ssl, uint8_t alert) {
|
|
1063
1160
|
return ssl->method->dispatch_alert(ssl);
|
1064
1161
|
}
|
1065
1162
|
|
1066
|
-
return
|
1163
|
+
return ssl_send_alert(ssl, SSL3_AL_FATAL, alert);
|
1067
1164
|
}
|
1068
1165
|
|
1069
1166
|
void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled) {
|
@@ -1094,7 +1191,7 @@ int SSL_early_data_accepted(const SSL *ssl) {
|
|
1094
1191
|
}
|
1095
1192
|
|
1096
1193
|
void SSL_reset_early_data_reject(SSL *ssl) {
|
1097
|
-
SSL_HANDSHAKE *hs = ssl->s3->hs;
|
1194
|
+
SSL_HANDSHAKE *hs = ssl->s3->hs.get();
|
1098
1195
|
if (hs == NULL ||
|
1099
1196
|
hs->wait != ssl_hs_early_data_rejected) {
|
1100
1197
|
abort();
|
@@ -1146,7 +1243,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
|
|
1146
1243
|
return SSL_ERROR_SYSCALL;
|
1147
1244
|
}
|
1148
1245
|
|
1149
|
-
switch (ssl->rwstate) {
|
1246
|
+
switch (ssl->s3->rwstate) {
|
1150
1247
|
case SSL_PENDING_SESSION:
|
1151
1248
|
return SSL_ERROR_PENDING_SESSION;
|
1152
1249
|
|
@@ -1272,8 +1369,8 @@ int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, size_t *out_len,
|
|
1272
1369
|
|
1273
1370
|
// tls-unique is not defined for SSL 3.0 or TLS 1.3.
|
1274
1371
|
if (!ssl->s3->initial_handshake_complete ||
|
1275
|
-
|
1276
|
-
|
1372
|
+
ssl_protocol_version(ssl) < TLS1_VERSION ||
|
1373
|
+
ssl_protocol_version(ssl) >= TLS1_3_VERSION) {
|
1277
1374
|
return 0;
|
1278
1375
|
}
|
1279
1376
|
|
@@ -1411,8 +1508,8 @@ static size_t copy_finished(void *out, size_t out_len, const uint8_t *in,
|
|
1411
1508
|
|
1412
1509
|
size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count) {
|
1413
1510
|
if (!ssl->s3->initial_handshake_complete ||
|
1414
|
-
|
1415
|
-
|
1511
|
+
ssl_protocol_version(ssl) < TLS1_VERSION ||
|
1512
|
+
ssl_protocol_version(ssl) >= TLS1_3_VERSION) {
|
1416
1513
|
return 0;
|
1417
1514
|
}
|
1418
1515
|
|
@@ -1427,8 +1524,8 @@ size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count) {
|
|
1427
1524
|
|
1428
1525
|
size_t SSL_get_peer_finished(const SSL *ssl, void *buf, size_t count) {
|
1429
1526
|
if (!ssl->s3->initial_handshake_complete ||
|
1430
|
-
|
1431
|
-
|
1527
|
+
ssl_protocol_version(ssl) < TLS1_VERSION ||
|
1528
|
+
ssl_protocol_version(ssl) >= TLS1_3_VERSION) {
|
1432
1529
|
return 0;
|
1433
1530
|
}
|
1434
1531
|
|
@@ -1449,7 +1546,7 @@ int SSL_get_extms_support(const SSL *ssl) {
|
|
1449
1546
|
if (!ssl->s3->have_version) {
|
1450
1547
|
return 0;
|
1451
1548
|
}
|
1452
|
-
if (
|
1549
|
+
if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) {
|
1453
1550
|
return 1;
|
1454
1551
|
}
|
1455
1552
|
|
@@ -1475,10 +1572,7 @@ void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes) { }
|
|
1475
1572
|
void SSL_set_read_ahead(SSL *ssl, int yes) { }
|
1476
1573
|
|
1477
1574
|
int SSL_pending(const SSL *ssl) {
|
1478
|
-
|
1479
|
-
return 0;
|
1480
|
-
}
|
1481
|
-
return ssl->s3->rrec.length;
|
1575
|
+
return static_cast<int>(ssl->s3->pending_app_data.size());
|
1482
1576
|
}
|
1483
1577
|
|
1484
1578
|
// Fix this so it checks all the valid key/cert options
|
@@ -1567,7 +1661,7 @@ int SSL_get_secure_renegotiation_support(const SSL *ssl) {
|
|
1567
1661
|
if (!ssl->s3->have_version) {
|
1568
1662
|
return 0;
|
1569
1663
|
}
|
1570
|
-
return
|
1664
|
+
return ssl_protocol_version(ssl) >= TLS1_3_VERSION ||
|
1571
1665
|
ssl->s3->send_connection_binding;
|
1572
1666
|
}
|
1573
1667
|
|
@@ -1740,23 +1834,19 @@ const char *SSL_get_cipher_list(const SSL *ssl, int n) {
|
|
1740
1834
|
}
|
1741
1835
|
|
1742
1836
|
int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) {
|
1743
|
-
return ssl_create_cipher_list(
|
1744
|
-
false /* not strict */);
|
1837
|
+
return ssl_create_cipher_list(&ctx->cipher_list, str, false /* not strict */);
|
1745
1838
|
}
|
1746
1839
|
|
1747
1840
|
int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, const char *str) {
|
1748
|
-
return ssl_create_cipher_list(
|
1749
|
-
true /* strict */);
|
1841
|
+
return ssl_create_cipher_list(&ctx->cipher_list, str, true /* strict */);
|
1750
1842
|
}
|
1751
1843
|
|
1752
1844
|
int SSL_set_cipher_list(SSL *ssl, const char *str) {
|
1753
|
-
return ssl_create_cipher_list(
|
1754
|
-
false /* not strict */);
|
1845
|
+
return ssl_create_cipher_list(&ssl->cipher_list, str, false /* not strict */);
|
1755
1846
|
}
|
1756
1847
|
|
1757
1848
|
int SSL_set_strict_cipher_list(SSL *ssl, const char *str) {
|
1758
|
-
return ssl_create_cipher_list(
|
1759
|
-
true /* strict */);
|
1849
|
+
return ssl_create_cipher_list(&ssl->cipher_list, str, true /* strict */);
|
1760
1850
|
}
|
1761
1851
|
|
1762
1852
|
const char *SSL_get_servername(const SSL *ssl, const int type) {
|
@@ -1770,7 +1860,7 @@ const char *SSL_get_servername(const SSL *ssl, const int type) {
|
|
1770
1860
|
return ssl->tlsext_hostname;
|
1771
1861
|
}
|
1772
1862
|
|
1773
|
-
return ssl->s3->hostname;
|
1863
|
+
return ssl->s3->hostname.get();
|
1774
1864
|
}
|
1775
1865
|
|
1776
1866
|
int SSL_get_servername_type(const SSL *ssl) {
|
@@ -1795,19 +1885,19 @@ void SSL_set_custom_verify(
|
|
1795
1885
|
}
|
1796
1886
|
|
1797
1887
|
void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx) {
|
1798
|
-
ctx->signed_cert_timestamps_enabled =
|
1888
|
+
ctx->signed_cert_timestamps_enabled = true;
|
1799
1889
|
}
|
1800
1890
|
|
1801
1891
|
void SSL_enable_signed_cert_timestamps(SSL *ssl) {
|
1802
|
-
ssl->signed_cert_timestamps_enabled =
|
1892
|
+
ssl->signed_cert_timestamps_enabled = true;
|
1803
1893
|
}
|
1804
1894
|
|
1805
1895
|
void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx) {
|
1806
|
-
ctx->ocsp_stapling_enabled =
|
1896
|
+
ctx->ocsp_stapling_enabled = true;
|
1807
1897
|
}
|
1808
1898
|
|
1809
1899
|
void SSL_enable_ocsp_stapling(SSL *ssl) {
|
1810
|
-
ssl->ocsp_stapling_enabled =
|
1900
|
+
ssl->ocsp_stapling_enabled = true;
|
1811
1901
|
}
|
1812
1902
|
|
1813
1903
|
void SSL_get0_signed_cert_timestamp_list(const SSL *ssl, const uint8_t **out,
|
@@ -1903,8 +1993,8 @@ found:
|
|
1903
1993
|
|
1904
1994
|
void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data,
|
1905
1995
|
unsigned *out_len) {
|
1906
|
-
*out_data = ssl->s3->next_proto_negotiated;
|
1907
|
-
*out_len = ssl->s3->
|
1996
|
+
*out_data = ssl->s3->next_proto_negotiated.data();
|
1997
|
+
*out_len = ssl->s3->next_proto_negotiated.size();
|
1908
1998
|
}
|
1909
1999
|
|
1910
2000
|
void SSL_CTX_set_next_protos_advertised_cb(
|
@@ -1961,8 +2051,8 @@ void SSL_get0_alpn_selected(const SSL *ssl, const uint8_t **out_data,
|
|
1961
2051
|
*out_data = ssl->s3->hs->early_session->early_alpn;
|
1962
2052
|
*out_len = ssl->s3->hs->early_session->early_alpn_len;
|
1963
2053
|
} else {
|
1964
|
-
*out_data = ssl->s3->alpn_selected;
|
1965
|
-
*out_len = ssl->s3->
|
2054
|
+
*out_data = ssl->s3->alpn_selected.data();
|
2055
|
+
*out_len = ssl->s3->alpn_selected.size();
|
1966
2056
|
}
|
1967
2057
|
}
|
1968
2058
|
|
@@ -2004,7 +2094,7 @@ int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, EVP_PKEY *private_key) {
|
|
2004
2094
|
EVP_PKEY_free(ctx->tlsext_channel_id_private);
|
2005
2095
|
EVP_PKEY_up_ref(private_key);
|
2006
2096
|
ctx->tlsext_channel_id_private = private_key;
|
2007
|
-
ctx->tlsext_channel_id_enabled =
|
2097
|
+
ctx->tlsext_channel_id_enabled = true;
|
2008
2098
|
|
2009
2099
|
return 1;
|
2010
2100
|
}
|
@@ -2018,7 +2108,7 @@ int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key) {
|
|
2018
2108
|
EVP_PKEY_free(ssl->tlsext_channel_id_private);
|
2019
2109
|
EVP_PKEY_up_ref(private_key);
|
2020
2110
|
ssl->tlsext_channel_id_private = private_key;
|
2021
|
-
ssl->tlsext_channel_id_enabled =
|
2111
|
+
ssl->tlsext_channel_id_enabled = true;
|
2022
2112
|
|
2023
2113
|
return 1;
|
2024
2114
|
}
|
@@ -2203,7 +2293,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
|
|
2203
2293
|
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
|
2204
2294
|
}
|
2205
2295
|
|
2206
|
-
int SSL_want(const SSL *ssl) { return ssl->rwstate; }
|
2296
|
+
int SSL_want(const SSL *ssl) { return ssl->s3->rwstate; }
|
2207
2297
|
|
2208
2298
|
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
|
2209
2299
|
RSA *(*cb)(SSL *ssl, int is_export,
|
@@ -2341,7 +2431,7 @@ int SSL_in_init(const SSL *ssl) {
|
|
2341
2431
|
// This returns false once all the handshake state has been finalized, to
|
2342
2432
|
// allow callbacks and getters based on SSL_in_init to return the correct
|
2343
2433
|
// values.
|
2344
|
-
SSL_HANDSHAKE *hs = ssl->s3->hs;
|
2434
|
+
SSL_HANDSHAKE *hs = ssl->s3->hs.get();
|
2345
2435
|
return hs != nullptr && !hs->handshake_finalized;
|
2346
2436
|
}
|
2347
2437
|
|
@@ -2454,7 +2544,7 @@ size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, size_t max_out) {
|
|
2454
2544
|
}
|
2455
2545
|
|
2456
2546
|
const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl) {
|
2457
|
-
SSL_HANDSHAKE *hs = ssl->s3->hs;
|
2547
|
+
SSL_HANDSHAKE *hs = ssl->s3->hs.get();
|
2458
2548
|
if (hs == NULL) {
|
2459
2549
|
return NULL;
|
2460
2550
|
}
|
@@ -2481,23 +2571,12 @@ int SSL_clear(SSL *ssl) {
|
|
2481
2571
|
// In OpenSSL, reusing a client |SSL| with |SSL_clear| causes the previously
|
2482
2572
|
// established session to be offered the next time around. wpa_supplicant
|
2483
2573
|
// depends on this behavior, so emulate it.
|
2484
|
-
SSL_SESSION
|
2574
|
+
UniquePtr<SSL_SESSION> session;
|
2485
2575
|
if (!ssl->server && ssl->s3->established_session != NULL) {
|
2486
|
-
session
|
2487
|
-
SSL_SESSION_up_ref(session);
|
2576
|
+
session.reset(ssl->s3->established_session.get());
|
2577
|
+
SSL_SESSION_up_ref(session.get());
|
2488
2578
|
}
|
2489
2579
|
|
2490
|
-
// TODO(davidben): Some state on |ssl| is reset both in |SSL_new| and
|
2491
|
-
// |SSL_clear| because it is per-connection state rather than configuration
|
2492
|
-
// state. Per-connection state should be on |ssl->s3| and |ssl->d1| so it is
|
2493
|
-
// naturally reset at the right points between |SSL_new|, |SSL_clear|, and
|
2494
|
-
// |ssl3_new|.
|
2495
|
-
|
2496
|
-
ssl->rwstate = SSL_NOTHING;
|
2497
|
-
|
2498
|
-
BUF_MEM_free(ssl->init_buf);
|
2499
|
-
ssl->init_buf = NULL;
|
2500
|
-
|
2501
2580
|
// The ssl->d1->mtu is simultaneously configuration (preserved across
|
2502
2581
|
// clear) and connection-specific state (gets reset).
|
2503
2582
|
//
|
@@ -2509,7 +2588,6 @@ int SSL_clear(SSL *ssl) {
|
|
2509
2588
|
|
2510
2589
|
ssl->method->ssl_free(ssl);
|
2511
2590
|
if (!ssl->method->ssl_new(ssl)) {
|
2512
|
-
SSL_SESSION_free(session);
|
2513
2591
|
return 0;
|
2514
2592
|
}
|
2515
2593
|
|
@@ -2517,9 +2595,8 @@ int SSL_clear(SSL *ssl) {
|
|
2517
2595
|
ssl->d1->mtu = mtu;
|
2518
2596
|
}
|
2519
2597
|
|
2520
|
-
if (session !=
|
2521
|
-
SSL_set_session(ssl, session);
|
2522
|
-
SSL_SESSION_free(session);
|
2598
|
+
if (session != nullptr) {
|
2599
|
+
SSL_set_session(ssl, session.get());
|
2523
2600
|
}
|
2524
2601
|
|
2525
2602
|
return 1;
|