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
@@ -153,6 +153,7 @@
|
|
153
153
|
|
154
154
|
#include <openssl/aead.h>
|
155
155
|
#include <openssl/err.h>
|
156
|
+
#include <openssl/lhash.h>
|
156
157
|
#include <openssl/mem.h>
|
157
158
|
#include <openssl/ssl.h>
|
158
159
|
#include <openssl/span.h>
|
@@ -387,9 +388,17 @@ bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb);
|
|
387
388
|
bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert,
|
388
389
|
uint16_t *out_version, const CBS *peer_versions);
|
389
390
|
|
390
|
-
//
|
391
|
+
// ssl_protocol_version returns |ssl|'s protocol version. It is an error to
|
391
392
|
// call this function before the version is determined.
|
392
|
-
uint16_t
|
393
|
+
uint16_t ssl_protocol_version(const SSL *ssl);
|
394
|
+
|
395
|
+
// ssl_is_draft21 returns whether the version corresponds to a draft21 TLS 1.3
|
396
|
+
// variant.
|
397
|
+
bool ssl_is_draft21(uint16_t version);
|
398
|
+
|
399
|
+
// ssl_is_draft22 returns whether the version corresponds to a draft22 TLS 1.3
|
400
|
+
// variant.
|
401
|
+
bool ssl_is_draft22(uint16_t version);
|
393
402
|
|
394
403
|
// ssl_is_resumption_experiment returns whether the version corresponds to a
|
395
404
|
// TLS 1.3 resumption experiment.
|
@@ -489,14 +498,12 @@ bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead,
|
|
489
498
|
const EVP_MD *ssl_get_handshake_digest(uint16_t version,
|
490
499
|
const SSL_CIPHER *cipher);
|
491
500
|
|
492
|
-
// ssl_create_cipher_list evaluates |rule_str
|
493
|
-
// |
|
494
|
-
//
|
495
|
-
//
|
496
|
-
//
|
497
|
-
// considered an error regardless of |strict|.
|
501
|
+
// ssl_create_cipher_list evaluates |rule_str|. It sets |*out_cipher_list| to a
|
502
|
+
// newly-allocated |ssl_cipher_preference_list_st| containing the result. It
|
503
|
+
// returns true on success and false on failure. If |strict| is true, nonsense
|
504
|
+
// will be rejected. If false, nonsense will be silently ignored. An empty
|
505
|
+
// result is considered an error regardless of |strict|.
|
498
506
|
bool ssl_create_cipher_list(
|
499
|
-
const SSL_PROTOCOL_METHOD *ssl_method,
|
500
507
|
struct ssl_cipher_preference_list_st **out_cipher_list,
|
501
508
|
const char *rule_str, bool strict);
|
502
509
|
|
@@ -544,10 +551,20 @@ class SSLTranscript {
|
|
544
551
|
// to call this function after the handshake buffer is released.
|
545
552
|
bool InitHash(uint16_t version, const SSL_CIPHER *cipher);
|
546
553
|
|
547
|
-
|
548
|
-
|
554
|
+
// UpdateForHelloRetryRequest resets the rolling hash with the
|
555
|
+
// HelloRetryRequest construction. It returns true on success and false on
|
556
|
+
// failure. It is an error to call this function before the handshake buffer
|
557
|
+
// is released.
|
558
|
+
bool UpdateForHelloRetryRequest();
|
559
|
+
|
560
|
+
// CopyHashContext copies the hash context into |ctx| and returns true on
|
561
|
+
// success.
|
562
|
+
bool CopyHashContext(EVP_MD_CTX *ctx);
|
563
|
+
|
564
|
+
Span<const uint8_t> buffer() {
|
565
|
+
return MakeConstSpan(reinterpret_cast<const uint8_t *>(buffer_->data),
|
566
|
+
buffer_->length);
|
549
567
|
}
|
550
|
-
size_t buffer_len() const { return buffer_->length; }
|
551
568
|
|
552
569
|
// FreeBuffer releases the handshake buffer. Subsequent calls to
|
553
570
|
// |Update| will not update the handshake buffer.
|
@@ -562,7 +579,7 @@ class SSLTranscript {
|
|
562
579
|
|
563
580
|
// Update adds |in| to the handshake buffer and handshake hash, whichever is
|
564
581
|
// enabled. It returns true on success and false on failure.
|
565
|
-
bool Update(const uint8_t
|
582
|
+
bool Update(Span<const uint8_t> in);
|
566
583
|
|
567
584
|
// GetHash writes the handshake hash to |out| which must have room for at
|
568
585
|
// least |DigestLen| bytes. On success, it returns true and sets |*out_len| to
|
@@ -595,14 +612,12 @@ class SSLTranscript {
|
|
595
612
|
ScopedEVP_MD_CTX md5_;
|
596
613
|
};
|
597
614
|
|
598
|
-
// tls1_prf computes the PRF function for |ssl|. It
|
599
|
-
//
|
600
|
-
//
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
size_t label_len, const uint8_t *seed1, size_t seed1_len,
|
605
|
-
const uint8_t *seed2, size_t seed2_len);
|
615
|
+
// tls1_prf computes the PRF function for |ssl|. It fills |out|, using |secret|
|
616
|
+
// as the secret and |label| as the label. |seed1| and |seed2| are concatenated
|
617
|
+
// to form the seed parameter. It returns true on success and false on failure.
|
618
|
+
bool tls1_prf(const EVP_MD *digest, Span<uint8_t> out,
|
619
|
+
Span<const uint8_t> secret, Span<const char> label,
|
620
|
+
Span<const uint8_t> seed1, Span<const uint8_t> seed2);
|
606
621
|
|
607
622
|
|
608
623
|
// Encryption layer.
|
@@ -745,10 +760,10 @@ class SSLAEADContext {
|
|
745
760
|
struct DTLS1_BITMAP {
|
746
761
|
// map is a bit mask of the last 64 sequence numbers. Bit
|
747
762
|
// |1<<i| corresponds to |max_seq_num - i|.
|
748
|
-
uint64_t map;
|
763
|
+
uint64_t map = 0;
|
749
764
|
// max_seq_num is the largest sequence number seen so far as a 64-bit
|
750
765
|
// integer.
|
751
|
-
uint64_t max_seq_num;
|
766
|
+
uint64_t max_seq_num = 0;
|
752
767
|
};
|
753
768
|
|
754
769
|
|
@@ -800,8 +815,9 @@ enum ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type,
|
|
800
815
|
Span<uint8_t> *out, size_t *out_consumed,
|
801
816
|
uint8_t *out_alert, Span<uint8_t> in);
|
802
817
|
|
803
|
-
// dtls_open_record implements |tls_open_record| for DTLS. It
|
804
|
-
// |ssl_open_record_partial|
|
818
|
+
// dtls_open_record implements |tls_open_record| for DTLS. It only returns
|
819
|
+
// |ssl_open_record_partial| if |in| was empty and sets |*out_consumed| to
|
820
|
+
// zero. The caller should read one packet and try again.
|
805
821
|
enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type,
|
806
822
|
Span<uint8_t> *out,
|
807
823
|
size_t *out_consumed,
|
@@ -876,22 +892,24 @@ int ssl_has_private_key(const SSL *ssl);
|
|
876
892
|
|
877
893
|
enum ssl_private_key_result_t ssl_private_key_sign(
|
878
894
|
SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out,
|
879
|
-
uint16_t sigalg, const uint8_t
|
895
|
+
uint16_t sigalg, Span<const uint8_t> in);
|
880
896
|
|
881
|
-
enum ssl_private_key_result_t ssl_private_key_decrypt(
|
882
|
-
|
883
|
-
|
897
|
+
enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs,
|
898
|
+
uint8_t *out,
|
899
|
+
size_t *out_len,
|
900
|
+
size_t max_out,
|
901
|
+
Span<const uint8_t> in);
|
884
902
|
|
885
|
-
// ssl_private_key_supports_signature_algorithm returns
|
886
|
-
// key supports |sigalg
|
887
|
-
|
903
|
+
// ssl_private_key_supports_signature_algorithm returns whether |hs|'s private
|
904
|
+
// key supports |sigalg|.
|
905
|
+
bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs,
|
888
906
|
uint16_t sigalg);
|
889
907
|
|
890
908
|
// ssl_public_key_verify verifies that the |signature| is valid for the public
|
891
909
|
// key |pkey| and input |in|, using the signature algorithm |sigalg|.
|
892
|
-
|
893
|
-
|
894
|
-
|
910
|
+
bool ssl_public_key_verify(SSL *ssl, Span<const uint8_t> signature,
|
911
|
+
uint16_t sigalg, EVP_PKEY *pkey,
|
912
|
+
Span<const uint8_t> in);
|
895
913
|
|
896
914
|
|
897
915
|
// Custom extensions
|
@@ -990,22 +1008,36 @@ struct SSLMessage {
|
|
990
1008
|
// Channel ID, are all enabled.
|
991
1009
|
#define SSL_MAX_HANDSHAKE_FLIGHT 7
|
992
1010
|
|
1011
|
+
extern const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE];
|
1012
|
+
|
993
1013
|
// ssl_max_handshake_message_len returns the maximum number of bytes permitted
|
994
1014
|
// in a handshake message for |ssl|.
|
995
1015
|
size_t ssl_max_handshake_message_len(const SSL *ssl);
|
996
1016
|
|
997
|
-
//
|
998
|
-
|
1017
|
+
// tls_can_accept_handshake_data returns whether |ssl| is able to accept more
|
1018
|
+
// data into handshake buffer.
|
1019
|
+
bool tls_can_accept_handshake_data(const SSL *ssl, uint8_t *out_alert);
|
1020
|
+
|
1021
|
+
// tls_has_unprocessed_handshake_data returns whether there is buffered
|
1022
|
+
// handshake data that has not been consumed by |get_message|.
|
1023
|
+
bool tls_has_unprocessed_handshake_data(const SSL *ssl);
|
999
1024
|
|
1000
|
-
//
|
1001
|
-
//
|
1002
|
-
|
1025
|
+
// dtls_has_unprocessed_handshake_data behaves like
|
1026
|
+
// |tls_has_unprocessed_handshake_data| for DTLS.
|
1027
|
+
bool dtls_has_unprocessed_handshake_data(const SSL *ssl);
|
1003
1028
|
|
1004
1029
|
struct DTLS_OUTGOING_MESSAGE {
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1030
|
+
DTLS_OUTGOING_MESSAGE() {}
|
1031
|
+
DTLS_OUTGOING_MESSAGE(const DTLS_OUTGOING_MESSAGE &) = delete;
|
1032
|
+
DTLS_OUTGOING_MESSAGE &operator=(const DTLS_OUTGOING_MESSAGE &) = delete;
|
1033
|
+
~DTLS_OUTGOING_MESSAGE() { Clear(); }
|
1034
|
+
|
1035
|
+
void Clear();
|
1036
|
+
|
1037
|
+
uint8_t *data = nullptr;
|
1038
|
+
uint32_t len = 0;
|
1039
|
+
uint16_t epoch = 0;
|
1040
|
+
bool is_ccs = false;
|
1009
1041
|
};
|
1010
1042
|
|
1011
1043
|
// dtls_clear_outgoing_messages releases all buffered outgoing messages.
|
@@ -1024,8 +1056,57 @@ void ssl_do_msg_callback(SSL *ssl, int is_write, int content_type,
|
|
1024
1056
|
|
1025
1057
|
// Transport buffers.
|
1026
1058
|
|
1027
|
-
|
1028
|
-
|
1059
|
+
class SSLBuffer {
|
1060
|
+
public:
|
1061
|
+
SSLBuffer() {}
|
1062
|
+
~SSLBuffer() { Clear(); }
|
1063
|
+
|
1064
|
+
SSLBuffer(const SSLBuffer &) = delete;
|
1065
|
+
SSLBuffer &operator=(const SSLBuffer &) = delete;
|
1066
|
+
|
1067
|
+
uint8_t *data() { return buf_ + offset_; }
|
1068
|
+
size_t size() const { return size_; }
|
1069
|
+
bool empty() const { return size_ == 0; }
|
1070
|
+
size_t cap() const { return cap_; }
|
1071
|
+
|
1072
|
+
Span<uint8_t> span() { return MakeSpan(data(), size()); }
|
1073
|
+
|
1074
|
+
Span<uint8_t> remaining() {
|
1075
|
+
return MakeSpan(data() + size(), cap() - size());
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
// Clear releases the buffer.
|
1079
|
+
void Clear();
|
1080
|
+
|
1081
|
+
// EnsureCap ensures the buffer has capacity at least |new_cap|, aligned such
|
1082
|
+
// that data written after |header_len| is aligned to a
|
1083
|
+
// |SSL3_ALIGN_PAYLOAD|-byte boundary. It returns true on success and false
|
1084
|
+
// on error.
|
1085
|
+
bool EnsureCap(size_t header_len, size_t new_cap);
|
1086
|
+
|
1087
|
+
// DidWrite extends the buffer by |len|. The caller must have filled in to
|
1088
|
+
// this point.
|
1089
|
+
void DidWrite(size_t len);
|
1090
|
+
|
1091
|
+
// Consume consumes |len| bytes from the front of the buffer. The memory
|
1092
|
+
// consumed will remain valid until the next call to |DiscardConsumed| or
|
1093
|
+
// |Clear|.
|
1094
|
+
void Consume(size_t len);
|
1095
|
+
|
1096
|
+
// DiscardConsumed discards the consumed bytes from the buffer. If the buffer
|
1097
|
+
// is now empty, it releases memory used by it.
|
1098
|
+
void DiscardConsumed();
|
1099
|
+
|
1100
|
+
private:
|
1101
|
+
// buf_ is the memory allocated for this buffer.
|
1102
|
+
uint8_t *buf_ = nullptr;
|
1103
|
+
// offset_ is the offset into |buf_| which the buffer contents start at.
|
1104
|
+
uint16_t offset_ = 0;
|
1105
|
+
// size_ is the size of the buffer contents from |buf_| + |offset_|.
|
1106
|
+
uint16_t size_ = 0;
|
1107
|
+
// cap_ is how much memory beyond |buf_| + |offset_| is available.
|
1108
|
+
uint16_t cap_ = 0;
|
1109
|
+
};
|
1029
1110
|
|
1030
1111
|
// ssl_read_buffer_extend_to extends the read buffer to the desired length. For
|
1031
1112
|
// TLS, it reads to the end of the buffer until the buffer is |len| bytes
|
@@ -1036,43 +1117,18 @@ Span<uint8_t> ssl_read_buffer(SSL *ssl);
|
|
1036
1117
|
// non-empty.
|
1037
1118
|
int ssl_read_buffer_extend_to(SSL *ssl, size_t len);
|
1038
1119
|
|
1039
|
-
//
|
1040
|
-
//
|
1041
|
-
//
|
1042
|
-
//
|
1043
|
-
|
1044
|
-
|
1045
|
-
// ssl_read_buffer_discard discards the consumed bytes from the read buffer. If
|
1046
|
-
// the buffer is now empty, it releases memory used by it.
|
1047
|
-
void ssl_read_buffer_discard(SSL *ssl);
|
1048
|
-
|
1049
|
-
// ssl_read_buffer_clear releases all memory associated with the read buffer and
|
1050
|
-
// zero-initializes it.
|
1051
|
-
void ssl_read_buffer_clear(SSL *ssl);
|
1052
|
-
|
1053
|
-
// ssl_write_buffer_is_pending returns one if the write buffer has pending data
|
1054
|
-
// and zero if is empty.
|
1055
|
-
int ssl_write_buffer_is_pending(const SSL *ssl);
|
1056
|
-
|
1057
|
-
// ssl_write_buffer_init initializes the write buffer. On success, it sets
|
1058
|
-
// |*out_ptr| to the start of the write buffer with space for up to |max_len|
|
1059
|
-
// bytes. It returns one on success and zero on failure. Call
|
1060
|
-
// |ssl_write_buffer_set_len| to complete initialization.
|
1061
|
-
int ssl_write_buffer_init(SSL *ssl, uint8_t **out_ptr, size_t max_len);
|
1062
|
-
|
1063
|
-
// ssl_write_buffer_set_len is called after |ssl_write_buffer_init| to complete
|
1064
|
-
// initialization after |len| bytes are written to the buffer.
|
1065
|
-
void ssl_write_buffer_set_len(SSL *ssl, size_t len);
|
1120
|
+
// ssl_handle_open_record handles the result of passing |ssl->s3->read_buffer|
|
1121
|
+
// to a record-processing function. If |ret| is a success or if the caller
|
1122
|
+
// should retry, it returns one and sets |*out_retry|. Otherwise, it returns <=
|
1123
|
+
// 0.
|
1124
|
+
int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret,
|
1125
|
+
size_t consumed, uint8_t alert);
|
1066
1126
|
|
1067
1127
|
// ssl_write_buffer_flush flushes the write buffer to the transport. It returns
|
1068
1128
|
// one on success and <= 0 on error. For DTLS, whether or not the write
|
1069
1129
|
// succeeds, the write buffer will be cleared.
|
1070
1130
|
int ssl_write_buffer_flush(SSL *ssl);
|
1071
1131
|
|
1072
|
-
// ssl_write_buffer_clear releases all memory associated with the write buffer
|
1073
|
-
// and zero-initializes it.
|
1074
|
-
void ssl_write_buffer_clear(SSL *ssl);
|
1075
|
-
|
1076
1132
|
|
1077
1133
|
// Certificate functions.
|
1078
1134
|
|
@@ -1121,6 +1177,9 @@ UniquePtr<STACK_OF(CRYPTO_BUFFER)> ssl_parse_client_CA_list(SSL *ssl,
|
|
1121
1177
|
uint8_t *out_alert,
|
1122
1178
|
CBS *cbs);
|
1123
1179
|
|
1180
|
+
// ssl_has_client_CAs returns there are configured CAs.
|
1181
|
+
bool ssl_has_client_CAs(SSL *ssl);
|
1182
|
+
|
1124
1183
|
// ssl_add_client_CA_list adds the configured CA list to |cbb| in the format
|
1125
1184
|
// used by a TLS CertificateRequest message. It returns one on success and zero
|
1126
1185
|
// on error.
|
@@ -1141,14 +1200,16 @@ int ssl_on_certificate_selected(SSL_HANDSHAKE *hs);
|
|
1141
1200
|
// TLS 1.3 key derivation.
|
1142
1201
|
|
1143
1202
|
// tls13_init_key_schedule initializes the handshake hash and key derivation
|
1144
|
-
// state. The cipher suite and PRF hash must have been
|
1145
|
-
// It returns one on success and zero on error.
|
1146
|
-
int tls13_init_key_schedule(SSL_HANDSHAKE *hs
|
1203
|
+
// state, and incorporates the PSK. The cipher suite and PRF hash must have been
|
1204
|
+
// selected at this point. It returns one on success and zero on error.
|
1205
|
+
int tls13_init_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk,
|
1206
|
+
size_t psk_len);
|
1147
1207
|
|
1148
1208
|
// tls13_init_early_key_schedule initializes the handshake hash and key
|
1149
|
-
// derivation state from the resumption secret
|
1150
|
-
// returns one on success and zero on error.
|
1151
|
-
int tls13_init_early_key_schedule(SSL_HANDSHAKE *hs
|
1209
|
+
// derivation state from the resumption secret and incorporates the PSK to
|
1210
|
+
// derive the early secrets. It returns one on success and zero on error.
|
1211
|
+
int tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk,
|
1212
|
+
size_t psk_len);
|
1152
1213
|
|
1153
1214
|
// tls13_advance_key_schedule incorporates |in| into the key schedule with
|
1154
1215
|
// HKDF-Extract. It returns one on success and zero on error.
|
@@ -1195,6 +1256,11 @@ int tls13_export_keying_material(SSL *ssl, uint8_t *out, size_t out_len,
|
|
1195
1256
|
int tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out,
|
1196
1257
|
size_t *out_len, int is_server);
|
1197
1258
|
|
1259
|
+
// tls13_derive_session_psk calculates the PSK for this session based on the
|
1260
|
+
// resumption master secret and |nonce|. It returns true on success, and false
|
1261
|
+
// on failure.
|
1262
|
+
bool tls13_derive_session_psk(SSL_SESSION *session, Span<const uint8_t> nonce);
|
1263
|
+
|
1198
1264
|
// tls13_write_psk_binder calculates the PSK binder value and replaces the last
|
1199
1265
|
// bytes of |msg| with the resulting value. It returns 1 on success, and 0 on
|
1200
1266
|
// failure.
|
@@ -1378,6 +1444,7 @@ struct SSL_HANDSHAKE {
|
|
1378
1444
|
bool needs_psk_binder:1;
|
1379
1445
|
|
1380
1446
|
bool received_hello_retry_request:1;
|
1447
|
+
bool sent_hello_retry_request:1;
|
1381
1448
|
|
1382
1449
|
bool received_custom_extension:1;
|
1383
1450
|
|
@@ -1450,14 +1517,11 @@ struct SSL_HANDSHAKE {
|
|
1450
1517
|
uint16_t early_data_written = 0;
|
1451
1518
|
};
|
1452
1519
|
|
1453
|
-
SSL_HANDSHAKE
|
1454
|
-
|
1455
|
-
// ssl_handshake_free releases all memory associated with |hs|.
|
1456
|
-
void ssl_handshake_free(SSL_HANDSHAKE *hs);
|
1520
|
+
UniquePtr<SSL_HANDSHAKE> ssl_handshake_new(SSL *ssl);
|
1457
1521
|
|
1458
1522
|
// ssl_check_message_type checks if |msg| has type |type|. If so it returns
|
1459
1523
|
// one. Otherwise, it sends an alert and returns zero.
|
1460
|
-
|
1524
|
+
bool ssl_check_message_type(SSL *ssl, const SSLMessage &msg, int type);
|
1461
1525
|
|
1462
1526
|
// ssl_run_handshake runs the TLS handshake. It returns one on success and <= 0
|
1463
1527
|
// on error. It sets |out_early_return| to one if we've completed the handshake
|
@@ -1502,20 +1566,21 @@ enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs);
|
|
1502
1566
|
int tls13_add_finished(SSL_HANDSHAKE *hs);
|
1503
1567
|
int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg);
|
1504
1568
|
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1569
|
+
bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs,
|
1570
|
+
Array<uint8_t> *out_secret,
|
1571
|
+
uint8_t *out_alert, CBS *contents);
|
1572
|
+
bool ssl_ext_key_share_parse_clienthello(SSL_HANDSHAKE *hs, bool *out_found,
|
1573
|
+
Array<uint8_t> *out_secret,
|
1574
|
+
uint8_t *out_alert, CBS *contents);
|
1575
|
+
bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out);
|
1576
|
+
|
1577
|
+
bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs,
|
1578
|
+
uint8_t *out_alert,
|
1579
|
+
CBS *contents);
|
1580
|
+
bool ssl_ext_pre_shared_key_parse_clienthello(
|
1516
1581
|
SSL_HANDSHAKE *hs, CBS *out_ticket, CBS *out_binders,
|
1517
1582
|
uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, CBS *contents);
|
1518
|
-
|
1583
|
+
bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out);
|
1519
1584
|
|
1520
1585
|
// ssl_is_sct_list_valid does a shallow parse of the SCT list in |contents| and
|
1521
1586
|
// returns one iff it's valid.
|
@@ -1531,18 +1596,21 @@ enum ssl_cert_verify_context_t {
|
|
1531
1596
|
|
1532
1597
|
// tls13_get_cert_verify_signature_input generates the message to be signed for
|
1533
1598
|
// TLS 1.3's CertificateVerify message. |cert_verify_context| determines the
|
1534
|
-
// type of signature. It sets |*out|
|
1535
|
-
//
|
1536
|
-
|
1537
|
-
|
1538
|
-
SSL_HANDSHAKE *hs, uint8_t **out, size_t *out_len,
|
1599
|
+
// type of signature. It sets |*out| to a newly allocated buffer containing the
|
1600
|
+
// result. This function returns true on success and false on failure.
|
1601
|
+
bool tls13_get_cert_verify_signature_input(
|
1602
|
+
SSL_HANDSHAKE *hs, Array<uint8_t> *out,
|
1539
1603
|
enum ssl_cert_verify_context_t cert_verify_context);
|
1540
1604
|
|
1605
|
+
// ssl_is_alpn_protocol_allowed returns whether |protocol| is a valid server
|
1606
|
+
// selection for |ssl|'s client preferences.
|
1607
|
+
bool ssl_is_alpn_protocol_allowed(const SSL *ssl, Span<const uint8_t> protocol);
|
1608
|
+
|
1541
1609
|
// ssl_negotiate_alpn negotiates the ALPN extension, if applicable. It returns
|
1542
|
-
//
|
1610
|
+
// true on successful negotiation or if nothing was negotiated. It returns false
|
1543
1611
|
// and sets |*out_alert| to an alert on error.
|
1544
|
-
|
1545
|
-
|
1612
|
+
bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert,
|
1613
|
+
const SSL_CLIENT_HELLO *client_hello);
|
1546
1614
|
|
1547
1615
|
struct SSL_EXTENSION_TYPE {
|
1548
1616
|
uint16_t type;
|
@@ -1562,6 +1630,10 @@ int ssl_parse_extensions(const CBS *cbs, uint8_t *out_alert,
|
|
1562
1630
|
// ssl_verify_peer_cert verifies the peer certificate for |hs|.
|
1563
1631
|
enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs);
|
1564
1632
|
|
1633
|
+
enum ssl_hs_wait_t ssl_get_finished(SSL_HANDSHAKE *hs);
|
1634
|
+
bool ssl_send_finished(SSL_HANDSHAKE *hs);
|
1635
|
+
bool ssl_output_cert_chain(SSL *ssl);
|
1636
|
+
|
1565
1637
|
|
1566
1638
|
// SSLKEYLOGFILE functions.
|
1567
1639
|
|
@@ -1706,64 +1778,81 @@ struct CERT {
|
|
1706
1778
|
|
1707
1779
|
// |SSL_PROTOCOL_METHOD| abstracts between TLS and DTLS.
|
1708
1780
|
struct SSL_PROTOCOL_METHOD {
|
1709
|
-
|
1710
|
-
|
1711
|
-
int (*ssl_new)(SSL *ssl);
|
1781
|
+
bool is_dtls;
|
1782
|
+
bool (*ssl_new)(SSL *ssl);
|
1712
1783
|
void (*ssl_free)(SSL *ssl);
|
1713
1784
|
// get_message sets |*out| to the current handshake message and returns true
|
1714
1785
|
// if one has been received. It returns false if more input is needed.
|
1715
1786
|
bool (*get_message)(SSL *ssl, SSLMessage *out);
|
1716
|
-
// read_message reads additional handshake data for |get_message|. On success,
|
1717
|
-
// it returns one. Otherwise, it returns <= 0.
|
1718
|
-
int (*read_message)(SSL *ssl);
|
1719
1787
|
// next_message is called to release the current handshake message.
|
1720
1788
|
void (*next_message)(SSL *ssl);
|
1721
|
-
//
|
1722
|
-
|
1723
|
-
|
1724
|
-
//
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1789
|
+
// Use the |ssl_open_handshake| wrapper.
|
1790
|
+
ssl_open_record_t (*open_handshake)(SSL *ssl, size_t *out_consumed,
|
1791
|
+
uint8_t *out_alert, Span<uint8_t> in);
|
1792
|
+
// Use the |ssl_open_change_cipher_spec| wrapper.
|
1793
|
+
ssl_open_record_t (*open_change_cipher_spec)(SSL *ssl, size_t *out_consumed,
|
1794
|
+
uint8_t *out_alert,
|
1795
|
+
Span<uint8_t> in);
|
1796
|
+
// Use the |ssl_open_app_data| wrapper.
|
1797
|
+
ssl_open_record_t (*open_app_data)(SSL *ssl, Span<uint8_t> *out,
|
1798
|
+
size_t *out_consumed, uint8_t *out_alert,
|
1799
|
+
Span<uint8_t> in);
|
1730
1800
|
int (*write_app_data)(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf,
|
1731
1801
|
int len);
|
1732
1802
|
int (*dispatch_alert)(SSL *ssl);
|
1733
|
-
// supports_cipher returns one if |cipher| is supported by this protocol and
|
1734
|
-
// zero otherwise.
|
1735
|
-
int (*supports_cipher)(const SSL_CIPHER *cipher);
|
1736
1803
|
// init_message begins a new handshake message of type |type|. |cbb| is the
|
1737
1804
|
// root CBB to be passed into |finish_message|. |*body| is set to a child CBB
|
1738
|
-
// the caller should write to. It returns
|
1739
|
-
|
1805
|
+
// the caller should write to. It returns true on success and false on error.
|
1806
|
+
bool (*init_message)(SSL *ssl, CBB *cbb, CBB *body, uint8_t type);
|
1740
1807
|
// finish_message finishes a handshake message. It sets |*out_msg| to the
|
1741
|
-
// serialized message. It returns
|
1742
|
-
|
1743
|
-
// add_message adds a handshake message to the pending flight. It returns
|
1744
|
-
// on success and
|
1745
|
-
|
1808
|
+
// serialized message. It returns true on success and false on error.
|
1809
|
+
bool (*finish_message)(SSL *ssl, CBB *cbb, bssl::Array<uint8_t> *out_msg);
|
1810
|
+
// add_message adds a handshake message to the pending flight. It returns
|
1811
|
+
// true on success and false on error.
|
1812
|
+
bool (*add_message)(SSL *ssl, bssl::Array<uint8_t> msg);
|
1746
1813
|
// add_change_cipher_spec adds a ChangeCipherSpec record to the pending
|
1747
|
-
// flight. It returns
|
1748
|
-
|
1749
|
-
// add_alert adds an alert to the pending flight. It returns
|
1750
|
-
// and
|
1751
|
-
|
1814
|
+
// flight. It returns true on success and false on error.
|
1815
|
+
bool (*add_change_cipher_spec)(SSL *ssl);
|
1816
|
+
// add_alert adds an alert to the pending flight. It returns true on success
|
1817
|
+
// and false on error.
|
1818
|
+
bool (*add_alert)(SSL *ssl, uint8_t level, uint8_t desc);
|
1752
1819
|
// flush_flight flushes the pending flight to the transport. It returns one on
|
1753
1820
|
// success and <= 0 on error.
|
1754
1821
|
int (*flush_flight)(SSL *ssl);
|
1755
1822
|
// on_handshake_complete is called when the handshake is complete.
|
1756
1823
|
void (*on_handshake_complete)(SSL *ssl);
|
1757
1824
|
// set_read_state sets |ssl|'s read cipher state to |aead_ctx|. It returns
|
1758
|
-
//
|
1825
|
+
// true on success and false if changing the read state is forbidden at this
|
1759
1826
|
// point.
|
1760
|
-
|
1827
|
+
bool (*set_read_state)(SSL *ssl, UniquePtr<SSLAEADContext> aead_ctx);
|
1761
1828
|
// set_write_state sets |ssl|'s write cipher state to |aead_ctx|. It returns
|
1762
|
-
//
|
1829
|
+
// true on success and false if changing the write state is forbidden at this
|
1763
1830
|
// point.
|
1764
|
-
|
1831
|
+
bool (*set_write_state)(SSL *ssl, UniquePtr<SSLAEADContext> aead_ctx);
|
1765
1832
|
};
|
1766
1833
|
|
1834
|
+
// The following wrappers call |open_*| but handle |read_shutdown| correctly.
|
1835
|
+
|
1836
|
+
// ssl_open_handshake processes a record from |in| for reading a handshake
|
1837
|
+
// message.
|
1838
|
+
ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed,
|
1839
|
+
uint8_t *out_alert, Span<uint8_t> in);
|
1840
|
+
|
1841
|
+
// ssl_open_change_cipher_spec processes a record from |in| for reading a
|
1842
|
+
// ChangeCipherSpec.
|
1843
|
+
ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed,
|
1844
|
+
uint8_t *out_alert,
|
1845
|
+
Span<uint8_t> in);
|
1846
|
+
|
1847
|
+
// ssl_open_app_data processes a record from |in| for reading application data.
|
1848
|
+
// On success, it returns |ssl_open_record_success| and sets |*out| to the
|
1849
|
+
// input. If it encounters a post-handshake message, it returns
|
1850
|
+
// |ssl_open_record_discard|. The caller should then retry, after processing any
|
1851
|
+
// messages received with |get_message|.
|
1852
|
+
ssl_open_record_t ssl_open_app_data(SSL *ssl, Span<uint8_t> *out,
|
1853
|
+
size_t *out_consumed, uint8_t *out_alert,
|
1854
|
+
Span<uint8_t> in);
|
1855
|
+
|
1767
1856
|
// ssl_crypto_x509_method provides the |SSL_X509_METHOD| functions using
|
1768
1857
|
// crypto/x509.
|
1769
1858
|
extern const SSL_X509_METHOD ssl_crypto_x509_method;
|
@@ -1820,6 +1909,12 @@ struct tlsext_ticket_key {
|
|
1820
1909
|
uint64_t next_rotation_tv_sec;
|
1821
1910
|
};
|
1822
1911
|
|
1912
|
+
} // namespace bssl
|
1913
|
+
|
1914
|
+
DECLARE_LHASH_OF(SSL_SESSION)
|
1915
|
+
|
1916
|
+
namespace bssl {
|
1917
|
+
|
1823
1918
|
// SSLContext backs the public |SSL_CTX| type. Due to compatibility constraints,
|
1824
1919
|
// it is a base class for |ssl_ctx_st|.
|
1825
1920
|
struct SSLContext {
|
@@ -1988,11 +2083,6 @@ struct SSLContext {
|
|
1988
2083
|
uint8_t *psk, unsigned int max_psk_len);
|
1989
2084
|
|
1990
2085
|
|
1991
|
-
// retain_only_sha256_of_client_certs is true if we should compute the SHA256
|
1992
|
-
// hash of the peer's certificate and then discard it to save memory and
|
1993
|
-
// session space. Only effective on the server side.
|
1994
|
-
char retain_only_sha256_of_client_certs;
|
1995
|
-
|
1996
2086
|
// Next protocol negotiation information
|
1997
2087
|
// (for experimental NPN extension).
|
1998
2088
|
|
@@ -2059,52 +2149,37 @@ struct SSLContext {
|
|
2059
2149
|
uint16_t *verify_sigalgs;
|
2060
2150
|
size_t num_verify_sigalgs;
|
2061
2151
|
|
2152
|
+
// retain_only_sha256_of_client_certs is true if we should compute the SHA256
|
2153
|
+
// hash of the peer's certificate and then discard it to save memory and
|
2154
|
+
// session space. Only effective on the server side.
|
2155
|
+
bool retain_only_sha256_of_client_certs:1;
|
2156
|
+
|
2062
2157
|
// quiet_shutdown is true if the connection should not send a close_notify on
|
2063
2158
|
// shutdown.
|
2064
|
-
|
2159
|
+
bool quiet_shutdown:1;
|
2065
2160
|
|
2066
2161
|
// ocsp_stapling_enabled is only used by client connections and indicates
|
2067
2162
|
// whether OCSP stapling will be requested.
|
2068
|
-
|
2163
|
+
bool ocsp_stapling_enabled:1;
|
2069
2164
|
|
2070
2165
|
// If true, a client will request certificate timestamps.
|
2071
|
-
|
2166
|
+
bool signed_cert_timestamps_enabled:1;
|
2072
2167
|
|
2073
2168
|
// tlsext_channel_id_enabled is one if Channel ID is enabled and zero
|
2074
2169
|
// otherwise. For a server, means that we'll accept Channel IDs from clients.
|
2075
2170
|
// For a client, means that we'll advertise support.
|
2076
|
-
|
2171
|
+
bool tlsext_channel_id_enabled:1;
|
2077
2172
|
|
2078
2173
|
// grease_enabled is one if draft-davidben-tls-grease-01 is enabled and zero
|
2079
2174
|
// otherwise.
|
2080
|
-
|
2175
|
+
bool grease_enabled:1;
|
2081
2176
|
|
2082
2177
|
// allow_unknown_alpn_protos is one if the client allows unsolicited ALPN
|
2083
2178
|
// protocols from the peer.
|
2084
|
-
|
2179
|
+
bool allow_unknown_alpn_protos:1;
|
2085
2180
|
|
2086
2181
|
// ed25519_enabled is one if Ed25519 is advertised in the handshake.
|
2087
|
-
|
2088
|
-
};
|
2089
|
-
|
2090
|
-
struct SSL3_RECORD {
|
2091
|
-
// type is the record type.
|
2092
|
-
uint8_t type;
|
2093
|
-
// length is the number of unconsumed bytes in the record.
|
2094
|
-
uint16_t length;
|
2095
|
-
// data is a non-owning pointer to the first unconsumed byte of the record.
|
2096
|
-
uint8_t *data;
|
2097
|
-
};
|
2098
|
-
|
2099
|
-
struct SSL3_BUFFER {
|
2100
|
-
// buf is the memory allocated for this buffer.
|
2101
|
-
uint8_t *buf;
|
2102
|
-
// offset is the offset into |buf| which the buffer contents start at.
|
2103
|
-
uint16_t offset;
|
2104
|
-
// len is the length of the buffer contents from |buf| + |offset|.
|
2105
|
-
uint16_t len;
|
2106
|
-
// cap is how much memory beyond |buf| + |offset| is available.
|
2107
|
-
uint16_t cap;
|
2182
|
+
bool ed25519_enabled:1;
|
2108
2183
|
};
|
2109
2184
|
|
2110
2185
|
// An ssl_shutdown_t describes the shutdown state of one end of the connection,
|
@@ -2112,53 +2187,69 @@ struct SSL3_BUFFER {
|
|
2112
2187
|
enum ssl_shutdown_t {
|
2113
2188
|
ssl_shutdown_none = 0,
|
2114
2189
|
ssl_shutdown_close_notify = 1,
|
2115
|
-
|
2190
|
+
ssl_shutdown_error = 2,
|
2116
2191
|
};
|
2117
2192
|
|
2118
2193
|
struct SSL3_STATE {
|
2119
|
-
|
2120
|
-
|
2194
|
+
static constexpr bool kAllowUniquePtr = true;
|
2195
|
+
|
2196
|
+
SSL3_STATE();
|
2197
|
+
~SSL3_STATE();
|
2121
2198
|
|
2122
|
-
uint8_t
|
2123
|
-
uint8_t
|
2199
|
+
uint8_t read_sequence[8] = {0};
|
2200
|
+
uint8_t write_sequence[8] = {0};
|
2201
|
+
|
2202
|
+
uint8_t server_random[SSL3_RANDOM_SIZE] = {0};
|
2203
|
+
uint8_t client_random[SSL3_RANDOM_SIZE] = {0};
|
2124
2204
|
|
2125
2205
|
// read_buffer holds data from the transport to be processed.
|
2126
|
-
|
2206
|
+
SSLBuffer read_buffer;
|
2127
2207
|
// write_buffer holds data to be written to the transport.
|
2128
|
-
|
2208
|
+
SSLBuffer write_buffer;
|
2129
2209
|
|
2130
|
-
|
2210
|
+
// pending_app_data is the unconsumed application data. It points into
|
2211
|
+
// |read_buffer|.
|
2212
|
+
Span<uint8_t> pending_app_data;
|
2131
2213
|
|
2132
2214
|
// partial write - check the numbers match
|
2133
|
-
unsigned int wnum; // number of bytes sent so far
|
2134
|
-
int wpend_tot; // number bytes written
|
2135
|
-
int wpend_type;
|
2136
|
-
int wpend_ret; // number of bytes submitted
|
2137
|
-
const uint8_t *wpend_buf;
|
2215
|
+
unsigned int wnum = 0; // number of bytes sent so far
|
2216
|
+
int wpend_tot = 0; // number bytes written
|
2217
|
+
int wpend_type = 0;
|
2218
|
+
int wpend_ret = 0; // number of bytes submitted
|
2219
|
+
const uint8_t *wpend_buf = nullptr;
|
2138
2220
|
|
2139
2221
|
// read_shutdown is the shutdown state for the read half of the connection.
|
2140
|
-
enum ssl_shutdown_t read_shutdown;
|
2222
|
+
enum ssl_shutdown_t read_shutdown = ssl_shutdown_none;
|
2141
2223
|
|
2142
2224
|
// write_shutdown is the shutdown state for the write half of the connection.
|
2143
|
-
enum ssl_shutdown_t write_shutdown;
|
2225
|
+
enum ssl_shutdown_t write_shutdown = ssl_shutdown_none;
|
2226
|
+
|
2227
|
+
// read_error, if |read_shutdown| is |ssl_shutdown_error|, is the error for
|
2228
|
+
// the receive half of the connection.
|
2229
|
+
UniquePtr<ERR_SAVE_STATE> read_error;
|
2230
|
+
|
2231
|
+
int alert_dispatch = 0;
|
2144
2232
|
|
2145
|
-
int
|
2233
|
+
int total_renegotiations = 0;
|
2146
2234
|
|
2147
|
-
|
2235
|
+
// This holds a variable that indicates what we were doing when a 0 or -1 is
|
2236
|
+
// returned. This is needed for non-blocking IO so we know what request
|
2237
|
+
// needs re-doing when in SSL_accept or SSL_connect
|
2238
|
+
int rwstate = SSL_NOTHING;
|
2148
2239
|
|
2149
2240
|
// early_data_skipped is the amount of early data that has been skipped by the
|
2150
2241
|
// record layer.
|
2151
|
-
uint16_t early_data_skipped;
|
2242
|
+
uint16_t early_data_skipped = 0;
|
2152
2243
|
|
2153
2244
|
// empty_record_count is the number of consecutive empty records received.
|
2154
|
-
uint8_t empty_record_count;
|
2245
|
+
uint8_t empty_record_count = 0;
|
2155
2246
|
|
2156
2247
|
// warning_alert_count is the number of consecutive warning alerts
|
2157
2248
|
// received.
|
2158
|
-
uint8_t warning_alert_count;
|
2249
|
+
uint8_t warning_alert_count = 0;
|
2159
2250
|
|
2160
2251
|
// key_update_count is the number of consecutive KeyUpdates received.
|
2161
|
-
uint8_t key_update_count;
|
2252
|
+
uint8_t key_update_count = 0;
|
2162
2253
|
|
2163
2254
|
// skip_early_data instructs the record layer to skip unexpected early data
|
2164
2255
|
// messages when 0RTT is rejected.
|
@@ -2202,56 +2293,49 @@ struct SSL3_STATE {
|
|
2202
2293
|
// wpend_pending is true if we have a pending write outstanding.
|
2203
2294
|
bool wpend_pending:1;
|
2204
2295
|
|
2205
|
-
uint8_t send_alert[2];
|
2296
|
+
uint8_t send_alert[2] = {0};
|
2297
|
+
|
2298
|
+
// hs_buf is the buffer of handshake data to process.
|
2299
|
+
UniquePtr<BUF_MEM> hs_buf;
|
2206
2300
|
|
2207
2301
|
// pending_flight is the pending outgoing flight. This is used to flush each
|
2208
2302
|
// handshake flight in a single write. |write_buffer| must be written out
|
2209
2303
|
// before this data.
|
2210
|
-
BUF_MEM
|
2304
|
+
UniquePtr<BUF_MEM> pending_flight;
|
2211
2305
|
|
2212
2306
|
// pending_flight_offset is the number of bytes of |pending_flight| which have
|
2213
2307
|
// been successfully written.
|
2214
|
-
uint32_t pending_flight_offset;
|
2308
|
+
uint32_t pending_flight_offset = 0;
|
2215
2309
|
|
2216
2310
|
// aead_read_ctx is the current read cipher state.
|
2217
|
-
SSLAEADContext
|
2311
|
+
UniquePtr<SSLAEADContext> aead_read_ctx;
|
2218
2312
|
|
2219
2313
|
// aead_write_ctx is the current write cipher state.
|
2220
|
-
SSLAEADContext
|
2314
|
+
UniquePtr<SSLAEADContext> aead_write_ctx;
|
2221
2315
|
|
2222
2316
|
// hs is the handshake state for the current handshake or NULL if there isn't
|
2223
2317
|
// one.
|
2224
|
-
SSL_HANDSHAKE
|
2318
|
+
UniquePtr<SSL_HANDSHAKE> hs;
|
2225
2319
|
|
2226
|
-
uint8_t write_traffic_secret[EVP_MAX_MD_SIZE];
|
2227
|
-
uint8_t read_traffic_secret[EVP_MAX_MD_SIZE];
|
2228
|
-
uint8_t exporter_secret[EVP_MAX_MD_SIZE];
|
2229
|
-
uint8_t early_exporter_secret[EVP_MAX_MD_SIZE];
|
2230
|
-
uint8_t write_traffic_secret_len;
|
2231
|
-
uint8_t read_traffic_secret_len;
|
2232
|
-
uint8_t exporter_secret_len;
|
2233
|
-
uint8_t early_exporter_secret_len;
|
2320
|
+
uint8_t write_traffic_secret[EVP_MAX_MD_SIZE] = {0};
|
2321
|
+
uint8_t read_traffic_secret[EVP_MAX_MD_SIZE] = {0};
|
2322
|
+
uint8_t exporter_secret[EVP_MAX_MD_SIZE] = {0};
|
2323
|
+
uint8_t early_exporter_secret[EVP_MAX_MD_SIZE] = {0};
|
2324
|
+
uint8_t write_traffic_secret_len = 0;
|
2325
|
+
uint8_t read_traffic_secret_len = 0;
|
2326
|
+
uint8_t exporter_secret_len = 0;
|
2327
|
+
uint8_t early_exporter_secret_len = 0;
|
2234
2328
|
|
2235
2329
|
// Connection binding to prevent renegotiation attacks
|
2236
|
-
uint8_t previous_client_finished[12];
|
2237
|
-
uint8_t previous_client_finished_len;
|
2238
|
-
uint8_t previous_server_finished_len;
|
2239
|
-
uint8_t previous_server_finished[12];
|
2240
|
-
|
2241
|
-
// State pertaining to the pending handshake.
|
2242
|
-
//
|
2243
|
-
// TODO(davidben): Move everything not needed after the handshake completes to
|
2244
|
-
// |hs| and remove this.
|
2245
|
-
struct {
|
2246
|
-
uint8_t new_mac_secret_len;
|
2247
|
-
uint8_t new_key_len;
|
2248
|
-
uint8_t new_fixed_iv_len;
|
2249
|
-
} tmp;
|
2330
|
+
uint8_t previous_client_finished[12] = {0};
|
2331
|
+
uint8_t previous_client_finished_len = 0;
|
2332
|
+
uint8_t previous_server_finished_len = 0;
|
2333
|
+
uint8_t previous_server_finished[12] = {0};
|
2250
2334
|
|
2251
2335
|
// established_session is the session established by the connection. This
|
2252
2336
|
// session is only filled upon the completion of the handshake and is
|
2253
2337
|
// immutable.
|
2254
|
-
SSL_SESSION
|
2338
|
+
UniquePtr<SSL_SESSION> established_session;
|
2255
2339
|
|
2256
2340
|
// Next protocol negotiation. For the client, this is the protocol that we
|
2257
2341
|
// sent in NextProtocol and is set when handling ServerHello extensions.
|
@@ -2259,8 +2343,7 @@ struct SSL3_STATE {
|
|
2259
2343
|
// For a server, this is the client's selected_protocol from NextProtocol and
|
2260
2344
|
// is set when handling the NextProtocol message, before the Finished
|
2261
2345
|
// message.
|
2262
|
-
uint8_t
|
2263
|
-
size_t next_proto_negotiated_len;
|
2346
|
+
Array<uint8_t> next_proto_negotiated;
|
2264
2347
|
|
2265
2348
|
// ALPN information
|
2266
2349
|
// (we are in the process of transitioning from NPN to ALPN.)
|
@@ -2268,22 +2351,21 @@ struct SSL3_STATE {
|
|
2268
2351
|
// In a server these point to the selected ALPN protocol after the
|
2269
2352
|
// ClientHello has been processed. In a client these contain the protocol
|
2270
2353
|
// that the server selected once the ServerHello has been processed.
|
2271
|
-
uint8_t
|
2272
|
-
size_t alpn_selected_len;
|
2354
|
+
Array<uint8_t> alpn_selected;
|
2273
2355
|
|
2274
2356
|
// hostname, on the server, is the value of the SNI extension.
|
2275
|
-
char
|
2357
|
+
UniquePtr<char> hostname;
|
2276
2358
|
|
2277
2359
|
// For a server:
|
2278
2360
|
// If |tlsext_channel_id_valid| is true, then this contains the
|
2279
2361
|
// verified Channel ID from the client: a P256 point, (x,y), where
|
2280
2362
|
// each are big-endian values.
|
2281
|
-
uint8_t tlsext_channel_id[64];
|
2363
|
+
uint8_t tlsext_channel_id[64] = {0};
|
2282
2364
|
|
2283
2365
|
// ticket_age_skew is the difference, in seconds, between the client-sent
|
2284
2366
|
// ticket age and the server-computed value in TLS 1.3 server connections
|
2285
2367
|
// which resumed a session.
|
2286
|
-
int32_t ticket_age_skew;
|
2368
|
+
int32_t ticket_age_skew = 0;
|
2287
2369
|
};
|
2288
2370
|
|
2289
2371
|
// lengths of messages
|
@@ -2307,18 +2389,26 @@ struct hm_header_st {
|
|
2307
2389
|
|
2308
2390
|
// An hm_fragment is an incoming DTLS message, possibly not yet assembled.
|
2309
2391
|
struct hm_fragment {
|
2392
|
+
static constexpr bool kAllowUniquePtr = true;
|
2393
|
+
|
2394
|
+
hm_fragment() {}
|
2395
|
+
hm_fragment(const hm_fragment &) = delete;
|
2396
|
+
hm_fragment &operator=(const hm_fragment &) = delete;
|
2397
|
+
|
2398
|
+
~hm_fragment();
|
2399
|
+
|
2310
2400
|
// type is the type of the message.
|
2311
|
-
uint8_t type;
|
2401
|
+
uint8_t type = 0;
|
2312
2402
|
// seq is the sequence number of this message.
|
2313
|
-
uint16_t seq;
|
2403
|
+
uint16_t seq = 0;
|
2314
2404
|
// msg_len is the length of the message body.
|
2315
|
-
uint32_t msg_len;
|
2405
|
+
uint32_t msg_len = 0;
|
2316
2406
|
// data is a pointer to the message, including message header. It has length
|
2317
2407
|
// |DTLS1_HM_HEADER_LENGTH| + |msg_len|.
|
2318
|
-
uint8_t *data;
|
2408
|
+
uint8_t *data = nullptr;
|
2319
2409
|
// reassembly is a bitmask of |msg_len| bits corresponding to which parts of
|
2320
2410
|
// the message have been received. It is NULL if the message is complete.
|
2321
|
-
uint8_t *reassembly;
|
2411
|
+
uint8_t *reassembly = nullptr;
|
2322
2412
|
};
|
2323
2413
|
|
2324
2414
|
struct OPENSSL_timeval {
|
@@ -2327,6 +2417,11 @@ struct OPENSSL_timeval {
|
|
2327
2417
|
};
|
2328
2418
|
|
2329
2419
|
struct DTLS1_STATE {
|
2420
|
+
static constexpr bool kAllowUniquePtr = true;
|
2421
|
+
|
2422
|
+
DTLS1_STATE();
|
2423
|
+
~DTLS1_STATE();
|
2424
|
+
|
2330
2425
|
// has_change_cipher_spec is true if we have received a ChangeCipherSpec from
|
2331
2426
|
// the peer in this epoch.
|
2332
2427
|
bool has_change_cipher_spec:1;
|
@@ -2341,54 +2436,54 @@ struct DTLS1_STATE {
|
|
2341
2436
|
// peer sent the final flight.
|
2342
2437
|
bool flight_has_reply:1;
|
2343
2438
|
|
2344
|
-
uint8_t cookie[DTLS1_COOKIE_LENGTH];
|
2345
|
-
size_t cookie_len;
|
2439
|
+
uint8_t cookie[DTLS1_COOKIE_LENGTH] = {0};
|
2440
|
+
size_t cookie_len = 0;
|
2346
2441
|
|
2347
2442
|
// The current data and handshake epoch. This is initially undefined, and
|
2348
2443
|
// starts at zero once the initial handshake is completed.
|
2349
|
-
uint16_t r_epoch;
|
2350
|
-
uint16_t w_epoch;
|
2444
|
+
uint16_t r_epoch = 0;
|
2445
|
+
uint16_t w_epoch = 0;
|
2351
2446
|
|
2352
2447
|
// records being received in the current epoch
|
2353
2448
|
DTLS1_BITMAP bitmap;
|
2354
2449
|
|
2355
|
-
uint16_t handshake_write_seq;
|
2356
|
-
uint16_t handshake_read_seq;
|
2450
|
+
uint16_t handshake_write_seq = 0;
|
2451
|
+
uint16_t handshake_read_seq = 0;
|
2357
2452
|
|
2358
2453
|
// save last sequence number for retransmissions
|
2359
|
-
uint8_t last_write_sequence[8];
|
2360
|
-
SSLAEADContext
|
2454
|
+
uint8_t last_write_sequence[8] = {0};
|
2455
|
+
UniquePtr<SSLAEADContext> last_aead_write_ctx;
|
2361
2456
|
|
2362
2457
|
// incoming_messages is a ring buffer of incoming handshake messages that have
|
2363
2458
|
// yet to be processed. The front of the ring buffer is message number
|
2364
2459
|
// |handshake_read_seq|, at position |handshake_read_seq| %
|
2365
2460
|
// |SSL_MAX_HANDSHAKE_FLIGHT|.
|
2366
|
-
hm_fragment
|
2461
|
+
UniquePtr<hm_fragment> incoming_messages[SSL_MAX_HANDSHAKE_FLIGHT];
|
2367
2462
|
|
2368
2463
|
// outgoing_messages is the queue of outgoing messages from the last handshake
|
2369
2464
|
// flight.
|
2370
2465
|
DTLS_OUTGOING_MESSAGE outgoing_messages[SSL_MAX_HANDSHAKE_FLIGHT];
|
2371
|
-
uint8_t outgoing_messages_len;
|
2466
|
+
uint8_t outgoing_messages_len = 0;
|
2372
2467
|
|
2373
2468
|
// outgoing_written is the number of outgoing messages that have been
|
2374
2469
|
// written.
|
2375
|
-
uint8_t outgoing_written;
|
2470
|
+
uint8_t outgoing_written = 0;
|
2376
2471
|
// outgoing_offset is the number of bytes of the next outgoing message have
|
2377
2472
|
// been written.
|
2378
|
-
uint32_t outgoing_offset;
|
2473
|
+
uint32_t outgoing_offset = 0;
|
2379
2474
|
|
2380
|
-
unsigned
|
2475
|
+
unsigned mtu = 0; // max DTLS packet size
|
2381
2476
|
|
2382
2477
|
// num_timeouts is the number of times the retransmit timer has fired since
|
2383
2478
|
// the last time it was reset.
|
2384
|
-
unsigned
|
2479
|
+
unsigned num_timeouts = 0;
|
2385
2480
|
|
2386
2481
|
// Indicates when the last handshake msg or heartbeat sent will
|
2387
2482
|
// timeout.
|
2388
|
-
struct OPENSSL_timeval next_timeout;
|
2483
|
+
struct OPENSSL_timeval next_timeout = {0, 0};
|
2389
2484
|
|
2390
2485
|
// timeout_duration_ms is the timeout duration in milliseconds.
|
2391
|
-
unsigned timeout_duration_ms;
|
2486
|
+
unsigned timeout_duration_ms = 0;
|
2392
2487
|
};
|
2393
2488
|
|
2394
2489
|
// SSLConnection backs the public |SSL| type. Due to compatibility constraints,
|
@@ -2428,8 +2523,6 @@ struct SSLConnection {
|
|
2428
2523
|
// progress.
|
2429
2524
|
enum ssl_hs_wait_t (*do_handshake)(SSL_HANDSHAKE *hs);
|
2430
2525
|
|
2431
|
-
BUF_MEM *init_buf; // buffer used during init
|
2432
|
-
|
2433
2526
|
SSL3_STATE *s3; // SSLv3 variables
|
2434
2527
|
DTLS1_STATE *d1; // DTLSv1 variables
|
2435
2528
|
|
@@ -2449,11 +2542,6 @@ struct SSLConnection {
|
|
2449
2542
|
// This is used to hold the server certificate used
|
2450
2543
|
CERT *cert;
|
2451
2544
|
|
2452
|
-
// This holds a variable that indicates what we were doing when a 0 or -1 is
|
2453
|
-
// returned. This is needed for non-blocking IO so we know what request
|
2454
|
-
// needs re-doing when in SSL_accept or SSL_connect
|
2455
|
-
int rwstate;
|
2456
|
-
|
2457
2545
|
// initial_timeout_duration_ms is the default DTLS timeout duration in
|
2458
2546
|
// milliseconds. It's used to initialize the timer any time it's restarted.
|
2459
2547
|
unsigned initial_timeout_duration_ms;
|
@@ -2529,35 +2617,34 @@ struct SSLConnection {
|
|
2529
2617
|
// server is true iff the this SSL* is the server half. Note: before the SSL*
|
2530
2618
|
// is initialized by either SSL_set_accept_state or SSL_set_connect_state,
|
2531
2619
|
// the side is not determined. In this state, server is always false.
|
2532
|
-
|
2620
|
+
bool server:1;
|
2533
2621
|
|
2534
2622
|
// quiet_shutdown is true if the connection should not send a close_notify on
|
2535
2623
|
// shutdown.
|
2536
|
-
|
2624
|
+
bool quiet_shutdown:1;
|
2537
2625
|
|
2538
2626
|
// Enable signed certificate time stamps. Currently client only.
|
2539
|
-
|
2627
|
+
bool signed_cert_timestamps_enabled:1;
|
2540
2628
|
|
2541
2629
|
// ocsp_stapling_enabled is only used by client connections and indicates
|
2542
2630
|
// whether OCSP stapling will be requested.
|
2543
|
-
|
2631
|
+
bool ocsp_stapling_enabled:1;
|
2544
2632
|
|
2545
2633
|
// tlsext_channel_id_enabled is copied from the |SSL_CTX|. For a server,
|
2546
2634
|
// means that we'll accept Channel IDs from clients. For a client, means that
|
2547
2635
|
// we'll advertise support.
|
2548
|
-
|
2636
|
+
bool tlsext_channel_id_enabled:1;
|
2549
2637
|
|
2550
2638
|
// retain_only_sha256_of_client_certs is true if we should compute the SHA256
|
2551
2639
|
// hash of the peer's certificate and then discard it to save memory and
|
2552
2640
|
// session space. Only effective on the server side.
|
2553
|
-
|
2641
|
+
bool retain_only_sha256_of_client_certs:1;
|
2554
2642
|
|
2555
2643
|
// early_data_accepted is true if early data was accepted by the server.
|
2556
|
-
|
2644
|
+
bool early_data_accepted:1;
|
2557
2645
|
};
|
2558
2646
|
|
2559
2647
|
// From draft-ietf-tls-tls13-18, used in determining PSK modes.
|
2560
|
-
#define SSL_PSK_KE 0x0
|
2561
2648
|
#define SSL_PSK_DHE_KE 0x1
|
2562
2649
|
|
2563
2650
|
// From draft-ietf-tls-tls13-16, used in determining whether to respond with a
|
@@ -2664,57 +2751,53 @@ const struct ssl_cipher_preference_list_st *ssl_get_cipher_preferences(
|
|
2664
2751
|
|
2665
2752
|
void ssl_update_cache(SSL_HANDSHAKE *hs, int mode);
|
2666
2753
|
|
2667
|
-
|
2668
|
-
int ssl3_send_alert(SSL *ssl, int level, int desc);
|
2754
|
+
int ssl_send_alert(SSL *ssl, int level, int desc);
|
2669
2755
|
bool ssl3_get_message(SSL *ssl, SSLMessage *out);
|
2670
|
-
|
2756
|
+
ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed,
|
2757
|
+
uint8_t *out_alert, Span<uint8_t> in);
|
2671
2758
|
void ssl3_next_message(SSL *ssl);
|
2672
2759
|
|
2673
|
-
int ssl3_send_finished(SSL_HANDSHAKE *hs);
|
2674
2760
|
int ssl3_dispatch_alert(SSL *ssl);
|
2675
|
-
|
2676
|
-
|
2677
|
-
|
2678
|
-
|
2679
|
-
|
2761
|
+
ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span<uint8_t> *out,
|
2762
|
+
size_t *out_consumed, uint8_t *out_alert,
|
2763
|
+
Span<uint8_t> in);
|
2764
|
+
ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed,
|
2765
|
+
uint8_t *out_alert,
|
2766
|
+
Span<uint8_t> in);
|
2680
2767
|
int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf,
|
2681
2768
|
int len);
|
2682
|
-
int ssl3_output_cert_chain(SSL *ssl);
|
2683
2769
|
|
2684
|
-
|
2770
|
+
bool ssl3_new(SSL *ssl);
|
2685
2771
|
void ssl3_free(SSL *ssl);
|
2686
2772
|
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
|
2773
|
+
bool ssl3_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type);
|
2774
|
+
bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array<uint8_t> *out_msg);
|
2775
|
+
bool ssl3_add_message(SSL *ssl, Array<uint8_t> msg);
|
2776
|
+
bool ssl3_add_change_cipher_spec(SSL *ssl);
|
2777
|
+
bool ssl3_add_alert(SSL *ssl, uint8_t level, uint8_t desc);
|
2692
2778
|
int ssl3_flush_flight(SSL *ssl);
|
2693
2779
|
|
2694
|
-
|
2695
|
-
|
2696
|
-
|
2697
|
-
|
2698
|
-
|
2780
|
+
bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type);
|
2781
|
+
bool dtls1_finish_message(SSL *ssl, CBB *cbb, Array<uint8_t> *out_msg);
|
2782
|
+
bool dtls1_add_message(SSL *ssl, Array<uint8_t> msg);
|
2783
|
+
bool dtls1_add_change_cipher_spec(SSL *ssl);
|
2784
|
+
bool dtls1_add_alert(SSL *ssl, uint8_t level, uint8_t desc);
|
2699
2785
|
int dtls1_flush_flight(SSL *ssl);
|
2700
2786
|
|
2701
2787
|
// ssl_add_message_cbb finishes the handshake message in |cbb| and adds it to
|
2702
|
-
// the pending flight. It returns
|
2703
|
-
|
2788
|
+
// the pending flight. It returns true on success and false on error.
|
2789
|
+
bool ssl_add_message_cbb(SSL *ssl, CBB *cbb);
|
2704
2790
|
|
2705
|
-
// ssl_hash_message incorporates |msg| into the handshake hash. It returns
|
2706
|
-
// on success and
|
2791
|
+
// ssl_hash_message incorporates |msg| into the handshake hash. It returns true
|
2792
|
+
// on success and false on allocation failure.
|
2707
2793
|
bool ssl_hash_message(SSL_HANDSHAKE *hs, const SSLMessage &msg);
|
2708
2794
|
|
2709
|
-
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
int len, int peek);
|
2716
|
-
int dtls1_read_change_cipher_spec(SSL *ssl);
|
2717
|
-
void dtls1_read_close_notify(SSL *ssl);
|
2795
|
+
ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span<uint8_t> *out,
|
2796
|
+
size_t *out_consumed, uint8_t *out_alert,
|
2797
|
+
Span<uint8_t> in);
|
2798
|
+
ssl_open_record_t dtls1_open_change_cipher_spec(SSL *ssl, size_t *out_consumed,
|
2799
|
+
uint8_t *out_alert,
|
2800
|
+
Span<uint8_t> in);
|
2718
2801
|
|
2719
2802
|
int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake,
|
2720
2803
|
const uint8_t *buf, int len);
|
@@ -2724,32 +2807,28 @@ int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake,
|
|
2724
2807
|
int dtls1_write_record(SSL *ssl, int type, const uint8_t *buf, size_t len,
|
2725
2808
|
enum dtls1_use_epoch_t use_epoch);
|
2726
2809
|
|
2727
|
-
int dtls1_send_finished(SSL *ssl, int a, int b, const char *sender, int slen);
|
2728
2810
|
int dtls1_retransmit_outgoing_messages(SSL *ssl);
|
2729
|
-
|
2730
|
-
int dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr,
|
2811
|
+
bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr,
|
2731
2812
|
CBS *out_body);
|
2732
|
-
|
2733
|
-
int dtls1_handshake_write(SSL *ssl);
|
2813
|
+
bool dtls1_check_timeout_num(SSL *ssl);
|
2734
2814
|
|
2735
2815
|
void dtls1_start_timer(SSL *ssl);
|
2736
2816
|
void dtls1_stop_timer(SSL *ssl);
|
2737
|
-
|
2817
|
+
bool dtls1_is_timer_expired(SSL *ssl);
|
2738
2818
|
unsigned int dtls1_min_mtu(void);
|
2739
2819
|
|
2740
|
-
|
2741
|
-
int dtls1_accept(SSL *ssl);
|
2742
|
-
int dtls1_connect(SSL *ssl);
|
2820
|
+
bool dtls1_new(SSL *ssl);
|
2743
2821
|
void dtls1_free(SSL *ssl);
|
2744
2822
|
|
2745
2823
|
bool dtls1_get_message(SSL *ssl, SSLMessage *out);
|
2746
|
-
|
2824
|
+
ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed,
|
2825
|
+
uint8_t *out_alert, Span<uint8_t> in);
|
2747
2826
|
void dtls1_next_message(SSL *ssl);
|
2748
2827
|
int dtls1_dispatch_alert(SSL *ssl);
|
2749
2828
|
|
2750
2829
|
int tls1_change_cipher_state(SSL_HANDSHAKE *hs, evp_aead_direction_t direction);
|
2751
2830
|
int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out,
|
2752
|
-
const uint8_t
|
2831
|
+
Span<const uint8_t> premaster);
|
2753
2832
|
|
2754
2833
|
// tls1_get_grouplist returns the locally-configured group preference list.
|
2755
2834
|
Span<const uint16_t> tls1_get_grouplist(const SSL *ssl);
|
@@ -2811,8 +2890,8 @@ int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg);
|
|
2811
2890
|
|
2812
2891
|
// tls1_write_channel_id generates a Channel ID message and puts the output in
|
2813
2892
|
// |cbb|. |ssl->tlsext_channel_id_private| must already be set before calling.
|
2814
|
-
// This function returns
|
2815
|
-
|
2893
|
+
// This function returns true on success and false on error.
|
2894
|
+
bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb);
|
2816
2895
|
|
2817
2896
|
// tls1_channel_id_hash computes the hash to be signed by Channel ID and writes
|
2818
2897
|
// it to |out|, which must contain at least |EVP_MAX_MD_SIZE| bytes. It returns
|
@@ -2827,10 +2906,6 @@ int tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs);
|
|
2827
2906
|
// operation should be retried later.
|
2828
2907
|
int ssl_do_channel_id_callback(SSL *ssl);
|
2829
2908
|
|
2830
|
-
// ssl3_can_false_start returns one if |ssl| is allowed to False Start and zero
|
2831
|
-
// otherwise.
|
2832
|
-
int ssl3_can_false_start(const SSL *ssl);
|
2833
|
-
|
2834
2909
|
// ssl_can_write returns one if |ssl| is allowed to write and zero otherwise.
|
2835
2910
|
int ssl_can_write(const SSL *ssl);
|
2836
2911
|
|
@@ -2844,6 +2919,10 @@ void ssl_ctx_get_current_time(const SSL_CTX *ctx,
|
|
2844
2919
|
// ssl_reset_error_state resets state for |SSL_get_error|.
|
2845
2920
|
void ssl_reset_error_state(SSL *ssl);
|
2846
2921
|
|
2922
|
+
// ssl_set_read_error sets |ssl|'s read half into an error state, saving the
|
2923
|
+
// current state of the error queue.
|
2924
|
+
void ssl_set_read_error(SSL* ssl);
|
2925
|
+
|
2847
2926
|
} // namespace bssl
|
2848
2927
|
|
2849
2928
|
|