grpc 1.81.1 → 1.83.0

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.
Files changed (948) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +15 -9
  3. data/etc/roots.pem +10400 -3855
  4. data/include/grpc/grpc.h +6 -7
  5. data/include/grpc/grpc_audit_logging.h +2 -2
  6. data/include/grpc/grpc_security_constants.h +2 -0
  7. data/include/grpc/impl/channel_arg_names.h +26 -1
  8. data/src/core/call/call_filters.h +21 -5
  9. data/src/core/call/call_spine.h +4 -4
  10. data/src/core/call/client_call.cc +2 -2
  11. data/src/core/call/interception_chain.h +6 -9
  12. data/src/core/call/metadata.cc +7 -2
  13. data/src/core/call/metadata.h +1 -1
  14. data/src/core/call/metadata_batch.cc +1 -1
  15. data/src/core/call/metadata_batch.h +17 -1
  16. data/src/core/call/parsed_metadata.h +7 -2
  17. data/src/core/call/server_call.cc +16 -4
  18. data/src/core/call/server_call.h +14 -5
  19. data/src/core/call/status_util.cc +0 -4
  20. data/src/core/call/status_util.h +0 -3
  21. data/src/core/channelz/channel_trace.cc +3 -1
  22. data/src/core/client_channel/backup_poller.cc +2 -17
  23. data/src/core/client_channel/client_channel.cc +23 -28
  24. data/src/core/client_channel/client_channel.h +5 -3
  25. data/src/core/client_channel/client_channel_filter.cc +19 -30
  26. data/src/core/client_channel/client_channel_filter.h +2 -2
  27. data/src/core/client_channel/client_channel_plugin.cc +1 -1
  28. data/src/core/client_channel/client_channel_service_config.cc +5 -13
  29. data/src/core/client_channel/config_selector.h +2 -7
  30. data/src/core/client_channel/direct_channel.cc +5 -1
  31. data/src/core/client_channel/direct_channel.h +3 -1
  32. data/src/core/client_channel/dynamic_filters.cc +4 -7
  33. data/src/core/client_channel/dynamic_filters.h +1 -3
  34. data/src/core/client_channel/retry_filter.cc +2 -25
  35. data/src/core/client_channel/retry_filter.h +3 -7
  36. data/src/core/client_channel/retry_filter_legacy_call_data.cc +1 -1
  37. data/src/core/client_channel/retry_filter_legacy_call_data.h +2 -2
  38. data/src/core/client_channel/retry_interceptor.cc +7 -35
  39. data/src/core/client_channel/retry_interceptor.h +11 -14
  40. data/src/core/client_channel/retry_service_config.cc +0 -2
  41. data/src/core/client_channel/retry_service_config.h +0 -2
  42. data/src/core/client_channel/retry_throttle.cc +19 -7
  43. data/src/core/client_channel/retry_throttle.h +24 -7
  44. data/src/core/client_channel/subchannel.cc +1 -1
  45. data/src/core/{filter/blackboard.cc → config/experiment_env_var.cc} +11 -14
  46. data/src/core/config/experiment_env_var.h +26 -0
  47. data/src/core/credentials/call/external/external_account_credentials.cc +125 -12
  48. data/src/core/credentials/call/external/external_account_credentials.h +6 -1
  49. data/src/core/credentials/call/jwt/jwt_credentials.cc +11 -1
  50. data/src/core/credentials/call/jwt/jwt_credentials.h +3 -0
  51. data/src/core/credentials/call/oauth2/oauth2_credentials.cc +64 -11
  52. data/src/core/credentials/call/oauth2/oauth2_credentials.h +0 -1
  53. data/src/core/credentials/call/regional_access_boundary_fetcher.cc +411 -0
  54. data/src/core/credentials/call/regional_access_boundary_fetcher.h +158 -0
  55. data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +1 -1
  56. data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.h +7 -1
  57. data/src/core/credentials/transport/insecure/insecure_security_connector.h +1 -1
  58. data/src/core/credentials/transport/local/local_security_connector.cc +1 -1
  59. data/src/core/credentials/transport/ssl/ssl_security_connector.cc +14 -2
  60. data/src/core/credentials/transport/tls/grpc_tls_certificate_selector.cc +172 -0
  61. data/src/core/credentials/transport/tls/grpc_tls_certificate_selector.h +103 -0
  62. data/src/core/credentials/transport/tls/load_system_roots_fallback.cc +3 -2
  63. data/src/core/credentials/transport/tls/load_system_roots_supported.cc +10 -3
  64. data/src/core/credentials/transport/tls/tls_security_connector.cc +14 -2
  65. data/src/core/credentials/transport/xds/xds_credentials.cc +4 -12
  66. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +6 -0
  67. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +28 -66
  68. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +0 -8
  69. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +24 -58
  70. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +24 -19
  71. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -81
  72. data/src/core/ext/filters/message_size/message_size_filter.h +1 -50
  73. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +2 -1
  74. data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +13 -56
  75. data/src/core/ext/filters/stateful_session/stateful_session_filter.h +0 -14
  76. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
  77. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +184 -54
  78. data/src/core/ext/transport/chttp2/server/chttp2_server.h +10 -1
  79. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +84 -15
  80. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -0
  81. data/src/core/ext/transport/chttp2/transport/flow_control.cc +3 -3
  82. data/src/core/ext/transport/chttp2/transport/flow_control.h +14 -2
  83. data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +2 -4
  84. data/src/core/ext/transport/chttp2/transport/frame.cc +120 -13
  85. data/src/core/ext/transport/chttp2/transport/frame.h +57 -10
  86. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +4 -1
  87. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +13 -7
  88. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -1
  89. data/src/core/ext/transport/chttp2/transport/frame_security.cc +10 -1
  90. data/src/core/ext/transport/chttp2/transport/frame_security.h +2 -1
  91. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -1
  92. data/src/core/ext/transport/chttp2/transport/goaway.cc +11 -1
  93. data/src/core/ext/transport/chttp2/transport/goaway.h +17 -1
  94. data/src/core/ext/transport/chttp2/transport/header_assembler.h +54 -22
  95. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +53 -5
  96. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +22 -0
  97. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +20 -0
  98. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +42 -1
  99. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +4 -1
  100. data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +219 -417
  101. data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +49 -29
  102. data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +2073 -0
  103. data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +746 -0
  104. data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -1
  105. data/src/core/ext/transport/chttp2/transport/http2_settings.h +49 -15
  106. data/src/core/ext/transport/chttp2/transport/http2_settings_manager.h +0 -2
  107. data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +74 -26
  108. data/src/core/ext/transport/chttp2/transport/http2_transport.cc +39 -15
  109. data/src/core/ext/transport/chttp2/transport/http2_transport.h +18 -48
  110. data/src/core/ext/transport/chttp2/transport/internal.h +18 -0
  111. data/src/core/ext/transport/chttp2/transport/message_assembler.h +1 -2
  112. data/src/core/ext/transport/chttp2/transport/parsing.cc +85 -26
  113. data/src/core/ext/transport/chttp2/transport/ping_promise.cc +1 -1
  114. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +4 -10
  115. data/src/core/ext/transport/chttp2/transport/read_context.h +494 -0
  116. data/src/core/ext/transport/chttp2/transport/security_frame.h +13 -3
  117. data/src/core/ext/transport/chttp2/transport/stream.h +287 -137
  118. data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +83 -65
  119. data/src/core/ext/transport/chttp2/transport/write_cycle.h +9 -1
  120. data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +16 -2
  121. data/src/core/ext/upb-gen/cel/expr/checked.upb.h +621 -432
  122. data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +264 -166
  123. data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +0 -13
  124. data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +708 -497
  125. data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +294 -176
  126. data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +0 -15
  127. data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb.h +262 -181
  128. data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c +84 -58
  129. data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.h +0 -5
  130. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +254 -190
  131. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +107 -53
  132. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.h +0 -4
  133. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb.h +271 -190
  134. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.c +88 -64
  135. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.h +0 -5
  136. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +1035 -730
  137. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +384 -260
  138. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.h +0 -19
  139. data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb.h +87 -56
  140. data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.c +26 -16
  141. data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.h +0 -2
  142. data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb.h +105 -71
  143. data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.c +30 -22
  144. data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.h +0 -2
  145. data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb.h +31 -29
  146. data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.c +19 -7
  147. data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.h +0 -1
  148. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +25 -23
  149. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +15 -7
  150. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.h +0 -1
  151. data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb.h +25 -23
  152. data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.c +15 -7
  153. data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.h +0 -1
  154. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +201 -165
  155. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +79 -31
  156. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.h +0 -2
  157. data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb.h +29 -26
  158. data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.c +17 -11
  159. data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.h +0 -1
  160. data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb.h +46 -29
  161. data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.c +37 -19
  162. data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.h +4 -4
  163. data/src/core/ext/upb-gen/envoy/annotations/resource.upb.h +34 -27
  164. data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.c +34 -13
  165. data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.h +1 -2
  166. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +617 -452
  167. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +221 -163
  168. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.h +0 -16
  169. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +1339 -970
  170. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +484 -324
  171. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.h +0 -23
  172. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +181 -135
  173. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +59 -43
  174. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.h +0 -3
  175. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +1353 -1028
  176. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +535 -361
  177. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.h +0 -25
  178. data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb.h +37 -33
  179. data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.c +19 -13
  180. data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.h +0 -1
  181. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +234 -196
  182. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +77 -57
  183. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.h +0 -1
  184. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +695 -502
  185. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +246 -186
  186. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.h +0 -15
  187. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +140 -116
  188. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +53 -43
  189. data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +0 -3
  190. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +363 -269
  191. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +131 -89
  192. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.h +0 -8
  193. data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb.h +35 -31
  194. data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.c +15 -13
  195. data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.h +0 -1
  196. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +1073 -769
  197. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +515 -293
  198. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +0 -30
  199. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +25 -23
  200. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +15 -7
  201. data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +0 -1
  202. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +375 -267
  203. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +142 -86
  204. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.h +0 -7
  205. data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb.h +32 -27
  206. data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.c +13 -11
  207. data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.h +0 -1
  208. data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb.h +29 -26
  209. data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.c +17 -11
  210. data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.h +0 -1
  211. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb.h +87 -56
  212. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.c +26 -16
  213. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.h +0 -2
  214. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +634 -468
  215. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +255 -161
  216. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.h +0 -14
  217. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +672 -474
  218. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +228 -130
  219. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.h +0 -9
  220. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb.h +56 -40
  221. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c +15 -13
  222. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.h +0 -1
  223. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +34 -29
  224. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +19 -11
  225. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.h +0 -1
  226. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +811 -635
  227. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +347 -221
  228. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.h +0 -16
  229. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +174 -118
  230. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +62 -38
  231. data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +0 -4
  232. data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb.h +78 -57
  233. data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.c +28 -18
  234. data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.h +0 -2
  235. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb.h +37 -33
  236. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.c +22 -14
  237. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.h +0 -1
  238. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +159 -119
  239. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +47 -35
  240. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.h +0 -5
  241. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +101 -76
  242. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +41 -23
  243. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.h +0 -2
  244. data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb.h +35 -31
  245. data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.c +15 -13
  246. data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.h +0 -1
  247. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +189 -127
  248. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +79 -49
  249. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.h +0 -4
  250. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +378 -283
  251. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +156 -98
  252. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +0 -8
  253. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +354 -255
  254. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +125 -69
  255. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.h +0 -6
  256. data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb.h +27 -24
  257. data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.c +13 -11
  258. data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.h +0 -1
  259. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +611 -451
  260. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +159 -119
  261. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +0 -11
  262. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +468 -321
  263. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +157 -99
  264. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.h +0 -6
  265. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +146 -119
  266. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +55 -35
  267. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.h +0 -1
  268. data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb.h +61 -51
  269. data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.c +16 -16
  270. data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.h +0 -2
  271. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +43 -39
  272. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +25 -13
  273. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.h +0 -1
  274. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +341 -247
  275. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +130 -84
  276. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.h +0 -8
  277. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +452 -313
  278. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c +144 -100
  279. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.h +0 -10
  280. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +666 -493
  281. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +251 -181
  282. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.h +0 -12
  283. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +327 -197
  284. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +92 -48
  285. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.h +0 -3
  286. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +3583 -2532
  287. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +1340 -816
  288. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +0 -60
  289. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +111 -82
  290. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +48 -28
  291. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.h +0 -3
  292. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +548 -410
  293. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +214 -148
  294. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.h +0 -12
  295. data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb.h +59 -50
  296. data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.c +30 -20
  297. data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.h +0 -2
  298. data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb.h +29 -26
  299. data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.c +17 -11
  300. data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.h +0 -1
  301. data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb.h +60 -49
  302. data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.c +28 -20
  303. data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.h +0 -2
  304. data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb.h +50 -36
  305. data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.c +19 -11
  306. data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.h +0 -1
  307. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +82 -63
  308. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +27 -19
  309. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.h +0 -1
  310. data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb.h +27 -24
  311. data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.c +13 -11
  312. data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.h +0 -1
  313. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +70 -58
  314. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +32 -22
  315. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.h +0 -2
  316. data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb.h +2 -5
  317. data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.c +1 -1
  318. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +73 -62
  319. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +39 -25
  320. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.h +0 -2
  321. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +49 -45
  322. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +33 -13
  323. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.h +0 -1
  324. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +771 -588
  325. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +383 -185
  326. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.h +0 -16
  327. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +66 -47
  328. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +31 -17
  329. data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +0 -2
  330. data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb.h +69 -58
  331. data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb_minitable.c +27 -23
  332. data/src/core/ext/upb-gen/envoy/extensions/common/matching/v3/extension_matcher.upb_minitable.h +0 -2
  333. data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb.h +151 -119
  334. data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c +45 -39
  335. data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h +0 -5
  336. data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb.h +19 -17
  337. data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb_minitable.c +1 -3
  338. data/src/core/ext/upb-gen/envoy/extensions/filters/common/matcher/action/v3/skip_action.upb_minitable.h +0 -1
  339. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb.h +144 -109
  340. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.c +46 -38
  341. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.h +0 -4
  342. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +184 -139
  343. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +65 -35
  344. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h +0 -3
  345. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +129 -106
  346. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +69 -41
  347. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h +0 -4
  348. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +83 -71
  349. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +40 -26
  350. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h +0 -2
  351. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +148 -101
  352. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +45 -27
  353. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.h +0 -2
  354. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +62 -51
  355. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +35 -21
  356. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.h +0 -2
  357. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1362 -1024
  358. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +508 -336
  359. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +0 -22
  360. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +21 -19
  361. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +13 -7
  362. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +0 -1
  363. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +35 -31
  364. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +15 -13
  365. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +0 -1
  366. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +27 -24
  367. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +13 -11
  368. data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +0 -1
  369. data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +27 -24
  370. data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.c +13 -11
  371. data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.h +0 -1
  372. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +94 -74
  373. 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 +35 -23
  374. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.h +0 -1
  375. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +231 -179
  376. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +88 -66
  377. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +0 -6
  378. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +21 -19
  379. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.c +13 -7
  380. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.h +0 -1
  381. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +63 -56
  382. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +31 -19
  383. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.h +0 -1
  384. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +27 -24
  385. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.c +13 -11
  386. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.h +0 -1
  387. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +27 -24
  388. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +13 -11
  389. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.h +0 -1
  390. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +2 -5
  391. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb_minitable.c +1 -1
  392. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +538 -364
  393. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +157 -95
  394. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.h +0 -8
  395. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +150 -110
  396. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +69 -49
  397. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +0 -4
  398. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +517 -389
  399. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +182 -116
  400. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.h +0 -7
  401. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +84 -62
  402. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c +30 -22
  403. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.h +0 -2
  404. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +340 -256
  405. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +92 -82
  406. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +0 -5
  407. data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb.h +19 -17
  408. data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.c +1 -3
  409. data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.h +0 -1
  410. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +857 -566
  411. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +288 -182
  412. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.h +0 -15
  413. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +105 -72
  414. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +36 -22
  415. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.h +0 -2
  416. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +312 -226
  417. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +132 -78
  418. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.h +0 -5
  419. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +82 -61
  420. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -19
  421. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +0 -2
  422. data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb.h +123 -89
  423. data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.c +25 -25
  424. data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.h +0 -4
  425. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb.h +48 -33
  426. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.c +13 -11
  427. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.h +0 -1
  428. data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb.h +42 -36
  429. data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.c +19 -13
  430. data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.h +0 -1
  431. data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb.h +101 -79
  432. data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.c +61 -31
  433. data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.h +0 -5
  434. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +83 -60
  435. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +37 -19
  436. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.h +0 -2
  437. data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb.h +56 -40
  438. data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.c +15 -13
  439. data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.h +0 -1
  440. data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb.h +34 -29
  441. data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.c +13 -11
  442. data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.h +0 -1
  443. data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb.h +32 -27
  444. data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.c +13 -11
  445. data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.h +0 -1
  446. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +88 -71
  447. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +48 -30
  448. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.h +0 -3
  449. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb.h +37 -30
  450. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c +1 -5
  451. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.h +0 -2
  452. data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb.h +95 -71
  453. data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.c +36 -22
  454. data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.h +0 -2
  455. data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb.h +79 -56
  456. data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.c +26 -18
  457. data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.h +0 -2
  458. data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb.h +164 -124
  459. data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.c +54 -40
  460. data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.h +0 -4
  461. data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb.h +200 -147
  462. data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.c +47 -41
  463. data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.h +0 -7
  464. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +160 -130
  465. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +89 -47
  466. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.h +0 -5
  467. data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb.h +78 -62
  468. data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.c +26 -20
  469. data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.h +0 -3
  470. data/src/core/ext/upb-gen/envoy/type/v3/http.upb.h +2 -5
  471. data/src/core/ext/upb-gen/envoy/type/v3/http.upb_minitable.c +1 -1
  472. data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb.h +21 -19
  473. data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.c +13 -7
  474. data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.h +0 -1
  475. data/src/core/ext/upb-gen/envoy/type/v3/percent.upb.h +43 -36
  476. data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.c +22 -12
  477. data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.h +0 -2
  478. data/src/core/ext/upb-gen/envoy/type/v3/range.upb.h +67 -55
  479. data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.c +36 -18
  480. data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.h +0 -3
  481. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb.h +62 -51
  482. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.c +33 -19
  483. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.h +0 -2
  484. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb.h +2 -5
  485. data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb_minitable.c +1 -1
  486. data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb.h +25 -23
  487. data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.c +15 -7
  488. data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.h +0 -1
  489. data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb.h +37 -33
  490. data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.c +19 -13
  491. data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.h +0 -1
  492. data/src/core/ext/upb-gen/google/api/annotations.upb.h +15 -13
  493. data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.c +22 -7
  494. data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.h +1 -1
  495. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +619 -430
  496. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +260 -168
  497. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.h +0 -13
  498. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +734 -518
  499. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +312 -182
  500. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.h +0 -16
  501. data/src/core/ext/upb-gen/google/api/http.upb.h +146 -105
  502. data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +65 -29
  503. data/src/core/ext/upb-gen/google/api/http.upb_minitable.h +0 -3
  504. data/src/core/ext/upb-gen/google/api/httpbody.upb.h +52 -37
  505. data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.c +19 -11
  506. data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.h +0 -1
  507. data/src/core/ext/upb-gen/google/protobuf/any.upb.h +23 -21
  508. data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c +15 -7
  509. data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.h +0 -1
  510. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +2236 -1514
  511. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +824 -406
  512. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +0 -34
  513. data/src/core/ext/upb-gen/google/protobuf/duration.upb.h +23 -21
  514. data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.c +15 -7
  515. data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.h +0 -1
  516. data/src/core/ext/upb-gen/google/protobuf/empty.upb.h +19 -17
  517. data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.c +1 -3
  518. data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.h +0 -1
  519. data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +149 -100
  520. data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.c +59 -43
  521. data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.h +0 -4
  522. data/src/core/ext/upb-gen/google/protobuf/timestamp.upb.h +23 -21
  523. data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.c +15 -7
  524. data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.h +0 -1
  525. data/src/core/ext/upb-gen/google/protobuf/wrappers.upb.h +181 -139
  526. data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.c +99 -53
  527. data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.h +0 -9
  528. data/src/core/ext/upb-gen/google/rpc/status.upb.h +52 -37
  529. data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.c +19 -11
  530. data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.h +0 -1
  531. data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb.h +1553 -1157
  532. data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.c +712 -410
  533. data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.h +0 -39
  534. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +189 -125
  535. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +59 -35
  536. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +0 -3
  537. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +454 -343
  538. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +204 -130
  539. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +0 -11
  540. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +369 -243
  541. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +109 -79
  542. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +0 -7
  543. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb.h +256 -175
  544. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.c +122 -68
  545. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.h +0 -8
  546. data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +71 -51
  547. data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.c +39 -19
  548. data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.h +0 -2
  549. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +583 -407
  550. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +259 -145
  551. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.h +0 -12
  552. data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb.h +114 -84
  553. data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.c +52 -30
  554. data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.h +0 -4
  555. data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb.h +41 -34
  556. data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c +25 -13
  557. data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.h +0 -2
  558. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +309 -230
  559. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +123 -79
  560. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.h +0 -9
  561. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +98 -63
  562. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +51 -23
  563. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.h +0 -3
  564. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +505 -312
  565. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +159 -87
  566. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.h +0 -9
  567. data/src/core/ext/upb-gen/udpa/annotations/migrate.upb.h +128 -91
  568. data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.c +82 -41
  569. data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.h +5 -8
  570. data/src/core/ext/upb-gen/udpa/annotations/security.upb.h +36 -29
  571. data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.c +36 -13
  572. data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.h +1 -2
  573. data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb.h +13 -11
  574. data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.c +22 -7
  575. data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.h +1 -1
  576. data/src/core/ext/upb-gen/udpa/annotations/status.upb.h +36 -29
  577. data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.c +36 -13
  578. data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.h +1 -2
  579. data/src/core/ext/upb-gen/udpa/annotations/versioning.upb.h +34 -27
  580. data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.c +34 -13
  581. data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.h +1 -2
  582. data/src/core/ext/upb-gen/validate/validate.upb.h +1682 -1130
  583. data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +587 -247
  584. data/src/core/ext/upb-gen/validate/validate.upb_minitable.h +4 -27
  585. data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb.h +128 -91
  586. data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.c +82 -41
  587. data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.h +5 -8
  588. data/src/core/ext/upb-gen/xds/annotations/v3/security.upb.h +36 -29
  589. data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.c +36 -13
  590. data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.h +1 -2
  591. data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb.h +13 -11
  592. data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.c +22 -7
  593. data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.h +1 -1
  594. data/src/core/ext/upb-gen/xds/annotations/v3/status.upb.h +122 -90
  595. data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.c +82 -39
  596. data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.h +3 -7
  597. data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb.h +34 -27
  598. data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.c +34 -13
  599. data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.h +1 -2
  600. data/src/core/ext/upb-gen/xds/core/v3/authority.upb.h +21 -19
  601. data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.c +13 -7
  602. data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.h +0 -1
  603. data/src/core/ext/upb-gen/xds/core/v3/cidr.upb.h +29 -26
  604. data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.c +17 -11
  605. data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.h +0 -1
  606. data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb.h +70 -58
  607. data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.c +32 -22
  608. data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.h +0 -2
  609. data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +53 -34
  610. data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.c +26 -16
  611. data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.h +0 -2
  612. data/src/core/ext/upb-gen/xds/core/v3/extension.upb.h +29 -26
  613. data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.c +17 -11
  614. data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.h +0 -1
  615. data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +37 -33
  616. data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +22 -14
  617. data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.h +0 -1
  618. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +102 -76
  619. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +43 -23
  620. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.h +0 -2
  621. data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb.h +33 -30
  622. data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.c +19 -11
  623. data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.h +0 -1
  624. data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +136 -83
  625. data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.c +41 -33
  626. data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.h +0 -4
  627. data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb.h +46 -32
  628. data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.c +20 -12
  629. data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.h +0 -1
  630. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +29 -26
  631. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +20 -12
  632. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.h +0 -1
  633. data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb.h +93 -61
  634. data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.c +28 -20
  635. data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.h +0 -2
  636. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +19 -17
  637. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +1 -3
  638. data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.h +0 -1
  639. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +105 -71
  640. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +32 -22
  641. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.h +0 -2
  642. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +430 -314
  643. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +153 -123
  644. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.h +0 -10
  645. data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb.h +307 -199
  646. data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.c +74 -62
  647. data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.h +0 -6
  648. data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb.h +52 -42
  649. data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.c +19 -13
  650. data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.h +0 -2
  651. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +95 -71
  652. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +36 -22
  653. data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.h +0 -2
  654. data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +92 -77
  655. data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +42 -28
  656. data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.h +0 -2
  657. data/src/core/ext/upb-gen/xds/type/v3/range.upb.h +67 -55
  658. data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.c +36 -18
  659. data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.h +0 -3
  660. data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb.h +29 -26
  661. data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.c +17 -11
  662. data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.h +0 -1
  663. data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +885 -855
  664. data/src/core/filter/composite/composite_filter.cc +10 -3
  665. data/src/core/filter/composite/composite_filter.h +11 -1
  666. data/src/core/filter/filter_args.h +4 -22
  667. data/src/core/handshaker/handshaker.cc +10 -2
  668. data/src/core/handshaker/security/secure_endpoint.cc +60 -5
  669. data/src/core/lib/channel/channel_args.h +12 -6
  670. data/src/core/lib/channel/channel_stack.cc +1 -2
  671. data/src/core/lib/channel/channel_stack.h +1 -7
  672. data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
  673. data/src/core/lib/channel/channel_stack_builder_impl.h +0 -7
  674. data/src/core/lib/channel/promise_based_filter.cc +90 -4
  675. data/src/core/lib/channel/promise_based_filter.h +241 -188
  676. data/src/core/lib/event_engine/extensions/chaotic_good_extension.h +0 -13
  677. data/src/core/lib/event_engine/extensions/receive_coalescing_extension.h +44 -0
  678. data/src/core/lib/event_engine/extensions/tcp_trace.h +1 -1
  679. data/src/core/lib/event_engine/posix.h +2 -0
  680. data/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc +2 -1
  681. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +11 -8
  682. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +9 -18
  683. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -1
  684. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +2 -1
  685. data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +10 -10
  686. data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +1 -1
  687. data/src/core/lib/event_engine/shim.cc +2 -16
  688. data/src/core/lib/event_engine/shim.h +0 -4
  689. data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +1 -1
  690. data/src/core/lib/event_engine/windows/native_windows_dns_resolver.cc +5 -4
  691. data/src/core/lib/experiments/experiments.cc +303 -183
  692. data/src/core/lib/experiments/experiments.h +166 -90
  693. data/src/core/lib/iomgr/buffer_list.h +1 -1
  694. data/src/core/lib/iomgr/error.cc +3 -73
  695. data/src/core/lib/iomgr/error.h +8 -6
  696. data/src/core/lib/iomgr/error_cfstream.cc +1 -2
  697. data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -7
  698. data/src/core/lib/iomgr/ev_poll_posix.cc +2 -6
  699. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
  700. data/src/core/lib/iomgr/tcp_posix.cc +4 -7
  701. data/src/core/lib/iomgr/tcp_server_posix.cc +3 -3
  702. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -1
  703. data/src/core/lib/promise/detail/promise_factory.h +8 -8
  704. data/src/core/lib/promise/interceptor_list.h +1 -1
  705. data/src/core/lib/promise/try_seq.h +2 -2
  706. data/src/core/lib/resource_quota/telemetry.cc +54 -0
  707. data/src/core/lib/resource_quota/telemetry.h +5 -23
  708. data/src/core/lib/security/authorization/audit_logging.cc +2 -2
  709. data/src/core/lib/security/authorization/audit_logging.h +3 -3
  710. data/src/core/lib/security/authorization/grpc_authorization_engine.cc +11 -13
  711. data/src/core/lib/security/authorization/grpc_authorization_engine.h +1 -1
  712. data/src/core/lib/security/authorization/matchers.cc +20 -20
  713. data/src/core/lib/security/authorization/matchers.h +15 -16
  714. data/src/core/lib/security/authorization/rbac_policy.h +1 -1
  715. data/src/core/lib/security/authorization/stdout_logger.cc +3 -3
  716. data/src/core/lib/security/authorization/stdout_logger.h +6 -5
  717. data/src/core/lib/surface/call.cc +6 -9
  718. data/src/core/lib/surface/call.h +11 -0
  719. data/src/core/lib/surface/channel.cc +21 -2
  720. data/src/core/lib/surface/channel.h +14 -6
  721. data/src/core/lib/surface/filter_stack_call.cc +10 -29
  722. data/src/core/lib/surface/legacy_channel.cc +7 -7
  723. data/src/core/lib/surface/legacy_channel.h +3 -1
  724. data/src/core/lib/surface/version.cc +2 -2
  725. data/src/core/lib/transport/bdp_estimator.cc +13 -13
  726. data/src/core/lib/transport/bdp_estimator.h +9 -5
  727. data/src/core/lib/transport/error_utils.cc +26 -138
  728. data/src/core/lib/transport/promise_endpoint.h +8 -8
  729. data/src/core/lib/transport/transport.h +31 -4
  730. data/src/core/load_balancing/grpclb/grpclb.cc +2 -1
  731. data/src/core/load_balancing/pick_first/pick_first.cc +33 -2
  732. data/src/core/load_balancing/pick_first/pick_first.h +6 -0
  733. data/src/core/load_balancing/ring_hash/ring_hash.cc +3 -10
  734. data/src/core/load_balancing/rls/rls.cc +2 -1
  735. data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +141 -74
  736. data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.h +88 -0
  737. data/src/core/load_balancing/xds/cds.cc +80 -56
  738. data/src/core/load_balancing/xds/cds.h +21 -0
  739. data/src/core/mitigation_engine/mitigation.h +53 -0
  740. data/src/core/mitigation_engine/mitigation_engine.h +81 -0
  741. data/src/core/mitigation_engine/mitigation_provider.h +62 -0
  742. data/src/core/plugin_registry/grpc_plugin_registry.cc +0 -2
  743. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -5
  744. data/src/core/resolver/dns/dns_resolver_plugin.cc +1 -6
  745. data/src/core/resolver/xds/xds_resolver.cc +37 -144
  746. data/src/core/server/server.cc +40 -18
  747. data/src/core/server/server.h +26 -18
  748. data/src/core/server/server_config_selector.h +5 -4
  749. data/src/core/server/server_config_selector_filter.cc +135 -26
  750. data/src/core/server/server_config_selector_filter.h +1 -0
  751. data/src/core/server/xds_server_config_fetcher.cc +687 -692
  752. data/src/core/server/xds_server_config_fetcher_legacy.cc +1336 -0
  753. data/src/core/telemetry/call_tracer.cc +49 -2
  754. data/src/core/telemetry/call_tracer.h +1 -0
  755. data/src/core/telemetry/histogram.h +10 -89
  756. data/src/core/telemetry/instrument.h +42 -28
  757. data/src/core/telemetry/tcp_tracer.h +38 -0
  758. data/src/core/transport/message_size_service_config.cc +123 -0
  759. data/src/core/transport/message_size_service_config.h +85 -0
  760. data/src/core/transport/session_endpoint.cc +29 -4
  761. data/src/core/transport/session_endpoint.h +4 -0
  762. data/src/core/tsi/alts/crypt/gsec.h +4 -2
  763. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
  764. data/src/core/tsi/ssl_telemetry_utils.cc +343 -0
  765. data/src/core/tsi/ssl_telemetry_utils.h +74 -0
  766. data/src/core/tsi/ssl_transport_security.cc +583 -305
  767. data/src/core/tsi/ssl_transport_security.h +22 -6
  768. data/src/core/tsi/ssl_transport_security_utils.cc +2 -0
  769. data/src/core/tsi/transport_security.h +7 -0
  770. data/src/core/util/http_client/httpcli.cc +1 -4
  771. data/src/core/util/http_client/httpcli_security_connector.cc +2 -1
  772. data/src/core/util/http_client/parser.cc +1 -1
  773. data/src/core/util/lru_cache.h +2 -0
  774. data/src/core/util/ref_counted_string.h +1 -1
  775. data/src/core/util/status_helper.cc +71 -192
  776. data/src/core/util/status_helper.h +16 -21
  777. data/src/core/util/tchar.cc +13 -7
  778. data/src/core/util/trie_lookup.h +1 -1
  779. data/src/core/xds/grpc/blackboard.cc +58 -0
  780. data/src/core/{filter → xds/grpc}/blackboard.h +30 -11
  781. data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +2 -11
  782. data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -7
  783. data/src/core/xds/grpc/xds_cluster_parser.cc +5 -16
  784. data/src/core/xds/grpc/xds_common_types.cc +96 -0
  785. data/src/core/xds/grpc/xds_common_types.h +35 -7
  786. data/src/core/xds/grpc/xds_common_types_parser.cc +205 -134
  787. data/src/core/xds/grpc/xds_common_types_parser.h +18 -1
  788. data/src/core/xds/grpc/xds_endpoint_parser.cc +7 -18
  789. data/src/core/xds/grpc/xds_http_composite_filter.cc +34 -18
  790. data/src/core/xds/grpc/xds_http_composite_filter.h +6 -3
  791. data/src/core/xds/grpc/xds_http_fault_filter.cc +0 -149
  792. data/src/core/xds/grpc/xds_http_fault_filter.h +19 -8
  793. data/src/core/xds/grpc/xds_http_filter.cc +2 -1
  794. data/src/core/xds/grpc/xds_http_filter.h +6 -16
  795. data/src/core/xds/grpc/xds_http_filter_registry.cc +2 -12
  796. data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +25 -119
  797. data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +27 -15
  798. data/src/core/xds/grpc/xds_http_rbac_filter.cc +3 -12
  799. data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +0 -149
  800. data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -8
  801. data/src/core/xds/grpc/xds_lb_policy_registry.cc +18 -0
  802. data/src/core/xds/grpc/xds_listener_parser.cc +13 -9
  803. data/src/core/xds/grpc/xds_metadata_parser.cc +0 -2
  804. data/src/core/xds/grpc/xds_route_config.h +1 -1
  805. data/src/core/xds/grpc/xds_route_config_parser.cc +10 -16
  806. data/src/core/xds/grpc/xds_routing.cc +115 -90
  807. data/src/core/xds/grpc/xds_routing.h +73 -24
  808. data/src/core/xds/grpc/xds_server_grpc.cc +22 -13
  809. data/src/core/xds/grpc/xds_server_grpc.h +16 -2
  810. data/src/core/xds/grpc/xds_server_grpc_interface.h +10 -0
  811. data/src/core/xds/grpc/xds_transport_grpc.cc +123 -18
  812. data/src/core/xds/grpc/xds_transport_grpc.h +28 -4
  813. data/src/core/xds/xds_client/lrs_client.cc +4 -8
  814. data/src/core/xds/xds_client/xds_bootstrap.cc +4 -16
  815. data/src/core/xds/xds_client/xds_client.cc +2 -15
  816. data/src/core/xds/xds_client/xds_transport.h +3 -0
  817. data/src/ruby/ext/grpc/rb_byte_buffer.c +1 -0
  818. data/src/ruby/ext/grpc/rb_call.c +3 -0
  819. data/src/ruby/ext/grpc/rb_call_credentials.c +1 -0
  820. data/src/ruby/ext/grpc/rb_channel.c +1 -0
  821. data/src/ruby/ext/grpc/rb_channel_args.c +1 -0
  822. data/src/ruby/ext/grpc/rb_channel_credentials.c +1 -0
  823. data/src/ruby/ext/grpc/rb_completion_queue.c +1 -0
  824. data/src/ruby/ext/grpc/rb_compression_options.c +1 -0
  825. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -4
  826. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -6
  827. data/src/ruby/ext/grpc/rb_server.c +1 -0
  828. data/src/ruby/ext/grpc/rb_server_credentials.c +1 -0
  829. data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +1 -0
  830. data/src/ruby/ext/grpc/rb_xds_server_credentials.c +1 -0
  831. data/src/ruby/lib/grpc/core/call_credentials.rb +86 -0
  832. data/src/ruby/lib/grpc/core/channel_credentials.rb +69 -0
  833. data/src/ruby/lib/grpc/core/credentials_helper.rb +126 -0
  834. data/src/ruby/lib/grpc/generic/client_stub.rb +86 -73
  835. data/src/ruby/lib/grpc/generic/interceptors.rb +1 -1
  836. data/src/ruby/lib/grpc/version.rb +1 -1
  837. data/src/ruby/lib/grpc.rb +25 -0
  838. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +1 -1
  839. data/src/ruby/spec/call_credentials_spec.rb +52 -2
  840. data/src/ruby/spec/credentials_helper_spec.rb +80 -0
  841. data/src/ruby/spec/generic/client_stub_spec.rb +27 -4
  842. data/src/ruby/spec/generic/server_interceptors_spec.rb +17 -3
  843. data/third_party/upb/upb/base/error_handler.h +79 -0
  844. data/third_party/upb/upb/base/internal/log2.h +29 -5
  845. data/third_party/upb/upb/generated_code_support.h +1 -0
  846. data/third_party/upb/upb/hash/common.c +129 -14
  847. data/third_party/upb/upb/hash/common.h +1 -1
  848. data/third_party/upb/upb/hash/ext_table.h +65 -0
  849. data/third_party/upb/upb/lex/strtod.c +14 -5
  850. data/third_party/upb/upb/mem/arena.c +113 -95
  851. data/third_party/upb/upb/mem/internal/arena.h +13 -8
  852. data/third_party/upb/upb/message/accessors.c +2 -3
  853. data/third_party/upb/upb/message/accessors.h +32 -12
  854. data/third_party/upb/upb/message/array.c +51 -2
  855. data/third_party/upb/upb/message/array.h +10 -0
  856. data/third_party/upb/upb/message/copy.c +18 -34
  857. data/third_party/upb/upb/message/internal/accessors.h +15 -49
  858. data/third_party/upb/upb/message/internal/array.h +1 -1
  859. data/third_party/upb/upb/message/internal/map.h +1 -1
  860. data/third_party/upb/upb/message/internal/message.c +8 -1
  861. data/third_party/upb/upb/message/internal/message.h +40 -10
  862. data/third_party/upb/upb/message/message.c +3 -2
  863. data/third_party/upb/upb/message/value.h +0 -6
  864. data/third_party/upb/upb/mini_descriptor/decode.c +78 -59
  865. data/third_party/upb/upb/mini_descriptor/link.c +8 -6
  866. data/third_party/upb/upb/mini_table/extension_registry.c +17 -49
  867. data/third_party/upb/upb/mini_table/extension_registry.h +5 -17
  868. data/third_party/upb/upb/mini_table/generated_registry.c +180 -0
  869. data/third_party/upb/upb/mini_table/generated_registry.h +66 -0
  870. data/third_party/upb/upb/mini_table/internal/extension.h +5 -3
  871. data/third_party/upb/upb/mini_table/internal/field.h +7 -5
  872. data/third_party/upb/upb/mini_table/internal/generated_registry.h +37 -0
  873. data/third_party/upb/upb/mini_table/internal/message.c +0 -18
  874. data/third_party/upb/upb/mini_table/internal/message.h +24 -41
  875. data/third_party/upb/upb/mini_table/internal/size_log2.h +2 -1
  876. data/third_party/upb/upb/mini_table/internal/sub.h +2 -5
  877. data/third_party/upb/upb/mini_table/message.h +34 -13
  878. data/third_party/upb/upb/port/atomic.h +180 -74
  879. data/third_party/upb/upb/port/def.inc +194 -29
  880. data/third_party/upb/upb/port/sanitizers.h +15 -0
  881. data/third_party/upb/upb/port/undef.inc +6 -2
  882. data/third_party/upb/upb/reflection/common.h +0 -6
  883. data/third_party/upb/upb/reflection/def.hpp +8 -12
  884. data/third_party/upb/upb/reflection/def_pool.c +85 -33
  885. data/third_party/upb/upb/reflection/def_pool.h +38 -8
  886. data/third_party/upb/upb/reflection/def_type.h +3 -0
  887. data/third_party/upb/upb/reflection/enum_def.c +45 -33
  888. data/third_party/upb/upb/reflection/enum_def.h +8 -4
  889. data/third_party/upb/upb/reflection/enum_reserved_range.c +7 -3
  890. data/third_party/upb/upb/reflection/enum_value_def.c +14 -29
  891. data/third_party/upb/upb/reflection/enum_value_def.h +5 -4
  892. data/third_party/upb/upb/reflection/extension_range.c +15 -14
  893. data/third_party/upb/upb/reflection/extension_range.h +7 -4
  894. data/third_party/upb/upb/reflection/field_def.c +114 -96
  895. data/third_party/upb/upb/reflection/field_def.h +3 -3
  896. data/third_party/upb/upb/reflection/file_def.c +71 -65
  897. data/third_party/upb/upb/reflection/file_def.h +4 -5
  898. data/third_party/upb/upb/reflection/internal/def_builder.c +22 -14
  899. data/third_party/upb/upb/reflection/internal/def_builder.h +44 -38
  900. data/third_party/upb/upb/reflection/internal/def_pool.h +5 -1
  901. data/third_party/upb/upb/reflection/internal/enum_def.h +6 -4
  902. data/third_party/upb/upb/reflection/internal/enum_reserved_range.h +3 -2
  903. data/third_party/upb/upb/reflection/internal/enum_value_def.h +7 -4
  904. data/third_party/upb/upb/reflection/internal/extension_range.h +4 -3
  905. data/third_party/upb/upb/reflection/internal/field_def.h +15 -12
  906. data/third_party/upb/upb/reflection/internal/file_def.h +8 -1
  907. data/third_party/upb/upb/reflection/internal/message_def.h +10 -7
  908. data/third_party/upb/upb/reflection/internal/message_reserved_range.h +3 -1
  909. data/third_party/upb/upb/reflection/internal/method_def.h +6 -6
  910. data/third_party/upb/upb/reflection/internal/oneof_def.h +6 -6
  911. data/third_party/upb/upb/reflection/internal/service_def.h +9 -6
  912. data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
  913. data/third_party/upb/upb/reflection/message_def.c +46 -53
  914. data/third_party/upb/upb/reflection/message_def.h +6 -7
  915. data/third_party/upb/upb/reflection/message_reserved_range.c +7 -6
  916. data/third_party/upb/upb/reflection/method_def.c +22 -20
  917. data/third_party/upb/upb/reflection/method_def.h +4 -4
  918. data/third_party/upb/upb/reflection/oneof_def.c +17 -15
  919. data/third_party/upb/upb/reflection/oneof_def.h +6 -3
  920. data/third_party/upb/upb/reflection/service_def.c +50 -23
  921. data/third_party/upb/upb/reflection/service_def.h +7 -4
  922. data/third_party/upb/upb/text/internal/encode.c +7 -10
  923. data/third_party/upb/upb/wire/decode.c +269 -430
  924. data/third_party/upb/upb/wire/decode.h +6 -45
  925. data/third_party/upb/upb/wire/decode_fast/combinations.h +7 -3
  926. data/third_party/upb/upb/wire/decode_fast/select.c +7 -2
  927. data/third_party/upb/upb/wire/encode.c +144 -106
  928. data/third_party/upb/upb/wire/encode.h +6 -2
  929. data/third_party/upb/upb/wire/eps_copy_input_stream.c +36 -7
  930. data/third_party/upb/upb/wire/eps_copy_input_stream.h +94 -380
  931. data/third_party/upb/upb/wire/internal/decoder.c +1 -14
  932. data/third_party/upb/upb/wire/internal/decoder.h +84 -24
  933. data/third_party/upb/upb/wire/internal/eps_copy_input_stream.h +339 -0
  934. data/third_party/upb/upb/wire/internal/reader.h +29 -12
  935. data/third_party/upb/upb/wire/reader.c +35 -22
  936. data/third_party/upb/upb/wire/reader.h +11 -18
  937. data/third_party/utf8_range/utf8_range.c +1 -1
  938. data/third_party/utf8_range/utf8_range.h +2 -1
  939. metadata +35 -13
  940. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +0 -117
  941. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +0 -109
  942. data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.cc +0 -80
  943. data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.h +0 -86
  944. data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +0 -83
  945. data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +0 -91
  946. data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +0 -217
  947. data/third_party/upb/upb/message/internal/tagged_ptr.h +0 -56
  948. data/third_party/upb/upb/message/tagged_ptr.h +0 -48
@@ -18,14 +18,18 @@
18
18
 
19
19
  #include "src/core/tsi/ssl_transport_security.h"
20
20
 
21
+ #include <grpc/event_engine/event_engine.h>
21
22
  #include <grpc/private_key_signer.h>
22
23
  #include <grpc/support/port_platform.h>
23
24
  #include <limits.h>
24
25
  #include <string.h>
25
26
 
26
27
  #include <cstddef>
28
+ #include <cstdint>
27
29
  #include <cstdlib>
28
30
  #include <utility>
31
+ #include <variant>
32
+ #include <vector>
29
33
 
30
34
  // TODO(jboeuf): refactor inet_ntop into a portability header.
31
35
  // Note: for whomever reads this and tries to refactor this, this
@@ -55,39 +59,39 @@
55
59
  #include <memory>
56
60
  #include <optional>
57
61
  #include <string>
58
- #include <vector>
59
62
 
63
+ #include "src/core/credentials/transport/tls/grpc_tls_certificate_selector.h"
60
64
  #include "src/core/credentials/transport/tls/grpc_tls_crl_provider.h"
65
+ #include "src/core/credentials/transport/tls/spiffe_utils.h"
61
66
  #include "src/core/credentials/transport/tls/ssl_utils.h"
62
- #include "src/core/lib/event_engine/default_event_engine.h"
67
+ #include "src/core/lib/debug/trace_impl.h"
63
68
  #include "src/core/lib/iomgr/exec_ctx.h"
64
69
  #include "src/core/lib/surface/init.h"
65
70
  #include "src/core/tsi/ssl/key_logging/ssl_key_logging.h"
71
+ #include "src/core/tsi/ssl/session_cache/ssl_session.h"
66
72
  #include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
67
73
  #include "src/core/tsi/ssl_transport_security_utils.h"
68
74
  #include "src/core/tsi/ssl_types.h"
69
75
  #include "src/core/tsi/transport_security.h"
70
76
  #include "src/core/tsi/transport_security_interface.h"
71
- #include "src/core/util/env.h"
72
77
  #include "src/core/util/grpc_check.h"
73
78
  #include "src/core/util/match.h"
79
+ #include "src/core/util/memory.h"
74
80
  #include "src/core/util/ref_counted.h"
75
81
  #include "src/core/util/ref_counted_ptr.h"
82
+ #include "src/core/util/status_helper.h"
76
83
  #include "src/core/util/sync.h"
77
84
  #include "src/core/util/useful.h"
78
85
  #include "absl/base/thread_annotations.h"
79
86
  #include "absl/functional/bind_front.h"
80
87
  #include "absl/log/log.h"
88
+ #include "absl/status/status.h"
81
89
  #include "absl/strings/match.h"
82
- #include "absl/strings/numbers.h"
83
90
  #include "absl/strings/str_cat.h"
91
+ #include "absl/strings/str_format.h"
84
92
  #include "absl/strings/str_join.h"
85
93
  #include "absl/strings/string_view.h"
86
-
87
- // Name of the environment variable controlling OpenSSL cleanup timeout.
88
- // This variable allows users to specify the timeout (in seconds) for OpenSSL
89
- // resource cleanup during gRPC shutdown. If not set, a default timeout is used.
90
- #define GRPC_ARG_OPENSSL_CLEANUP_TIMEOUT_ENV "grpc.openssl_cleanup_timeout"
94
+ #include "absl/time/time.h"
91
95
 
92
96
  // --- Constants. ---
93
97
 
@@ -96,6 +100,12 @@
96
100
  #define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_LOWER_BOUND 1024
97
101
  #define TSI_SSL_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE 1024
98
102
  const size_t kMaxChainLength = 100;
103
+ const char kDefaultBoringSSLKeyExchangeGroups[] =
104
+ "X25519MLKEM768:X25519:P-256:P-384:P-521";
105
+ [[maybe_unused]] const char kDefaultOpenSSL1_1_1KeyExchangeGroups[] =
106
+ "X25519:P-256:P-384:P-521";
107
+ [[maybe_unused]] const char kDefaultOpenSSL1_0_2KeyExchangeGroups[] =
108
+ "P-256:P-384:P-521";
99
109
 
100
110
  // Putting a macro like this and littering the source file with #if is really
101
111
  // bad practice.
@@ -109,7 +119,14 @@ const size_t kMaxChainLength = 100;
109
119
  #define TSI_SSL_MAX_PROTECTION_OVERHEAD 100
110
120
 
111
121
  using TlsSessionKeyLogger = tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger;
112
-
122
+ #if defined(OPENSSL_IS_BORINGSSL)
123
+ using SelectCertificateInfo =
124
+ grpc_core::CertificateSelector::SelectCertificateInfo;
125
+ using SelectCertificateResult =
126
+ grpc_core::CertificateSelector::SelectCertificateResult;
127
+ using AsyncCertificateSelectionHandle =
128
+ grpc_core::CertificateSelector::AsyncCertificateSelectionHandle;
129
+ #endif
113
130
  using tsi::PrivateKey;
114
131
  using tsi::RootCertInfo;
115
132
 
@@ -169,6 +186,9 @@ struct tsi_ssl_server_handshaker_factory {
169
186
  size_t alpn_protocol_list_length;
170
187
  grpc_core::RefCountedPtr<TlsSessionKeyLogger> key_logger;
171
188
  std::shared_ptr<tsi::RootCertInfo> root_cert_info;
189
+ #if defined(OPENSSL_IS_BORINGSSL)
190
+ std::shared_ptr<grpc_core::CertificateSelector> certificate_selector;
191
+ #endif // defined(OPENSSL_IS_BORINGSSL)
172
192
  };
173
193
 
174
194
  // Tracks the arguments for a pending call to tsi_handshaker_next().
@@ -188,7 +208,27 @@ struct HandshakerNextArgs {
188
208
 
189
209
  struct tsi_ssl_handshaker : public tsi_handshaker,
190
210
  public grpc_core::RefCounted<tsi_ssl_handshaker> {
191
- tsi_ssl_handshaker() = default;
211
+ tsi_ssl_handshaker(
212
+ const tsi_handshaker_vtable* handshaker_vtable, SSL* ssl, BIO* network_io,
213
+ tsi_ssl_handshaker_factory* factory_ref,
214
+ grpc_core::RefCountedPtr<grpc_core::CollectionScope> collection_scope,
215
+ bool is_client, std::shared_ptr<grpc_core::PrivateKeySigner> signer)
216
+ : tsi_handshaker(handshaker_vtable),
217
+ ssl(ssl),
218
+ network_io(network_io),
219
+ result(TSI_HANDSHAKE_IN_PROGRESS),
220
+ outgoing_bytes_buffer_size(
221
+ TSI_SSL_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE),
222
+ outgoing_bytes_buffer(static_cast<unsigned char*>(
223
+ gpr_zalloc(outgoing_bytes_buffer_size))),
224
+ factory_ref(factory_ref),
225
+ collection_scope(std::move(collection_scope)),
226
+ is_client(is_client) {
227
+ #if defined(OPENSSL_IS_BORINGSSL)
228
+ key_signer = std::move(signer);
229
+ #endif
230
+ }
231
+
192
232
  ~tsi_ssl_handshaker() override {
193
233
  SSL_free(ssl);
194
234
  BIO_free(network_io);
@@ -199,9 +239,10 @@ struct tsi_ssl_handshaker : public tsi_handshaker,
199
239
  SSL* ssl;
200
240
  BIO* network_io;
201
241
  tsi_result result;
202
- unsigned char* outgoing_bytes_buffer;
203
242
  size_t outgoing_bytes_buffer_size;
243
+ unsigned char* outgoing_bytes_buffer;
204
244
  tsi_ssl_handshaker_factory* factory_ref;
245
+ grpc_core::RefCountedPtr<grpc_core::CollectionScope> collection_scope;
205
246
  grpc_core::Mutex mu;
206
247
  bool is_shutdown ABSL_GUARDED_BY(mu) = false;
207
248
 
@@ -214,8 +255,16 @@ struct tsi_ssl_handshaker : public tsi_handshaker,
214
255
  if (handshaker_next_args->error_ptr == nullptr) return;
215
256
  *handshaker_next_args->error_ptr = std::move(error);
216
257
  }
258
+ bool is_client = false;
217
259
  #if defined(OPENSSL_IS_BORINGSSL)
218
- std::shared_ptr<grpc_core::PrivateKeySigner> key_signer;
260
+ std::shared_ptr<AsyncCertificateSelectionHandle> cert_selection_handle
261
+ ABSL_GUARDED_BY(mu);
262
+ // Will be set if the certificate selector is used and the asynchronous cert
263
+ // selection is done.
264
+ std::optional<absl::Status> cert_selection_status ABSL_GUARDED_BY(mu);
265
+ // This may be from the factory, or from the certificate selection result when
266
+ // the certificate selector is used.
267
+ std::shared_ptr<grpc_core::PrivateKeySigner> key_signer ABSL_GUARDED_BY(mu);
219
268
  // The signed_bytes are populated when the signature process is completed if
220
269
  // the Private Key offload was successful. If there was an error during the
221
270
  // signature, the status will be returned.
@@ -367,6 +416,73 @@ int ServerHandshakerFactoryAlpnCallback(SSL* /*ssl*/, const unsigned char** out,
367
416
  factory->alpn_protocol_list_length);
368
417
  }
369
418
  #endif // TSI_OPENSSL_ALPN_SUPPORT
419
+
420
+ // Populates the key exchange groups.
421
+ // Prefers the key exchange groups (input argument) configured by the user,
422
+ // otherwise uses the following defaults:
423
+ // - BoringSSL: {X25519MLKEM768, X25519, P-256, P-384, P-521}
424
+ // - OpenSSL < 3.0: {X25519, P-256, P-384, P-521}
425
+ // - OpenSSL >= 3: OpenSSL Defaults (prefers X25519MLKEM768 in OpenSSL 3.5+)
426
+ tsi_result SetKeyExchangeGroups(
427
+ SSL_CTX* context,
428
+ const std::vector<grpc_tls_key_exchange_group>& key_exchange_groups) {
429
+ // Explicitly set the key exchange groups based on user-provided preferences.
430
+ if (!key_exchange_groups.empty()) {
431
+ std::vector<absl::string_view> group_names;
432
+ group_names.reserve(key_exchange_groups.size());
433
+ for (const auto& group : key_exchange_groups) {
434
+ auto group_name = tsi::ConvertKeyExchangeGroupToString(group);
435
+ if (!group_name.ok()) {
436
+ LOG(ERROR) << "Could not convert key exchange group to string: "
437
+ << group;
438
+ return TSI_INVALID_ARGUMENT;
439
+ }
440
+ group_names.push_back(*group_name);
441
+ }
442
+ #if OPENSSL_VERSION_NUMBER >= 0x10101000L
443
+ std::string group_list_str = absl::StrJoin(group_names, ":");
444
+ if (!SSL_CTX_set1_groups_list(context, group_list_str.c_str())) {
445
+ LOG(ERROR) << "Could not set key exchange groups: " << group_list_str;
446
+ return TSI_INTERNAL_ERROR;
447
+ }
448
+ SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE);
449
+ #else
450
+
451
+ LOG(ERROR) << "Setting TLS key exchange groups is not supported when "
452
+ "building against OpenSSL versions < 1.1.1.";
453
+ return TSI_FAILED_PRECONDITION;
454
+ #endif // OPENSSL_VERSION_NUMBER >= 0x10100000
455
+ } else {
456
+ // Use defaults
457
+ #if defined(OPENSSL_IS_BORINGSSL)
458
+ if (!SSL_CTX_set1_groups_list(context,
459
+ kDefaultBoringSSLKeyExchangeGroups)) {
460
+ LOG(ERROR) << "Could not set default key exchange groups for BoringSSL.";
461
+ return TSI_INTERNAL_ERROR;
462
+ }
463
+ #elif OPENSSL_VERSION_NUMBER < 0x30000000L && \
464
+ OPENSSL_VERSION_NUMBER >= 0x10101000L
465
+ if (!SSL_CTX_set1_groups_list(context,
466
+ kDefaultOpenSSL1_1_1KeyExchangeGroups)) {
467
+ LOG(ERROR)
468
+ << "Could not set default key exchange groups for OpenSSL 1.1.1.";
469
+ return TSI_INTERNAL_ERROR;
470
+ }
471
+ #elif OPENSSL_VERSION_NUMBER < 0x10101000L
472
+ if (!SSL_CTX_set1_curves_list(context,
473
+ kDefaultOpenSSL1_0_2KeyExchangeGroups)) {
474
+ LOG(ERROR)
475
+ << "Could not set default key exchange groups for OpenSSL 1.0.2.";
476
+ return TSI_INTERNAL_ERROR;
477
+ }
478
+ if (!SSL_CTX_set_ecdh_auto(context, /*onoff=*/1)) {
479
+ LOG(ERROR) << "Could not set ecdh auto for OpenSSL 1.0.2.";
480
+ return TSI_INTERNAL_ERROR;
481
+ }
482
+ #endif
483
+ }
484
+ return TSI_OK;
485
+ }
370
486
  } // namespace
371
487
 
372
488
  static gpr_once g_init_openssl_once = GPR_ONCE_INIT;
@@ -446,7 +562,7 @@ enum ssl_private_key_result_t TlsPrivateKeySignWrapper(
446
562
  return ssl_private_key_failure;
447
563
  }
448
564
  if (handshaker->is_shutdown) {
449
- handshaker->MaybeSetError("Handshaker is shuting down");
565
+ handshaker->MaybeSetError("Handshaker is shutting down");
450
566
  return ssl_private_key_failure;
451
567
  }
452
568
  // Create the completion callback by binding the current context.
@@ -487,13 +603,174 @@ const SSL_PRIVATE_KEY_METHOD TlsOffloadPrivateKeyMethod = {
487
603
  TlsPrivateKeySignWrapper,
488
604
  nullptr, // decrypt not implemented for this use case
489
605
  TlsPrivateKeyOffloadComplete};
606
+
607
+ SelectCertificateInfo PrepareSelectCertificateInfo(
608
+ const SSL_CLIENT_HELLO* client_hello) {
609
+ SelectCertificateInfo select_cert_info;
610
+ const char* sni =
611
+ SSL_get_servername(client_hello->ssl, TLSEXT_NAMETYPE_host_name);
612
+ if (sni != nullptr) {
613
+ select_cert_info.sni = sni;
614
+ } else {
615
+ VLOG(2) << "Client did not provide SNI for cert selection.";
616
+ }
617
+ return select_cert_info;
618
+ }
619
+
620
+ absl::Status ProcessSelectCertificateResult(tsi_ssl_handshaker* handshaker,
621
+ SelectCertificateResult result)
622
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&tsi_ssl_handshaker::mu) {
623
+ if (result.certificate_chain.empty()) {
624
+ return absl::InvalidArgumentError("The cert chain is empty.");
625
+ }
626
+ std::vector<CRYPTO_BUFFER*> cert_chain;
627
+ cert_chain.reserve(result.certificate_chain.size());
628
+ for (auto& raw_cert : result.certificate_chain) {
629
+ cert_chain.push_back(raw_cert.get());
630
+ }
631
+ return grpc_core::MatchMutable(
632
+ &result.private_key,
633
+ [&](bssl::UniquePtr<EVP_PKEY>* key) {
634
+ VLOG(2) << "Select cert result returned a static private key.";
635
+ if (!SSL_set_chain_and_key(handshaker->ssl, cert_chain.data(),
636
+ cert_chain.size(), key->get(),
637
+ /*privkey_method=*/nullptr)) {
638
+ return absl::InternalError(
639
+ absl::StrFormat("Failed to set chain and key: %s",
640
+ tsi::SslErrorString(SSL_get_error(
641
+ handshaker->ssl, /*ret_code=*/0))));
642
+ }
643
+ return absl::OkStatus();
644
+ },
645
+ [&](std::shared_ptr<grpc_core::PrivateKeySigner>* signer)
646
+ ABSL_NO_THREAD_SAFETY_ANALYSIS {
647
+ VLOG(2) << "Select cert result returned a private key signer.";
648
+ handshaker->key_signer = std::move(*signer);
649
+ if (!SSL_set_chain_and_key(
650
+ handshaker->ssl, cert_chain.data(), cert_chain.size(),
651
+ /*privkey=*/nullptr, &TlsOffloadPrivateKeyMethod)) {
652
+ return absl::InternalError(
653
+ absl::StrFormat("Failed to set chain and key: %s",
654
+ tsi::SslErrorString(SSL_get_error(
655
+ handshaker->ssl, /*ret_code=*/0))));
656
+ }
657
+ return absl::OkStatus();
658
+ });
659
+ }
660
+
661
+ // Invoked by the cert selector when it runs asynchronously.
662
+ void OnSelectCertificateDone(
663
+ grpc_core::RefCountedPtr<tsi_ssl_handshaker> handshaker,
664
+ absl::StatusOr<SelectCertificateResult> result) {
665
+ grpc_core::ExecCtx exec_ctx;
666
+ tsi_result next_result;
667
+ std::optional<HandshakerNextArgs> next_args;
668
+ {
669
+ grpc_core::MutexLock lock(&handshaker->mu);
670
+ if (handshaker->is_shutdown) return;
671
+ if (!result.ok()) {
672
+ VLOG(2) << "SelectCertificate failed " << result.status();
673
+ handshaker->cert_selection_status = std::move(result).status();
674
+ } else {
675
+ handshaker->cert_selection_status =
676
+ ProcessSelectCertificateResult(handshaker.get(), *std::move(result));
677
+ }
678
+ handshaker->cert_selection_handle.reset();
679
+ auto async_result = ssl_handshaker_next_async(handshaker.get());
680
+ next_result = async_result.first;
681
+ next_args = std::move(async_result.second);
682
+ }
683
+ // If result is not TSI_ASYNC and there are args, we are ready to flush.
684
+ if (next_result != TSI_ASYNC && next_args.has_value() &&
685
+ next_args->cb != nullptr) {
686
+ next_args->cb(next_result, next_args->user_data, next_args->bytes_to_send,
687
+ next_args->bytes_to_send_size, next_args->handshaker_result);
688
+ }
689
+ }
690
+
691
+ grpc_core::CertificateSelector* GetCertificateSelector(
692
+ tsi_ssl_handshaker* handshaker) {
693
+ if (handshaker->is_client) {
694
+ return nullptr;
695
+ }
696
+ return reinterpret_cast<tsi_ssl_server_handshaker_factory*>(
697
+ handshaker->factory_ref)
698
+ ->certificate_selector.get();
699
+ }
700
+
701
+ // Invoked by BoringSSL to get the result of cert selection.
702
+ ssl_select_cert_result_t SelectCertificateCallback(
703
+ const SSL_CLIENT_HELLO* client_hello)
704
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&tsi_ssl_handshaker::mu) {
705
+ tsi_ssl_handshaker* handshaker = GetHandshaker(client_hello->ssl);
706
+ // Sanity check. Should never happen.
707
+ if (handshaker == nullptr || client_hello == nullptr) {
708
+ handshaker->MaybeSetError(
709
+ "SelectCertificateCallback failed because handshaker or client_hello "
710
+ "is nullptr; this should never happen.");
711
+ return ssl_select_cert_error;
712
+ }
713
+ grpc_core::CertificateSelector* cert_selector =
714
+ GetCertificateSelector(handshaker);
715
+ if (cert_selector == nullptr) {
716
+ handshaker->MaybeSetError(
717
+ "SelectCertificateCallback failed because certificate selector "
718
+ "is nullptr; this should never happen.");
719
+ return ssl_select_cert_error;
720
+ }
721
+ // The async cert selection is finished.
722
+ if (handshaker->cert_selection_status.has_value()) {
723
+ if (!handshaker->cert_selection_status->ok()) {
724
+ VLOG(2) << "Async cert selection failed: "
725
+ << *handshaker->cert_selection_status;
726
+ handshaker->MaybeSetError(handshaker->cert_selection_status->ToString());
727
+ return ssl_select_cert_error;
728
+ }
729
+ // The cert selection is done.
730
+ return ssl_select_cert_success;
731
+ }
732
+ // The callback holds a ref to the handshaker to ensure it's not destroyed
733
+ // when the callback is invoked asynchronously.
734
+ std::variant<absl::StatusOr<SelectCertificateResult>,
735
+ std::shared_ptr<AsyncCertificateSelectionHandle>>
736
+ result = cert_selector->SelectCertificate(
737
+ PrepareSelectCertificateInfo(client_hello),
738
+ absl::bind_front(OnSelectCertificateDone, handshaker->Ref()));
739
+ // The outer function guarantees the mutex lock, and we have to disable the
740
+ // absl thread safety analysis because the use of MatchMutable.
741
+ return grpc_core::MatchMutable(
742
+ &result,
743
+ [&](absl::StatusOr<SelectCertificateResult>* select_cert_result)
744
+ ABSL_NO_THREAD_SAFETY_ANALYSIS {
745
+ if (!select_cert_result->ok()) {
746
+ VLOG(2) << "Sync select cert failed: "
747
+ << select_cert_result->status();
748
+ handshaker->MaybeSetError(
749
+ select_cert_result->status().ToString());
750
+ return ssl_select_cert_error;
751
+ }
752
+ absl::Status status = ProcessSelectCertificateResult(
753
+ handshaker, *std::move(*select_cert_result));
754
+ if (!status.ok()) {
755
+ LOG(INFO) << "Sync select cert failed: " << status;
756
+ handshaker->MaybeSetError(status.ToString());
757
+ return ssl_select_cert_error;
758
+ }
759
+ return ssl_select_cert_success;
760
+ },
761
+ [&](std::shared_ptr<AsyncCertificateSelectionHandle>* async_handle)
762
+ ABSL_NO_THREAD_SAFETY_ANALYSIS {
763
+ handshaker->cert_selection_handle = std::move(*async_handle);
764
+ return ssl_select_cert_retry;
765
+ });
766
+ }
490
767
  #endif // defined(OPENSSL_IS_BORINGSSL)
491
768
 
492
769
  #if !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_NO_ENGINE)
493
770
  static const char kSslEnginePrefix[] = "engine:";
494
771
  #endif
495
772
 
496
- #if OPENSSL_VERSION_NUMBER < 0x10100000
773
+ #if OPENSSL_VERSION_NUMBER < 0x10101000L
497
774
  static gpr_mu* g_openssl_mutexes = nullptr;
498
775
  static void openssl_locking_cb(int mode, int type, const char* file,
499
776
  int line) GRPC_UNUSED;
@@ -519,39 +796,14 @@ static void verified_root_cert_free(void* /*parent*/, void* ptr,
519
796
  }
520
797
 
521
798
  static void init_openssl(void) {
522
- #if OPENSSL_VERSION_NUMBER >= 0x10100000
523
- OPENSSL_init_ssl(0, nullptr);
524
- // Ensure OPENSSL global clean up happens after gRPC shutdown completes.
525
- // OPENSSL registers an exit handler to clean up global objects, which
526
- // otherwise may happen before gRPC removes all references to OPENSSL. Below
527
- // exit handler is guaranteed to run after OPENSSL's.
528
- std::atexit([]() {
529
- // Retrieve the OpenSSL cleanup timeout from the environment variable.
530
- // This allows users to override the default cleanup timeout for OpenSSL
531
- // resource deallocation during gRPC shutdown.
532
- std::optional<std::string> env =
533
- grpc_core::GetEnv(GRPC_ARG_OPENSSL_CLEANUP_TIMEOUT_ENV);
534
- int timeout_sec = 2;
535
- if (env.has_value()) {
536
- int parsed_timeout_sec = 0;
537
- if (absl::SimpleAtoi(*env, &parsed_timeout_sec)) {
538
- timeout_sec = parsed_timeout_sec;
539
- } else {
540
- GRPC_TRACE_LOG(tsi, ERROR)
541
- << "Invalid value [" << (*env) << "] for "
542
- << GRPC_ARG_OPENSSL_CLEANUP_TIMEOUT_ENV
543
- << " environment variable. Using default value of 2 seconds.";
544
- }
545
- }
546
-
547
- grpc_wait_for_shutdown_with_timeout(absl::Seconds(timeout_sec));
548
- });
799
+ #if OPENSSL_VERSION_NUMBER >= 0x10101000L
800
+ OPENSSL_init_ssl(OPENSSL_INIT_NO_ATEXIT, nullptr);
549
801
  #else
550
802
  SSL_library_init();
551
803
  SSL_load_error_strings();
552
804
  OpenSSL_add_all_algorithms();
553
805
  #endif
554
- #if OPENSSL_VERSION_NUMBER < 0x10100000
806
+ #if OPENSSL_VERSION_NUMBER < 0x10101000L
555
807
  if (!CRYPTO_get_locking_callback()) {
556
808
  int num_locks = CRYPTO_num_locks();
557
809
  GRPC_CHECK_GT(num_locks, 0);
@@ -894,9 +1146,11 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
894
1146
  if (subject_alt_names != nullptr) {
895
1147
  sk_GENERAL_NAME_pop_free(subject_alt_names, GENERAL_NAME_free);
896
1148
  }
897
- if (result != TSI_OK) tsi_peer_destruct(peer);
898
-
899
- GRPC_CHECK((int)peer->property_count == current_insert_index);
1149
+ if (result != TSI_OK) {
1150
+ tsi_peer_destruct(peer);
1151
+ } else {
1152
+ GRPC_CHECK((int)peer->property_count == current_insert_index);
1153
+ }
900
1154
  return result;
901
1155
  }
902
1156
 
@@ -1193,40 +1447,9 @@ static tsi_result populate_ssl_context(
1193
1447
  LOG(ERROR) << "Invalid cipher list: " << cipher_list;
1194
1448
  return TSI_INVALID_ARGUMENT;
1195
1449
  }
1196
- if (!key_exchange_groups.empty()) {
1197
- std::vector<absl::string_view> group_names;
1198
- group_names.reserve(key_exchange_groups.size());
1199
- for (const auto& group : key_exchange_groups) {
1200
- auto group_name = tsi::ConvertKeyExchangeGroupToString(group);
1201
- if (!group_name.ok()) {
1202
- LOG(ERROR) << "Could not convert key exchange group to string.";
1203
- return TSI_INVALID_ARGUMENT;
1204
- }
1205
- group_names.push_back(*group_name);
1206
- }
1207
- #if OPENSSL_VERSION_NUMBER >= 0x10101000L
1208
- std::string group_list_str = absl::StrJoin(group_names, ":");
1209
- if (!SSL_CTX_set1_groups_list(context, group_list_str.c_str())) {
1210
- LOG(ERROR) << "Could not set key exchange groups: " << group_list_str;
1211
- return TSI_INTERNAL_ERROR;
1212
- }
1213
- SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE);
1214
- #else
1215
- LOG(ERROR) << "SSL_CTX_set1_groups is not supported in OpenSSL < 1.1.1 "
1216
- "version.";
1217
- return TSI_FAILED_PRECONDITION;
1218
- #endif // OPENSSL_VERSION_NUMBER >= 0x10100000
1219
- } else {
1220
- #if OPENSSL_VERSION_NUMBER < 0x30000000L
1221
- EC_KEY* ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
1222
- if (!SSL_CTX_set_tmp_ecdh(context, ecdh)) {
1223
- LOG(ERROR) << "Could not set ephemeral ECDH key.";
1224
- EC_KEY_free(ecdh);
1225
- return TSI_INTERNAL_ERROR;
1226
- }
1227
- SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE);
1228
- EC_KEY_free(ecdh);
1229
- #endif
1450
+ result = SetKeyExchangeGroups(context, key_exchange_groups);
1451
+ if (result != TSI_OK) {
1452
+ return result;
1230
1453
  }
1231
1454
  return TSI_OK;
1232
1455
  }
@@ -1932,6 +2155,12 @@ static tsi_result ssl_handshaker_result_extract_peer(
1932
2155
  if (alpn_selected != nullptr) new_property_count++;
1933
2156
  if (peer_chain != nullptr) new_property_count++;
1934
2157
  if (verified_root_cert != nullptr) new_property_count++;
2158
+ #if defined(OPENSSL_IS_BORINGSSL) || OPENSSL_VERSION_NUMBER >= 0x30000000L
2159
+ int nid = SSL_get_negotiated_group(impl->ssl);
2160
+ const char* negotiated_group_name =
2161
+ (nid != NID_undef && nid != 0) ? OBJ_nid2sn(nid) : nullptr;
2162
+ if (negotiated_group_name != nullptr) new_property_count++;
2163
+ #endif
1935
2164
  tsi_peer_property* new_properties = static_cast<tsi_peer_property*>(
1936
2165
  gpr_zalloc(sizeof(*new_properties) * new_property_count));
1937
2166
  for (size_t i = 0; i < peer->property_count; i++) {
@@ -1978,6 +2207,16 @@ static tsi_result ssl_handshaker_result_extract_peer(
1978
2207
  peer->property_count++;
1979
2208
  }
1980
2209
 
2210
+ #if defined(OPENSSL_IS_BORINGSSL) || OPENSSL_VERSION_NUMBER >= 0x30000000L
2211
+ if (negotiated_group_name != nullptr) {
2212
+ result = tsi_construct_string_peer_property_from_cstring(
2213
+ TSI_SSL_NEGOTIATED_KEY_EXCHANGE_GROUP, negotiated_group_name,
2214
+ &peer->properties[peer->property_count]);
2215
+ if (result != TSI_OK) return result;
2216
+ peer->property_count++;
2217
+ }
2218
+ #endif
2219
+
1981
2220
  return result;
1982
2221
  }
1983
2222
 
@@ -2145,6 +2384,8 @@ static tsi_result ssl_handshaker_do_handshake(tsi_ssl_handshaker* impl)
2145
2384
  #if defined(OPENSSL_IS_BORINGSSL)
2146
2385
  case SSL_ERROR_WANT_PRIVATE_KEY_OPERATION:
2147
2386
  return TSI_ASYNC;
2387
+ case SSL_ERROR_PENDING_CERTIFICATE:
2388
+ return TSI_ASYNC;
2148
2389
  #endif
2149
2390
  default: {
2150
2391
  char err_str[256];
@@ -2306,10 +2547,11 @@ static tsi_result ssl_handshaker_next_impl(tsi_ssl_handshaker* self)
2306
2547
  self->handshaker_next_args->received_bytes.clear();
2307
2548
  }
2308
2549
  #if defined(OPENSSL_IS_BORINGSSL)
2309
- } else if (self->key_signer != nullptr) {
2310
- // During the PrivateKeyOffload signature, an empty call to
2311
- // ssl_handshaker_do_handshake needs to be forced after the async offload
2312
- // has completed.
2550
+ } else if (self->key_signer != nullptr ||
2551
+ GetCertificateSelector(self) != nullptr) {
2552
+ // After an asynchronous certificate selection offload or private key
2553
+ // offload, another call to ssl_handshaker_do_handshake needs to be
2554
+ // triggered to continue the SSL handshake.
2313
2555
  status = ssl_handshaker_do_handshake(self);
2314
2556
  #endif
2315
2557
  }
@@ -2432,23 +2674,41 @@ static tsi_result ssl_handshaker_next(
2432
2674
  static void ssl_handshaker_shutdown(tsi_handshaker* self) {
2433
2675
  #if defined(OPENSSL_IS_BORINGSSL)
2434
2676
  tsi_ssl_handshaker* impl = static_cast<tsi_ssl_handshaker*>(self);
2677
+ std::shared_ptr<grpc_core::PrivateKeySigner> key_signer;
2435
2678
  std::shared_ptr<grpc_core::PrivateKeySigner::AsyncSigningHandle>
2436
2679
  signing_handle;
2680
+ std::shared_ptr<AsyncCertificateSelectionHandle> cert_selection_handle;
2437
2681
  std::optional<HandshakerNextArgs> next_args;
2438
2682
  {
2439
2683
  grpc_core::MutexLock lock(&impl->mu);
2440
2684
  if (impl->ssl == nullptr) return;
2441
2685
  impl->is_shutdown = true;
2442
2686
  if (impl->key_signer != nullptr && impl->signing_handle != nullptr) {
2687
+ key_signer = std::move(impl->key_signer);
2443
2688
  signing_handle = std::move(impl->signing_handle);
2444
2689
  }
2690
+ if (GetCertificateSelector(impl) != nullptr &&
2691
+ impl->cert_selection_handle != nullptr) {
2692
+ cert_selection_handle = std::move(impl->cert_selection_handle);
2693
+ }
2445
2694
  if (impl->handshaker_next_args.has_value()) {
2446
2695
  next_args = std::move(*impl->handshaker_next_args);
2447
2696
  impl->handshaker_next_args.reset();
2448
2697
  }
2449
2698
  }
2450
- if (signing_handle != nullptr) {
2451
- impl->key_signer->Cancel(signing_handle);
2699
+ // We must not invoke these Cancel functions while holding the mutex because
2700
+ // this could lead to a deadlock due to mutexes being acquired in reverse
2701
+ // order in different threads. In one thread, the key signer or cert selector
2702
+ // plugin may be holding its own mutex while it invokes the on_complete
2703
+ // callback, which will then acquire the mutex here. So we can't also be
2704
+ // holding the mutex here while calling the plugin's Cancel method, which may
2705
+ // need to acquire its own mutex.
2706
+ if (key_signer != nullptr) {
2707
+ key_signer->Cancel(signing_handle);
2708
+ }
2709
+ if (cert_selection_handle != nullptr) {
2710
+ reinterpret_cast<tsi_ssl_server_handshaker_factory*>(impl->factory_ref)
2711
+ ->certificate_selector->Cancel(cert_selection_handle);
2452
2712
  }
2453
2713
  if (next_args.has_value()) {
2454
2714
  grpc_event_engine::experimental::GetDefaultEventEngine()->Run(
@@ -2492,15 +2752,16 @@ static void tsi_ssl_handshaker_resume_session(
2492
2752
  }
2493
2753
 
2494
2754
  static tsi_result create_tsi_ssl_handshaker(
2495
- SSL_CTX* ctx, int is_client, const char* server_name_indication,
2755
+ SSL_CTX* ctx, bool is_client, const char* server_name_indication,
2496
2756
  size_t network_bio_buf_size, size_t ssl_bio_buf_size,
2497
2757
  std::optional<std::string> alpn_preferred_protocol_raw_list,
2498
2758
  std::shared_ptr<grpc_core::PrivateKeySigner> key_signer,
2499
- tsi_ssl_handshaker_factory* factory, tsi_handshaker** handshaker) {
2759
+ tsi_ssl_handshaker_factory* factory,
2760
+ grpc_core::RefCountedPtr<grpc_core::CollectionScope> collection_scope,
2761
+ tsi_handshaker** handshaker) {
2500
2762
  SSL* ssl = SSL_new(ctx);
2501
2763
  BIO* network_io = nullptr;
2502
2764
  BIO* ssl_io = nullptr;
2503
- tsi_ssl_handshaker* impl = nullptr;
2504
2765
  *handshaker = nullptr;
2505
2766
  if (ctx == nullptr) {
2506
2767
  LOG(ERROR) << "SSL Context is null. Should never happen.";
@@ -2590,20 +2851,10 @@ static tsi_result create_tsi_ssl_handshaker(
2590
2851
  SSL_set_accept_state(ssl);
2591
2852
  }
2592
2853
 
2593
- impl = new tsi_ssl_handshaker();
2594
- impl->ssl = ssl;
2595
- impl->network_io = network_io;
2596
- impl->result = TSI_HANDSHAKE_IN_PROGRESS;
2597
- impl->outgoing_bytes_buffer_size =
2598
- TSI_SSL_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE;
2599
- impl->outgoing_bytes_buffer =
2600
- static_cast<unsigned char*>(gpr_zalloc(impl->outgoing_bytes_buffer_size));
2601
- impl->vtable = &handshaker_vtable;
2602
- impl->factory_ref = tsi_ssl_handshaker_factory_ref(factory);
2603
- #if defined(OPENSSL_IS_BORINGSSL)
2604
- impl->key_signer = std::move(key_signer);
2605
- #endif
2606
-
2854
+ tsi_ssl_handshaker* impl = new tsi_ssl_handshaker(
2855
+ &handshaker_vtable, ssl, network_io,
2856
+ tsi_ssl_handshaker_factory_ref(factory), std::move(collection_scope),
2857
+ is_client, std::move(key_signer));
2607
2858
  *handshaker = impl;
2608
2859
 
2609
2860
  if (!SSL_set_ex_data(ssl, g_ssl_ex_handshaker_index, impl)) {
@@ -2648,20 +2899,19 @@ tsi_result tsi_ssl_client_handshaker_factory_create_handshaker(
2648
2899
  const char* server_name_indication, size_t network_bio_buf_size,
2649
2900
  size_t ssl_bio_buf_size,
2650
2901
  std::optional<std::string> alpn_preferred_protocol_list,
2902
+ grpc_core::RefCountedPtr<grpc_core::CollectionScope> collection_scope,
2651
2903
  tsi_handshaker** handshaker) {
2652
2904
  GRPC_TRACE_LOG(tsi, INFO)
2653
2905
  << "Creating SSL handshaker with SNI " << server_name_indication;
2906
+ std::shared_ptr<grpc_core::PrivateKeySigner> key_signer;
2654
2907
  #if defined(OPENSSL_IS_BORINGSSL)
2655
- return create_tsi_ssl_handshaker(
2656
- factory->ssl_context, 1, server_name_indication, network_bio_buf_size,
2657
- ssl_bio_buf_size, alpn_preferred_protocol_list, factory->key_signer,
2658
- &factory->base, handshaker);
2659
- #else
2660
- return create_tsi_ssl_handshaker(
2661
- factory->ssl_context, 1, server_name_indication, network_bio_buf_size,
2662
- ssl_bio_buf_size, alpn_preferred_protocol_list, /*key_signer=*/nullptr,
2663
- &factory->base, handshaker);
2908
+ key_signer = factory->key_signer;
2664
2909
  #endif
2910
+ return create_tsi_ssl_handshaker(
2911
+ factory->ssl_context, /*is_client=*/true, server_name_indication,
2912
+ network_bio_buf_size, ssl_bio_buf_size, alpn_preferred_protocol_list,
2913
+ std::move(key_signer), &factory->base, std::move(collection_scope),
2914
+ handshaker);
2665
2915
  }
2666
2916
 
2667
2917
  void tsi_ssl_client_handshaker_factory_unref(
@@ -2701,23 +2951,23 @@ static int client_handshaker_factory_npn_callback(
2701
2951
 
2702
2952
  tsi_result tsi_ssl_server_handshaker_factory_create_handshaker(
2703
2953
  tsi_ssl_server_handshaker_factory* factory, size_t network_bio_buf_size,
2704
- size_t ssl_bio_buf_size, tsi_handshaker** handshaker) {
2954
+ size_t ssl_bio_buf_size,
2955
+ grpc_core::RefCountedPtr<grpc_core::CollectionScope> collection_scope,
2956
+ tsi_handshaker** handshaker) {
2705
2957
  if (factory->ssl_contexts.empty()) return TSI_INVALID_ARGUMENT;
2706
- #if defined(OPENSSL_IS_BORINGSSL)
2707
2958
  // Create the handshaker with the first context. We will switch if needed
2708
2959
  // because of SNI in ssl_server_handshaker_factory_servername_callback.
2709
2960
  // Likewise, we pass the private key signer corresponding to the first
2710
2961
  // context.
2711
- return create_tsi_ssl_handshaker(
2712
- factory->ssl_contexts[0].ssl_ctx, 0, nullptr, network_bio_buf_size,
2713
- ssl_bio_buf_size, std::nullopt, factory->ssl_contexts[0].key_signer,
2714
- &factory->base, handshaker);
2715
- #else
2716
- return create_tsi_ssl_handshaker(factory->ssl_contexts[0].ssl_ctx, 0, nullptr,
2717
- network_bio_buf_size, ssl_bio_buf_size,
2718
- std::nullopt, /*key_signer=*/nullptr,
2719
- &factory->base, handshaker);
2962
+ std::shared_ptr<grpc_core::PrivateKeySigner> key_signer;
2963
+ #if defined(OPENSSL_IS_BORINGSSL)
2964
+ key_signer = factory->ssl_contexts[0].key_signer;
2720
2965
  #endif
2966
+ return create_tsi_ssl_handshaker(
2967
+ factory->ssl_contexts[0].ssl_ctx, /*is_client=*/false, nullptr,
2968
+ network_bio_buf_size, ssl_bio_buf_size, std::nullopt,
2969
+ std::move(key_signer), &factory->base, std::move(collection_scope),
2970
+ handshaker);
2721
2971
  }
2722
2972
 
2723
2973
  void tsi_ssl_server_handshaker_factory_unref(
@@ -2777,7 +3027,8 @@ static int does_entry_match_name(absl::string_view entry,
2777
3027
 
2778
3028
  static int ssl_server_handshaker_factory_servername_callback(SSL* ssl,
2779
3029
  int* /*ap*/,
2780
- void* arg) {
3030
+ void* arg)
3031
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&tsi_ssl_handshaker::mu) {
2781
3032
  tsi_ssl_server_handshaker_factory* impl =
2782
3033
  static_cast<tsi_ssl_server_handshaker_factory*>(arg);
2783
3034
  const char* servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
@@ -3056,19 +3307,19 @@ static tsi_ssl_handshaker_factory_vtable server_handshaker_factory_vtable = {
3056
3307
  tsi_ssl_server_handshaker_factory_destroy};
3057
3308
 
3058
3309
  tsi_result tsi_create_ssl_server_handshaker_factory(
3059
- std::vector<tsi_ssl_pem_key_cert_pair> pem_key_cert_pairs,
3310
+ tsi_ssl_key_cert_pairs pem_key_cert_pairs,
3060
3311
  const char* pem_client_root_certs, int force_client_auth,
3061
3312
  const char* cipher_suites, const char** alpn_protocols,
3062
3313
  uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory** factory) {
3063
3314
  return tsi_create_ssl_server_handshaker_factory_ex(
3064
- pem_key_cert_pairs, pem_client_root_certs,
3315
+ std::move(pem_key_cert_pairs), pem_client_root_certs,
3065
3316
  force_client_auth ? TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
3066
3317
  : TSI_DONT_REQUEST_CLIENT_CERTIFICATE,
3067
3318
  cipher_suites, alpn_protocols, num_alpn_protocols, factory);
3068
3319
  }
3069
3320
 
3070
3321
  tsi_result tsi_create_ssl_server_handshaker_factory_ex(
3071
- std::vector<tsi_ssl_pem_key_cert_pair> pem_key_cert_pairs,
3322
+ tsi_ssl_key_cert_pairs pem_key_cert_pairs,
3072
3323
  const char* pem_client_root_certs,
3073
3324
  tsi_client_certificate_request_type client_certificate_request,
3074
3325
  const char* cipher_suites, const char** alpn_protocols,
@@ -3087,219 +3338,246 @@ tsi_result tsi_create_ssl_server_handshaker_factory_ex(
3087
3338
  factory);
3088
3339
  }
3089
3340
 
3090
- tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
3341
+ tsi_result tsi_configure_server_ssl_context(
3091
3342
  const tsi_ssl_server_handshaker_options* options,
3092
- tsi_ssl_server_handshaker_factory** factory) {
3093
- tsi_ssl_server_handshaker_factory* impl = nullptr;
3094
- tsi_result result = TSI_OK;
3095
- size_t i = 0;
3343
+ const tsi_ssl_pem_key_cert_pair* pem_key_cert_pair,
3344
+ tsi_ssl_server_handshaker_factory* impl, SslContext& ssl_context) {
3345
+ #if OPENSSL_VERSION_NUMBER >= 0x10100000
3346
+ ssl_context.ssl_ctx = SSL_CTX_new(TLS_method());
3347
+ #else
3348
+ ssl_context.ssl_ctx = SSL_CTX_new(TLSv1_2_method());
3349
+ #endif
3350
+ #if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER)
3351
+ SSL_CTX_set_options(ssl_context.ssl_ctx, SSL_OP_NO_RENEGOTIATION);
3352
+ #endif
3353
+ if (ssl_context.ssl_ctx == nullptr) {
3354
+ tsi::LogSslErrorStack();
3355
+ LOG(ERROR) << "Could not create ssl context.";
3356
+ return TSI_OUT_OF_RESOURCES;
3357
+ }
3096
3358
 
3097
- gpr_once_init(&g_init_openssl_once, init_openssl);
3359
+ tsi_result result = tsi_set_min_and_max_tls_versions(
3360
+ ssl_context.ssl_ctx, options->min_tls_version, options->max_tls_version);
3361
+ if (result != TSI_OK) return result;
3098
3362
 
3099
- if (factory == nullptr) return TSI_INVALID_ARGUMENT;
3100
- *factory = nullptr;
3101
- if (options->pem_key_cert_pairs.empty()) {
3102
- return TSI_INVALID_ARGUMENT;
3363
+ result = populate_ssl_context(ssl_context.ssl_ctx, pem_key_cert_pair,
3364
+ options->cipher_suites,
3365
+ options->key_exchange_groups);
3366
+ #if defined(OPENSSL_IS_BORINGSSL)
3367
+ if (pem_key_cert_pair != nullptr) {
3368
+ grpc_core::Match(
3369
+ pem_key_cert_pair->private_key, [](const std::string&) {},
3370
+ [&](const std::shared_ptr<grpc_core::PrivateKeySigner>& key_signer) {
3371
+ ssl_context.key_signer = key_signer;
3372
+ });
3103
3373
  }
3374
+ #endif
3375
+ if (result != TSI_OK) return result;
3104
3376
 
3105
- impl = new tsi_ssl_server_handshaker_factory();
3106
- tsi_ssl_handshaker_factory_init(&impl->base);
3107
- impl->base.vtable = &server_handshaker_factory_vtable;
3377
+ // TODO(elessar): Provide ability to disable session ticket keys.
3108
3378
 
3109
- if (options->root_cert_info != nullptr) {
3110
- impl->root_cert_info = options->root_cert_info;
3379
+ // Allow client cache sessions (it's needed for OpenSSL only).
3380
+ int set_sid_ctx_result =
3381
+ SSL_CTX_set_session_id_context(ssl_context.ssl_ctx, kSslSessionIdContext,
3382
+ GPR_ARRAY_SIZE(kSslSessionIdContext));
3383
+ if (set_sid_ctx_result == 0) {
3384
+ LOG(ERROR) << "Failed to set session id context.";
3385
+ return TSI_INTERNAL_ERROR;
3111
3386
  }
3112
3387
 
3113
- if (options->num_alpn_protocols > 0) {
3114
- result = BuildAlpnProtocolNameList(
3115
- options->alpn_protocols, options->num_alpn_protocols,
3116
- &impl->alpn_protocol_list, &impl->alpn_protocol_list_length);
3388
+ if (options->session_ticket_key != nullptr) {
3389
+ if (SSL_CTX_set_tlsext_ticket_keys(
3390
+ ssl_context.ssl_ctx, const_cast<char*>(options->session_ticket_key),
3391
+ options->session_ticket_key_size) == 0) {
3392
+ LOG(ERROR) << "Invalid STEK size.";
3393
+ return TSI_INVALID_ARGUMENT;
3394
+ }
3395
+ }
3396
+ if (options->root_cert_info != nullptr) {
3397
+ grpc_core::Match(
3398
+ *options->root_cert_info,
3399
+ [&](const std::string& pem_root_certs) {
3400
+ STACK_OF(X509_NAME)* root_names = nullptr;
3401
+ result = ssl_ctx_load_verification_certs(
3402
+ ssl_context.ssl_ctx, pem_root_certs.c_str(),
3403
+ pem_root_certs.size(), nullptr);
3404
+ if (result != TSI_OK) {
3405
+ LOG(ERROR) << "Invalid verification certs.";
3406
+ }
3407
+ if (options->send_client_ca_list) {
3408
+ SSL_CTX_set_client_CA_list(ssl_context.ssl_ctx, root_names);
3409
+ }
3410
+ },
3411
+ [&](const grpc_core::SpiffeBundleMap& spiffe_bundle_map) {
3412
+ X509_STORE* cert_store = SSL_CTX_get_cert_store(ssl_context.ssl_ctx);
3413
+ X509_STORE_set_flags(cert_store, X509_V_FLAG_PARTIAL_CHAIN |
3414
+ X509_V_FLAG_TRUSTED_FIRST);
3415
+ const void* p = &spiffe_bundle_map;
3416
+ void* map = const_cast<void*>(p);
3417
+ SSL_CTX_set_ex_data(ssl_context.ssl_ctx,
3418
+ g_ssl_ctx_ex_spiffe_bundle_map_index, map);
3419
+ });
3117
3420
  if (result != TSI_OK) {
3118
- tsi_ssl_handshaker_factory_unref(&impl->base);
3119
3421
  return result;
3120
3422
  }
3121
3423
  }
3122
-
3123
- if (options->key_logger != nullptr) {
3124
- impl->key_logger = options->key_logger->Ref();
3424
+ switch (options->client_certificate_request) {
3425
+ case TSI_DONT_REQUEST_CLIENT_CERTIFICATE:
3426
+ SSL_CTX_set_verify(ssl_context.ssl_ctx, SSL_VERIFY_NONE, nullptr);
3427
+ break;
3428
+ case TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
3429
+ SSL_CTX_set_verify(ssl_context.ssl_ctx, SSL_VERIFY_PEER, nullptr);
3430
+ SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx, NullVerifyCallback,
3431
+ nullptr);
3432
+ break;
3433
+ case TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY:
3434
+ SSL_CTX_set_verify(ssl_context.ssl_ctx, SSL_VERIFY_PEER, nullptr);
3435
+ SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx,
3436
+ CustomVerificationFunction, nullptr);
3437
+ break;
3438
+ case TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
3439
+ SSL_CTX_set_verify(ssl_context.ssl_ctx,
3440
+ SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
3441
+ nullptr);
3442
+ SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx, NullVerifyCallback,
3443
+ nullptr);
3444
+ break;
3445
+ case TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY:
3446
+ SSL_CTX_set_verify(ssl_context.ssl_ctx,
3447
+ SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
3448
+ nullptr);
3449
+ SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx,
3450
+ CustomVerificationFunction, nullptr);
3451
+ break;
3125
3452
  }
3126
3453
 
3127
- impl->ssl_contexts.reserve(options->pem_key_cert_pairs.size());
3128
- for (i = 0; i < options->pem_key_cert_pairs.size(); i++) {
3129
- SslContext& ssl_context = impl->ssl_contexts.emplace_back();
3130
- do {
3131
- #if OPENSSL_VERSION_NUMBER >= 0x10100000
3132
- ssl_context.ssl_ctx = SSL_CTX_new(TLS_method());
3133
- #else
3134
- ssl_context.ssl_ctx = SSL_CTX_new(TLSv1_2_method());
3454
+ #if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
3455
+ if (options->crl_provider != nullptr) {
3456
+ SSL_CTX_set_ex_data(ssl_context.ssl_ctx, g_ssl_ctx_ex_crl_provider_index,
3457
+ options->crl_provider.get());
3458
+ } else if (options->crl_directory != nullptr &&
3459
+ strcmp(options->crl_directory, "") != 0) {
3460
+ X509_STORE* cert_store = SSL_CTX_get_cert_store(ssl_context.ssl_ctx);
3461
+ X509_STORE_set_verify_cb(cert_store, verify_cb);
3462
+ if (!X509_STORE_load_locations(cert_store, nullptr,
3463
+ options->crl_directory)) {
3464
+ LOG(ERROR) << "Failed to load CRL File from directory.";
3465
+ } else {
3466
+ X509_VERIFY_PARAM* param = X509_STORE_get0_param(cert_store);
3467
+ X509_VERIFY_PARAM_set_flags(
3468
+ param, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
3469
+ }
3470
+ }
3135
3471
  #endif
3472
+
3473
+ if (pem_key_cert_pair != nullptr) {
3474
+ result = tsi_ssl_extract_x509_subject_names_from_pem_cert(
3475
+ pem_key_cert_pair->cert_chain.c_str(), &ssl_context.x509_subject_name);
3476
+ if (result != TSI_OK) return result;
3477
+ SSL_CTX_set_tlsext_servername_callback(
3478
+ ssl_context.ssl_ctx, ssl_server_handshaker_factory_servername_callback);
3479
+ SSL_CTX_set_tlsext_servername_arg(ssl_context.ssl_ctx, impl);
3480
+ }
3481
+ #if TSI_OPENSSL_ALPN_SUPPORT
3482
+ SSL_CTX_set_alpn_select_cb(ssl_context.ssl_ctx,
3483
+ ServerHandshakerFactoryAlpnCallback, impl);
3484
+ #endif // TSI_OPENSSL_ALPN_SUPPORT
3485
+ SSL_CTX_set_next_protos_advertised_cb(
3486
+ ssl_context.ssl_ctx, server_handshaker_factory_npn_advertised_callback,
3487
+ impl);
3488
+
3136
3489
  #if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER)
3137
- SSL_CTX_set_options(ssl_context.ssl_ctx, SSL_OP_NO_RENEGOTIATION);
3490
+ // Register factory at index
3491
+ if (options->key_logger != nullptr) {
3492
+ // Need to set factory at g_ssl_ctx_ex_factory_index
3493
+ SSL_CTX_set_ex_data(ssl_context.ssl_ctx, g_ssl_ctx_ex_factory_index, impl);
3494
+ // SSL_CTX_set_keylog_callback is set here to register callback
3495
+ // when ssl/tls handshakes complete.
3496
+ SSL_CTX_set_keylog_callback(
3497
+ ssl_context.ssl_ctx,
3498
+ ssl_keylogging_callback<tsi_ssl_server_handshaker_factory>);
3499
+ }
3138
3500
  #endif
3139
- if (ssl_context.ssl_ctx == nullptr) {
3140
- tsi::LogSslErrorStack();
3141
- LOG(ERROR) << "Could not create ssl context.";
3142
- result = TSI_OUT_OF_RESOURCES;
3143
- break;
3144
- }
3145
3501
 
3146
- result = tsi_set_min_and_max_tls_versions(ssl_context.ssl_ctx,
3147
- options->min_tls_version,
3148
- options->max_tls_version);
3149
- if (result != TSI_OK) return result;
3502
+ return result;
3503
+ }
3150
3504
 
3151
- result = populate_ssl_context(
3152
- ssl_context.ssl_ctx, &options->pem_key_cert_pairs[i],
3153
- options->cipher_suites, options->key_exchange_groups);
3154
- if (result != TSI_OK) break;
3505
+ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
3506
+ const tsi_ssl_server_handshaker_options* options,
3507
+ tsi_ssl_server_handshaker_factory** factory) {
3508
+ tsi_ssl_server_handshaker_factory* impl = nullptr;
3155
3509
 
3156
- #if defined(OPENSSL_IS_BORINGSSL)
3157
- grpc_core::Match(
3158
- options->pem_key_cert_pairs[i].private_key, [](const std::string&) {},
3159
- [&](const std::shared_ptr<grpc_core::PrivateKeySigner>& key_signer) {
3160
- ssl_context.key_signer = key_signer;
3161
- });
3162
- #endif
3510
+ gpr_once_init(&g_init_openssl_once, init_openssl);
3163
3511
 
3164
- // TODO(elessar): Provide ability to disable session ticket keys.
3512
+ if (factory == nullptr) return TSI_INVALID_ARGUMENT;
3513
+ *factory = nullptr;
3165
3514
 
3166
- // Allow client cache sessions (it's needed for OpenSSL only).
3167
- int set_sid_ctx_result = SSL_CTX_set_session_id_context(
3168
- ssl_context.ssl_ctx, kSslSessionIdContext,
3169
- GPR_ARRAY_SIZE(kSslSessionIdContext));
3170
- if (set_sid_ctx_result == 0) {
3171
- LOG(ERROR) << "Failed to set session id context.";
3172
- result = TSI_INTERNAL_ERROR;
3173
- break;
3174
- }
3515
+ impl = new tsi_ssl_server_handshaker_factory();
3516
+ tsi_ssl_handshaker_factory_init(&impl->base);
3517
+ impl->base.vtable = &server_handshaker_factory_vtable;
3175
3518
 
3176
- if (options->session_ticket_key != nullptr) {
3177
- if (SSL_CTX_set_tlsext_ticket_keys(
3178
- ssl_context.ssl_ctx,
3179
- const_cast<char*>(options->session_ticket_key),
3180
- options->session_ticket_key_size) == 0) {
3181
- LOG(ERROR) << "Invalid STEK size.";
3182
- result = TSI_INVALID_ARGUMENT;
3183
- break;
3519
+ tsi_result result = grpc_core::Match(
3520
+ options->pem_key_cert_pairs,
3521
+ [&](const std::vector<tsi_ssl_pem_key_cert_pair>& pem_key_cert_pairs) {
3522
+ if (pem_key_cert_pairs.empty()) {
3523
+ return TSI_INVALID_ARGUMENT;
3184
3524
  }
3185
- }
3186
- if (options->root_cert_info != nullptr) {
3187
- Match(
3188
- *options->root_cert_info,
3189
- [&](const std::string& pem_root_certs) {
3190
- STACK_OF(X509_NAME)* root_names = nullptr;
3191
- result = ssl_ctx_load_verification_certs(
3192
- ssl_context.ssl_ctx, pem_root_certs.c_str(),
3193
- pem_root_certs.size(), nullptr);
3194
- if (result != TSI_OK) {
3195
- LOG(ERROR) << "Invalid verification certs.";
3196
- }
3197
- if (options->send_client_ca_list) {
3198
- SSL_CTX_set_client_CA_list(ssl_context.ssl_ctx, root_names);
3199
- }
3200
- },
3201
- [&](const grpc_core::SpiffeBundleMap& spiffe_bundle_map) {
3202
- X509_STORE* cert_store =
3203
- SSL_CTX_get_cert_store(ssl_context.ssl_ctx);
3204
- X509_STORE_set_flags(cert_store, X509_V_FLAG_PARTIAL_CHAIN |
3205
- X509_V_FLAG_TRUSTED_FIRST);
3206
- const void* p = &spiffe_bundle_map;
3207
- void* map = const_cast<void*>(p);
3208
- SSL_CTX_set_ex_data(ssl_context.ssl_ctx,
3209
- g_ssl_ctx_ex_spiffe_bundle_map_index, map);
3210
- });
3211
- if (result != TSI_OK) {
3212
- break;
3525
+ impl->ssl_contexts.reserve(pem_key_cert_pairs.size());
3526
+ for (size_t i = 0; i < pem_key_cert_pairs.size(); ++i) {
3527
+ SslContext& ssl_context = impl->ssl_contexts.emplace_back();
3528
+ tsi_result result = tsi_configure_server_ssl_context(
3529
+ options, &pem_key_cert_pairs[i], impl, ssl_context);
3530
+ if (result != TSI_OK) {
3531
+ return result;
3532
+ }
3213
3533
  }
3214
- }
3215
- switch (options->client_certificate_request) {
3216
- case TSI_DONT_REQUEST_CLIENT_CERTIFICATE:
3217
- SSL_CTX_set_verify(ssl_context.ssl_ctx, SSL_VERIFY_NONE, nullptr);
3218
- break;
3219
- case TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
3220
- SSL_CTX_set_verify(ssl_context.ssl_ctx, SSL_VERIFY_PEER, nullptr);
3221
- SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx,
3222
- NullVerifyCallback, nullptr);
3223
- break;
3224
- case TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY:
3225
- SSL_CTX_set_verify(ssl_context.ssl_ctx, SSL_VERIFY_PEER, nullptr);
3226
- SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx,
3227
- CustomVerificationFunction, nullptr);
3228
- break;
3229
- case TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY:
3230
- SSL_CTX_set_verify(ssl_context.ssl_ctx,
3231
- SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
3232
- nullptr);
3233
- SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx,
3234
- NullVerifyCallback, nullptr);
3235
- break;
3236
- case TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY:
3237
- SSL_CTX_set_verify(ssl_context.ssl_ctx,
3238
- SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
3239
- nullptr);
3240
- SSL_CTX_set_cert_verify_callback(ssl_context.ssl_ctx,
3241
- CustomVerificationFunction, nullptr);
3242
- break;
3243
- }
3244
-
3245
- #if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
3246
- if (options->crl_provider != nullptr) {
3247
- SSL_CTX_set_ex_data(ssl_context.ssl_ctx,
3248
- g_ssl_ctx_ex_crl_provider_index,
3249
- options->crl_provider.get());
3250
- } else if (options->crl_directory != nullptr &&
3251
- strcmp(options->crl_directory, "") != 0) {
3252
- X509_STORE* cert_store = SSL_CTX_get_cert_store(ssl_context.ssl_ctx);
3253
- X509_STORE_set_verify_cb(cert_store, verify_cb);
3254
- if (!X509_STORE_load_locations(cert_store, nullptr,
3255
- options->crl_directory)) {
3256
- LOG(ERROR) << "Failed to load CRL File from directory.";
3257
- } else {
3258
- X509_VERIFY_PARAM* param = X509_STORE_get0_param(cert_store);
3259
- X509_VERIFY_PARAM_set_flags(
3260
- param, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
3534
+ return TSI_OK;
3535
+ },
3536
+ [&](const std::shared_ptr<grpc_core::CertificateSelector>&
3537
+ cert_selector) {
3538
+ #if defined(OPENSSL_IS_BORINGSSL)
3539
+ if (cert_selector == nullptr) {
3540
+ return TSI_INVALID_ARGUMENT;
3261
3541
  }
3262
- }
3542
+ SslContext& ssl_context = impl->ssl_contexts.emplace_back();
3543
+ tsi_result result = tsi_configure_server_ssl_context(
3544
+ options, /*pem_key_cert_pair=*/nullptr, impl, ssl_context);
3545
+ if (result != TSI_OK) {
3546
+ return result;
3547
+ }
3548
+ impl->certificate_selector = cert_selector;
3549
+ SSL_CTX_set_select_certificate_cb(ssl_context.ssl_ctx,
3550
+ SelectCertificateCallback);
3551
+ return TSI_OK;
3552
+ #else
3553
+ VLOG(2) << "CertificateSelector is not supported with this SSL "
3554
+ "implementation.";
3555
+ return TSI_UNIMPLEMENTED;
3263
3556
  #endif
3557
+ });
3558
+ if (result != TSI_OK) {
3559
+ tsi_ssl_handshaker_factory_unref(&impl->base);
3560
+ return result;
3561
+ }
3264
3562
 
3265
- result = tsi_ssl_extract_x509_subject_names_from_pem_cert(
3266
- options->pem_key_cert_pairs[i].cert_chain.c_str(),
3267
- &ssl_context.x509_subject_name);
3268
- if (result != TSI_OK) break;
3269
-
3270
- SSL_CTX_set_tlsext_servername_callback(
3271
- ssl_context.ssl_ctx,
3272
- ssl_server_handshaker_factory_servername_callback);
3273
- SSL_CTX_set_tlsext_servername_arg(ssl_context.ssl_ctx, impl);
3274
- #if TSI_OPENSSL_ALPN_SUPPORT
3275
- SSL_CTX_set_alpn_select_cb(ssl_context.ssl_ctx,
3276
- ServerHandshakerFactoryAlpnCallback, impl);
3277
- #endif // TSI_OPENSSL_ALPN_SUPPORT
3278
- SSL_CTX_set_next_protos_advertised_cb(
3279
- ssl_context.ssl_ctx,
3280
- server_handshaker_factory_npn_advertised_callback, impl);
3281
-
3282
- #if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER)
3283
- // Register factory at index
3284
- if (options->key_logger != nullptr) {
3285
- // Need to set factory at g_ssl_ctx_ex_factory_index
3286
- SSL_CTX_set_ex_data(ssl_context.ssl_ctx, g_ssl_ctx_ex_factory_index,
3287
- impl);
3288
- // SSL_CTX_set_keylog_callback is set here to register callback
3289
- // when ssl/tls handshakes complete.
3290
- SSL_CTX_set_keylog_callback(
3291
- ssl_context.ssl_ctx,
3292
- ssl_keylogging_callback<tsi_ssl_server_handshaker_factory>);
3293
- }
3294
- #endif
3295
- } while (false);
3563
+ if (options->root_cert_info != nullptr) {
3564
+ impl->root_cert_info = options->root_cert_info;
3565
+ }
3296
3566
 
3567
+ if (options->num_alpn_protocols > 0) {
3568
+ result = BuildAlpnProtocolNameList(
3569
+ options->alpn_protocols, options->num_alpn_protocols,
3570
+ &impl->alpn_protocol_list, &impl->alpn_protocol_list_length);
3297
3571
  if (result != TSI_OK) {
3298
3572
  tsi_ssl_handshaker_factory_unref(&impl->base);
3299
3573
  return result;
3300
3574
  }
3301
3575
  }
3302
3576
 
3577
+ if (options->key_logger != nullptr) {
3578
+ impl->key_logger = options->key_logger->Ref();
3579
+ }
3580
+
3303
3581
  *factory = impl;
3304
3582
  return TSI_OK;
3305
3583
  }