grpc 1.85.4 → 1.86.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +13 -9
- data/etc/roots.pem +0 -583
- data/include/grpc/channel_factory.h +78 -0
- data/include/grpc/credentials.h +21 -0
- data/include/grpc/grpc.h +7 -0
- data/include/grpc/grpc_security_constants.h +2 -0
- data/include/grpc/module.modulemap +1 -0
- data/src/core/call/call_filters.cc +4 -1
- data/src/core/call/call_filters.h +3 -1
- data/src/core/call/call_spine.h +12 -6
- data/src/core/call/call_state.h +3 -3
- data/src/core/call/client_call.cc +4 -1
- data/src/core/call/client_call.h +1 -0
- data/src/core/call/filter_fusion.h +2 -15
- data/src/core/call/interception_chain.h +2 -7
- data/src/core/call/metadata_batch.cc +5 -0
- data/src/core/call/metadata_batch.h +13 -3
- data/src/core/call/request_buffer.cc +1 -1
- data/src/core/call/server_call.cc +3 -3
- data/src/core/call/server_call.h +15 -0
- data/src/core/channelz/channelz_registry.cc +4 -4
- data/src/core/client_channel/backup_poller.cc +1 -2
- data/src/core/client_channel/channel_factory.cc +110 -0
- data/src/core/client_channel/channel_factory.h +45 -0
- data/src/core/client_channel/global_subchannel_pool.cc +2 -2
- data/src/core/client_channel/lame_channel.cc +59 -0
- data/src/core/client_channel/lame_channel.h +86 -0
- data/src/core/credentials/call/external/aws_request_signer.cc +2 -1
- data/src/core/credentials/call/external/url_external_account_credentials.cc +6 -17
- data/src/core/credentials/call/external/url_external_account_credentials.h +0 -1
- data/src/core/credentials/call/jwt/jwt_verifier.cc +25 -13
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +14 -0
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +12 -2
- data/src/core/credentials/transport/tls/ssl_utils.cc +20 -0
- data/src/core/credentials/transport/tls/ssl_utils.h +4 -0
- data/src/core/credentials/transport/tls/tls_security_connector.cc +6 -2
- data/src/core/ext/filters/rbac/rbac_filter.cc +3 -41
- data/src/core/ext/filters/rbac/rbac_filter.h +2 -11
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -2
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +31 -24
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +1 -2
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +69 -102
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -1
- data/src/core/ext/transport/chttp2/transport/flow_control.h +2 -2
- data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame.cc +15 -19
- data/src/core/ext/transport/chttp2/transport/frame.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +18 -61
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +0 -4
- data/src/core/ext/transport/chttp2/transport/frame_security.cc +1 -2
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +9 -0
- data/src/core/ext/transport/chttp2/transport/goaway.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/goaway.h +0 -5
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +1 -5
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +34 -19
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +5 -2
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +134 -82
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +30 -15
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +4 -3
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +9 -33
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +1 -6
- data/src/core/ext/transport/chttp2/transport/http2_transport_stats.h +60 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -1
- data/src/core/ext/transport/chttp2/transport/keepalive.h +1 -4
- data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -8
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +35 -11
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +52 -47
- data/src/core/ext/transport/chttp2/transport/read_context.h +19 -5
- data/src/core/ext/transport/chttp2/transport/security_frame.h +7 -6
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +7 -5
- data/src/core/ext/transport/chttp2/transport/transport_common.cc +47 -0
- data/src/core/ext/transport/chttp2/transport/transport_common.h +29 -0
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +1 -1
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +1 -7
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +16 -0
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +129 -81
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +50 -39
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +411 -163
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +95 -44
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.h +3 -0
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +41 -8
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +8 -5
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +427 -222
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +97 -66
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +130 -99
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +29 -27
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +49 -33
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +19 -8
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +95 -3
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +33 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb.h +93 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c +8 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +656 -134
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +117 -51
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +45 -23
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +19 -10
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +99 -34
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +12 -7
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +344 -273
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +62 -69
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +1 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +53 -22
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +9 -7
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +108 -0
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c +26 -2
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +809 -231
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +183 -77
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +3 -0
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +151 -26
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +17 -9
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +24 -8
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +6 -5
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb.h +224 -16
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.c +83 -10
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb.h +95 -79
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.c +23 -22
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +34 -18
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +10 -9
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +243 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +53 -5
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h +3 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +53 -22
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +9 -7
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +23 -7
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +9 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +516 -215
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +99 -60
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +60 -28
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +12 -10
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +109 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +32 -2
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +37 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +7 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +65 -47
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +29 -12
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +20 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c +6 -3
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb.h +776 -88
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.c +195 -35
- data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.h +5 -0
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb.h +23 -7
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.c +10 -3
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb.h +44 -0
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c +11 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/envoy/type/v3/scope.upb.h +218 -0
- data/src/core/ext/upb-gen/envoy/type/v3/scope.upb_minitable.c +70 -0
- data/src/core/ext/upb-gen/envoy/type/v3/scope.upb_minitable.h +31 -0
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/clusters.upbdefs.c +30 -24
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/server_info.upbdefs.c +166 -152
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +467 -422
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +15 -0
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +120 -110
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +912 -857
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/outlier_detection.upbdefs.c +26 -19
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +59 -54
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +356 -346
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/http_service.upbdefs.c +49 -37
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +599 -483
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.c +65 -49
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +165 -161
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +369 -327
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -15
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +129 -121
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +224 -204
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +2046 -1932
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.h +15 -0
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +70 -37
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +7 -3
- data/src/core/ext/upbdefs-gen/envoy/data/accesslog/v3/accesslog.upbdefs.c +5 -3
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/composite/v3/composite.upbdefs.c +121 -78
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/composite/v3/composite.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.c +165 -160
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +121 -118
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c +68 -37
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h +15 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c +48 -40
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +44 -37
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +919 -870
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upbdefs.c +26 -14
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +44 -36
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +372 -371
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +32 -28
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/address.upbdefs.c +17 -15
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.c +4 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/v3/scope.upbdefs.c +76 -0
- data/src/core/ext/upbdefs-gen/envoy/type/v3/scope.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/envoy/type/v3/token_bucket.upbdefs.c +1 -1
- data/src/core/filter/ext_proc/ext_proc_filter.cc +537 -259
- data/src/core/filter/ext_proc/ext_proc_filter.h +47 -14
- data/src/core/filter/ext_proc/ext_proc_messages.cc +38 -17
- data/src/core/filter/ext_proc/ext_proc_messages.h +19 -7
- data/src/core/filter/filter_args.h +5 -60
- data/src/core/handshaker/http_connect/http_connect_client_handshaker.cc +1 -1
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +23 -22
- data/src/core/handshaker/security/secure_endpoint.cc +16 -16
- data/src/core/lib/channel/channel_stack.cc +0 -12
- data/src/core/lib/channel/channel_stack.h +0 -8
- data/src/core/lib/channel/promise_based_filter.cc +57 -44
- data/src/core/lib/channel/promise_based_filter.h +29 -41
- data/src/core/lib/event_engine/ares_resolver.cc +10 -4
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +1 -1
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +1 -5
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +10 -12
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +3 -17
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +21 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +10 -12
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +1 -1
- data/src/core/lib/event_engine/posix_engine/timer.cc +2 -2
- data/src/core/lib/event_engine/shim.cc +1 -6
- data/src/core/lib/event_engine/shim.h +0 -5
- data/src/core/lib/event_engine/windows/windows_engine.cc +4 -4
- data/src/core/lib/event_engine/windows/windows_listener.cc +1 -1
- data/src/core/lib/experiments/experiments.cc +141 -246
- data/src/core/lib/experiments/experiments.h +42 -109
- data/src/core/lib/iomgr/iomgr_windows.cc +1 -6
- data/src/core/lib/iomgr/tcp_posix.cc +21 -21
- data/src/core/lib/iomgr/tcp_server_posix.cc +64 -242
- data/src/core/lib/iomgr/tcp_server_windows.cc +0 -469
- data/src/core/lib/promise/activity.cc +8 -8
- data/src/core/lib/promise/activity.h +5 -5
- data/src/core/lib/promise/inter_activity_pipe.h +3 -3
- data/src/core/lib/promise/party.cc +5 -5
- data/src/core/lib/promise/status_flag.h +7 -2
- data/src/core/lib/resource_quota/memory_quota.cc +2 -2
- data/src/core/lib/security/authorization/rbac_policy.h +2 -2
- data/src/core/lib/surface/call.cc +13 -3
- data/src/core/lib/surface/call.h +23 -6
- data/src/core/lib/surface/channel_create.cc +7 -1
- data/src/core/lib/surface/channel_init.h +1 -8
- data/src/core/lib/surface/filter_stack_call.cc +16 -0
- data/src/core/lib/surface/filter_stack_call.h +1 -0
- data/src/core/lib/surface/init.cc +3 -3
- data/src/core/lib/surface/legacy_channel.cc +4 -1
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/lib/transport/transport.cc +15 -8
- data/src/core/lib/transport/transport_framing_endpoint_extension.h +8 -2
- data/src/core/load_balancing/autosharding/autosharding.cc +0 -8
- data/src/core/load_balancing/outlier_detection/outlier_detection.cc +99 -8
- data/src/core/load_balancing/outlier_detection/outlier_detection_metrics.cc +38 -0
- data/src/core/load_balancing/outlier_detection/outlier_detection_metrics.h +55 -0
- data/src/core/load_balancing/ring_hash/ring_hash.cc +2 -1
- data/src/core/load_balancing/rls/rls.cc +21 -1
- data/src/core/load_balancing/xds/cds.cc +4 -51
- data/src/core/plugin_registry/grpc_plugin_registry.cc +10 -13
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -7
- data/src/core/resolver/xds/xds_resolver.cc +1 -1
- data/src/core/server/server.cc +60 -4
- data/src/core/server/server_config_selector.h +4 -18
- data/src/core/server/server_config_selector_filter.cc +20 -146
- data/src/core/server/server_config_selector_filter.h +2 -2
- data/src/core/server/xds_server_config_fetcher.cc +5 -20
- data/src/core/transport/auth_context.cc +15 -5
- data/src/core/transport/auth_context.h +5 -0
- data/src/core/tsi/ssl_telemetry_utils.cc +9 -1
- data/src/core/tsi/ssl_transport_security.cc +158 -52
- data/src/core/tsi/ssl_transport_security.h +18 -2
- data/src/core/tsi/ssl_transport_security_utils.cc +123 -12
- data/src/core/tsi/ssl_transport_security_utils.h +19 -0
- data/src/core/util/latent_see.cc +65 -3
- data/src/core/util/latent_see.h +57 -12
- data/src/core/util/linux/cpu.cc +12 -6
- data/src/core/util/mpscq.cc +2 -2
- data/src/core/util/sync_abseil.cc +3 -3
- data/src/core/util/trie_lookup.h +5 -1
- data/src/core/util/windows/env.cc +1 -0
- data/src/core/util/work_serializer.cc +1 -1
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +10 -9
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +3 -3
- data/src/core/xds/grpc/streaming_call_promise_wrapper.cc +5 -2
- data/src/core/xds/grpc/streaming_call_promise_wrapper.h +2 -5
- data/src/core/xds/grpc/xds_audit_logger_registry.cc +0 -54
- data/src/core/xds/grpc/xds_audit_logger_registry.h +0 -8
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +2 -28
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.h +0 -20
- data/src/core/xds/grpc/xds_client_grpc.cc +4 -4
- data/src/core/xds/grpc/xds_client_grpc.h +1 -1
- data/src/core/xds/grpc/xds_cluster_parser.cc +5 -1
- data/src/core/xds/grpc/xds_common_types_parser.cc +12 -0
- data/src/core/xds/grpc/xds_endpoint_parser.cc +3 -3
- data/src/core/xds/grpc/xds_http_composite_filter.cc +0 -5
- data/src/core/xds/grpc/xds_http_composite_filter.h +1 -27
- data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +1 -5
- data/src/core/xds/grpc/xds_http_ext_proc_filter.h +3 -29
- data/src/core/xds/grpc/xds_http_fault_filter.cc +0 -4
- data/src/core/xds/grpc/xds_http_fault_filter.h +0 -26
- data/src/core/xds/grpc/xds_http_filter.h +1 -63
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +0 -5
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +1 -27
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +0 -527
- data/src/core/xds/grpc/xds_http_rbac_filter.h +0 -15
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +0 -5
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +0 -26
- data/src/core/xds/grpc/xds_listener.cc +0 -2
- data/src/core/xds/grpc/xds_listener.h +0 -2
- data/src/core/xds/grpc/xds_listener_parser.cc +0 -7
- data/src/core/xds/grpc/xds_matcher.cc +17 -11
- data/src/core/xds/grpc/xds_matcher.h +2 -1
- data/src/core/xds/grpc/xds_matcher_context.cc +3 -0
- data/src/core/xds/grpc/xds_matcher_context.h +1 -1
- data/src/core/xds/grpc/xds_matcher_input.cc +19 -1
- data/src/core/xds/grpc/xds_matcher_parse.cc +3 -2
- data/src/core/xds/grpc/xds_route_config.cc +0 -2
- data/src/core/xds/grpc/xds_route_config.h +0 -2
- data/src/core/xds/grpc/xds_route_config_parser.cc +0 -5
- data/src/core/xds/grpc/xds_routing.cc +1 -112
- data/src/core/xds/grpc/xds_routing.h +0 -26
- data/src/core/xds/grpc/xds_transport_factory_grpc.cc +236 -0
- data/src/core/xds/grpc/xds_transport_factory_grpc.h +95 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +78 -241
- data/src/core/xds/grpc/xds_transport_grpc.h +41 -51
- data/src/core/xds/xds_client/lrs_client.cc +3 -5
- data/src/core/xds/xds_client/lrs_client.h +2 -1
- data/src/core/xds/xds_client/xds_client.cc +36 -23
- data/src/core/xds/xds_client/xds_client.h +6 -5
- data/src/core/xds/xds_client/xds_transport.h +110 -108
- data/src/core/xds/xds_client/xds_transport_factory.h +43 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -0
- data/src/ruby/lib/grpc/generic/rpc_server.rb +2 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/boringssl-with-bazel/crypto/asn1/a_type.cc +54 -19
- data/third_party/boringssl-with-bazel/crypto/asn1/asn1_lib.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/asn1/internal.h +58 -12
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_dec.cc +13 -13
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_enc.cc +13 -11
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_fre.cc +14 -18
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_new.cc +31 -35
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_typ.cc +0 -2
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_utl.cc +17 -24
- data/third_party/boringssl-with-bazel/crypto/bio/bio.cc +0 -1
- data/third_party/boringssl-with-bazel/crypto/bio/bio_mem.cc +9 -3
- data/third_party/boringssl-with-bazel/crypto/bio/connect.cc +3 -3
- data/third_party/boringssl-with-bazel/crypto/bio/fd.cc +0 -1
- data/third_party/boringssl-with-bazel/crypto/bio/file.cc +0 -1
- data/third_party/boringssl-with-bazel/crypto/bio/internal.h +2 -3
- data/third_party/boringssl-with-bazel/crypto/bio/pair.cc +0 -1
- data/third_party/boringssl-with-bazel/crypto/bio/socket.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/bytestring/cbb.cc +70 -45
- data/third_party/boringssl-with-bazel/crypto/bytestring/cbs.cc +15 -34
- data/third_party/boringssl-with-bazel/crypto/bytestring/internal.h +5 -0
- data/third_party/boringssl-with-bazel/crypto/cipher/e_aesgcmsiv.cc +20 -165
- data/third_party/boringssl-with-bazel/crypto/cipher/e_tls.cc +7 -4
- data/third_party/boringssl-with-bazel/crypto/cipher/internal.h +159 -0
- data/third_party/boringssl-with-bazel/crypto/curve25519/curve25519.cc +295 -16
- data/third_party/boringssl-with-bazel/crypto/curve25519/internal.h +25 -14
- data/third_party/boringssl-with-bazel/crypto/dh/params.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/ec/hash_to_curve.cc +208 -36
- data/third_party/boringssl-with-bazel/crypto/err/err.cc +3 -2
- data/third_party/boringssl-with-bazel/crypto/evp/evp.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/evp/evp_kem.cc +25 -6
- data/third_party/boringssl-with-bazel/crypto/evp/internal.h +15 -11
- data/third_party/boringssl-with-bazel/crypto/evp/p_ec.cc +121 -0
- data/third_party/boringssl-with-bazel/crypto/evp/p_mlkem.cc +34 -9
- data/third_party/boringssl-with-bazel/crypto/evp/p_rsa.cc +76 -8
- data/third_party/boringssl-with-bazel/crypto/evp/p_xwing.cc +47 -20
- data/third_party/boringssl-with-bazel/crypto/ex_data.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/aes_nohw.cc.inc +1 -1
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/gcm.cc.inc +2 -2
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bcm.cc +1 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/add.cc.inc +9 -4
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/asm/x86_64-gcc.cc.inc +4 -4
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/exponentiation.cc.inc +2 -2
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/internal.h +12 -6
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/jacobi.cc.inc +1 -1
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/montgomery_inv.cc.inc +4 -4
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/prime.cc.inc +3 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/rsaz_exp.cc.inc +6 -6
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/sqrt.cc.inc +21 -21
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/aead.cc.inc +4 -2
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/cipher.cc.inc +97 -132
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/internal.h +7 -6
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/dh.cc.inc +3 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/internal.h +1 -1
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec.cc.inc +77 -17
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec_montgomery.cc.inc +13 -13
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/felem.cc.inc +117 -34
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/internal.h +67 -18
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/oct.cc.inc +29 -151
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.cc.inc +740 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.h +207 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256.cc.inc +407 -519
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/simple.cc.inc +27 -28
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdsa/ecdsa.cc.inc +1 -1
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/jitter.cc.inc +1 -1
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/fips_shared_support.cc +4 -4
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/internal.h +70 -1
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/keccak.cc.inc +292 -52
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mldsa/mldsa.cc.inc +226 -69
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mlkem/mlkem.cc.inc +238 -83
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/rsa_impl.cc.inc +6 -6
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha1.cc.inc +2 -2
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/fors.cc.inc +1 -1
- data/third_party/boringssl-with-bazel/crypto/hpke/hpke.cc +327 -272
- data/third_party/boringssl-with-bazel/crypto/hrss/hrss.cc +14 -14
- data/third_party/boringssl-with-bazel/crypto/internal.h +63 -0
- data/third_party/boringssl-with-bazel/crypto/mem_internal.h +38 -3
- data/third_party/boringssl-with-bazel/crypto/obj/obj_dat.h +97 -1
- data/third_party/boringssl-with-bazel/crypto/pem/internal.h +86 -0
- data/third_party/boringssl-with-bazel/crypto/pem/pem_all.cc +8 -5
- data/third_party/boringssl-with-bazel/crypto/pem/pem_lib.cc +41 -73
- data/third_party/boringssl-with-bazel/crypto/pem/pem_pk8.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/pem/pem_pkey.cc +10 -4
- data/third_party/boringssl-with-bazel/crypto/pem/pem_x509.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/pem/pem_xaux.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7_x509.cc +2 -2
- data/third_party/boringssl-with-bazel/crypto/pkcs8/pkcs8_x509.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/poly1305/internal.h +17 -0
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_arm.cc +1 -13
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_vec.cc +3 -3
- data/third_party/boringssl-with-bazel/crypto/slhdsa/slhdsa.cc +23 -6
- data/third_party/boringssl-with-bazel/crypto/stack/stack.cc +7 -0
- data/third_party/boringssl-with-bazel/crypto/trust_token/internal.h +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/a_verify.cc +14 -7
- data/third_party/boringssl-with-bazel/crypto/x509/internal.h +110 -76
- data/third_party/boringssl-with-bazel/crypto/x509/name_print.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/rsa_pss.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/t_req.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/t_x509.cc +6 -5
- data/third_party/boringssl-with-bazel/crypto/x509/v3_crld.cc +11 -53
- data/third_party/boringssl-with-bazel/crypto/x509/v3_ncons.cc +5 -5
- data/third_party/boringssl-with-bazel/crypto/x509/v3_purp.cc +16 -39
- data/third_party/boringssl-with-bazel/crypto/x509/v3_skey.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/v3_utl.cc +12 -16
- data/third_party/boringssl-with-bazel/crypto/x509/x509_cmp.cc +9 -11
- data/third_party/boringssl-with-bazel/crypto/x509/x509_mtc.cc +598 -0
- data/third_party/boringssl-with-bazel/crypto/x509/x509_obj.cc +9 -8
- data/third_party/boringssl-with-bazel/crypto/x509/x509_set.cc +14 -18
- data/third_party/boringssl-with-bazel/crypto/x509/x509_vfy.cc +315 -390
- data/third_party/boringssl-with-bazel/crypto/x509/x509_vpm.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/x509name.cc +31 -29
- data/third_party/boringssl-with-bazel/crypto/x509/x_all.cc +10 -9
- data/third_party/boringssl-with-bazel/crypto/x509/x_crl.cc +3 -53
- data/third_party/boringssl-with-bazel/crypto/x509/x_name.cc +37 -59
- data/third_party/boringssl-with-bazel/crypto/x509/x_pubkey.cc +29 -47
- data/third_party/boringssl-with-bazel/crypto/x509/x_req.cc +2 -1
- data/third_party/boringssl-with-bazel/crypto/x509/x_x509.cc +53 -53
- data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_64_win_asm.inc +24 -0
- data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_win_asm.inc +24 -0
- data/third_party/boringssl-with-bazel/gen/crypto/err_data.cc +509 -497
- data/third_party/boringssl-with-bazel/include/openssl/aead.h +7 -19
- data/third_party/boringssl-with-bazel/include/openssl/asm_base.h +1 -1
- data/third_party/boringssl-with-bazel/include/openssl/asn1.h +6 -10
- data/third_party/boringssl-with-bazel/include/openssl/base.h +43 -16
- data/third_party/boringssl-with-bazel/include/openssl/bio.h +25 -10
- data/third_party/boringssl-with-bazel/include/openssl/bytestring.h +33 -1
- data/third_party/boringssl-with-bazel/include/openssl/cipher.h +11 -9
- data/third_party/boringssl-with-bazel/include/openssl/configuration.h +18 -0
- data/third_party/boringssl-with-bazel/include/openssl/curve25519.h +36 -0
- data/third_party/boringssl-with-bazel/include/openssl/digest.h +4 -4
- data/third_party/boringssl-with-bazel/include/openssl/ec.h +35 -1
- data/third_party/boringssl-with-bazel/include/openssl/ec_key.h +2 -2
- data/third_party/boringssl-with-bazel/include/openssl/evp.h +120 -3
- data/third_party/boringssl-with-bazel/include/openssl/evp_errors.h +1 -0
- data/third_party/boringssl-with-bazel/include/openssl/hmac.h +2 -2
- data/third_party/boringssl-with-bazel/include/openssl/hpke.h +38 -7
- data/third_party/boringssl-with-bazel/include/openssl/mem.h +5 -5
- data/third_party/boringssl-with-bazel/include/openssl/nid.h +42 -0
- data/third_party/boringssl-with-bazel/include/openssl/pem.h +650 -351
- data/third_party/boringssl-with-bazel/include/openssl/posix_time.h +4 -4
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols.h +130 -4
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_S.h +48 -0
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_c.h +24 -0
- data/third_party/boringssl-with-bazel/include/openssl/rsa.h +1 -1
- data/third_party/boringssl-with-bazel/include/openssl/slhdsa.h +25 -1
- data/third_party/boringssl-with-bazel/include/openssl/ssl.h +256 -87
- data/third_party/boringssl-with-bazel/include/openssl/stack.h +9 -0
- data/third_party/boringssl-with-bazel/include/openssl/types.h +18 -0
- data/third_party/boringssl-with-bazel/include/openssl/x509.h +40 -21
- data/third_party/boringssl-with-bazel/ssl/bio_ssl.cc +3 -5
- data/third_party/boringssl-with-bazel/ssl/d1_both.cc +146 -81
- data/third_party/boringssl-with-bazel/ssl/d1_lib.cc +39 -34
- data/third_party/boringssl-with-bazel/ssl/d1_pkt.cc +6 -6
- data/third_party/boringssl-with-bazel/ssl/d1_srtp.cc +10 -8
- data/third_party/boringssl-with-bazel/ssl/dtls_method.cc +4 -4
- data/third_party/boringssl-with-bazel/ssl/dtls_record.cc +15 -14
- data/third_party/boringssl-with-bazel/ssl/encrypted_client_hello.cc +41 -25
- data/third_party/boringssl-with-bazel/ssl/extensions.cc +153 -171
- data/third_party/boringssl-with-bazel/ssl/handoff.cc +79 -64
- data/third_party/boringssl-with-bazel/ssl/handshake.cc +15 -16
- data/third_party/boringssl-with-bazel/ssl/handshake_client.cc +35 -78
- data/third_party/boringssl-with-bazel/ssl/handshake_server.cc +75 -155
- data/third_party/boringssl-with-bazel/ssl/internal.h +419 -308
- data/third_party/boringssl-with-bazel/ssl/s3_both.cc +17 -150
- data/third_party/boringssl-with-bazel/ssl/s3_lib.cc +2 -3
- data/third_party/boringssl-with-bazel/ssl/s3_pkt.cc +10 -9
- data/third_party/boringssl-with-bazel/ssl/ssl_asn1.cc +13 -13
- data/third_party/boringssl-with-bazel/ssl/ssl_buffer.cc +8 -8
- data/third_party/boringssl-with-bazel/ssl/ssl_cert.cc +58 -24
- data/third_party/boringssl-with-bazel/ssl/ssl_cipher.cc +198 -26
- data/third_party/boringssl-with-bazel/ssl/ssl_credential.cc +164 -37
- data/third_party/boringssl-with-bazel/ssl/ssl_file.cc +10 -8
- data/third_party/boringssl-with-bazel/ssl/ssl_key_share.cc +2 -95
- data/third_party/boringssl-with-bazel/ssl/ssl_lib.cc +785 -472
- data/third_party/boringssl-with-bazel/ssl/ssl_privkey.cc +78 -67
- data/third_party/boringssl-with-bazel/ssl/ssl_session.cc +187 -150
- data/third_party/boringssl-with-bazel/ssl/ssl_stat.cc +6 -3
- data/third_party/boringssl-with-bazel/ssl/ssl_transcript.cc +1 -1
- data/third_party/boringssl-with-bazel/ssl/ssl_versions.cc +25 -19
- data/third_party/boringssl-with-bazel/ssl/ssl_x509.cc +148 -114
- data/third_party/boringssl-with-bazel/ssl/t1_enc.cc +28 -19
- data/third_party/boringssl-with-bazel/ssl/tls13_both.cc +24 -22
- data/third_party/boringssl-with-bazel/ssl/tls13_client.cc +30 -30
- data/third_party/boringssl-with-bazel/ssl/tls13_enc.cc +17 -16
- data/third_party/boringssl-with-bazel/ssl/tls13_server.cc +55 -63
- data/third_party/boringssl-with-bazel/ssl/tls_method.cc +12 -12
- data/third_party/boringssl-with-bazel/ssl/tls_record.cc +23 -20
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_64.h +38 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_64_msvc.h +2 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_field.c.inc +26 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_point.br.c.inc +0 -54
- data/third_party/cares/cares/include/ares.h +8 -0
- data/third_party/cares/cares/include/ares_dns_record.h +3 -2
- data/third_party/cares/cares/include/ares_version.h +3 -3
- data/third_party/cares/cares/src/lib/ares_addrinfo_localhost.c +20 -20
- data/third_party/cares/cares/src/lib/ares_cancel.c +17 -8
- data/third_party/cares/cares/src/lib/ares_close_sockets.c +81 -16
- data/third_party/cares/cares/src/lib/ares_conn.c +256 -10
- data/third_party/cares/cares/src/lib/ares_conn.h +40 -3
- data/third_party/cares/cares/src/lib/ares_cookie.c +2 -2
- data/third_party/cares/cares/src/lib/ares_destroy.c +75 -10
- data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +85 -10
- data/third_party/cares/cares/src/lib/ares_gethostbyaddr.c +5 -0
- data/third_party/cares/cares/src/lib/ares_gethostbyname.c +4 -0
- data/third_party/cares/cares/src/lib/ares_getnameinfo.c +10 -2
- data/third_party/cares/cares/src/lib/ares_hosts_file.c +8 -0
- data/third_party/cares/cares/src/lib/ares_inet_net_pton.h +28 -0
- data/third_party/cares/cares/src/lib/ares_init.c +55 -10
- data/third_party/cares/cares/src/lib/ares_library_init.c +25 -7
- data/third_party/cares/cares/src/lib/ares_options.c +38 -10
- data/third_party/cares/cares/src/lib/ares_parse_into_addrinfo.c +1 -1
- data/third_party/cares/cares/src/lib/ares_private.h +186 -27
- data/third_party/cares/cares/src/lib/ares_process.c +604 -112
- data/third_party/cares/cares/src/lib/ares_qcache.c +200 -36
- data/third_party/cares/cares/src/lib/ares_query.c +5 -0
- data/third_party/cares/cares/src/lib/ares_search.c +10 -0
- data/third_party/cares/cares/src/lib/ares_send.c +81 -10
- data/third_party/cares/cares/src/lib/ares_set_socket_functions.c +3 -1
- data/third_party/cares/cares/src/lib/ares_socket.c +28 -0
- data/third_party/cares/cares/src/lib/ares_socket.h +23 -0
- data/third_party/cares/cares/src/lib/ares_sysconfig.c +6 -3
- data/third_party/cares/cares/src/lib/ares_sysconfig_files.c +33 -11
- data/third_party/cares/cares/src/lib/ares_sysconfig_win.c +132 -80
- data/third_party/cares/cares/src/lib/ares_timeout.c +11 -0
- data/third_party/cares/cares/src/lib/ares_update_servers.c +55 -11
- data/third_party/cares/cares/src/lib/dsa/ares_array.c +20 -5
- data/third_party/cares/cares/src/lib/dsa/ares_htable.c +8 -4
- data/third_party/cares/cares/src/lib/dsa/ares_htable_dict.c +2 -0
- data/third_party/cares/cares/src/lib/dsa/ares_llist.c +4 -1
- data/third_party/cares/cares/src/lib/event/ares_event_configchg.c +5 -2
- data/third_party/cares/cares/src/lib/event/ares_event_select.c +14 -1
- data/third_party/cares/cares/src/lib/event/ares_event_thread.c +8 -0
- data/third_party/cares/cares/src/lib/event/ares_event_wake_pipe.c +7 -1
- data/third_party/cares/cares/src/lib/event/ares_event_win32.c +3 -0
- data/third_party/cares/cares/src/lib/include/ares_mem.h +3 -0
- data/third_party/cares/cares/src/lib/include/ares_str.h +17 -0
- data/third_party/cares/cares/src/lib/inet_net_pton.c +37 -28
- data/third_party/cares/cares/src/lib/legacy/ares_expand_name.c +1 -1
- data/third_party/cares/cares/src/lib/legacy/ares_parse_a_reply.c +5 -2
- data/third_party/cares/cares/src/lib/legacy/ares_parse_aaaa_reply.c +5 -2
- data/third_party/cares/cares/src/lib/legacy/ares_parse_ns_reply.c +2 -2
- data/third_party/cares/cares/src/lib/legacy/ares_parse_ptr_reply.c +2 -2
- data/third_party/cares/cares/src/lib/legacy/ares_parse_uri_reply.c +1 -1
- data/third_party/cares/cares/src/lib/record/ares_dns_mapping.c +19 -4
- data/third_party/cares/cares/src/lib/record/ares_dns_multistring.c +3 -1
- data/third_party/cares/cares/src/lib/record/ares_dns_name.c +67 -4
- data/third_party/cares/cares/src/lib/record/ares_dns_parse.c +62 -34
- data/third_party/cares/cares/src/lib/record/ares_dns_private.h +4 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_record.c +47 -7
- data/third_party/cares/cares/src/lib/record/ares_dns_write.c +13 -5
- data/third_party/cares/cares/src/lib/str/ares_buf.c +33 -16
- data/third_party/cares/cares/src/lib/str/ares_str.c +54 -0
- data/third_party/cares/cares/src/lib/util/ares_iface_ips.c +22 -10
- data/third_party/cares/cares/src/lib/util/ares_iface_ips.h +1 -0
- data/third_party/cares/cares/src/lib/util/ares_math.c +17 -2
- data/third_party/cares/cares/src/lib/util/ares_math.h +32 -7
- data/third_party/cares/cares/src/lib/util/ares_rand.c +4 -4
- data/third_party/cares/cares/src/lib/util/ares_threads.c +1 -2
- data/third_party/cares/cares/src/lib/util/ares_time.h +1 -0
- data/third_party/cares/cares/src/lib/util/ares_uri.c +9 -3
- data/third_party/zlib/compress.c +34 -10
- data/third_party/zlib/crc32.c +49 -115
- data/third_party/zlib/deflate.c +107 -61
- data/third_party/zlib/deflate.h +7 -1
- data/third_party/zlib/gzguts.h +33 -31
- data/third_party/zlib/infback.c +20 -67
- data/third_party/zlib/inffast.c +7 -6
- data/third_party/zlib/inffixed.h +91 -91
- data/third_party/zlib/inflate.c +38 -151
- data/third_party/zlib/inflate.h +1 -1
- data/third_party/zlib/inftrees.c +134 -9
- data/third_party/zlib/inftrees.h +3 -1
- data/third_party/zlib/trees.c +14 -12
- data/third_party/zlib/uncompr.c +39 -23
- data/third_party/zlib/zconf.h +27 -19
- data/third_party/zlib/zlib.h +215 -96
- data/third_party/zlib/zutil.c +49 -35
- data/third_party/zlib/zutil.h +87 -10
- metadata +23 -9
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +0 -916
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +0 -84
- data/src/core/server/xds_channel_stack_modifier.cc +0 -108
- data/src/core/server/xds_channel_stack_modifier.h +0 -62
- data/src/core/server/xds_server_config_fetcher_legacy.cc +0 -1340
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256_internal.h +0 -193
- data/third_party/boringssl-with-bazel/crypto/kyber/internal.h +0 -165
- data/third_party/boringssl-with-bazel/crypto/kyber/kyber.cc +0 -870
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
#include <ctype.h>
|
|
16
15
|
#include <limits.h>
|
|
17
16
|
#include <string.h>
|
|
18
17
|
#include <time.h>
|
|
@@ -61,7 +60,8 @@ static ExDataClass g_ex_data_class(/*with_app_data=*/true);
|
|
|
61
60
|
#define CRL_SCORE_AKID 0x004
|
|
62
61
|
|
|
63
62
|
static int null_callback(int ok, X509_STORE_CTX *e);
|
|
64
|
-
static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk,
|
|
63
|
+
static X509 *find_issuer(X509_STORE_CTX *ctx, const STACK_OF(X509) *sk,
|
|
64
|
+
const X509 *x);
|
|
65
65
|
static int check_chain_extensions(X509_STORE_CTX *ctx);
|
|
66
66
|
static int check_name_constraints(X509_STORE_CTX *ctx);
|
|
67
67
|
static int check_id(X509_STORE_CTX *ctx);
|
|
@@ -70,7 +70,7 @@ static int check_revocation(X509_STORE_CTX *ctx);
|
|
|
70
70
|
static int check_cert(X509_STORE_CTX *ctx);
|
|
71
71
|
static int check_policy(X509_STORE_CTX *ctx);
|
|
72
72
|
|
|
73
|
-
static X509
|
|
73
|
+
static UniquePtr<X509> get_trusted_issuer(X509_STORE_CTX *ctx, const X509 *x);
|
|
74
74
|
static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, X509_CRL *crl,
|
|
75
75
|
X509 *x);
|
|
76
76
|
static int get_crl(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509 *x);
|
|
@@ -108,316 +108,261 @@ static int call_verify_cb(int ok, X509_STORE_CTX *ctx) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// Given a certificate try and find an exact match in the store
|
|
111
|
-
static X509
|
|
112
|
-
STACK_OF(X509) *certs;
|
|
113
|
-
X509 *xtmp = nullptr;
|
|
114
|
-
size_t i;
|
|
111
|
+
static UniquePtr<X509> lookup_cert_match(X509_STORE_CTX *ctx, const X509 *x) {
|
|
115
112
|
// Lookup all certs with matching subject name
|
|
116
|
-
|
|
113
|
+
UniquePtr<STACK_OF(X509)> certs(
|
|
114
|
+
X509_STORE_CTX_get1_certs(ctx, X509_get_subject_name(x)));
|
|
117
115
|
if (certs == nullptr) {
|
|
118
116
|
return nullptr;
|
|
119
117
|
}
|
|
120
118
|
// Look for exact match
|
|
121
|
-
for (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
break;
|
|
119
|
+
for (X509 *found : certs.get()) {
|
|
120
|
+
if (X509_cmp(found, x) == 0) {
|
|
121
|
+
return UpRef(found);
|
|
125
122
|
}
|
|
126
123
|
}
|
|
127
|
-
|
|
128
|
-
X509_up_ref(xtmp);
|
|
129
|
-
} else {
|
|
130
|
-
xtmp = nullptr;
|
|
131
|
-
}
|
|
132
|
-
sk_X509_pop_free(certs, X509_free);
|
|
133
|
-
return xtmp;
|
|
124
|
+
return nullptr;
|
|
134
125
|
}
|
|
135
126
|
|
|
136
127
|
int X509_verify_cert(X509_STORE_CTX *ctx) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
128
|
+
int ok = 0;
|
|
129
|
+
Cleanup set_ctx_error = [&] {
|
|
130
|
+
// Safety net, error returns must set ctx->error
|
|
131
|
+
if (!ok && ctx->error == X509_V_OK) {
|
|
132
|
+
ctx->error = X509_V_ERR_UNSPECIFIED;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const X509_VERIFY_PARAM *param = ctx->param;
|
|
137
|
+
if (ctx->cert == nullptr) {
|
|
138
|
+
OPENSSL_PUT_ERROR(X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);
|
|
139
|
+
ctx->error = X509_V_ERR_INVALID_CALL;
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (ctx->chain != nullptr) {
|
|
144
|
+
// This X509_STORE_CTX has already been used to verify a cert. We
|
|
145
|
+
// cannot do another one.
|
|
146
|
+
OPENSSL_PUT_ERROR(X509, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
|
147
|
+
ctx->error = X509_V_ERR_INVALID_CALL;
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (param->flags &
|
|
152
|
+
(X509_V_FLAG_EXTENDED_CRL_SUPPORT | X509_V_FLAG_USE_DELTAS)) {
|
|
153
|
+
// We do not support indirect or delta CRLs. The flags still exist for
|
|
154
|
+
// compatibility with bindings libraries, but to ensure we do not
|
|
155
|
+
// inadvertently skip a CRL check that the caller expects, fail closed.
|
|
156
|
+
OPENSSL_PUT_ERROR(X509, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
|
157
|
+
ctx->error = X509_V_ERR_INVALID_CALL;
|
|
158
|
+
return 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// first we make sure the chain we are going to build is present and that
|
|
162
|
+
// the first entry is in place
|
|
163
|
+
ctx->chain = sk_X509_new_null();
|
|
164
|
+
if (ctx->chain == nullptr || !PushToStack(ctx->chain, UpRef(ctx->cert))) {
|
|
165
|
+
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
166
|
+
return 0;
|
|
167
|
+
}
|
|
168
|
+
ctx->last_untrusted = 1;
|
|
169
|
+
|
|
170
|
+
// We use a temporary STACK so we can chop and hack at it. `sktmp` is not a
|
|
171
|
+
// `UniquePtr<STACK_OF(X509)>` because that would do a deep free and this is a
|
|
172
|
+
// shallow free.
|
|
142
173
|
STACK_OF(X509) *sktmp = nullptr;
|
|
174
|
+
Cleanup free_sktmp = [&] { sk_X509_free(sktmp); };
|
|
175
|
+
if (ctx->untrusted != nullptr &&
|
|
176
|
+
(sktmp = sk_X509_dup(ctx->untrusted)) == nullptr) {
|
|
177
|
+
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
178
|
+
return 0;
|
|
179
|
+
}
|
|
143
180
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
181
|
+
// Maintain invariants: `num` is always the size of `ctx->chain` and `last` is
|
|
182
|
+
// always the last element.
|
|
183
|
+
int num = (int)sk_X509_num(ctx->chain);
|
|
184
|
+
X509 *last = sk_X509_last(ctx->chain);
|
|
185
|
+
// `param->depth` does not include the leaf certificate or the trust anchor,
|
|
186
|
+
// so the maximum size is 2 more.
|
|
187
|
+
int max_chain = param->depth >= INT_MAX - 2 ? INT_MAX : param->depth + 2;
|
|
150
188
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return 0;
|
|
189
|
+
for (;;) {
|
|
190
|
+
if (num >= max_chain) {
|
|
191
|
+
// FIXME: If this happens, we should take note of it and, if
|
|
192
|
+
// appropriate, use the X509_V_ERR_CERT_CHAIN_TOO_LONG error code later.
|
|
193
|
+
break;
|
|
157
194
|
}
|
|
158
195
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
// compatibility with bindings libraries, but to ensure we do not
|
|
163
|
-
// inadvertently skip a CRL check that the caller expects, fail closed.
|
|
164
|
-
OPENSSL_PUT_ERROR(X509, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
|
165
|
-
ctx->error = X509_V_ERR_INVALID_CALL;
|
|
196
|
+
int is_self_signed;
|
|
197
|
+
if (!cert_self_signed(last, &is_self_signed)) {
|
|
198
|
+
ctx->error = X509_V_ERR_INVALID_EXTENSION;
|
|
166
199
|
return 0;
|
|
167
200
|
}
|
|
168
201
|
|
|
169
|
-
//
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (ctx->chain == nullptr || !sk_X509_push(ctx->chain, ctx->cert)) {
|
|
173
|
-
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
174
|
-
goto end;
|
|
202
|
+
// If we are self signed, we break
|
|
203
|
+
if (is_self_signed) {
|
|
204
|
+
break;
|
|
175
205
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
(sktmp = sk_X509_dup(ctx->untrusted)) == nullptr) {
|
|
182
|
-
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
183
|
-
goto end;
|
|
206
|
+
// See if we can find issuer in trusted store first.
|
|
207
|
+
if (UniquePtr<X509> trusted = get_trusted_issuer(ctx, last);
|
|
208
|
+
trusted != nullptr) {
|
|
209
|
+
// Free the certificate. It will be picked up again later.
|
|
210
|
+
break;
|
|
184
211
|
}
|
|
185
212
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
213
|
+
// If we were passed a cert chain, use it first
|
|
214
|
+
if (sktmp != nullptr) {
|
|
215
|
+
X509 *issuer = find_issuer(ctx, sktmp, last);
|
|
216
|
+
if (issuer != nullptr) {
|
|
217
|
+
if (!PushToStack(ctx->chain, UpRef(issuer))) {
|
|
218
|
+
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
219
|
+
return 0;
|
|
220
|
+
}
|
|
221
|
+
(void)sk_X509_delete_ptr(sktmp, issuer);
|
|
222
|
+
ctx->last_untrusted++;
|
|
223
|
+
last = issuer;
|
|
224
|
+
num++;
|
|
225
|
+
// reparse the full chain for the next one
|
|
226
|
+
continue;
|
|
197
227
|
}
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
198
231
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
232
|
+
// At this point, chain should contain a list of untrusted certificates.
|
|
233
|
+
// We now need to add at least one trusted one, if possible, otherwise we
|
|
234
|
+
// complain.
|
|
235
|
+
assert(num == static_cast<int>(sk_X509_num(ctx->chain)));
|
|
236
|
+
assert(last == sk_X509_last(ctx->chain));
|
|
204
237
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
X509 *issuer = get_trusted_issuer(ctx, x);
|
|
212
|
-
if (issuer != nullptr) {
|
|
213
|
-
// Free the certificate. It will be picked up again later.
|
|
214
|
-
X509_free(issuer);
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
238
|
+
// Examine last certificate in chain and see if it is self signed.
|
|
239
|
+
int is_self_signed;
|
|
240
|
+
if (!cert_self_signed(last, &is_self_signed)) {
|
|
241
|
+
ctx->error = X509_V_ERR_INVALID_EXTENSION;
|
|
242
|
+
return 0;
|
|
243
|
+
}
|
|
218
244
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
245
|
+
int bad_chain = 0;
|
|
246
|
+
UniquePtr<X509> chain_ss;
|
|
247
|
+
if (is_self_signed) {
|
|
248
|
+
// we have a self signed certificate
|
|
249
|
+
if (sk_X509_num(ctx->chain) == 1) {
|
|
250
|
+
// We have a single self signed certificate: see if we can
|
|
251
|
+
// find it in the store. We must have an exact match to avoid
|
|
252
|
+
// possible impersonation.
|
|
253
|
+
UniquePtr<X509> issuer = get_trusted_issuer(ctx, last);
|
|
254
|
+
if (issuer == nullptr || X509_cmp(last, issuer.get()) != 0) {
|
|
255
|
+
ctx->error = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT;
|
|
256
|
+
ctx->current_cert = last;
|
|
257
|
+
ctx->error_depth = num - 1;
|
|
258
|
+
bad_chain = 1;
|
|
259
|
+
if (!call_verify_cb(0, ctx)) {
|
|
260
|
+
return 0;
|
|
234
261
|
}
|
|
262
|
+
} else {
|
|
263
|
+
// We have a match: replace certificate with store
|
|
264
|
+
// version so we get any trust settings.
|
|
265
|
+
X509_free(last);
|
|
266
|
+
last = issuer.release();
|
|
267
|
+
(void)sk_X509_set(ctx->chain, num - 1, last);
|
|
268
|
+
ctx->last_untrusted = 0;
|
|
235
269
|
}
|
|
270
|
+
} else {
|
|
271
|
+
// extract and save self signed certificate for later use
|
|
272
|
+
chain_ss.reset(sk_X509_pop(ctx->chain));
|
|
273
|
+
ctx->last_untrusted--;
|
|
274
|
+
num--;
|
|
275
|
+
last = sk_X509_value(ctx->chain, num - 1);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
// We now lookup certs from the certificate store
|
|
279
|
+
for (;;) {
|
|
280
|
+
if (num >= max_chain) {
|
|
281
|
+
// FIXME: If this happens, we should take note of it and, if
|
|
282
|
+
// appropriate, use the X509_V_ERR_CERT_CHAIN_TOO_LONG error code
|
|
283
|
+
// later.
|
|
236
284
|
break;
|
|
237
285
|
}
|
|
286
|
+
if (!cert_self_signed(last, &is_self_signed)) {
|
|
287
|
+
ctx->error = X509_V_ERR_INVALID_EXTENSION;
|
|
288
|
+
return 0;
|
|
289
|
+
}
|
|
290
|
+
// If we are self signed, we break
|
|
291
|
+
if (is_self_signed) {
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
UniquePtr<X509> issuer = get_trusted_issuer(ctx, last);
|
|
295
|
+
if (issuer == nullptr) {
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
last = issuer.get();
|
|
299
|
+
if (!PushToStack(ctx->chain, std::move(issuer))) {
|
|
300
|
+
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
301
|
+
return 0;
|
|
302
|
+
}
|
|
303
|
+
num++;
|
|
304
|
+
}
|
|
238
305
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
// at this point, chain should contain a list of untrusted certificates.
|
|
242
|
-
// We now need to add at least one trusted one, if possible, otherwise we
|
|
243
|
-
// complain.
|
|
244
|
-
|
|
245
|
-
do {
|
|
246
|
-
// Examine last certificate in chain and see if it is self signed.
|
|
247
|
-
i = (int)sk_X509_num(ctx->chain);
|
|
248
|
-
x = sk_X509_value(ctx->chain, i - 1);
|
|
249
|
-
|
|
250
|
-
int is_self_signed;
|
|
251
|
-
if (!cert_self_signed(x, &is_self_signed)) {
|
|
252
|
-
ctx->error = X509_V_ERR_INVALID_EXTENSION;
|
|
253
|
-
goto end;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (is_self_signed) {
|
|
257
|
-
// we have a self signed certificate
|
|
258
|
-
if (sk_X509_num(ctx->chain) == 1) {
|
|
259
|
-
// We have a single self signed certificate: see if we can
|
|
260
|
-
// find it in the store. We must have an exact match to avoid
|
|
261
|
-
// possible impersonation.
|
|
262
|
-
X509 *issuer = get_trusted_issuer(ctx, x);
|
|
263
|
-
if (issuer == nullptr || X509_cmp(x, issuer) != 0) {
|
|
264
|
-
X509_free(issuer);
|
|
265
|
-
ctx->error = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT;
|
|
266
|
-
ctx->current_cert = x;
|
|
267
|
-
ctx->error_depth = i - 1;
|
|
268
|
-
bad_chain = 1;
|
|
269
|
-
if (!call_verify_cb(0, ctx)) {
|
|
270
|
-
goto end;
|
|
271
|
-
}
|
|
272
|
-
} else {
|
|
273
|
-
// We have a match: replace certificate with store
|
|
274
|
-
// version so we get any trust settings.
|
|
275
|
-
X509_free(x);
|
|
276
|
-
x = issuer;
|
|
277
|
-
(void)sk_X509_set(ctx->chain, i - 1, x);
|
|
278
|
-
ctx->last_untrusted = 0;
|
|
279
|
-
}
|
|
280
|
-
} else {
|
|
281
|
-
// extract and save self signed certificate for later use
|
|
282
|
-
chain_ss = sk_X509_pop(ctx->chain);
|
|
283
|
-
ctx->last_untrusted--;
|
|
284
|
-
num--;
|
|
285
|
-
j--;
|
|
286
|
-
x = sk_X509_value(ctx->chain, num - 1);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
// We now lookup certs from the certificate store
|
|
290
|
-
for (;;) {
|
|
291
|
-
if (num >= max_chain) {
|
|
292
|
-
// FIXME: If this happens, we should take note of it and, if
|
|
293
|
-
// appropriate, use the X509_V_ERR_CERT_CHAIN_TOO_LONG error code
|
|
294
|
-
// later.
|
|
295
|
-
break;
|
|
296
|
-
}
|
|
297
|
-
if (!cert_self_signed(x, &is_self_signed)) {
|
|
298
|
-
ctx->error = X509_V_ERR_INVALID_EXTENSION;
|
|
299
|
-
goto end;
|
|
300
|
-
}
|
|
301
|
-
// If we are self signed, we break
|
|
302
|
-
if (is_self_signed) {
|
|
303
|
-
break;
|
|
304
|
-
}
|
|
305
|
-
X509 *issuer = get_trusted_issuer(ctx, x);
|
|
306
|
-
if (issuer == nullptr) {
|
|
307
|
-
break;
|
|
308
|
-
}
|
|
309
|
-
x = issuer;
|
|
310
|
-
if (!sk_X509_push(ctx->chain, x)) {
|
|
311
|
-
X509_free(issuer);
|
|
312
|
-
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
313
|
-
goto end;
|
|
314
|
-
}
|
|
315
|
-
num++;
|
|
316
|
-
}
|
|
306
|
+
// we now have our chain, lets check it...
|
|
307
|
+
int trust = check_trust(ctx);
|
|
317
308
|
|
|
318
|
-
|
|
319
|
-
|
|
309
|
+
// If explicitly rejected error
|
|
310
|
+
if (trust == X509_TRUST_REJECTED) {
|
|
311
|
+
return 0;
|
|
312
|
+
}
|
|
320
313
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
retry = 0;
|
|
330
|
-
if (trust != X509_TRUST_TRUSTED &&
|
|
331
|
-
!(ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) &&
|
|
332
|
-
!(ctx->param->flags & X509_V_FLAG_NO_ALT_CHAINS)) {
|
|
333
|
-
while (j-- > 1) {
|
|
334
|
-
X509 *issuer =
|
|
335
|
-
get_trusted_issuer(ctx, sk_X509_value(ctx->chain, j - 1));
|
|
336
|
-
// Check if we found an alternate chain
|
|
337
|
-
if (issuer != nullptr) {
|
|
338
|
-
// Free up the found cert we'll add it again later
|
|
339
|
-
X509_free(issuer);
|
|
340
|
-
|
|
341
|
-
// Dump all the certs above this point - we've found an
|
|
342
|
-
// alternate chain
|
|
343
|
-
while (num > j) {
|
|
344
|
-
X509_free(sk_X509_pop(ctx->chain));
|
|
345
|
-
num--;
|
|
346
|
-
}
|
|
347
|
-
ctx->last_untrusted = (int)sk_X509_num(ctx->chain);
|
|
348
|
-
retry = 1;
|
|
349
|
-
break;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
} while (retry);
|
|
354
|
-
|
|
355
|
-
// If not explicitly trusted then indicate error unless it's a single
|
|
356
|
-
// self signed certificate in which case we've indicated an error already
|
|
357
|
-
// and set bad_chain == 1
|
|
358
|
-
if (trust != X509_TRUST_TRUSTED && !bad_chain) {
|
|
359
|
-
if (chain_ss == nullptr ||
|
|
360
|
-
!x509_check_issued_with_callback(ctx, x, chain_ss)) {
|
|
361
|
-
if (ctx->last_untrusted >= num) {
|
|
362
|
-
ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY;
|
|
363
|
-
} else {
|
|
364
|
-
ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
|
|
365
|
-
}
|
|
366
|
-
ctx->current_cert = x;
|
|
314
|
+
// If not explicitly trusted then indicate error unless it's a single
|
|
315
|
+
// self signed certificate in which case we've indicated an error already
|
|
316
|
+
// and set bad_chain == 1
|
|
317
|
+
if (trust != X509_TRUST_TRUSTED && !bad_chain) {
|
|
318
|
+
if (chain_ss == nullptr ||
|
|
319
|
+
!x509_check_issued_with_callback(ctx, last, chain_ss.get())) {
|
|
320
|
+
if (ctx->last_untrusted >= num) {
|
|
321
|
+
ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY;
|
|
367
322
|
} else {
|
|
368
|
-
|
|
369
|
-
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
370
|
-
goto end;
|
|
371
|
-
}
|
|
372
|
-
num++;
|
|
373
|
-
ctx->last_untrusted = num;
|
|
374
|
-
ctx->current_cert = chain_ss;
|
|
375
|
-
ctx->error = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN;
|
|
376
|
-
chain_ss = nullptr;
|
|
323
|
+
ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
|
|
377
324
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
325
|
+
ctx->current_cert = last;
|
|
326
|
+
} else {
|
|
327
|
+
if (!PushToStack(ctx->chain, std::move(chain_ss))) {
|
|
328
|
+
ctx->error = X509_V_ERR_OUT_OF_MEM;
|
|
329
|
+
return 0;
|
|
383
330
|
}
|
|
331
|
+
num++;
|
|
332
|
+
ctx->last_untrusted = num;
|
|
333
|
+
ctx->current_cert = sk_X509_last(ctx->chain);
|
|
334
|
+
ctx->error = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN;
|
|
384
335
|
}
|
|
385
336
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
// be needed for CRL signature verification.
|
|
391
|
-
!check_revocation(ctx) || //
|
|
392
|
-
!internal_verify(ctx) || //
|
|
393
|
-
!check_name_constraints(ctx) ||
|
|
394
|
-
// TODO(davidben): Does `check_policy` still need to be conditioned on
|
|
395
|
-
// |!bad_chain|? DoS concerns have been resolved.
|
|
396
|
-
(!bad_chain && !check_policy(ctx))) {
|
|
397
|
-
goto end;
|
|
337
|
+
ctx->error_depth = num - 1;
|
|
338
|
+
bad_chain = 1;
|
|
339
|
+
if (!call_verify_cb(0, ctx)) {
|
|
340
|
+
return 0;
|
|
398
341
|
}
|
|
399
|
-
|
|
400
|
-
ok = 1;
|
|
401
342
|
}
|
|
402
343
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
344
|
+
// We have the chain complete: now we need to check its purpose
|
|
345
|
+
if (!check_chain_extensions(ctx) || //
|
|
346
|
+
!check_id(ctx) ||
|
|
347
|
+
// We check revocation status after copying parameters because they may
|
|
348
|
+
// be needed for CRL signature verification.
|
|
349
|
+
!check_revocation(ctx) || //
|
|
350
|
+
!internal_verify(ctx) || //
|
|
351
|
+
!check_name_constraints(ctx) ||
|
|
352
|
+
// TODO(davidben): Does `check_policy` still need to be conditioned on
|
|
353
|
+
// |!bad_chain|? DoS concerns have been resolved.
|
|
354
|
+
(!bad_chain && !check_policy(ctx))) {
|
|
355
|
+
return 0;
|
|
410
356
|
}
|
|
411
|
-
|
|
357
|
+
|
|
358
|
+
ok = 1;
|
|
359
|
+
return 1;
|
|
412
360
|
}
|
|
413
361
|
|
|
414
362
|
// Given a STACK_OF(X509) find the issuer of cert (if any)
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
X509 *issuer;
|
|
419
|
-
for (i = 0; i < sk_X509_num(sk); i++) {
|
|
420
|
-
issuer = sk_X509_value(sk, i);
|
|
363
|
+
static X509 *find_issuer(X509_STORE_CTX *ctx, const STACK_OF(X509) *sk,
|
|
364
|
+
const X509 *x) {
|
|
365
|
+
for (X509 *issuer : sk) {
|
|
421
366
|
if (x509_check_issued_with_callback(ctx, x, issuer)) {
|
|
422
367
|
return issuer;
|
|
423
368
|
}
|
|
@@ -426,7 +371,6 @@ static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x) {
|
|
|
426
371
|
}
|
|
427
372
|
|
|
428
373
|
// Given a possible certificate and issuer check them
|
|
429
|
-
|
|
430
374
|
int bssl::x509_check_issued_with_callback(X509_STORE_CTX *ctx, const X509 *x,
|
|
431
375
|
const X509 *issuer) {
|
|
432
376
|
int ret;
|
|
@@ -444,26 +388,22 @@ int bssl::x509_check_issued_with_callback(X509_STORE_CTX *ctx, const X509 *x,
|
|
|
444
388
|
return call_verify_cb(0, ctx);
|
|
445
389
|
}
|
|
446
390
|
|
|
447
|
-
static X509
|
|
448
|
-
X509 *issuer;
|
|
391
|
+
static UniquePtr<X509> get_trusted_issuer(X509_STORE_CTX *ctx, const X509 *x) {
|
|
449
392
|
if (ctx->trusted_stack != nullptr) {
|
|
450
393
|
// Ignore the store and use the configured stack instead.
|
|
451
|
-
|
|
452
|
-
if (issuer != nullptr) {
|
|
453
|
-
X509_up_ref(issuer);
|
|
454
|
-
}
|
|
455
|
-
return issuer;
|
|
394
|
+
return UpRef(find_issuer(ctx, ctx->trusted_stack, x));
|
|
456
395
|
}
|
|
457
396
|
|
|
397
|
+
X509 *issuer = nullptr;
|
|
458
398
|
if (!X509_STORE_CTX_get1_issuer(&issuer, ctx, x)) {
|
|
459
399
|
return nullptr;
|
|
460
400
|
}
|
|
461
|
-
|
|
401
|
+
// `X509_STORE_CTX_get1_issuer` passes ownership of `issuer`.
|
|
402
|
+
return UniquePtr<X509>(issuer);
|
|
462
403
|
}
|
|
463
404
|
|
|
464
405
|
// Check a certificate chains extensions for consistency with the supplied
|
|
465
406
|
// purpose
|
|
466
|
-
|
|
467
407
|
static int check_chain_extensions(X509_STORE_CTX *ctx) {
|
|
468
408
|
int plen = 0;
|
|
469
409
|
int purpose = ctx->param->purpose;
|
|
@@ -499,9 +439,16 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) {
|
|
|
499
439
|
return 0;
|
|
500
440
|
}
|
|
501
441
|
}
|
|
502
|
-
// Check
|
|
503
|
-
|
|
504
|
-
|
|
442
|
+
// Check path length constraints. See steps (l) and (m) of RFC 5280,
|
|
443
|
+
// section 6.1.4. Note the spec is structured differently from this
|
|
444
|
+
// logic. Section 6.1.4 runs from root to leaf and does not run on
|
|
445
|
+
// the leaf. `plen` counts the number of times step (l) would have
|
|
446
|
+
// run. The constraint is violated if some `x->ex_pathlen`, read in
|
|
447
|
+
// step (m), is too low to be decremented `plen` times.
|
|
448
|
+
//
|
|
449
|
+
// Note that path lengths of self-issued certificates still have to be
|
|
450
|
+
// considered - they are just not counted as part of the path length!
|
|
451
|
+
if (i > 1 && x->ex_pathlen != -1 && plen > x->ex_pathlen + 1) {
|
|
505
452
|
ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED;
|
|
506
453
|
ctx->error_depth = i;
|
|
507
454
|
ctx->current_cert = x;
|
|
@@ -509,8 +456,11 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) {
|
|
|
509
456
|
return 0;
|
|
510
457
|
}
|
|
511
458
|
}
|
|
512
|
-
// Increment path length if not self issued
|
|
513
|
-
|
|
459
|
+
// Increment path length if not self issued. As only self-issued
|
|
460
|
+
// _intermediates_ are skipped in (l) of RFC 5280 (simply because it
|
|
461
|
+
// operates on certificate chain _edges_), always increment for the first
|
|
462
|
+
// (the leaf) in the chain.
|
|
463
|
+
if (i == 0 || !(x->ex_flags & EXFLAG_SI)) {
|
|
514
464
|
plen++;
|
|
515
465
|
}
|
|
516
466
|
}
|
|
@@ -559,7 +509,7 @@ static int check_name_constraints(X509_STORE_CTX *ctx) {
|
|
|
559
509
|
// but if it includes constraints it is to be assumed it expects them
|
|
560
510
|
// to be obeyed.
|
|
561
511
|
for (j = (int)sk_X509_num(ctx->chain) - 1; j > i; j--) {
|
|
562
|
-
NAME_CONSTRAINTS *nc = FromOpaque(sk_X509_value(ctx->chain, j))->nc;
|
|
512
|
+
NAME_CONSTRAINTS *nc = FromOpaque(sk_X509_value(ctx->chain, j))->nc.get();
|
|
563
513
|
if (nc) {
|
|
564
514
|
has_name_constraints = 1;
|
|
565
515
|
rv = NAME_CONSTRAINTS_check(x, nc);
|
|
@@ -663,10 +613,9 @@ static int check_id(X509_STORE_CTX *ctx) {
|
|
|
663
613
|
}
|
|
664
614
|
|
|
665
615
|
static int check_trust(X509_STORE_CTX *ctx) {
|
|
666
|
-
X509 *x = nullptr;
|
|
667
616
|
// Check all trusted certificates in chain
|
|
668
617
|
for (size_t i = ctx->last_untrusted; i < sk_X509_num(ctx->chain); i++) {
|
|
669
|
-
x = sk_X509_value(ctx->chain, i);
|
|
618
|
+
X509 *x = sk_X509_value(ctx->chain, i);
|
|
670
619
|
int trust = X509_check_trust(x, ctx->param->trust, 0);
|
|
671
620
|
// If explicitly trusted return trusted
|
|
672
621
|
if (trust == X509_TRUST_TRUSTED) {
|
|
@@ -686,14 +635,13 @@ static int check_trust(X509_STORE_CTX *ctx) {
|
|
|
686
635
|
// If we accept partial chains and have at least one trusted certificate
|
|
687
636
|
// return success.
|
|
688
637
|
if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) {
|
|
689
|
-
X509 *mx;
|
|
690
638
|
if (ctx->last_untrusted < (int)sk_X509_num(ctx->chain)) {
|
|
691
639
|
return X509_TRUST_TRUSTED;
|
|
692
640
|
}
|
|
693
|
-
x = sk_X509_value(ctx->chain, 0);
|
|
694
|
-
mx = lookup_cert_match(ctx, x);
|
|
641
|
+
X509 *x = sk_X509_value(ctx->chain, 0);
|
|
642
|
+
UniquePtr<X509> mx = lookup_cert_match(ctx, x);
|
|
695
643
|
if (mx) {
|
|
696
|
-
(void)sk_X509_set(ctx->chain, 0, mx);
|
|
644
|
+
(void)sk_X509_set(ctx->chain, 0, mx.release());
|
|
697
645
|
X509_free(x);
|
|
698
646
|
ctx->last_untrusted = 0;
|
|
699
647
|
return X509_TRUST_TRUSTED;
|
|
@@ -879,24 +827,28 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509 **pissuer,
|
|
|
879
827
|
// the certificate issuer this is returned in *pissuer.
|
|
880
828
|
static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer, X509_CRL *crl,
|
|
881
829
|
X509 *x) {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
830
|
+
if (crl->idp) {
|
|
831
|
+
// Per RFC 5280, section 5.2.5, at most one of onlyContainsUserCerts,
|
|
832
|
+
// onlyContainsCACerts, and onlyContainsAttributeCerts may be true.
|
|
833
|
+
// TODO(crbug.com/42290307): Move this check to the `ISSUING_DIST_POINT`
|
|
834
|
+
// parser.
|
|
835
|
+
int num_only =
|
|
836
|
+
(!!crl->idp->onlyuser) + (!!crl->idp->onlyCA) + (!!crl->idp->onlyattr);
|
|
837
|
+
if (num_only > 1) {
|
|
838
|
+
return 0;
|
|
839
|
+
}
|
|
840
|
+
// Reason codes and indirect CRLs are not supported.
|
|
841
|
+
if (crl->idp->indirectCRL || crl->idp->onlysomereasons) {
|
|
842
|
+
return 0;
|
|
843
|
+
}
|
|
893
844
|
}
|
|
845
|
+
|
|
894
846
|
// We do not support indirect CRLs, so the issuer names must match.
|
|
895
847
|
if (X509_NAME_cmp(X509_get_issuer_name(x), X509_CRL_get_issuer(crl))) {
|
|
896
848
|
return 0;
|
|
897
849
|
}
|
|
898
|
-
crl_score |= CRL_SCORE_ISSUER_NAME;
|
|
899
850
|
|
|
851
|
+
int crl_score = CRL_SCORE_ISSUER_NAME;
|
|
900
852
|
if (!(crl->flags & EXFLAG_CRITICAL)) {
|
|
901
853
|
crl_score |= CRL_SCORE_NOCRITICAL;
|
|
902
854
|
}
|
|
@@ -953,93 +905,52 @@ static int crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer,
|
|
|
953
905
|
return 0;
|
|
954
906
|
}
|
|
955
907
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
//
|
|
959
|
-
//
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
908
|
+
static int idp_check_dp(const DIST_POINT_NAME *dp_cert,
|
|
909
|
+
const DIST_POINT_NAME *dp_crl) {
|
|
910
|
+
// If the CRL IDP does not have a distributionPoint field, the CRL is scoped
|
|
911
|
+
// to the entire CA and matches everything.
|
|
912
|
+
//
|
|
913
|
+
// TODO(crbug.com/42290219): This covers a null `dp_crl`, but not `dp_cert`.
|
|
914
|
+
// If `dp_cert` is null, that means the certificate's DistributionPoint lacks
|
|
915
|
+
// a distributionPoint. However, DistributionPoints are required to have
|
|
916
|
+
// either distributionPoint or cRLIssuer (indirect CRL) and we reject the
|
|
917
|
+
// latter. However, we don't seem to check this in the parser. Enforce this so
|
|
918
|
+
// that `dp_cert` cannot be null.
|
|
919
|
+
if (!dp_cert || !dp_crl) {
|
|
966
920
|
return 1;
|
|
967
921
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
return 0;
|
|
971
|
-
}
|
|
972
|
-
// Case 1: two X509_NAME
|
|
973
|
-
if (b->type == 1) {
|
|
974
|
-
if (!b->dpname) {
|
|
975
|
-
return 0;
|
|
976
|
-
}
|
|
977
|
-
if (!X509_NAME_cmp(a->dpname, b->dpname)) {
|
|
978
|
-
return 1;
|
|
979
|
-
} else {
|
|
980
|
-
return 0;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
// Case 2: set name and GENERAL_NAMES appropriately
|
|
984
|
-
nm = a->dpname;
|
|
985
|
-
gens = b->name.fullname;
|
|
986
|
-
} else if (b->type == 1) {
|
|
987
|
-
if (!b->dpname) {
|
|
988
|
-
return 0;
|
|
989
|
-
}
|
|
990
|
-
// Case 2: set name and GENERAL_NAMES appropriately
|
|
991
|
-
gens = a->name.fullname;
|
|
992
|
-
nm = b->dpname;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
// Handle case 2 with one GENERAL_NAMES and one X509_NAME
|
|
996
|
-
if (nm) {
|
|
997
|
-
for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
|
|
998
|
-
gena = sk_GENERAL_NAME_value(gens, i);
|
|
999
|
-
if (gena->type != GEN_DIRNAME) {
|
|
1000
|
-
continue;
|
|
1001
|
-
}
|
|
1002
|
-
if (!X509_NAME_cmp(nm, gena->d.directoryName)) {
|
|
1003
|
-
return 1;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
922
|
+
// We only support fullName, not nameRelativeToCRLIssuer.
|
|
923
|
+
if (dp_cert->type != 0 || dp_crl->type != 0) {
|
|
1006
924
|
return 0;
|
|
1007
925
|
}
|
|
1008
|
-
|
|
1009
|
-
//
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
if (
|
|
926
|
+
// Check that the CRL's distributionPoint has some name in common with the
|
|
927
|
+
// certificate's. A CA might shard across multiple CRLs. This check ensures we
|
|
928
|
+
// are looking at the right shard.
|
|
929
|
+
//
|
|
930
|
+
// TODO(crbug.com/565047760): This should not be an O(N^2) comparison.
|
|
931
|
+
for (const GENERAL_NAME *gen_cert : dp_cert->name.fullname) {
|
|
932
|
+
for (const GENERAL_NAME *gen_crl : dp_crl->name.fullname) {
|
|
933
|
+
if (GENERAL_NAME_cmp(gen_cert, gen_crl) == 0) {
|
|
1016
934
|
return 1;
|
|
1017
935
|
}
|
|
1018
936
|
}
|
|
1019
937
|
}
|
|
1020
|
-
|
|
1021
938
|
return 0;
|
|
1022
939
|
}
|
|
1023
940
|
|
|
1024
941
|
// Check CRLDP and IDP
|
|
1025
942
|
static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score) {
|
|
1026
943
|
auto *impl = FromOpaque(x);
|
|
1027
|
-
// TODO(bbe): crbug.com/409778435 Make tests for the corner cases we hit
|
|
1028
|
-
// here so that we stay correct for RFC 5280 6.3.3 steps b.1 and b.2
|
|
1029
|
-
if (crl->idp_flags & IDP_ONLYATTR) {
|
|
1030
|
-
return 0;
|
|
1031
|
-
}
|
|
1032
944
|
if (impl->ex_flags & EXFLAG_CA) {
|
|
1033
|
-
if (crl->
|
|
945
|
+
if (crl->idp && crl->idp->onlyuser) {
|
|
1034
946
|
return 0;
|
|
1035
947
|
}
|
|
1036
948
|
} else {
|
|
1037
|
-
if (crl->
|
|
949
|
+
if (crl->idp && crl->idp->onlyCA) {
|
|
1038
950
|
return 0;
|
|
1039
951
|
}
|
|
1040
952
|
}
|
|
1041
|
-
for (
|
|
1042
|
-
DIST_POINT *dp = sk_DIST_POINT_value(impl->crldp, i);
|
|
953
|
+
for (const DIST_POINT *dp : impl->crldp.get()) {
|
|
1043
954
|
// Skip distribution points with a reasons field or a CRL issuer:
|
|
1044
955
|
//
|
|
1045
956
|
// We do not support CRLs partitioned by reason code. RFC 5280 requires CAs
|
|
@@ -1060,10 +971,10 @@ static int crl_crldp_check(X509 *x, X509_CRL *crl, int crl_score) {
|
|
|
1060
971
|
}
|
|
1061
972
|
|
|
1062
973
|
// If the CRL does not specify an issuing distribution point, allow it to
|
|
1063
|
-
// match anything.
|
|
1064
|
-
//
|
|
1065
|
-
//
|
|
1066
|
-
//
|
|
974
|
+
// match anything. This partially implements RFC 5280. The final paragraph of
|
|
975
|
+
// RFC 5280, section 6.3.3, specifies a default CRL-DP. This default would
|
|
976
|
+
// match IDP-less CRLs and CRLs with an IDP of the default CRL-DP. We do not
|
|
977
|
+
// implement the second condition.
|
|
1067
978
|
return !crl->idp || !crl->idp->distpoint;
|
|
1068
979
|
}
|
|
1069
980
|
|
|
@@ -1140,13 +1051,6 @@ static int check_crl(X509_STORE_CTX *ctx, X509_CRL *crl) {
|
|
|
1140
1051
|
}
|
|
1141
1052
|
}
|
|
1142
1053
|
|
|
1143
|
-
if (crl->idp_flags & IDP_INVALID) {
|
|
1144
|
-
ctx->error = X509_V_ERR_INVALID_EXTENSION;
|
|
1145
|
-
if (!call_verify_cb(0, ctx)) {
|
|
1146
|
-
return 0;
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
1054
|
if (!(ctx->current_crl_score & CRL_SCORE_TIME)) {
|
|
1151
1055
|
if (!check_crl_time(ctx, crl, 1)) {
|
|
1152
1056
|
return 0;
|
|
@@ -1227,7 +1131,9 @@ static int check_cert_time(X509_STORE_CTX *ctx, X509 *x) {
|
|
|
1227
1131
|
ptime = time(nullptr);
|
|
1228
1132
|
}
|
|
1229
1133
|
|
|
1230
|
-
int i =
|
|
1134
|
+
int i = (ctx->param->flags & X509_V_FLAG_ALLOW_TIMEZONE_OFFSET)
|
|
1135
|
+
? X509_cmp_time_posix_nonstandard(X509_get_notBefore(x), ptime)
|
|
1136
|
+
: X509_cmp_time_posix(X509_get_notBefore(x), ptime);
|
|
1231
1137
|
if (i == 0) {
|
|
1232
1138
|
ctx->error = X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD;
|
|
1233
1139
|
ctx->current_cert = x;
|
|
@@ -1244,7 +1150,9 @@ static int check_cert_time(X509_STORE_CTX *ctx, X509 *x) {
|
|
|
1244
1150
|
}
|
|
1245
1151
|
}
|
|
1246
1152
|
|
|
1247
|
-
i =
|
|
1153
|
+
i = (ctx->param->flags & X509_V_FLAG_ALLOW_TIMEZONE_OFFSET)
|
|
1154
|
+
? X509_cmp_time_posix_nonstandard(X509_get_notAfter(x), ptime)
|
|
1155
|
+
: X509_cmp_time_posix(X509_get_notAfter(x), ptime);
|
|
1248
1156
|
if (i == 0) {
|
|
1249
1157
|
ctx->error = X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD;
|
|
1250
1158
|
ctx->current_cert = x;
|
|
@@ -1264,6 +1172,18 @@ static int check_cert_time(X509_STORE_CTX *ctx, X509 *x) {
|
|
|
1264
1172
|
return 1;
|
|
1265
1173
|
}
|
|
1266
1174
|
|
|
1175
|
+
static int verify_signature(X509_STORE_CTX *ctx, const X509 *x509,
|
|
1176
|
+
const X509 *issuer, EVP_PKEY *pkey) {
|
|
1177
|
+
int ret;
|
|
1178
|
+
if ((ctx->param->flags & X509_V_FLAG_USE_MTC_DRAFT_PLANTS_05) &&
|
|
1179
|
+
x509_is_merkle_tree_ca(issuer)) {
|
|
1180
|
+
ret = x509_verify_mtc(x509, pkey, issuer);
|
|
1181
|
+
} else {
|
|
1182
|
+
ret = X509_verify(x509, pkey);
|
|
1183
|
+
}
|
|
1184
|
+
return ret ? X509_V_OK : X509_V_ERR_CERT_SIGNATURE_FAILURE;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1267
1187
|
static int internal_verify(X509_STORE_CTX *ctx) {
|
|
1268
1188
|
// TODO(davidben): This logic is incredibly confusing. Rewrite this:
|
|
1269
1189
|
//
|
|
@@ -1304,14 +1224,10 @@ static int internal_verify(X509_STORE_CTX *ctx) {
|
|
|
1304
1224
|
// time.
|
|
1305
1225
|
if (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE)) {
|
|
1306
1226
|
EVP_PKEY *pkey = X509_get0_pubkey(xi);
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
return 0;
|
|
1312
|
-
}
|
|
1313
|
-
} else if (X509_verify(xs, pkey) <= 0) {
|
|
1314
|
-
ctx->error = X509_V_ERR_CERT_SIGNATURE_FAILURE;
|
|
1227
|
+
int err = pkey == nullptr ? X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY
|
|
1228
|
+
: verify_signature(ctx, xs, xi, pkey);
|
|
1229
|
+
if (err != X509_V_OK) {
|
|
1230
|
+
ctx->error = err;
|
|
1315
1231
|
ctx->current_cert = xs;
|
|
1316
1232
|
if (!call_verify_cb(0, ctx)) {
|
|
1317
1233
|
return 0;
|
|
@@ -1358,6 +1274,15 @@ int X509_cmp_time_posix(const ASN1_TIME *ctm, int64_t cmp_time) {
|
|
|
1358
1274
|
return (ctm_time - cmp_time <= 0) ? -1 : 1;
|
|
1359
1275
|
}
|
|
1360
1276
|
|
|
1277
|
+
int X509_cmp_time_posix_nonstandard(const ASN1_TIME *ctm, int64_t cmp_time) {
|
|
1278
|
+
int64_t ctm_time;
|
|
1279
|
+
if (!ASN1_TIME_to_posix_nonstandard(ctm, &ctm_time)) {
|
|
1280
|
+
return 0;
|
|
1281
|
+
}
|
|
1282
|
+
// The return value 0 is reserved for errors.
|
|
1283
|
+
return (ctm_time - cmp_time <= 0) ? -1 : 1;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1361
1286
|
ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long offset_sec) {
|
|
1362
1287
|
return X509_time_adj(s, offset_sec, nullptr);
|
|
1363
1288
|
}
|