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
@@ -152,49 +152,49 @@ namespace bssl {
|
|
152
152
|
|
153
153
|
static const unsigned kVersion = 1;
|
154
154
|
|
155
|
-
static const
|
155
|
+
static const unsigned kTimeTag =
|
156
156
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1;
|
157
|
-
static const
|
157
|
+
static const unsigned kTimeoutTag =
|
158
158
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 2;
|
159
|
-
static const
|
159
|
+
static const unsigned kPeerTag =
|
160
160
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 3;
|
161
|
-
static const
|
161
|
+
static const unsigned kSessionIDContextTag =
|
162
162
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 4;
|
163
|
-
static const
|
163
|
+
static const unsigned kVerifyResultTag =
|
164
164
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 5;
|
165
|
-
static const
|
165
|
+
static const unsigned kHostNameTag =
|
166
166
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 6;
|
167
|
-
static const
|
167
|
+
static const unsigned kPSKIdentityTag =
|
168
168
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 8;
|
169
|
-
static const
|
169
|
+
static const unsigned kTicketLifetimeHintTag =
|
170
170
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 9;
|
171
|
-
static const
|
171
|
+
static const unsigned kTicketTag =
|
172
172
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 10;
|
173
|
-
static const
|
173
|
+
static const unsigned kPeerSHA256Tag =
|
174
174
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 13;
|
175
|
-
static const
|
175
|
+
static const unsigned kOriginalHandshakeHashTag =
|
176
176
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 14;
|
177
|
-
static const
|
177
|
+
static const unsigned kSignedCertTimestampListTag =
|
178
178
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 15;
|
179
|
-
static const
|
179
|
+
static const unsigned kOCSPResponseTag =
|
180
180
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 16;
|
181
|
-
static const
|
181
|
+
static const unsigned kExtendedMasterSecretTag =
|
182
182
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 17;
|
183
|
-
static const
|
183
|
+
static const unsigned kGroupIDTag =
|
184
184
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 18;
|
185
|
-
static const
|
185
|
+
static const unsigned kCertChainTag =
|
186
186
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 19;
|
187
|
-
static const
|
187
|
+
static const unsigned kTicketAgeAddTag =
|
188
188
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 21;
|
189
|
-
static const
|
189
|
+
static const unsigned kIsServerTag =
|
190
190
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 22;
|
191
|
-
static const
|
191
|
+
static const unsigned kPeerSignatureAlgorithmTag =
|
192
192
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 23;
|
193
|
-
static const
|
193
|
+
static const unsigned kTicketMaxEarlyDataTag =
|
194
194
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 24;
|
195
|
-
static const
|
195
|
+
static const unsigned kAuthTimeoutTag =
|
196
196
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 25;
|
197
|
-
static const
|
197
|
+
static const unsigned kEarlyALPNTag =
|
198
198
|
CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 26;
|
199
199
|
|
200
200
|
static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, uint8_t **out_data,
|
@@ -36,17 +36,22 @@ static_assert(0xffff <= INT_MAX, "uint16_t does not fit in int");
|
|
36
36
|
static_assert((SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) == 0,
|
37
37
|
"SSL3_ALIGN_PAYLOAD must be a power of 2");
|
38
38
|
|
39
|
-
|
40
|
-
//
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
void SSLBuffer::Clear() {
|
40
|
+
free(buf_); // Allocated with malloc().
|
41
|
+
buf_ = nullptr;
|
42
|
+
offset_ = 0;
|
43
|
+
size_ = 0;
|
44
|
+
cap_ = 0;
|
45
|
+
}
|
46
|
+
|
47
|
+
bool SSLBuffer::EnsureCap(size_t header_len, size_t new_cap) {
|
48
|
+
if (new_cap > 0xffff) {
|
44
49
|
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
|
45
|
-
return
|
50
|
+
return false;
|
46
51
|
}
|
47
52
|
|
48
|
-
if (
|
49
|
-
return
|
53
|
+
if (cap_ >= new_cap) {
|
54
|
+
return true;
|
50
55
|
}
|
51
56
|
|
52
57
|
// Add up to |SSL3_ALIGN_PAYLOAD| - 1 bytes of slack for alignment.
|
@@ -54,88 +59,88 @@ static int ensure_buffer(SSL3_BUFFER *buf, size_t header_len, size_t cap) {
|
|
54
59
|
// Since this buffer gets allocated quite frequently and doesn't contain any
|
55
60
|
// sensitive data, we allocate with malloc rather than |OPENSSL_malloc| and
|
56
61
|
// avoid zeroing on free.
|
57
|
-
uint8_t *new_buf = (uint8_t *)malloc(
|
62
|
+
uint8_t *new_buf = (uint8_t *)malloc(new_cap + SSL3_ALIGN_PAYLOAD - 1);
|
58
63
|
if (new_buf == NULL) {
|
59
64
|
OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE);
|
60
|
-
return
|
65
|
+
return false;
|
61
66
|
}
|
62
67
|
|
63
68
|
// Offset the buffer such that the record body is aligned.
|
64
69
|
size_t new_offset =
|
65
70
|
(0 - header_len - (uintptr_t)new_buf) & (SSL3_ALIGN_PAYLOAD - 1);
|
66
71
|
|
67
|
-
if (
|
68
|
-
OPENSSL_memcpy(new_buf + new_offset,
|
69
|
-
free(
|
72
|
+
if (buf_ != NULL) {
|
73
|
+
OPENSSL_memcpy(new_buf + new_offset, buf_ + offset_, size_);
|
74
|
+
free(buf_); // Allocated with malloc().
|
70
75
|
}
|
71
76
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
return
|
77
|
+
buf_ = new_buf;
|
78
|
+
offset_ = new_offset;
|
79
|
+
cap_ = new_cap;
|
80
|
+
return true;
|
76
81
|
}
|
77
82
|
|
78
|
-
|
79
|
-
if (
|
83
|
+
void SSLBuffer::DidWrite(size_t new_size) {
|
84
|
+
if (new_size > cap() - size()) {
|
80
85
|
abort();
|
81
86
|
}
|
82
|
-
|
83
|
-
buf->len -= (uint16_t)len;
|
84
|
-
buf->cap -= (uint16_t)len;
|
87
|
+
size_ += new_size;
|
85
88
|
}
|
86
89
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
+
void SSLBuffer::Consume(size_t len) {
|
91
|
+
if (len > size_) {
|
92
|
+
abort();
|
93
|
+
}
|
94
|
+
offset_ += (uint16_t)len;
|
95
|
+
size_ -= (uint16_t)len;
|
96
|
+
cap_ -= (uint16_t)len;
|
90
97
|
}
|
91
98
|
|
92
|
-
|
93
|
-
|
94
|
-
|
99
|
+
void SSLBuffer::DiscardConsumed() {
|
100
|
+
if (size_ == 0) {
|
101
|
+
Clear();
|
102
|
+
}
|
95
103
|
}
|
96
104
|
|
97
105
|
static int dtls_read_buffer_next_packet(SSL *ssl) {
|
98
|
-
|
106
|
+
SSLBuffer *buf = &ssl->s3->read_buffer;
|
99
107
|
|
100
|
-
if (buf->
|
108
|
+
if (!buf->empty()) {
|
101
109
|
// It is an error to call |dtls_read_buffer_extend| when the read buffer is
|
102
110
|
// not empty.
|
103
111
|
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
|
104
112
|
return -1;
|
105
113
|
}
|
106
114
|
|
107
|
-
// Read a single packet from |ssl->rbio|. |buf->cap| must fit in an int.
|
108
|
-
int ret = BIO_read(ssl->rbio, buf->
|
115
|
+
// Read a single packet from |ssl->rbio|. |buf->cap()| must fit in an int.
|
116
|
+
int ret = BIO_read(ssl->rbio, buf->data(), static_cast<int>(buf->cap()));
|
109
117
|
if (ret <= 0) {
|
110
|
-
ssl->rwstate = SSL_READING;
|
118
|
+
ssl->s3->rwstate = SSL_READING;
|
111
119
|
return ret;
|
112
120
|
}
|
113
|
-
|
114
|
-
buf->len = (uint16_t)ret;
|
121
|
+
buf->DidWrite(static_cast<size_t>(ret));
|
115
122
|
return 1;
|
116
123
|
}
|
117
124
|
|
118
125
|
static int tls_read_buffer_extend_to(SSL *ssl, size_t len) {
|
119
|
-
|
126
|
+
SSLBuffer *buf = &ssl->s3->read_buffer;
|
120
127
|
|
121
|
-
if (len > buf->cap) {
|
128
|
+
if (len > buf->cap()) {
|
122
129
|
OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL);
|
123
130
|
return -1;
|
124
131
|
}
|
125
132
|
|
126
133
|
// Read until the target length is reached.
|
127
|
-
while (buf->
|
134
|
+
while (buf->size() < len) {
|
128
135
|
// The amount of data to read is bounded by |buf->cap|, which must fit in an
|
129
136
|
// int.
|
130
|
-
int ret = BIO_read(ssl->rbio, buf->
|
131
|
-
|
137
|
+
int ret = BIO_read(ssl->rbio, buf->data() + buf->size(),
|
138
|
+
static_cast<int>(len - buf->size()));
|
132
139
|
if (ret <= 0) {
|
133
|
-
ssl->rwstate = SSL_READING;
|
140
|
+
ssl->s3->rwstate = SSL_READING;
|
134
141
|
return ret;
|
135
142
|
}
|
136
|
-
|
137
|
-
// overflow.
|
138
|
-
buf->len += (uint16_t)ret;
|
143
|
+
buf->DidWrite(static_cast<size_t>(ret));
|
139
144
|
}
|
140
145
|
|
141
146
|
return 1;
|
@@ -143,7 +148,7 @@ static int tls_read_buffer_extend_to(SSL *ssl, size_t len) {
|
|
143
148
|
|
144
149
|
int ssl_read_buffer_extend_to(SSL *ssl, size_t len) {
|
145
150
|
// |ssl_read_buffer_extend_to| implicitly discards any consumed data.
|
146
|
-
|
151
|
+
ssl->s3->read_buffer.DiscardConsumed();
|
147
152
|
|
148
153
|
if (SSL_is_dtls(ssl)) {
|
149
154
|
static_assert(
|
@@ -154,7 +159,7 @@ int ssl_read_buffer_extend_to(SSL *ssl, size_t len) {
|
|
154
159
|
len = DTLS1_RT_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH;
|
155
160
|
}
|
156
161
|
|
157
|
-
if (!
|
162
|
+
if (!ssl->s3->read_buffer.EnsureCap(ssl_record_prefix_len(ssl), len)) {
|
158
163
|
return -1;
|
159
164
|
}
|
160
165
|
|
@@ -174,38 +179,51 @@ int ssl_read_buffer_extend_to(SSL *ssl, size_t len) {
|
|
174
179
|
if (ret <= 0) {
|
175
180
|
// If the buffer was empty originally and remained empty after attempting to
|
176
181
|
// extend it, release the buffer until the next attempt.
|
177
|
-
|
182
|
+
ssl->s3->read_buffer.DiscardConsumed();
|
178
183
|
}
|
179
184
|
return ret;
|
180
185
|
}
|
181
186
|
|
182
|
-
|
183
|
-
|
187
|
+
int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret,
|
188
|
+
size_t consumed, uint8_t alert) {
|
189
|
+
*out_retry = false;
|
190
|
+
if (ret != ssl_open_record_partial) {
|
191
|
+
ssl->s3->read_buffer.Consume(consumed);
|
192
|
+
}
|
193
|
+
if (ret != ssl_open_record_success) {
|
194
|
+
// Nothing was returned to the caller, so discard anything marked consumed.
|
195
|
+
ssl->s3->read_buffer.DiscardConsumed();
|
196
|
+
}
|
197
|
+
switch (ret) {
|
198
|
+
case ssl_open_record_success:
|
199
|
+
return 1;
|
200
|
+
|
201
|
+
case ssl_open_record_partial: {
|
202
|
+
int read_ret = ssl_read_buffer_extend_to(ssl, consumed);
|
203
|
+
if (read_ret <= 0) {
|
204
|
+
return read_ret;
|
205
|
+
}
|
206
|
+
*out_retry = true;
|
207
|
+
return 1;
|
208
|
+
}
|
184
209
|
|
185
|
-
|
210
|
+
case ssl_open_record_discard:
|
211
|
+
*out_retry = true;
|
212
|
+
return 1;
|
186
213
|
|
187
|
-
|
188
|
-
|
189
|
-
// |ssl_read_buffer_discard| will require a |memcpy| to shift the excess back
|
190
|
-
// to the front of the buffer, to ensure there is enough space for the next
|
191
|
-
// record.
|
192
|
-
assert(SSL_is_dtls(ssl) || len == 0 || buf->len == 0);
|
193
|
-
}
|
214
|
+
case ssl_open_record_close_notify:
|
215
|
+
return 0;
|
194
216
|
|
195
|
-
|
196
|
-
|
197
|
-
|
217
|
+
case ssl_open_record_error:
|
218
|
+
if (alert != 0) {
|
219
|
+
ssl_send_alert(ssl, SSL3_AL_FATAL, alert);
|
220
|
+
}
|
221
|
+
return -1;
|
198
222
|
}
|
223
|
+
assert(0);
|
224
|
+
return -1;
|
199
225
|
}
|
200
226
|
|
201
|
-
void ssl_read_buffer_clear(SSL *ssl) {
|
202
|
-
clear_buffer(&ssl->s3->read_buffer);
|
203
|
-
}
|
204
|
-
|
205
|
-
|
206
|
-
int ssl_write_buffer_is_pending(const SSL *ssl) {
|
207
|
-
return ssl->s3->write_buffer.len > 0;
|
208
|
-
}
|
209
227
|
|
210
228
|
static_assert(SSL3_RT_HEADER_LENGTH * 2 +
|
211
229
|
SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD * 2 +
|
@@ -218,61 +236,37 @@ static_assert(DTLS1_RT_HEADER_LENGTH + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD +
|
|
218
236
|
0xffff,
|
219
237
|
"maximum DTLS write buffer is too large");
|
220
238
|
|
221
|
-
int ssl_write_buffer_init(SSL *ssl, uint8_t **out_ptr, size_t max_len) {
|
222
|
-
SSL3_BUFFER *buf = &ssl->s3->write_buffer;
|
223
|
-
|
224
|
-
if (buf->buf != NULL) {
|
225
|
-
OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
|
226
|
-
return 0;
|
227
|
-
}
|
228
|
-
|
229
|
-
if (!ensure_buffer(buf, ssl_seal_align_prefix_len(ssl), max_len)) {
|
230
|
-
return 0;
|
231
|
-
}
|
232
|
-
*out_ptr = buf->buf + buf->offset;
|
233
|
-
return 1;
|
234
|
-
}
|
235
|
-
|
236
|
-
void ssl_write_buffer_set_len(SSL *ssl, size_t len) {
|
237
|
-
SSL3_BUFFER *buf = &ssl->s3->write_buffer;
|
238
|
-
|
239
|
-
if (len > buf->cap) {
|
240
|
-
abort();
|
241
|
-
}
|
242
|
-
buf->len = len;
|
243
|
-
}
|
244
|
-
|
245
239
|
static int tls_write_buffer_flush(SSL *ssl) {
|
246
|
-
|
240
|
+
SSLBuffer *buf = &ssl->s3->write_buffer;
|
247
241
|
|
248
|
-
while (buf->
|
249
|
-
int ret = BIO_write(ssl->wbio, buf->
|
242
|
+
while (!buf->empty()) {
|
243
|
+
int ret = BIO_write(ssl->wbio, buf->data(), buf->size());
|
250
244
|
if (ret <= 0) {
|
251
|
-
ssl->rwstate = SSL_WRITING;
|
245
|
+
ssl->s3->rwstate = SSL_WRITING;
|
252
246
|
return ret;
|
253
247
|
}
|
254
|
-
|
248
|
+
buf->Consume(static_cast<size_t>(ret));
|
255
249
|
}
|
256
|
-
|
250
|
+
buf->Clear();
|
257
251
|
return 1;
|
258
252
|
}
|
259
253
|
|
260
254
|
static int dtls_write_buffer_flush(SSL *ssl) {
|
261
|
-
|
262
|
-
if (buf->
|
255
|
+
SSLBuffer *buf = &ssl->s3->write_buffer;
|
256
|
+
if (buf->empty()) {
|
263
257
|
return 1;
|
264
258
|
}
|
265
259
|
|
266
|
-
int ret = BIO_write(ssl->wbio, buf->
|
260
|
+
int ret = BIO_write(ssl->wbio, buf->data(), buf->size());
|
267
261
|
if (ret <= 0) {
|
268
|
-
ssl->rwstate = SSL_WRITING;
|
262
|
+
ssl->s3->rwstate = SSL_WRITING;
|
269
263
|
// If the write failed, drop the write buffer anyway. Datagram transports
|
270
264
|
// can't write half a packet, so the caller is expected to retry from the
|
271
265
|
// top.
|
272
|
-
|
266
|
+
buf->Clear();
|
273
267
|
return ret;
|
274
268
|
}
|
275
|
-
|
269
|
+
buf->Clear();
|
276
270
|
return 1;
|
277
271
|
}
|
278
272
|
|
@@ -289,8 +283,4 @@ int ssl_write_buffer_flush(SSL *ssl) {
|
|
289
283
|
}
|
290
284
|
}
|
291
285
|
|
292
|
-
void ssl_write_buffer_clear(SSL *ssl) {
|
293
|
-
clear_buffer(&ssl->s3->write_buffer);
|
294
|
-
}
|
295
|
-
|
296
286
|
} // namespace bssl
|
@@ -704,6 +704,17 @@ UniquePtr<STACK_OF(CRYPTO_BUFFER)> ssl_parse_client_CA_list(SSL *ssl,
|
|
704
704
|
return ret;
|
705
705
|
}
|
706
706
|
|
707
|
+
bool ssl_has_client_CAs(SSL *ssl) {
|
708
|
+
STACK_OF(CRYPTO_BUFFER) *names = ssl->client_CA;
|
709
|
+
if (names == NULL) {
|
710
|
+
names = ssl->ctx->client_CA;
|
711
|
+
}
|
712
|
+
if (names == NULL) {
|
713
|
+
return false;
|
714
|
+
}
|
715
|
+
return sk_CRYPTO_BUFFER_num(names) > 0;
|
716
|
+
}
|
717
|
+
|
707
718
|
int ssl_add_client_CA_list(SSL *ssl, CBB *cbb) {
|
708
719
|
CBB child, name_cbb;
|
709
720
|
if (!CBB_add_u16_length_prefixed(cbb, &child)) {
|
@@ -732,7 +743,7 @@ int ssl_add_client_CA_list(SSL *ssl, CBB *cbb) {
|
|
732
743
|
int ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey,
|
733
744
|
const CRYPTO_BUFFER *leaf) {
|
734
745
|
SSL *const ssl = hs->ssl;
|
735
|
-
assert(
|
746
|
+
assert(ssl_protocol_version(ssl) < TLS1_3_VERSION);
|
736
747
|
|
737
748
|
// Check the certificate's type matches the cipher.
|
738
749
|
if (!(hs->new_cipher->algorithm_auth & ssl_cipher_auth_mask_for_key(pkey))) {
|
@@ -578,7 +578,7 @@ typedef struct cipher_alias_st {
|
|
578
578
|
|
579
579
|
static const CIPHER_ALIAS kCipherAliases[] = {
|
580
580
|
// "ALL" doesn't include eNULL. It must be explicitly enabled.
|
581
|
-
{"ALL", ~0u, ~0u, ~
|
581
|
+
{"ALL", ~0u, ~0u, ~0u, ~0u, 0},
|
582
582
|
|
583
583
|
// The "COMPLEMENTOFDEFAULT" rule is omitted. It matches nothing.
|
584
584
|
|
@@ -594,7 +594,7 @@ static const CIPHER_ALIAS kCipherAliases[] = {
|
|
594
594
|
{"kPSK", SSL_kPSK, ~0u, ~0u, ~0u, 0},
|
595
595
|
|
596
596
|
// server authentication aliases
|
597
|
-
{"aRSA", ~0u, SSL_aRSA, ~
|
597
|
+
{"aRSA", ~0u, SSL_aRSA, ~0u, ~0u, 0},
|
598
598
|
{"aECDSA", ~0u, SSL_aECDSA, ~0u, ~0u, 0},
|
599
599
|
{"ECDSA", ~0u, SSL_aECDSA, ~0u, ~0u, 0},
|
600
600
|
{"aPSK", ~0u, SSL_aPSK, ~0u, ~0u, 0},
|
@@ -602,7 +602,7 @@ static const CIPHER_ALIAS kCipherAliases[] = {
|
|
602
602
|
// aliases combining key exchange and server authentication
|
603
603
|
{"ECDHE", SSL_kECDHE, ~0u, ~0u, ~0u, 0},
|
604
604
|
{"EECDH", SSL_kECDHE, ~0u, ~0u, ~0u, 0},
|
605
|
-
{"RSA", SSL_kRSA, SSL_aRSA, ~
|
605
|
+
{"RSA", SSL_kRSA, SSL_aRSA, ~0u, ~0u, 0},
|
606
606
|
{"PSK", SSL_kPSK, SSL_aPSK, ~0u, ~0u, 0},
|
607
607
|
|
608
608
|
// symmetric encryption aliases
|
@@ -614,20 +614,20 @@ static const CIPHER_ALIAS kCipherAliases[] = {
|
|
614
614
|
{"CHACHA20", ~0u, ~0u, SSL_CHACHA20POLY1305, ~0u, 0},
|
615
615
|
|
616
616
|
// MAC aliases
|
617
|
-
{"SHA1", ~0u, ~0u, ~
|
618
|
-
{"SHA", ~0u, ~0u, ~
|
617
|
+
{"SHA1", ~0u, ~0u, ~0u, SSL_SHA1, 0},
|
618
|
+
{"SHA", ~0u, ~0u, ~0u, SSL_SHA1, 0},
|
619
619
|
{"SHA256", ~0u, ~0u, ~0u, SSL_SHA256, 0},
|
620
620
|
{"SHA384", ~0u, ~0u, ~0u, SSL_SHA384, 0},
|
621
621
|
|
622
622
|
// Legacy protocol minimum version aliases. "TLSv1" is intentionally the
|
623
623
|
// same as "SSLv3".
|
624
|
-
{"SSLv3", ~0u, ~0u, ~
|
625
|
-
{"TLSv1", ~0u, ~0u, ~
|
626
|
-
{"TLSv1.2", ~0u, ~0u, ~
|
624
|
+
{"SSLv3", ~0u, ~0u, ~0u, ~0u, SSL3_VERSION},
|
625
|
+
{"TLSv1", ~0u, ~0u, ~0u, ~0u, SSL3_VERSION},
|
626
|
+
{"TLSv1.2", ~0u, ~0u, ~0u, ~0u, TLS1_2_VERSION},
|
627
627
|
|
628
628
|
// Legacy strength classes.
|
629
|
-
{"HIGH", ~0u, ~0u, ~
|
630
|
-
{"FIPS", ~0u, ~0u, ~
|
629
|
+
{"HIGH", ~0u, ~0u, ~0u, ~0u, 0},
|
630
|
+
{"FIPS", ~0u, ~0u, ~0u, ~0u, 0},
|
631
631
|
};
|
632
632
|
|
633
633
|
static const size_t kCipherAliasesLen = OPENSSL_ARRAY_SIZE(kCipherAliases);
|
@@ -811,19 +811,14 @@ static void ll_append_head(CIPHER_ORDER **head, CIPHER_ORDER *curr,
|
|
811
811
|
*head = curr;
|
812
812
|
}
|
813
813
|
|
814
|
-
static void ssl_cipher_collect_ciphers(
|
815
|
-
CIPHER_ORDER *co_list,
|
814
|
+
static void ssl_cipher_collect_ciphers(CIPHER_ORDER *co_list,
|
816
815
|
CIPHER_ORDER **head_p,
|
817
816
|
CIPHER_ORDER **tail_p) {
|
818
|
-
// The set of ciphers is static, but some subset may be unsupported by
|
819
|
-
// |ssl_method|, so the list may be smaller.
|
820
817
|
size_t co_list_num = 0;
|
821
|
-
for (
|
822
|
-
|
823
|
-
if (
|
824
|
-
|
825
|
-
cipher->algorithm_mkey != SSL_kGENERIC) {
|
826
|
-
co_list[co_list_num].cipher = cipher;
|
818
|
+
for (const SSL_CIPHER &cipher : kCiphers) {
|
819
|
+
// TLS 1.3 ciphers do not participate in this mechanism.
|
820
|
+
if (cipher.algorithm_mkey != SSL_kGENERIC) {
|
821
|
+
co_list[co_list_num].cipher = &cipher;
|
827
822
|
co_list[co_list_num].next = NULL;
|
828
823
|
co_list[co_list_num].prev = NULL;
|
829
824
|
co_list[co_list_num].active = false;
|
@@ -923,7 +918,9 @@ static void ssl_cipher_apply_rule(
|
|
923
918
|
!(alg_auth & cp->algorithm_auth) ||
|
924
919
|
!(alg_enc & cp->algorithm_enc) ||
|
925
920
|
!(alg_mac & cp->algorithm_mac) ||
|
926
|
-
(min_version != 0 && SSL_CIPHER_get_min_version(cp) != min_version)
|
921
|
+
(min_version != 0 && SSL_CIPHER_get_min_version(cp) != min_version) ||
|
922
|
+
// The NULL cipher must be selected explicitly.
|
923
|
+
cp->algorithm_enc == SSL_eNULL) {
|
927
924
|
continue;
|
928
925
|
}
|
929
926
|
}
|
@@ -1023,8 +1020,7 @@ static bool ssl_cipher_strength_sort(CIPHER_ORDER **head_p,
|
|
1023
1020
|
return true;
|
1024
1021
|
}
|
1025
1022
|
|
1026
|
-
static bool ssl_cipher_process_rulestr(const
|
1027
|
-
const char *rule_str,
|
1023
|
+
static bool ssl_cipher_process_rulestr(const char *rule_str,
|
1028
1024
|
CIPHER_ORDER **head_p,
|
1029
1025
|
CIPHER_ORDER **tail_p, bool strict) {
|
1030
1026
|
uint32_t alg_mkey, alg_auth, alg_enc, alg_mac;
|
@@ -1206,7 +1202,6 @@ static bool ssl_cipher_process_rulestr(const SSL_PROTOCOL_METHOD *ssl_method,
|
|
1206
1202
|
}
|
1207
1203
|
|
1208
1204
|
bool ssl_create_cipher_list(
|
1209
|
-
const SSL_PROTOCOL_METHOD *ssl_method,
|
1210
1205
|
struct ssl_cipher_preference_list_st **out_cipher_list,
|
1211
1206
|
const char *rule_str, bool strict) {
|
1212
1207
|
STACK_OF(SSL_CIPHER) *cipherstack = NULL;
|
@@ -1229,7 +1224,7 @@ bool ssl_create_cipher_list(
|
|
1229
1224
|
return false;
|
1230
1225
|
}
|
1231
1226
|
|
1232
|
-
ssl_cipher_collect_ciphers(
|
1227
|
+
ssl_cipher_collect_ciphers(co_list, &head, &tail);
|
1233
1228
|
|
1234
1229
|
// Now arrange all ciphers by preference:
|
1235
1230
|
// TODO(davidben): Compute this order once and copy it.
|
@@ -1288,8 +1283,8 @@ bool ssl_create_cipher_list(
|
|
1288
1283
|
// using the (possibly available) additional rules.
|
1289
1284
|
const char *rule_p = rule_str;
|
1290
1285
|
if (strncmp(rule_str, "DEFAULT", 7) == 0) {
|
1291
|
-
if (!ssl_cipher_process_rulestr(
|
1292
|
-
|
1286
|
+
if (!ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, &head, &tail,
|
1287
|
+
strict)) {
|
1293
1288
|
goto err;
|
1294
1289
|
}
|
1295
1290
|
rule_p += 7;
|
@@ -1299,7 +1294,7 @@ bool ssl_create_cipher_list(
|
|
1299
1294
|
}
|
1300
1295
|
|
1301
1296
|
if (*rule_p != '\0' &&
|
1302
|
-
!ssl_cipher_process_rulestr(
|
1297
|
+
!ssl_cipher_process_rulestr(rule_p, &head, &tail, strict)) {
|
1303
1298
|
goto err;
|
1304
1299
|
}
|
1305
1300
|
|