grpc 1.85.0 → 1.86.0.pre1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (634) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +13 -9
  3. data/etc/roots.pem +0 -583
  4. data/include/grpc/channel_factory.h +78 -0
  5. data/include/grpc/credentials.h +21 -0
  6. data/include/grpc/grpc.h +7 -0
  7. data/include/grpc/grpc_security_constants.h +2 -0
  8. data/include/grpc/module.modulemap +1 -0
  9. data/src/core/call/call_filters.cc +4 -1
  10. data/src/core/call/call_filters.h +3 -1
  11. data/src/core/call/call_spine.h +12 -6
  12. data/src/core/call/call_state.h +3 -3
  13. data/src/core/call/client_call.cc +4 -1
  14. data/src/core/call/client_call.h +1 -0
  15. data/src/core/call/evaluate_args.cc +15 -14
  16. data/src/core/call/filter_fusion.h +2 -15
  17. data/src/core/call/interception_chain.h +2 -7
  18. data/src/core/call/metadata_batch.cc +5 -0
  19. data/src/core/call/metadata_batch.h +34 -3
  20. data/src/core/call/request_buffer.cc +1 -1
  21. data/src/core/call/server_call.cc +3 -3
  22. data/src/core/call/server_call.h +15 -0
  23. data/src/core/channelz/channelz_registry.cc +4 -4
  24. data/src/core/channelz/ztrace_collector.h +11 -2
  25. data/src/core/client_channel/backup_poller.cc +1 -2
  26. data/src/core/client_channel/channel_factory.cc +110 -0
  27. data/src/core/client_channel/channel_factory.h +45 -0
  28. data/src/core/client_channel/global_subchannel_pool.cc +2 -2
  29. data/src/core/client_channel/lame_channel.cc +59 -0
  30. data/src/core/client_channel/lame_channel.h +86 -0
  31. data/src/core/credentials/call/external/aws_request_signer.cc +2 -1
  32. data/src/core/credentials/call/external/url_external_account_credentials.cc +6 -17
  33. data/src/core/credentials/call/external/url_external_account_credentials.h +0 -1
  34. data/src/core/credentials/call/jwt/jwt_verifier.cc +25 -13
  35. data/src/core/credentials/call/oauth2/oauth2_credentials.cc +6 -4
  36. data/src/core/credentials/call/regional_access_boundary_fetcher.cc +16 -0
  37. data/src/core/credentials/call/regional_access_boundary_fetcher.h +6 -2
  38. data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +14 -0
  39. data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +12 -2
  40. data/src/core/credentials/transport/tls/ssl_utils.cc +20 -0
  41. data/src/core/credentials/transport/tls/ssl_utils.h +4 -0
  42. data/src/core/credentials/transport/tls/tls_security_connector.cc +6 -2
  43. data/src/core/ext/filters/http/server/http_server_filter.cc +6 -1
  44. data/src/core/ext/filters/rbac/rbac_filter.cc +3 -41
  45. data/src/core/ext/filters/rbac/rbac_filter.h +2 -11
  46. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -2
  47. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +31 -24
  48. data/src/core/ext/transport/chttp2/server/chttp2_server.h +1 -2
  49. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +69 -102
  50. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -1
  51. data/src/core/ext/transport/chttp2/transport/flow_control.h +2 -2
  52. data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +1 -1
  53. data/src/core/ext/transport/chttp2/transport/frame.cc +15 -19
  54. data/src/core/ext/transport/chttp2/transport/frame.h +1 -1
  55. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +18 -61
  56. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +0 -4
  57. data/src/core/ext/transport/chttp2/transport/frame_security.cc +1 -2
  58. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +9 -0
  59. data/src/core/ext/transport/chttp2/transport/goaway.cc +1 -1
  60. data/src/core/ext/transport/chttp2/transport/goaway.h +0 -5
  61. data/src/core/ext/transport/chttp2/transport/header_assembler.h +1 -5
  62. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +3 -0
  63. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +8 -0
  64. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +33 -0
  65. data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +34 -19
  66. data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +5 -2
  67. data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +134 -82
  68. data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +30 -15
  69. data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +4 -3
  70. data/src/core/ext/transport/chttp2/transport/http2_transport.cc +9 -33
  71. data/src/core/ext/transport/chttp2/transport/http2_transport.h +1 -6
  72. data/src/core/ext/transport/chttp2/transport/http2_transport_stats.h +60 -0
  73. data/src/core/ext/transport/chttp2/transport/internal.h +6 -1
  74. data/src/core/ext/transport/chttp2/transport/keepalive.h +1 -4
  75. data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -8
  76. data/src/core/ext/transport/chttp2/transport/ping_promise.cc +35 -11
  77. data/src/core/ext/transport/chttp2/transport/ping_promise.h +52 -47
  78. data/src/core/ext/transport/chttp2/transport/read_context.h +19 -5
  79. data/src/core/ext/transport/chttp2/transport/security_frame.h +7 -6
  80. data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +7 -5
  81. data/src/core/ext/transport/chttp2/transport/transport_common.cc +47 -0
  82. data/src/core/ext/transport/chttp2/transport/transport_common.h +29 -0
  83. data/src/core/ext/transport/chttp2/transport/writable_streams.h +1 -1
  84. data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +1 -7
  85. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +16 -0
  86. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +4 -3
  87. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +129 -81
  88. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +50 -39
  89. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +411 -163
  90. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +95 -44
  91. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.h +3 -0
  92. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +41 -8
  93. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +8 -5
  94. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +427 -222
  95. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +97 -66
  96. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.h +1 -0
  97. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +130 -99
  98. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +29 -27
  99. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +49 -33
  100. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +19 -8
  101. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +95 -3
  102. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +33 -6
  103. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +1 -0
  104. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb.h +93 -11
  105. data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c +8 -5
  106. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +656 -134
  107. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +117 -51
  108. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.h +2 -0
  109. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +45 -23
  110. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +19 -10
  111. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +99 -34
  112. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +12 -7
  113. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +344 -273
  114. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +62 -69
  115. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +1 -3
  116. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +53 -22
  117. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +9 -7
  118. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +108 -0
  119. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c +26 -2
  120. data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.h +1 -0
  121. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +809 -231
  122. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +183 -77
  123. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +3 -0
  124. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +151 -26
  125. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +17 -9
  126. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +24 -8
  127. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +6 -5
  128. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +2 -1
  129. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb.h +224 -16
  130. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.c +83 -10
  131. data/src/core/ext/upb-gen/envoy/extensions/filters/http/composite/v3/composite.upb_minitable.h +2 -0
  132. data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb.h +95 -79
  133. data/src/core/ext/upb-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upb_minitable.c +23 -22
  134. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +34 -18
  135. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +10 -9
  136. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +243 -2
  137. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +53 -5
  138. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h +3 -0
  139. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +53 -22
  140. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +9 -7
  141. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +23 -7
  142. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +9 -4
  143. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +516 -215
  144. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +99 -60
  145. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +1 -0
  146. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +60 -28
  147. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +12 -10
  148. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +109 -0
  149. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +32 -2
  150. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +1 -0
  151. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +37 -4
  152. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +7 -4
  153. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +65 -47
  154. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +29 -12
  155. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +20 -4
  156. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c +6 -3
  157. data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb.h +776 -88
  158. data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.c +195 -35
  159. data/src/core/ext/upb-gen/envoy/service/ext_proc/v3/external_processor.upb_minitable.h +5 -0
  160. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb.h +23 -7
  161. data/src/core/ext/upb-gen/envoy/type/matcher/v3/address.upb_minitable.c +10 -3
  162. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb.h +44 -0
  163. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c +11 -2
  164. data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.h +1 -0
  165. data/src/core/ext/upb-gen/envoy/type/v3/scope.upb.h +218 -0
  166. data/src/core/ext/upb-gen/envoy/type/v3/scope.upb_minitable.c +70 -0
  167. data/src/core/ext/upb-gen/envoy/type/v3/scope.upb_minitable.h +31 -0
  168. data/src/core/ext/upbdefs-gen/envoy/admin/v3/clusters.upbdefs.c +30 -24
  169. data/src/core/ext/upbdefs-gen/envoy/admin/v3/server_info.upbdefs.c +166 -152
  170. data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +467 -422
  171. data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +15 -0
  172. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +120 -110
  173. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +912 -857
  174. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.h +5 -0
  175. data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/outlier_detection.upbdefs.c +26 -19
  176. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +59 -54
  177. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +356 -346
  178. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.h +5 -0
  179. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/http_service.upbdefs.c +49 -37
  180. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +599 -483
  181. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.h +10 -0
  182. data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.c +65 -49
  183. data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +165 -161
  184. data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +369 -327
  185. data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -15
  186. data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +129 -121
  187. data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +224 -204
  188. data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.h +5 -0
  189. data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +2046 -1932
  190. data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.h +15 -0
  191. data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +70 -37
  192. data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +7 -3
  193. data/src/core/ext/upbdefs-gen/envoy/data/accesslog/v3/accesslog.upbdefs.c +5 -3
  194. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/composite/v3/composite.upbdefs.c +121 -78
  195. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/composite/v3/composite.upbdefs.h +10 -0
  196. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/ext_proc/v3/ext_proc.upbdefs.c +165 -160
  197. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +121 -118
  198. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c +68 -37
  199. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h +15 -0
  200. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c +48 -40
  201. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +44 -37
  202. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +919 -870
  203. data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
  204. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upbdefs.c +26 -14
  205. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +44 -36
  206. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +372 -371
  207. data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +32 -28
  208. data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/address.upbdefs.c +17 -15
  209. data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.c +4 -1
  210. data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.h +5 -0
  211. data/src/core/ext/upbdefs-gen/envoy/type/v3/scope.upbdefs.c +76 -0
  212. data/src/core/ext/upbdefs-gen/envoy/type/v3/scope.upbdefs.h +37 -0
  213. data/src/core/ext/upbdefs-gen/envoy/type/v3/token_bucket.upbdefs.c +1 -1
  214. data/src/core/filter/ext_proc/ext_proc_filter.cc +537 -259
  215. data/src/core/filter/ext_proc/ext_proc_filter.h +47 -14
  216. data/src/core/filter/ext_proc/ext_proc_messages.cc +38 -17
  217. data/src/core/filter/ext_proc/ext_proc_messages.h +19 -7
  218. data/src/core/filter/filter_args.h +5 -60
  219. data/src/core/handshaker/http_connect/http_connect_client_handshaker.cc +1 -1
  220. data/src/core/handshaker/security/pipelined_secure_endpoint.cc +23 -22
  221. data/src/core/handshaker/security/secure_endpoint.cc +16 -16
  222. data/src/core/lib/channel/channel_stack.cc +0 -12
  223. data/src/core/lib/channel/channel_stack.h +0 -8
  224. data/src/core/lib/channel/promise_based_filter.cc +57 -44
  225. data/src/core/lib/channel/promise_based_filter.h +29 -41
  226. data/src/core/lib/event_engine/ares_resolver.cc +10 -4
  227. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +1 -1
  228. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +3 -3
  229. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +1 -5
  230. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +10 -12
  231. data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +3 -17
  232. data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +21 -1
  233. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +5 -5
  234. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +10 -12
  235. data/src/core/lib/event_engine/posix_engine/posix_interface.h +1 -1
  236. data/src/core/lib/event_engine/posix_engine/timer.cc +2 -2
  237. data/src/core/lib/event_engine/shim.cc +1 -6
  238. data/src/core/lib/event_engine/shim.h +0 -5
  239. data/src/core/lib/event_engine/windows/windows_engine.cc +4 -4
  240. data/src/core/lib/event_engine/windows/windows_listener.cc +1 -1
  241. data/src/core/lib/experiments/experiments.cc +144 -261
  242. data/src/core/lib/experiments/experiments.h +48 -120
  243. data/src/core/lib/iomgr/iomgr_windows.cc +1 -6
  244. data/src/core/lib/iomgr/tcp_posix.cc +21 -21
  245. data/src/core/lib/iomgr/tcp_server_posix.cc +64 -242
  246. data/src/core/lib/iomgr/tcp_server_windows.cc +0 -469
  247. data/src/core/lib/promise/activity.cc +8 -8
  248. data/src/core/lib/promise/activity.h +5 -5
  249. data/src/core/lib/promise/inter_activity_pipe.h +3 -3
  250. data/src/core/lib/promise/party.cc +5 -5
  251. data/src/core/lib/promise/status_flag.h +7 -2
  252. data/src/core/lib/resource_quota/memory_quota.cc +2 -2
  253. data/src/core/lib/security/authorization/rbac_policy.h +2 -2
  254. data/src/core/lib/surface/call.cc +13 -3
  255. data/src/core/lib/surface/call.h +23 -6
  256. data/src/core/lib/surface/channel_create.cc +7 -1
  257. data/src/core/lib/surface/channel_init.h +1 -8
  258. data/src/core/lib/surface/filter_stack_call.cc +16 -0
  259. data/src/core/lib/surface/filter_stack_call.h +1 -0
  260. data/src/core/lib/surface/init.cc +3 -3
  261. data/src/core/lib/surface/legacy_channel.cc +4 -1
  262. data/src/core/lib/surface/version.cc +2 -2
  263. data/src/core/lib/transport/transport.cc +15 -8
  264. data/src/core/lib/transport/transport_framing_endpoint_extension.h +8 -2
  265. data/src/core/load_balancing/outlier_detection/outlier_detection.cc +99 -8
  266. data/src/core/load_balancing/outlier_detection/outlier_detection_metrics.cc +38 -0
  267. data/src/core/load_balancing/outlier_detection/outlier_detection_metrics.h +55 -0
  268. data/src/core/load_balancing/ring_hash/ring_hash.cc +2 -1
  269. data/src/core/load_balancing/rls/rls.cc +21 -1
  270. data/src/core/load_balancing/xds/cds.cc +4 -51
  271. data/src/core/plugin_registry/grpc_plugin_registry.cc +10 -13
  272. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -7
  273. data/src/core/resolver/xds/xds_resolver.cc +1 -1
  274. data/src/core/server/server.cc +60 -4
  275. data/src/core/server/server_config_selector.h +4 -18
  276. data/src/core/server/server_config_selector_filter.cc +20 -146
  277. data/src/core/server/server_config_selector_filter.h +2 -2
  278. data/src/core/server/xds_server_config_fetcher.cc +5 -20
  279. data/src/core/transport/auth_context.cc +15 -5
  280. data/src/core/transport/auth_context.h +5 -0
  281. data/src/core/tsi/ssl_telemetry_utils.cc +9 -1
  282. data/src/core/tsi/ssl_transport_security.cc +158 -52
  283. data/src/core/tsi/ssl_transport_security.h +18 -2
  284. data/src/core/tsi/ssl_transport_security_utils.cc +123 -12
  285. data/src/core/tsi/ssl_transport_security_utils.h +19 -0
  286. data/src/core/util/latent_see.cc +65 -3
  287. data/src/core/util/latent_see.h +57 -12
  288. data/src/core/util/linux/cpu.cc +12 -6
  289. data/src/core/util/mpscq.cc +2 -2
  290. data/src/core/util/sync_abseil.cc +3 -3
  291. data/src/core/util/trie_lookup.h +5 -1
  292. data/src/core/util/windows/env.cc +1 -0
  293. data/src/core/util/work_serializer.cc +1 -1
  294. data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +10 -9
  295. data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +3 -3
  296. data/src/core/xds/grpc/streaming_call_promise_wrapper.cc +5 -2
  297. data/src/core/xds/grpc/streaming_call_promise_wrapper.h +2 -5
  298. data/src/core/xds/grpc/xds_audit_logger_registry.cc +0 -54
  299. data/src/core/xds/grpc/xds_audit_logger_registry.h +0 -8
  300. data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +2 -28
  301. data/src/core/xds/grpc/xds_bootstrap_grpc_builder.h +0 -20
  302. data/src/core/xds/grpc/xds_client_grpc.cc +4 -4
  303. data/src/core/xds/grpc/xds_client_grpc.h +1 -1
  304. data/src/core/xds/grpc/xds_cluster_parser.cc +5 -1
  305. data/src/core/xds/grpc/xds_common_types_parser.cc +12 -0
  306. data/src/core/xds/grpc/xds_endpoint_parser.cc +3 -3
  307. data/src/core/xds/grpc/xds_http_composite_filter.cc +0 -5
  308. data/src/core/xds/grpc/xds_http_composite_filter.h +1 -27
  309. data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +1 -5
  310. data/src/core/xds/grpc/xds_http_ext_proc_filter.h +3 -29
  311. data/src/core/xds/grpc/xds_http_fault_filter.cc +0 -4
  312. data/src/core/xds/grpc/xds_http_fault_filter.h +0 -26
  313. data/src/core/xds/grpc/xds_http_filter.h +1 -63
  314. data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +0 -5
  315. data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +1 -27
  316. data/src/core/xds/grpc/xds_http_rbac_filter.cc +0 -527
  317. data/src/core/xds/grpc/xds_http_rbac_filter.h +0 -15
  318. data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +0 -5
  319. data/src/core/xds/grpc/xds_http_stateful_session_filter.h +0 -26
  320. data/src/core/xds/grpc/xds_listener.cc +0 -2
  321. data/src/core/xds/grpc/xds_listener.h +0 -2
  322. data/src/core/xds/grpc/xds_listener_parser.cc +0 -7
  323. data/src/core/xds/grpc/xds_matcher.cc +17 -11
  324. data/src/core/xds/grpc/xds_matcher.h +2 -1
  325. data/src/core/xds/grpc/xds_matcher_context.cc +11 -0
  326. data/src/core/xds/grpc/xds_matcher_context.h +3 -2
  327. data/src/core/xds/grpc/xds_matcher_input.cc +19 -1
  328. data/src/core/xds/grpc/xds_matcher_parse.cc +3 -2
  329. data/src/core/xds/grpc/xds_route_config.cc +0 -2
  330. data/src/core/xds/grpc/xds_route_config.h +0 -2
  331. data/src/core/xds/grpc/xds_route_config_parser.cc +0 -5
  332. data/src/core/xds/grpc/xds_routing.cc +22 -112
  333. data/src/core/xds/grpc/xds_routing.h +2 -27
  334. data/src/core/xds/grpc/xds_transport_factory_grpc.cc +236 -0
  335. data/src/core/xds/grpc/xds_transport_factory_grpc.h +95 -0
  336. data/src/core/xds/grpc/xds_transport_grpc.cc +78 -241
  337. data/src/core/xds/grpc/xds_transport_grpc.h +41 -51
  338. data/src/core/xds/xds_client/lrs_client.cc +3 -5
  339. data/src/core/xds/xds_client/lrs_client.h +2 -1
  340. data/src/core/xds/xds_client/xds_client.cc +36 -23
  341. data/src/core/xds/xds_client/xds_client.h +6 -5
  342. data/src/core/xds/xds_client/xds_transport.h +110 -108
  343. data/src/core/xds/xds_client/xds_transport_factory.h +43 -0
  344. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -0
  345. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -0
  346. data/src/ruby/lib/grpc/generic/rpc_server.rb +2 -2
  347. data/src/ruby/lib/grpc/version.rb +1 -1
  348. data/third_party/boringssl-with-bazel/crypto/asn1/a_type.cc +54 -19
  349. data/third_party/boringssl-with-bazel/crypto/asn1/asn1_lib.cc +1 -1
  350. data/third_party/boringssl-with-bazel/crypto/asn1/internal.h +58 -12
  351. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_dec.cc +13 -13
  352. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_enc.cc +13 -11
  353. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_fre.cc +14 -18
  354. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_new.cc +31 -35
  355. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_typ.cc +0 -2
  356. data/third_party/boringssl-with-bazel/crypto/asn1/tasn_utl.cc +17 -24
  357. data/third_party/boringssl-with-bazel/crypto/bio/bio.cc +0 -1
  358. data/third_party/boringssl-with-bazel/crypto/bio/bio_mem.cc +9 -3
  359. data/third_party/boringssl-with-bazel/crypto/bio/connect.cc +3 -3
  360. data/third_party/boringssl-with-bazel/crypto/bio/fd.cc +0 -1
  361. data/third_party/boringssl-with-bazel/crypto/bio/file.cc +0 -1
  362. data/third_party/boringssl-with-bazel/crypto/bio/internal.h +2 -3
  363. data/third_party/boringssl-with-bazel/crypto/bio/pair.cc +0 -1
  364. data/third_party/boringssl-with-bazel/crypto/bio/socket.cc +1 -1
  365. data/third_party/boringssl-with-bazel/crypto/bytestring/cbb.cc +70 -45
  366. data/third_party/boringssl-with-bazel/crypto/bytestring/cbs.cc +15 -34
  367. data/third_party/boringssl-with-bazel/crypto/bytestring/internal.h +5 -0
  368. data/third_party/boringssl-with-bazel/crypto/cipher/e_aesgcmsiv.cc +20 -165
  369. data/third_party/boringssl-with-bazel/crypto/cipher/e_tls.cc +7 -4
  370. data/third_party/boringssl-with-bazel/crypto/cipher/internal.h +159 -0
  371. data/third_party/boringssl-with-bazel/crypto/curve25519/curve25519.cc +295 -16
  372. data/third_party/boringssl-with-bazel/crypto/curve25519/internal.h +25 -14
  373. data/third_party/boringssl-with-bazel/crypto/dh/params.cc +1 -1
  374. data/third_party/boringssl-with-bazel/crypto/ec/hash_to_curve.cc +208 -36
  375. data/third_party/boringssl-with-bazel/crypto/err/err.cc +3 -2
  376. data/third_party/boringssl-with-bazel/crypto/evp/evp.cc +3 -0
  377. data/third_party/boringssl-with-bazel/crypto/evp/evp_kem.cc +25 -6
  378. data/third_party/boringssl-with-bazel/crypto/evp/internal.h +15 -11
  379. data/third_party/boringssl-with-bazel/crypto/evp/p_ec.cc +121 -0
  380. data/third_party/boringssl-with-bazel/crypto/evp/p_mlkem.cc +34 -9
  381. data/third_party/boringssl-with-bazel/crypto/evp/p_rsa.cc +76 -8
  382. data/third_party/boringssl-with-bazel/crypto/evp/p_xwing.cc +47 -20
  383. data/third_party/boringssl-with-bazel/crypto/ex_data.cc +1 -1
  384. data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/aes_nohw.cc.inc +1 -1
  385. data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/gcm.cc.inc +2 -2
  386. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bcm.cc +1 -0
  387. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/add.cc.inc +9 -4
  388. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/asm/x86_64-gcc.cc.inc +4 -4
  389. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/exponentiation.cc.inc +2 -2
  390. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/internal.h +12 -6
  391. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/jacobi.cc.inc +1 -1
  392. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/montgomery_inv.cc.inc +4 -4
  393. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/prime.cc.inc +3 -3
  394. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/rsaz_exp.cc.inc +6 -6
  395. data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/sqrt.cc.inc +21 -21
  396. data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/aead.cc.inc +4 -2
  397. data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/cipher.cc.inc +97 -132
  398. data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/internal.h +7 -6
  399. data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/dh.cc.inc +3 -3
  400. data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/internal.h +1 -1
  401. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec.cc.inc +77 -17
  402. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec_montgomery.cc.inc +13 -13
  403. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/felem.cc.inc +117 -34
  404. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/internal.h +67 -18
  405. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/oct.cc.inc +29 -151
  406. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.cc.inc +740 -0
  407. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.h +207 -0
  408. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256.cc.inc +407 -519
  409. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/simple.cc.inc +27 -28
  410. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdsa/ecdsa.cc.inc +1 -1
  411. data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/jitter.cc.inc +1 -1
  412. data/third_party/boringssl-with-bazel/crypto/fipsmodule/fips_shared_support.cc +4 -4
  413. data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/internal.h +70 -1
  414. data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/keccak.cc.inc +292 -52
  415. data/third_party/boringssl-with-bazel/crypto/fipsmodule/mldsa/mldsa.cc.inc +226 -69
  416. data/third_party/boringssl-with-bazel/crypto/fipsmodule/mlkem/mlkem.cc.inc +238 -83
  417. data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/rsa_impl.cc.inc +6 -6
  418. data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha1.cc.inc +2 -2
  419. data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/fors.cc.inc +1 -1
  420. data/third_party/boringssl-with-bazel/crypto/hpke/hpke.cc +327 -272
  421. data/third_party/boringssl-with-bazel/crypto/hrss/hrss.cc +14 -14
  422. data/third_party/boringssl-with-bazel/crypto/internal.h +63 -0
  423. data/third_party/boringssl-with-bazel/crypto/mem_internal.h +38 -3
  424. data/third_party/boringssl-with-bazel/crypto/obj/obj_dat.h +97 -1
  425. data/third_party/boringssl-with-bazel/crypto/pem/internal.h +86 -0
  426. data/third_party/boringssl-with-bazel/crypto/pem/pem_all.cc +8 -5
  427. data/third_party/boringssl-with-bazel/crypto/pem/pem_lib.cc +41 -73
  428. data/third_party/boringssl-with-bazel/crypto/pem/pem_pk8.cc +3 -0
  429. data/third_party/boringssl-with-bazel/crypto/pem/pem_pkey.cc +10 -4
  430. data/third_party/boringssl-with-bazel/crypto/pem/pem_x509.cc +3 -0
  431. data/third_party/boringssl-with-bazel/crypto/pem/pem_xaux.cc +3 -0
  432. data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7.cc +1 -1
  433. data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7_x509.cc +2 -2
  434. data/third_party/boringssl-with-bazel/crypto/pkcs8/pkcs8_x509.cc +1 -1
  435. data/third_party/boringssl-with-bazel/crypto/poly1305/internal.h +17 -0
  436. data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_arm.cc +1 -13
  437. data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_vec.cc +3 -3
  438. data/third_party/boringssl-with-bazel/crypto/slhdsa/slhdsa.cc +23 -6
  439. data/third_party/boringssl-with-bazel/crypto/stack/stack.cc +7 -0
  440. data/third_party/boringssl-with-bazel/crypto/trust_token/internal.h +1 -1
  441. data/third_party/boringssl-with-bazel/crypto/x509/a_verify.cc +14 -7
  442. data/third_party/boringssl-with-bazel/crypto/x509/internal.h +110 -76
  443. data/third_party/boringssl-with-bazel/crypto/x509/name_print.cc +1 -1
  444. data/third_party/boringssl-with-bazel/crypto/x509/rsa_pss.cc +1 -1
  445. data/third_party/boringssl-with-bazel/crypto/x509/t_req.cc +1 -1
  446. data/third_party/boringssl-with-bazel/crypto/x509/t_x509.cc +6 -5
  447. data/third_party/boringssl-with-bazel/crypto/x509/v3_crld.cc +11 -53
  448. data/third_party/boringssl-with-bazel/crypto/x509/v3_ncons.cc +5 -5
  449. data/third_party/boringssl-with-bazel/crypto/x509/v3_purp.cc +16 -39
  450. data/third_party/boringssl-with-bazel/crypto/x509/v3_skey.cc +1 -1
  451. data/third_party/boringssl-with-bazel/crypto/x509/v3_utl.cc +12 -16
  452. data/third_party/boringssl-with-bazel/crypto/x509/x509_cmp.cc +9 -11
  453. data/third_party/boringssl-with-bazel/crypto/x509/x509_mtc.cc +598 -0
  454. data/third_party/boringssl-with-bazel/crypto/x509/x509_obj.cc +9 -8
  455. data/third_party/boringssl-with-bazel/crypto/x509/x509_set.cc +14 -18
  456. data/third_party/boringssl-with-bazel/crypto/x509/x509_vfy.cc +315 -390
  457. data/third_party/boringssl-with-bazel/crypto/x509/x509_vpm.cc +1 -1
  458. data/third_party/boringssl-with-bazel/crypto/x509/x509name.cc +31 -29
  459. data/third_party/boringssl-with-bazel/crypto/x509/x_all.cc +10 -9
  460. data/third_party/boringssl-with-bazel/crypto/x509/x_crl.cc +3 -53
  461. data/third_party/boringssl-with-bazel/crypto/x509/x_name.cc +37 -59
  462. data/third_party/boringssl-with-bazel/crypto/x509/x_pubkey.cc +29 -47
  463. data/third_party/boringssl-with-bazel/crypto/x509/x_req.cc +2 -1
  464. data/third_party/boringssl-with-bazel/crypto/x509/x_x509.cc +53 -53
  465. data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_64_win_asm.inc +24 -0
  466. data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_win_asm.inc +24 -0
  467. data/third_party/boringssl-with-bazel/gen/crypto/err_data.cc +509 -497
  468. data/third_party/boringssl-with-bazel/include/openssl/aead.h +7 -19
  469. data/third_party/boringssl-with-bazel/include/openssl/asm_base.h +1 -1
  470. data/third_party/boringssl-with-bazel/include/openssl/asn1.h +6 -10
  471. data/third_party/boringssl-with-bazel/include/openssl/base.h +43 -16
  472. data/third_party/boringssl-with-bazel/include/openssl/bio.h +25 -10
  473. data/third_party/boringssl-with-bazel/include/openssl/bytestring.h +33 -1
  474. data/third_party/boringssl-with-bazel/include/openssl/cipher.h +11 -9
  475. data/third_party/boringssl-with-bazel/include/openssl/configuration.h +18 -0
  476. data/third_party/boringssl-with-bazel/include/openssl/curve25519.h +36 -0
  477. data/third_party/boringssl-with-bazel/include/openssl/digest.h +4 -4
  478. data/third_party/boringssl-with-bazel/include/openssl/ec.h +35 -1
  479. data/third_party/boringssl-with-bazel/include/openssl/ec_key.h +2 -2
  480. data/third_party/boringssl-with-bazel/include/openssl/evp.h +120 -3
  481. data/third_party/boringssl-with-bazel/include/openssl/evp_errors.h +1 -0
  482. data/third_party/boringssl-with-bazel/include/openssl/hmac.h +2 -2
  483. data/third_party/boringssl-with-bazel/include/openssl/hpke.h +38 -7
  484. data/third_party/boringssl-with-bazel/include/openssl/mem.h +5 -5
  485. data/third_party/boringssl-with-bazel/include/openssl/nid.h +42 -0
  486. data/third_party/boringssl-with-bazel/include/openssl/pem.h +650 -351
  487. data/third_party/boringssl-with-bazel/include/openssl/posix_time.h +4 -4
  488. data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols.h +130 -4
  489. data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_S.h +48 -0
  490. data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_c.h +24 -0
  491. data/third_party/boringssl-with-bazel/include/openssl/rsa.h +1 -1
  492. data/third_party/boringssl-with-bazel/include/openssl/slhdsa.h +25 -1
  493. data/third_party/boringssl-with-bazel/include/openssl/ssl.h +256 -87
  494. data/third_party/boringssl-with-bazel/include/openssl/stack.h +9 -0
  495. data/third_party/boringssl-with-bazel/include/openssl/types.h +18 -0
  496. data/third_party/boringssl-with-bazel/include/openssl/x509.h +40 -21
  497. data/third_party/boringssl-with-bazel/ssl/bio_ssl.cc +3 -5
  498. data/third_party/boringssl-with-bazel/ssl/d1_both.cc +146 -81
  499. data/third_party/boringssl-with-bazel/ssl/d1_lib.cc +39 -34
  500. data/third_party/boringssl-with-bazel/ssl/d1_pkt.cc +6 -6
  501. data/third_party/boringssl-with-bazel/ssl/d1_srtp.cc +10 -8
  502. data/third_party/boringssl-with-bazel/ssl/dtls_method.cc +4 -4
  503. data/third_party/boringssl-with-bazel/ssl/dtls_record.cc +15 -14
  504. data/third_party/boringssl-with-bazel/ssl/encrypted_client_hello.cc +41 -25
  505. data/third_party/boringssl-with-bazel/ssl/extensions.cc +153 -171
  506. data/third_party/boringssl-with-bazel/ssl/handoff.cc +79 -64
  507. data/third_party/boringssl-with-bazel/ssl/handshake.cc +15 -16
  508. data/third_party/boringssl-with-bazel/ssl/handshake_client.cc +35 -78
  509. data/third_party/boringssl-with-bazel/ssl/handshake_server.cc +75 -155
  510. data/third_party/boringssl-with-bazel/ssl/internal.h +419 -308
  511. data/third_party/boringssl-with-bazel/ssl/s3_both.cc +17 -150
  512. data/third_party/boringssl-with-bazel/ssl/s3_lib.cc +2 -3
  513. data/third_party/boringssl-with-bazel/ssl/s3_pkt.cc +10 -9
  514. data/third_party/boringssl-with-bazel/ssl/ssl_asn1.cc +13 -13
  515. data/third_party/boringssl-with-bazel/ssl/ssl_buffer.cc +8 -8
  516. data/third_party/boringssl-with-bazel/ssl/ssl_cert.cc +58 -24
  517. data/third_party/boringssl-with-bazel/ssl/ssl_cipher.cc +198 -26
  518. data/third_party/boringssl-with-bazel/ssl/ssl_credential.cc +164 -37
  519. data/third_party/boringssl-with-bazel/ssl/ssl_file.cc +10 -8
  520. data/third_party/boringssl-with-bazel/ssl/ssl_key_share.cc +2 -95
  521. data/third_party/boringssl-with-bazel/ssl/ssl_lib.cc +785 -472
  522. data/third_party/boringssl-with-bazel/ssl/ssl_privkey.cc +78 -67
  523. data/third_party/boringssl-with-bazel/ssl/ssl_session.cc +187 -150
  524. data/third_party/boringssl-with-bazel/ssl/ssl_stat.cc +6 -3
  525. data/third_party/boringssl-with-bazel/ssl/ssl_transcript.cc +1 -1
  526. data/third_party/boringssl-with-bazel/ssl/ssl_versions.cc +25 -19
  527. data/third_party/boringssl-with-bazel/ssl/ssl_x509.cc +148 -114
  528. data/third_party/boringssl-with-bazel/ssl/t1_enc.cc +28 -19
  529. data/third_party/boringssl-with-bazel/ssl/tls13_both.cc +24 -22
  530. data/third_party/boringssl-with-bazel/ssl/tls13_client.cc +30 -30
  531. data/third_party/boringssl-with-bazel/ssl/tls13_enc.cc +17 -16
  532. data/third_party/boringssl-with-bazel/ssl/tls13_server.cc +55 -63
  533. data/third_party/boringssl-with-bazel/ssl/tls_method.cc +12 -12
  534. data/third_party/boringssl-with-bazel/ssl/tls_record.cc +23 -20
  535. data/third_party/boringssl-with-bazel/third_party/fiat/p256_64.h +38 -0
  536. data/third_party/boringssl-with-bazel/third_party/fiat/p256_64_msvc.h +2 -0
  537. data/third_party/boringssl-with-bazel/third_party/fiat/p256_field.c.inc +26 -0
  538. data/third_party/boringssl-with-bazel/third_party/fiat/p256_point.br.c.inc +0 -54
  539. data/third_party/cares/cares/include/ares.h +8 -0
  540. data/third_party/cares/cares/include/ares_dns_record.h +3 -2
  541. data/third_party/cares/cares/include/ares_version.h +3 -3
  542. data/third_party/cares/cares/src/lib/ares_addrinfo_localhost.c +20 -20
  543. data/third_party/cares/cares/src/lib/ares_cancel.c +17 -8
  544. data/third_party/cares/cares/src/lib/ares_close_sockets.c +81 -16
  545. data/third_party/cares/cares/src/lib/ares_conn.c +256 -10
  546. data/third_party/cares/cares/src/lib/ares_conn.h +40 -3
  547. data/third_party/cares/cares/src/lib/ares_cookie.c +2 -2
  548. data/third_party/cares/cares/src/lib/ares_destroy.c +75 -10
  549. data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +85 -10
  550. data/third_party/cares/cares/src/lib/ares_gethostbyaddr.c +5 -0
  551. data/third_party/cares/cares/src/lib/ares_gethostbyname.c +4 -0
  552. data/third_party/cares/cares/src/lib/ares_getnameinfo.c +10 -2
  553. data/third_party/cares/cares/src/lib/ares_hosts_file.c +8 -0
  554. data/third_party/cares/cares/src/lib/ares_inet_net_pton.h +28 -0
  555. data/third_party/cares/cares/src/lib/ares_init.c +55 -10
  556. data/third_party/cares/cares/src/lib/ares_library_init.c +25 -7
  557. data/third_party/cares/cares/src/lib/ares_options.c +38 -10
  558. data/third_party/cares/cares/src/lib/ares_parse_into_addrinfo.c +1 -1
  559. data/third_party/cares/cares/src/lib/ares_private.h +186 -27
  560. data/third_party/cares/cares/src/lib/ares_process.c +604 -112
  561. data/third_party/cares/cares/src/lib/ares_qcache.c +200 -36
  562. data/third_party/cares/cares/src/lib/ares_query.c +5 -0
  563. data/third_party/cares/cares/src/lib/ares_search.c +10 -0
  564. data/third_party/cares/cares/src/lib/ares_send.c +81 -10
  565. data/third_party/cares/cares/src/lib/ares_set_socket_functions.c +3 -1
  566. data/third_party/cares/cares/src/lib/ares_socket.c +28 -0
  567. data/third_party/cares/cares/src/lib/ares_socket.h +23 -0
  568. data/third_party/cares/cares/src/lib/ares_sysconfig.c +6 -3
  569. data/third_party/cares/cares/src/lib/ares_sysconfig_files.c +33 -11
  570. data/third_party/cares/cares/src/lib/ares_sysconfig_win.c +132 -80
  571. data/third_party/cares/cares/src/lib/ares_timeout.c +11 -0
  572. data/third_party/cares/cares/src/lib/ares_update_servers.c +55 -11
  573. data/third_party/cares/cares/src/lib/dsa/ares_array.c +20 -5
  574. data/third_party/cares/cares/src/lib/dsa/ares_htable.c +8 -4
  575. data/third_party/cares/cares/src/lib/dsa/ares_htable_dict.c +2 -0
  576. data/third_party/cares/cares/src/lib/dsa/ares_llist.c +4 -1
  577. data/third_party/cares/cares/src/lib/event/ares_event_configchg.c +5 -2
  578. data/third_party/cares/cares/src/lib/event/ares_event_select.c +14 -1
  579. data/third_party/cares/cares/src/lib/event/ares_event_thread.c +8 -0
  580. data/third_party/cares/cares/src/lib/event/ares_event_wake_pipe.c +7 -1
  581. data/third_party/cares/cares/src/lib/event/ares_event_win32.c +3 -0
  582. data/third_party/cares/cares/src/lib/include/ares_mem.h +3 -0
  583. data/third_party/cares/cares/src/lib/include/ares_str.h +17 -0
  584. data/third_party/cares/cares/src/lib/inet_net_pton.c +37 -28
  585. data/third_party/cares/cares/src/lib/legacy/ares_expand_name.c +1 -1
  586. data/third_party/cares/cares/src/lib/legacy/ares_parse_a_reply.c +5 -2
  587. data/third_party/cares/cares/src/lib/legacy/ares_parse_aaaa_reply.c +5 -2
  588. data/third_party/cares/cares/src/lib/legacy/ares_parse_ns_reply.c +2 -2
  589. data/third_party/cares/cares/src/lib/legacy/ares_parse_ptr_reply.c +2 -2
  590. data/third_party/cares/cares/src/lib/legacy/ares_parse_uri_reply.c +1 -1
  591. data/third_party/cares/cares/src/lib/record/ares_dns_mapping.c +19 -4
  592. data/third_party/cares/cares/src/lib/record/ares_dns_multistring.c +3 -1
  593. data/third_party/cares/cares/src/lib/record/ares_dns_name.c +67 -4
  594. data/third_party/cares/cares/src/lib/record/ares_dns_parse.c +62 -34
  595. data/third_party/cares/cares/src/lib/record/ares_dns_private.h +4 -0
  596. data/third_party/cares/cares/src/lib/record/ares_dns_record.c +47 -7
  597. data/third_party/cares/cares/src/lib/record/ares_dns_write.c +13 -5
  598. data/third_party/cares/cares/src/lib/str/ares_buf.c +33 -16
  599. data/third_party/cares/cares/src/lib/str/ares_str.c +54 -0
  600. data/third_party/cares/cares/src/lib/util/ares_iface_ips.c +22 -10
  601. data/third_party/cares/cares/src/lib/util/ares_iface_ips.h +1 -0
  602. data/third_party/cares/cares/src/lib/util/ares_math.c +17 -2
  603. data/third_party/cares/cares/src/lib/util/ares_math.h +32 -7
  604. data/third_party/cares/cares/src/lib/util/ares_rand.c +4 -4
  605. data/third_party/cares/cares/src/lib/util/ares_threads.c +1 -2
  606. data/third_party/cares/cares/src/lib/util/ares_time.h +1 -0
  607. data/third_party/cares/cares/src/lib/util/ares_uri.c +9 -3
  608. data/third_party/zlib/compress.c +34 -10
  609. data/third_party/zlib/crc32.c +49 -115
  610. data/third_party/zlib/deflate.c +107 -61
  611. data/third_party/zlib/deflate.h +7 -1
  612. data/third_party/zlib/gzguts.h +33 -31
  613. data/third_party/zlib/infback.c +20 -67
  614. data/third_party/zlib/inffast.c +7 -6
  615. data/third_party/zlib/inffixed.h +91 -91
  616. data/third_party/zlib/inflate.c +38 -151
  617. data/third_party/zlib/inflate.h +1 -1
  618. data/third_party/zlib/inftrees.c +134 -9
  619. data/third_party/zlib/inftrees.h +3 -1
  620. data/third_party/zlib/trees.c +14 -12
  621. data/third_party/zlib/uncompr.c +39 -23
  622. data/third_party/zlib/zconf.h +27 -19
  623. data/third_party/zlib/zlib.h +215 -96
  624. data/third_party/zlib/zutil.c +49 -35
  625. data/third_party/zlib/zutil.h +87 -10
  626. metadata +4095 -4049
  627. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +0 -916
  628. data/src/core/ext/filters/rbac/rbac_service_config_parser.h +0 -84
  629. data/src/core/server/xds_channel_stack_modifier.cc +0 -108
  630. data/src/core/server/xds_channel_stack_modifier.h +0 -62
  631. data/src/core/server/xds_server_config_fetcher_legacy.cc +0 -1340
  632. data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256_internal.h +0 -193
  633. data/third_party/boringssl-with-bazel/crypto/kyber/internal.h +0 -165
  634. data/third_party/boringssl-with-bazel/crypto/kyber/kyber.cc +0 -870
@@ -205,9 +205,23 @@ OPENSSL_EXPORT int SSL_set_wfd(SSL *ssl, int fd);
205
205
  #endif // !OPENSSL_NO_SOCK
206
206
 
207
207
  // SSL_do_handshake continues the current handshake. If there is none or the
208
- // handshake has completed or False Started, it returns one. Otherwise, it
209
- // returns <= 0. The caller should pass the value into `SSL_get_error` to
210
- // determine how to proceed.
208
+ // handshake has completed, it returns one. Otherwise, it returns zero if the
209
+ // handshake was interrupted by EOF and -1 on error. If the return value was not
210
+ // one, the caller should pass the value into `SSL_get_error` to determine how
211
+ // to proceed.
212
+ //
213
+ // Both a TLS-level EOF (the close_notify alert) and a transport-level EOF
214
+ // result in a zero return. `SSL_get_error` can be used to distinguish the two.
215
+ //
216
+ // TODO(crbug.com/42290000): Replace the two EOF cases with -1 and some error in
217
+ // the error queue. Unlike in `SSL_read`, these are both error conditions
218
+ // because we were expecting a handshake.
219
+ //
220
+ // When some features are enabled (TLS 1.2 False Start and TLS 1.3 Early Data),
221
+ // application data may be sent or received before the handshake is fully
222
+ // complete. In those modes, `SSL_do_handshake` will return one early to signal
223
+ // that `ssl` is usable. These features are opt-in. See the corresponding
224
+ // features for details on how they impact API behavior.
211
225
  //
212
226
  // In DTLS, the caller must drive retransmissions and timeouts. After calling
213
227
  // this function, the caller must use `DTLSv1_get_timeout` to determine the
@@ -222,9 +236,6 @@ OPENSSL_EXPORT int SSL_set_wfd(SSL *ssl, int fd);
222
236
  // post-handshake messages. To handle these, the caller must always be prepared
223
237
  // to receive packets and process them with `SSL_read`, even when the
224
238
  // application protocol would otherwise not read from the connection.
225
- //
226
- // TODO(davidben): Ensure 0 is only returned on transport EOF.
227
- // https://crbug.com/466303.
228
239
  OPENSSL_EXPORT int SSL_do_handshake(SSL *ssl);
229
240
 
230
241
  // SSL_connect configures `ssl` as a client, if unconfigured, and calls
@@ -237,20 +248,29 @@ OPENSSL_EXPORT int SSL_accept(SSL *ssl);
237
248
 
238
249
  // SSL_read reads up to `num` bytes from `ssl` into `buf`. It implicitly runs
239
250
  // any pending handshakes, including renegotiations when enabled. On success, it
240
- // returns the number of bytes read. Otherwise, it returns <= 0. The caller
241
- // should pass the value into `SSL_get_error` to determine how to proceed.
251
+ // returns the number of bytes read. Otherwise, it returns zero on EOF and -1 on
252
+ // error. In the latter two cases, the caller should pass the value into
253
+ // `SSL_get_error` to determine how to proceed.
254
+ //
255
+ // Both a TLS-level EOF (the close_notify alert) and a transport-level EOF
256
+ // result in a zero return. `SSL_get_error` can be used to distinguish the two.
257
+ // Transport-level EOFs are unauthenticated and may be injected by a network
258
+ // attacker. However, some ecosystems, such as HTTPS, do not reliably send
259
+ // close_notify in practice.
260
+ //
261
+ // WARNING: If `num` is zero, the success and EOF cases are ambiguous. Callers
262
+ // attempting to seek to the next record, without consuming data, should instead
263
+ // call `SSL_peek` with a one-byte buffer.
242
264
  //
243
265
  // In DTLS 1.3, the caller must also drive timeouts from retransmitting the
244
266
  // final flight of the handshake, as well as post-handshake messages. After
245
267
  // calling this function, the caller must use `DTLSv1_get_timeout` to determine
246
268
  // the current timeout, if any. If it expires before the application next calls
247
269
  // into `ssl`, call `DTLSv1_handle_timeout`.
248
- //
249
- // TODO(davidben): Ensure 0 is only returned on transport EOF.
250
- // https://crbug.com/466303.
251
270
  OPENSSL_EXPORT int SSL_read(SSL *ssl, void *buf, int num);
252
271
 
253
- // SSL_peek behaves like `SSL_read` but does not consume any bytes returned.
272
+ // SSL_peek behaves like `SSL_read` but does not consume any bytes returned. A
273
+ // subsequent call to `SSL_read` or `SSL_peek` will return the same data.
254
274
  OPENSSL_EXPORT int SSL_peek(SSL *ssl, void *buf, int num);
255
275
 
256
276
  // SSL_pending returns the number of buffered, decrypted bytes available for
@@ -280,8 +300,15 @@ OPENSSL_EXPORT int SSL_has_pending(const SSL *ssl);
280
300
 
281
301
  // SSL_write writes up to `num` bytes from `buf` into `ssl`. It implicitly runs
282
302
  // any pending handshakes, including renegotiations when enabled. On success, it
283
- // returns the number of bytes written. Otherwise, it returns <= 0. The caller
284
- // should pass the value into `SSL_get_error` to determine how to proceed.
303
+ // returns the number of bytes written. Otherwise, it returns -1. In the latter
304
+ // case, the caller should pass the value into `SSL_get_error` to determine how
305
+ // to proceed.
306
+ //
307
+ // A zero return is only possible if `num` is zero. If `num` is zero, this
308
+ // function will flush any pending control messages, such as NewSessionTicket or
309
+ // KeyUpdate, otherwise do nothing, and return zero on success. If `num` is
310
+ // greater than zero, it will either successfully write a greater than zero
311
+ // number of bytes, or -1 to indicate failure.
285
312
  //
286
313
  // In TLS, a non-blocking `SSL_write` differs from non-blocking `write` in that
287
314
  // a failed `SSL_write` still commits to the data passed in. When retrying, the
@@ -301,9 +328,6 @@ OPENSSL_EXPORT int SSL_has_pending(const SSL *ssl);
301
328
  // different buffer freely. A single call to `SSL_write` only ever writes a
302
329
  // single record in a single packet, so `num` must be at most
303
330
  // `SSL3_RT_MAX_PLAIN_LENGTH`.
304
- //
305
- // TODO(davidben): Ensure 0 is only returned on transport EOF.
306
- // https://crbug.com/466303.
307
331
  OPENSSL_EXPORT int SSL_write(SSL *ssl, const void *buf, int num);
308
332
 
309
333
  // SSL_KEY_UPDATE_REQUESTED indicates that the peer should reply to a KeyUpdate
@@ -792,6 +816,11 @@ OPENSSL_EXPORT void SSL_CTX_set1_buffer_pool(SSL_CTX *ctx,
792
816
  // example, a callback could evaluate application-specific SNI rules to filter
793
817
  // down to an ECDSA and RSA credential, then configure both for BoringSSL to
794
818
  // select between the two.
819
+ //
820
+ // On the server, the credential is selected before resumption. By default,
821
+ // sessions established when using one credential can be resumed on other
822
+ // credentials. Callers can partition sessions with
823
+ // `SSL_CREDENTIAL_set1_session_id_context`.
795
824
 
796
825
  // SSL_CREDENTIAL_new_x509 returns a new, empty X.509 credential, or NULL on
797
826
  // error. Callers should release the result with `SSL_CREDENTIAL_free` when
@@ -856,8 +885,8 @@ OPENSSL_EXPORT int SSL_CREDENTIAL_set1_ocsp_response(SSL_CREDENTIAL *cred,
856
885
  CRYPTO_BUFFER *ocsp);
857
886
 
858
887
  // SSL_CREDENTIAL_set1_certificate_properties parses
859
- // `certificate_property_list` as a CertificatePropertyList (see Section 6 of
860
- // draft-ietf-tls-trust-anchor-ids-00) and applies recognized properties to
888
+ // `certificate_property_list` as a CertificatePropertyList (see Section 7 of
889
+ // draft-ietf-tls-trust-anchor-ids-05) and applies recognized properties to
861
890
  // `cred`. It returns one on success and zero on error. It is an error if
862
891
  // `certificate_property_list` does not parse correctly, or if any recognized
863
892
  // properties from `certificate_property_list` cannot be applied to `cred`.
@@ -868,7 +897,8 @@ OPENSSL_EXPORT int SSL_CREDENTIAL_set1_ocsp_response(SSL_CREDENTIAL *cred,
868
897
  // logic, without requiring application changes for each property defined.
869
898
  //
870
899
  // BoringSSL currently supports the following properties:
871
- // * trust_anchor_identifier (see `SSL_CREDENTIAL_set1_trust_anchor_id`)
900
+ // * trust_anchor_id (see `SSL_CREDENTIAL_set1_trust_anchor_id`)
901
+ // * trust_anchor_groups (see `SSL_CREDENTIAL_add1_trust_anchor_group`)
872
902
  //
873
903
  // Note this function does not automatically enable issuer matching. Callers
874
904
  // must separately call `SSL_CREDENTIAL_set_must_match_issuer` if desired.
@@ -906,6 +936,19 @@ OPENSSL_EXPORT int SSL_CREDENTIAL_set1_signed_cert_timestamp_list(
906
936
  OPENSSL_EXPORT void SSL_CREDENTIAL_set_must_match_issuer(SSL_CREDENTIAL *cred,
907
937
  int match);
908
938
 
939
+ // SSL_CREDENTIAL_set1_session_id_context sets `cred`'s session ID context to
940
+ // `sid_ctx`. It returns one on success and zero on error. The session ID
941
+ // context is an application-defined opaque byte string used to partition
942
+ // session resumption. A session will not be used in a connection without a
943
+ // matching session ID context.
944
+ //
945
+ // If unset on a server credential, the session ID context configured on the
946
+ // `SSL` (or `SSL_CTX`) will be used. See `SSL_CTX_set_session_id_context`.
947
+ //
948
+ // This setting is only applicable to server credentials.
949
+ OPENSSL_EXPORT int SSL_CREDENTIAL_set1_session_id_context(
950
+ SSL_CREDENTIAL *cred, const uint8_t *sid_ctx, size_t sid_ctx_len);
951
+
909
952
  // SSL_CTX_add1_credential appends `cred` to `ctx`'s credential list. It returns
910
953
  // one on success and zero on error. The credential list is maintained in order
911
954
  // of decreasing preference, so earlier calls are preferred over later calls.
@@ -1047,6 +1090,18 @@ OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx,
1047
1090
  int (*cb)(SSL *ssl, void *arg),
1048
1091
  void *arg);
1049
1092
 
1093
+ // SSL_CTX_set_cert_cb_ex sets a callback that is called to select a certificate
1094
+ // like `SSL_CTX_set_cert_cb` with an additional argument to allow the callback
1095
+ // to select the fatal alert to send.
1096
+ // If `cb` returns zero, it should set `*out_alert` to one of `SSL_AD_*` to
1097
+ // specify the alert. If unset, it defaults to `SSL_AD_INTERNAL_ERROR`.
1098
+ // `SSL_AD_HANDSHAKE_FAILURE` is an appropriate alert if the caller and peer do
1099
+ // not have parameters in common.
1100
+ OPENSSL_EXPORT void SSL_CTX_set_cert_cb_ex(SSL_CTX *ctx,
1101
+ int (*cb)(SSL *ssl, void *arg,
1102
+ uint8_t *out_alert),
1103
+ void *arg);
1104
+
1050
1105
  // SSL_set_cert_cb sets a callback that is called to select a certificate. The
1051
1106
  // callback returns one on success, zero on internal error, and a negative
1052
1107
  // number on failure or to pause the handshake. If the handshake is paused,
@@ -1062,6 +1117,16 @@ OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx,
1062
1117
  OPENSSL_EXPORT void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg),
1063
1118
  void *arg);
1064
1119
 
1120
+ // SSL_set_cert_cb_ex sets a callback that is called to select a certificate
1121
+ // like `SSL_CTX_set_cert_cb` with an additional argument to allow the callback
1122
+ // to select the fatal alert to send.
1123
+ // If `cb` returns zero, it should set `*out_alert` to one of `SSL_AD_*` to
1124
+ // specify the alert. If unset, it defaults to `SSL_AD_INTERNAL_ERROR`.
1125
+ // `SSL_AD_HANDSHAKE_FAILURE` is an appropriate alert if the caller and peer do
1126
+ // not have parameters in common.
1127
+ OPENSSL_EXPORT void SSL_set_cert_cb_ex(
1128
+ SSL *ssl, int (*cb)(SSL *ssl, void *arg, uint8_t *out_alert), void *arg);
1129
+
1065
1130
  // SSL_get0_certificate_types, for a client, sets `*out_types` to an array
1066
1131
  // containing the client certificate types requested by a server. It returns the
1067
1132
  // length of the array. Note this list is always empty in TLS 1.3. The server
@@ -1186,6 +1251,7 @@ OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, const uint8_t *response,
1186
1251
  // SSL_get_signature_algorithm_name returns a human-readable name for `sigalg`,
1187
1252
  // or NULL if unknown. If `include_curve` is one, the curve for ECDSA algorithms
1188
1253
  // is included as in TLS 1.3. Otherwise, it is excluded as in TLS 1.2.
1254
+ // This string is always an ASCII string.
1189
1255
  OPENSSL_EXPORT const char *SSL_get_signature_algorithm_name(uint16_t sigalg,
1190
1256
  int include_curve);
1191
1257
 
@@ -1201,6 +1267,7 @@ OPENSSL_EXPORT const char *SSL_get_signature_algorithm_name(uint16_t sigalg,
1201
1267
  // placeholder, experimental, or deprecated values that do not apply to every
1202
1268
  // caller. Future versions of BoringSSL may also return strings not in this
1203
1269
  // list, so this does not apply if, say, sending strings across services.
1270
+ // The strings are always ASCII-encoded.
1204
1271
  OPENSSL_EXPORT size_t SSL_get_all_signature_algorithm_names(const char **out,
1205
1272
  size_t max_out);
1206
1273
 
@@ -1580,11 +1647,13 @@ OPENSSL_EXPORT uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher);
1580
1647
 
1581
1648
  // SSL_CIPHER_standard_name returns the standard IETF name for `cipher`. For
1582
1649
  // example, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256".
1650
+ // The standard name is always an ASCII string.
1583
1651
  OPENSSL_EXPORT const char *SSL_CIPHER_standard_name(const SSL_CIPHER *cipher);
1584
1652
 
1585
1653
  // SSL_CIPHER_get_kx_name returns a string that describes the key-exchange
1586
1654
  // method used by `cipher`. For example, "ECDHE_ECDSA". TLS 1.3 AEAD-only
1587
1655
  // ciphers return the string "GENERIC".
1656
+ // The key-exchange method name is always an ASCII string.
1588
1657
  OPENSSL_EXPORT const char *SSL_CIPHER_get_kx_name(const SSL_CIPHER *cipher);
1589
1658
 
1590
1659
  // SSL_CIPHER_get_bits returns the strength, in bits, of `cipher`. If
@@ -1605,6 +1674,7 @@ OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher,
1605
1674
  // placeholder, experimental, or deprecated values that do not apply to every
1606
1675
  // caller. Future versions of BoringSSL may also return strings not in this
1607
1676
  // list, so this does not apply if, say, sending strings across services.
1677
+ // The strings are always ASCII-encoded.
1608
1678
  OPENSSL_EXPORT size_t SSL_get_all_cipher_names(const char **out,
1609
1679
  size_t max_out);
1610
1680
 
@@ -1621,6 +1691,7 @@ OPENSSL_EXPORT size_t SSL_get_all_cipher_names(const char **out,
1621
1691
  // placeholder, experimental, or deprecated values that do not apply to every
1622
1692
  // caller. Future versions of BoringSSL may also return strings not in this
1623
1693
  // list, so this does not apply if, say, sending strings across services.
1694
+ // The strings are always ASCII-encoded.
1624
1695
  OPENSSL_EXPORT size_t SSL_get_all_standard_cipher_names(const char **out,
1625
1696
  size_t max_out);
1626
1697
 
@@ -1716,9 +1787,10 @@ OPENSSL_EXPORT size_t SSL_get_all_standard_cipher_names(const char **out,
1716
1787
  // Once an equal-preference group is used, future directives must be
1717
1788
  // opcode-less. Inside an equal-preference group, spaces are not allowed.
1718
1789
  //
1719
- // TLS 1.3 ciphers do not participate in this mechanism and instead have a
1720
- // built-in preference order. Functions to set cipher lists do not affect TLS
1721
- // 1.3, and functions to query the cipher list do not include TLS 1.3 ciphers.
1790
+ // TLS 1.3 ciphers do not participate in this mechanism and are instead
1791
+ // configured by the functions in the next section. Functions to set cipher
1792
+ // lists do not affect TLS 1.3, and functions to query the cipher list do not
1793
+ // include TLS 1.3 ciphers.
1722
1794
 
1723
1795
  // SSL_DEFAULT_CIPHER_LIST is the default cipher suite configuration. It is
1724
1796
  // substituted when a cipher string starts with 'DEFAULT'.
@@ -1751,6 +1823,7 @@ OPENSSL_EXPORT int SSL_set_cipher_list(SSL *ssl, const char *str);
1751
1823
 
1752
1824
  // SSL_CTX_get_ciphers returns the cipher list for `ctx`, in order of
1753
1825
  // preference.
1826
+ // TODO(crbug.com/550501994): This should return a const pointer.
1754
1827
  OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx);
1755
1828
 
1756
1829
  // SSL_CTX_cipher_in_group returns one if the `i`th cipher (see
@@ -1759,9 +1832,43 @@ OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx);
1759
1832
  OPENSSL_EXPORT int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i);
1760
1833
 
1761
1834
  // SSL_get_ciphers returns the cipher list for `ssl`, in order of preference.
1835
+ // TODO(crbug.com/550501994): This should return a const pointer.
1762
1836
  OPENSSL_EXPORT STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl);
1763
1837
 
1764
1838
 
1839
+ // TLS 1.3 Ciphers.
1840
+
1841
+ // SSL_CIPHER_FLAG_* define flags used with `SSL_CTX_set1_tls13_ciphers` and
1842
+ // `SSL_set1_tls13_ciphers`.
1843
+ //
1844
+ // If configuring a server, SSL_CIPHER_FLAG_EQUAL_PREFERENCE_WITH_NEXT indicates
1845
+ // that the corresponding cipher suite has equal preference with the next member
1846
+ // of the list of ciphers being configured. Assigning equal preference to a
1847
+ // range of consecutively listed cipher suites allows a server to partially
1848
+ // respect the client's preferences.
1849
+ #define SSL_CIPHER_FLAG_EQUAL_PREFERENCE_WITH_NEXT 0x01
1850
+
1851
+ // SSL_CTX_set1_tls13_ciphers sets the preferred TLS 1.3 cipher suites for `ctx`
1852
+ // to `cipher_ids`. If `flags` is non-null, the preference list is modified by
1853
+ // the corresponding `flags` for each element, which is a set of
1854
+ // `SSL_CIPHER_FLAG_*` values ORed together. Each element of `cipher_ids` should
1855
+ // be a unique one of the `SSL_CIPHER_*` constants corresponding to the protocol
1856
+ // ID of a TLS 1.3 cipher suite. If `cipher_ids` is empty, TLS 1.3 cipher suites
1857
+ // will instead be determined by a built-in preference order. `cipher_ids` and
1858
+ // `flags` (if non-null) should both have `num_cipher_ids` elements. This
1859
+ // function returns one on success and zero on failure.
1860
+ OPENSSL_EXPORT int SSL_CTX_set1_tls13_ciphers(SSL_CTX *ctx,
1861
+ const uint16_t *cipher_ids,
1862
+ const uint32_t *flags,
1863
+ size_t num_cipher_ids);
1864
+
1865
+ // SSL_set1_tls13_ciphers behaves like `SSL_CTX_set1_tls13_ciphers` except that
1866
+ // it configures the preferred TLS 1.3 ciphers on `ssl`.
1867
+ OPENSSL_EXPORT int SSL_set1_tls13_ciphers(SSL *ssl, const uint16_t *cipher_ids,
1868
+ const uint32_t *flags,
1869
+ size_t num_cipher_ids);
1870
+
1871
+
1765
1872
  // Connection information.
1766
1873
 
1767
1874
  // SSL_is_init_finished returns one if `ssl` has completed its initial handshake
@@ -1906,8 +2013,6 @@ OPENSSL_EXPORT int SSL_export_keying_material(const SSL *ssl, uint8_t *out,
1906
2013
  // connections within an application-level session will reuse TLS sessions. TLS
1907
2014
  // sessions may be dropped by the client or ignored by the server at any time.
1908
2015
 
1909
- DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
1910
-
1911
2016
  // SSL_SESSION_new returns a newly-allocated blank `SSL_SESSION` or NULL on
1912
2017
  // error. This may be useful when writing tests but should otherwise not be
1913
2018
  // used.
@@ -1940,8 +2045,30 @@ OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_from_bytes(const uint8_t *in,
1940
2045
  size_t in_len,
1941
2046
  const SSL_CTX *ctx);
1942
2047
 
2048
+ // PEM_read_bio_SSL_SESSION reads an `SSL_SESSION` as a PEM block of type "SSL
2049
+ // SESSION PARAMETERS", as described in `PEM_read_bio_SAMPLE`.
2050
+ OPENSSL_EXPORT SSL_SESSION *PEM_read_bio_SSL_SESSION(BIO *bio,
2051
+ SSL_SESSION **out,
2052
+ pem_password_cb *cb,
2053
+ void *userdata);
2054
+
2055
+ // PEM_read_SSL_SESSION behaves like `PEM_read_bio_SSL_SESSION` but reads from
2056
+ // `fp`.
2057
+ OPENSSL_EXPORT SSL_SESSION *PEM_read_SSL_SESSION(FILE *fp, SSL_SESSION **out,
2058
+ pem_password_cb *cb,
2059
+ void *userdata);
2060
+
2061
+ // PEM_write_bio_SSL_SESSION writes `in` to `bio` as a PEM block of type "SSL
2062
+ // SESSION PARAMETERS", as described in `PEM_write_bio_SAMPLE`.
2063
+ OPENSSL_EXPORT int PEM_write_bio_SSL_SESSION(BIO *bio, const SSL_SESSION *in);
2064
+
2065
+ // PEM_write_SSL_SESSION behaves like `PEM_write_bio_SSL_SESSION` but writes to
2066
+ // `fp`.
2067
+ OPENSSL_EXPORT int PEM_write_SSL_SESSION(FILE *fp, const SSL_SESSION *in);
2068
+
1943
2069
  // SSL_SESSION_get_version returns a string describing the TLS or DTLS version
1944
2070
  // `session` was established at. For example, "TLSv1.2" or "DTLSv1".
2071
+ // The version string is always an ASCII string.
1945
2072
  OPENSSL_EXPORT const char *SSL_SESSION_get_version(const SSL_SESSION *session);
1946
2073
 
1947
2074
  // SSL_SESSION_get_protocol_version returns the TLS or DTLS version `session`
@@ -2162,7 +2289,8 @@ OPENSSL_EXPORT int SSL_SESSION_is_resumable_across_names(
2162
2289
  // be cached under different keys. A client that connects to the same host with,
2163
2290
  // e.g., different cipher suite settings or client certificates should also use
2164
2291
  // separate session caches between those contexts. Servers should also partition
2165
- // session caches between SNI hosts with `SSL_CTX_set_session_id_context`.
2292
+ // session caches between SNI hosts with `SSL_CTX_set_session_id_context` or
2293
+ // `SSL_CREDENTIAL_set1_session_id_context`.
2166
2294
  //
2167
2295
  // Note also, in TLS 1.2 and earlier, offering sessions allows passive observers
2168
2296
  // to correlate different client connections. TLS 1.3 and later fix this,
@@ -2252,11 +2380,11 @@ OPENSSL_EXPORT uint32_t SSL_CTX_get_timeout(const SSL_CTX *ctx);
2252
2380
 
2253
2381
  // SSL_CTX_set_session_id_context sets `ctx`'s session ID context to `sid_ctx`.
2254
2382
  // It returns one on success and zero on error. The session ID context is an
2255
- // application-defined opaque byte string. A session will not be used in a
2256
- // connection without a matching session ID context.
2383
+ // application-defined opaque byte string used to partition session resumption.
2384
+ // A session will not be used in a connection without a matching session ID
2385
+ // context.
2257
2386
  //
2258
- // For a server, if `SSL_VERIFY_PEER` is enabled, it is an error to not set a
2259
- // session ID context.
2387
+ // See also `SSL_CREDENTIAL_set1_session_id_context`.
2260
2388
  OPENSSL_EXPORT int SSL_CTX_set_session_id_context(SSL_CTX *ctx,
2261
2389
  const uint8_t *sid_ctx,
2262
2390
  size_t sid_ctx_len);
@@ -2291,7 +2419,10 @@ OPENSSL_EXPORT size_t SSL_CTX_sess_number(const SSL_CTX *ctx);
2291
2419
 
2292
2420
  // SSL_CTX_add_session inserts `session` into `ctx`'s internal session cache. It
2293
2421
  // returns one on success and zero on error or if `session` is already in the
2294
- // cache. The caller retains its reference to `session`.
2422
+ // cache. The caller retains its reference to `session`. A `session` can be
2423
+ // only in one `ctx` at any given time; it is an error to add it to more.
2424
+ //
2425
+ // TODO(crbug.com/527997772): Remove this restriction.
2295
2426
  OPENSSL_EXPORT int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *session);
2296
2427
 
2297
2428
  // SSL_CTX_remove_session removes `session` from `ctx`'s internal session cache.
@@ -2594,7 +2725,6 @@ OPENSSL_EXPORT size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx);
2594
2725
  #define SSL_GROUP_SECP521R1 25
2595
2726
  #define SSL_GROUP_X25519 29
2596
2727
  #define SSL_GROUP_X25519_MLKEM768 0x11ec
2597
- #define SSL_GROUP_X25519_KYBER768_DRAFT00 0x6399
2598
2728
  #define SSL_GROUP_MLKEM1024 0x0202
2599
2729
 
2600
2730
  // SSL_CTX_set1_group_ids sets the preferred groups for `ctx` to `group_ids`.
@@ -2636,7 +2766,7 @@ OPENSSL_EXPORT int SSL_CTX_set1_group_ids_with_flags(SSL_CTX *ctx,
2636
2766
 
2637
2767
  // SSL_set1_group_ids_with_flags sets the preferred groups for `ssl` to
2638
2768
  // `group_ids`, using the corresponding `flags` for each element, which is a set
2639
- // of SSL_GROUP_FLAG_* values ORed toegether. Each element of `group_ids` should
2769
+ // of SSL_GROUP_FLAG_* values ORed together. Each element of `group_ids` should
2640
2770
  // be a unique one of the `SSL_GROUP_*` constants. If `group_ids` is empty, a
2641
2771
  // default list of groups and flags defaulting to zero will be set instead.
2642
2772
  // `group_ids` and `flags` should both have `num_group_ids` elements. It
@@ -2652,6 +2782,7 @@ OPENSSL_EXPORT uint16_t SSL_get_group_id(const SSL *ssl);
2652
2782
 
2653
2783
  // SSL_get_group_name returns a human-readable name for the group specified by
2654
2784
  // the given TLS group ID, or NULL if the group is unknown.
2785
+ // The group name is always an ASCII string.
2655
2786
  OPENSSL_EXPORT const char *SSL_get_group_name(uint16_t group_id);
2656
2787
 
2657
2788
  // SSL_get_all_group_names outputs a list of possible strings
@@ -2666,6 +2797,7 @@ OPENSSL_EXPORT const char *SSL_get_group_name(uint16_t group_id);
2666
2797
  // placeholder, experimental, or deprecated values that do not apply to every
2667
2798
  // caller. Future versions of BoringSSL may also return strings not in this
2668
2799
  // list, so this does not apply if, say, sending strings across services.
2800
+ // The strings are always ASCII-encoded.
2669
2801
  OPENSSL_EXPORT size_t SSL_get_all_group_names(const char **out, size_t max_out);
2670
2802
 
2671
2803
  // The following APIs also configure Diffie-Hellman groups, but use `NID_*`
@@ -3222,31 +3354,42 @@ OPENSSL_EXPORT int SSL_add_bio_cert_subjects_to_stack(STACK_OF(X509_NAME) *out,
3222
3354
 
3223
3355
  // SSL_CREDENTIAL_set1_trust_anchor_id sets `cred`'s trust anchor ID to `id`, or
3224
3356
  // clears it if `id_len` is zero. It returns one on success and zero on
3225
- // error. If not clearing, `id` must be in binary format (Section 3 of
3226
- // draft-ietf-tls-trust-anchor-ids-00) of length `id_len`, and describe the
3357
+ // error. If not clearing, `id` must be in binary format (Section 4 of
3358
+ // draft-ietf-tls-trust-anchor-ids-05) of length `id_len`, and describe the
3227
3359
  // issuer of the final certificate in `cred`'s certificate chain.
3228
3360
  //
3229
3361
  // Additionally, `cred` must enable issuer matching (see
3230
3362
  // `SSL_CREDENTIAL_set_must_match_issuer`) for this value to take effect.
3231
3363
  //
3232
- // For better extensibility, callers are recommended to configure this
3233
- // information with a CertificatePropertyList instead. See
3234
- // `SSL_CREDENTIAL_set1_certificate_properties`.
3364
+ // For extensibility, callers are recommended to configure this information with
3365
+ // a CertificatePropertyList. See `SSL_CREDENTIAL_set1_certificate_properties`.
3235
3366
  OPENSSL_EXPORT int SSL_CREDENTIAL_set1_trust_anchor_id(SSL_CREDENTIAL *cred,
3236
3367
  const uint8_t *id,
3237
3368
  size_t id_len);
3238
3369
 
3370
+ // SSL_CREDENTIAL_add1_trust_anchor_group specifies that `cred` matches all
3371
+ // trust anchor IDs that match `pattern`. It returns one on success and zero on
3372
+ // error. This function may be called multiple times to register multiple group
3373
+ // patterns.
3374
+ //
3375
+ // `pattern` is interpreted as the byte representation of a trust anchor ID
3376
+ // pattern, as described in draft-ietf-tls-trust-anchor-ids.
3377
+ //
3378
+ // For extensibility, callers are recommended to configure this information with
3379
+ // a CertificatePropertyList. See `SSL_CREDENTIAL_set1_certificate_properties`.
3380
+ OPENSSL_EXPORT int SSL_CREDENTIAL_add1_trust_anchor_group(
3381
+ SSL_CREDENTIAL *cred, const uint8_t *pattern, size_t pattern_len);
3382
+
3239
3383
  // SSL_CTX_set1_requested_trust_anchors configures `ctx` to request a
3240
- // certificate issued by one of the trust anchors in `ids`. It returns one on
3241
- // success and zero on error. `ids` must be a list of trust anchor IDs in
3242
- // wire-format (a series of non-empty, 8-bit length-prefixed strings).
3384
+ // certificate issued by one of the trust anchors or trust anchor groups in
3385
+ // `ids`. It returns one on success and zero on error. `ids` must be a list of
3386
+ // trust anchor IDs in wire-format (a series of non-empty, 8-bit length-prefixed
3387
+ // strings).
3243
3388
  //
3244
- // The list may describe application's full list of supported trust anchors, or
3245
- // a, possibly empty, subset. Applications can select this subset using
3246
- // out-of-band information, such as the DNS hint in Section 5 of
3247
- // draft-ietf-tls-trust-anchor-ids-00. Client applications sending a subset
3248
- // should use `SSL_get0_peer_available_trust_anchors` to implement the retry
3249
- // flow from Section 4.3 of draft-ietf-tls-trust-anchor-ids-00.
3389
+ // See Section 5.2 of draft-ietf-tls-trust-anchor-ids-05 for guidance on
3390
+ // determining this list. If applicable, client applications can use
3391
+ // `SSL_get0_peer_available_trust_anchors` to implement the recovery flow from
3392
+ // Section 5.6 of draft-ietf-tls-trust-anchor-ids-05.
3250
3393
  //
3251
3394
  // If empty (`ids_len` is zero), the trust_anchors extension will still be sent
3252
3395
  // in ClientHello. This may be used by a client application to signal support
@@ -3285,7 +3428,7 @@ OPENSSL_EXPORT int SSL_peer_matched_trust_anchor(const SSL *ssl);
3285
3428
  // This value is only available during the handshake and is expected to be
3286
3429
  // called in the event of certificate verification failure. Client applications
3287
3430
  // can use it to retry the connection, requesting different trust anchors. See
3288
- // Section 4.3 of draft-ietf-tls-trust-anchor-ids-00 for details.
3431
+ // Section 5.6 of draft-ietf-tls-trust-anchor-ids-05 for details.
3289
3432
  // `CBS_get_u8_length_prefixed` may be used to iterate over the format.
3290
3433
  //
3291
3434
  // If needed in other contexts, callers may save the value during certificate
@@ -3391,7 +3534,13 @@ OPENSSL_EXPORT SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx);
3391
3534
  // `protos`. `protos` must be in wire-format (i.e. a series of non-empty, 8-bit
3392
3535
  // length-prefixed strings), or the empty string to disable ALPN. It returns
3393
3536
  // zero on success and one on failure. Configuring a non-empty string enables
3394
- // ALPN on a client.
3537
+ // ALPN on a client. On a client, it will advertise these protocols. On a
3538
+ // server, it will use them to automatically select a protocol if the client
3539
+ // supports ALPN and no select callback is set.
3540
+ //
3541
+ // Those configuring HTTP/2 must also configure the cipher suite set on the
3542
+ // SSL_CTX so that the selected cipher is compliant with RFC 7540 Section 9.2.
3543
+ // Servers should install their own ALPN callback to comply with the RFC.
3395
3544
  //
3396
3545
  // WARNING: this function is dangerous because it breaks the usual return value
3397
3546
  // convention.
@@ -3402,7 +3551,13 @@ OPENSSL_EXPORT int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos,
3402
3551
  // `protos` must be in wire-format (i.e. a series of non-empty, 8-bit
3403
3552
  // length-prefixed strings), or the empty string to disable ALPN. It returns
3404
3553
  // zero on success and one on failure. Configuring a non-empty string enables
3405
- // ALPN on a client.
3554
+ // ALPN on a client. On a client, it will advertise these protocols. On a
3555
+ // server, it will use them to automatically select a protocol if the client
3556
+ // supports ALPN and no select callback is set.
3557
+ //
3558
+ // Those configuring HTTP/2 must also configure the cipher suite set on the
3559
+ // SSL_CTX so that the selected cipher is compliant with RFC 7540 Section 9.2.
3560
+ // Servers should install their own ALPN callback to comply with the RFC.
3406
3561
  //
3407
3562
  // WARNING: this function is dangerous because it breaks the usual return value
3408
3563
  // convention.
@@ -3813,6 +3968,12 @@ OPENSSL_EXPORT SSL_CREDENTIAL *SSL_CREDENTIAL_new_pre_shared_key(
3813
3968
  const uint8_t *key, size_t key_len, const uint8_t *id, size_t id_len,
3814
3969
  const EVP_MD *md, const uint8_t *context, size_t context_len);
3815
3970
 
3971
+ // SSL_CREDENTIAL_get0_pre_shared_key_id returns the external identity of this
3972
+ // pre-shared key credential, or NULL if `cred` is not a pre-shared key
3973
+ // credential or `id_len` is NULL.
3974
+ OPENSSL_EXPORT const uint8_t *SSL_CREDENTIAL_get0_pre_shared_key_id(
3975
+ const SSL_CREDENTIAL *cred, size_t *id_len);
3976
+
3816
3977
 
3817
3978
  // TLS 1.2 pre-shared keys.
3818
3979
  //
@@ -4294,7 +4455,7 @@ struct ssl_quic_method_st {
4294
4455
  int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level, uint8_t alert);
4295
4456
  };
4296
4457
 
4297
- // SSL_quic_max_handshake_flight_len returns returns the maximum number of bytes
4458
+ // SSL_quic_max_handshake_flight_len returns the maximum number of bytes
4298
4459
  // that may be received at the given encryption level. This function should be
4299
4460
  // used to limit buffering in the QUIC implementation.
4300
4461
  //
@@ -4529,6 +4690,7 @@ OPENSSL_EXPORT enum ssl_early_data_reason_t SSL_get_early_data_reason(
4529
4690
 
4530
4691
  // SSL_early_data_reason_string returns a string representation for `reason`, or
4531
4692
  // NULL if `reason` is unknown. This function may be used for logging.
4693
+ // This string is always ASCII-encoded.
4532
4694
  OPENSSL_EXPORT const char *SSL_early_data_reason_string(
4533
4695
  enum ssl_early_data_reason_t reason);
4534
4696
 
@@ -4552,6 +4714,11 @@ OPENSSL_EXPORT const char *SSL_early_data_reason_string(
4552
4714
  // ECH extension when no supported ECHConfig is available.
4553
4715
  OPENSSL_EXPORT void SSL_set_enable_ech_grease(SSL *ssl, int enable);
4554
4716
 
4717
+ // SSL_set_reject_unusable_ech_config configures whether the client will fail
4718
+ // the handshake if a valid, supported ECHConfig cannot be selected to offer
4719
+ // ECH.
4720
+ OPENSSL_EXPORT void SSL_set_reject_unusable_ech_config(SSL *ssl, int enable);
4721
+
4555
4722
  // SSL_set1_ech_config_list configures `ssl` to, as a client, offer ECH with the
4556
4723
  // specified configuration. `ech_config_list` should contain a serialized
4557
4724
  // ECHConfigList structure. It returns one on success and zero on error.
@@ -4768,10 +4935,12 @@ OPENSSL_EXPORT int SSL_ech_accepted(const SSL *ssl);
4768
4935
 
4769
4936
  // SSL_alert_type_string_long returns a string description of `value` as an
4770
4937
  // alert type (warning or fatal).
4938
+ // This string is always ASCII-encoded.
4771
4939
  OPENSSL_EXPORT const char *SSL_alert_type_string_long(int value);
4772
4940
 
4773
4941
  // SSL_alert_desc_string_long returns a string description of `value` as an
4774
4942
  // alert description or "unknown" if unknown.
4943
+ // This string is always ASCII-encoded.
4775
4944
  OPENSSL_EXPORT const char *SSL_alert_desc_string_long(int value);
4776
4945
 
4777
4946
  // SSL_send_fatal_alert sends a fatal alert over `ssl` of the specified type,
@@ -4889,7 +5058,7 @@ OPENSSL_EXPORT int SSL_CTX_set_record_protocol_version(SSL_CTX *ctx,
4889
5058
  // retains its final flight for retransmission in case of loss. There is no
4890
5059
  // explicit protocol signal for when this completes, though after receiving
4891
5060
  // application data and/or a timeout it is likely that this is no longer needed.
4892
- // BoringSSL does not currently evaluate either condition and leaves it it to
5061
+ // BoringSSL does not currently evaluate either condition and leaves it to
4893
5062
  // the caller to determine whether this is now unnecessary. This applies when
4894
5063
  // `ssl` is a server for full handshakes and when `ssl` is a client for full
4895
5064
  // handshakes.
@@ -5101,8 +5270,7 @@ OPENSSL_EXPORT void SSL_set_msg_callback_arg(SSL *ssl, void *arg);
5101
5270
  // should log `line` followed by a newline, synchronizing with any concurrent
5102
5271
  // access to the log.
5103
5272
  //
5104
- // The format is described in
5105
- // https://www.ietf.org/archive/id/draft-ietf-tls-keylogfile-01.html
5273
+ // The format is described in RFC 9850.
5106
5274
  //
5107
5275
  // WARNING: The data in `line` allows an attacker to break security properties
5108
5276
  // of the TLS protocol, including confidentiality, integrity, and forward
@@ -5348,24 +5516,6 @@ OPENSSL_EXPORT void SSL_CTX_set_dos_protection_cb(
5348
5516
  // respected on clients.
5349
5517
  OPENSSL_EXPORT void SSL_CTX_set_reverify_on_resume(SSL_CTX *ctx, int enabled);
5350
5518
 
5351
- // SSL_set_enforce_rsa_key_usage configures whether, when `ssl` is a client
5352
- // negotiating TLS 1.2 or below, the keyUsage extension of RSA leaf server
5353
- // certificates will be checked for consistency with the TLS usage. In all other
5354
- // cases, this check is always enabled.
5355
- //
5356
- // This parameter may be set late; it will not be read until after the
5357
- // certificate verification callback.
5358
- OPENSSL_EXPORT void SSL_set_enforce_rsa_key_usage(SSL *ssl, int enabled);
5359
-
5360
- // SSL_was_key_usage_invalid returns one if `ssl`'s handshake succeeded despite
5361
- // using TLS parameters which were incompatible with the leaf certificate's
5362
- // keyUsage extension. Otherwise, it returns zero.
5363
- //
5364
- // If `SSL_set_enforce_rsa_key_usage` is enabled or not applicable, this
5365
- // function will always return zero because key usages will be consistently
5366
- // checked.
5367
- OPENSSL_EXPORT int SSL_was_key_usage_invalid(const SSL *ssl);
5368
-
5369
5519
  // SSL_ST_* are possible values for `SSL_state`, the bitmasks that make them up,
5370
5520
  // and some historical values for compatibility. Only `SSL_ST_INIT` and
5371
5521
  // `SSL_ST_OK` are ever returned.
@@ -5451,6 +5601,7 @@ OPENSSL_EXPORT void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,
5451
5601
 
5452
5602
  // SSL_state_string_long returns the current state of the handshake state
5453
5603
  // machine as a string. This may be useful for debugging and logging.
5604
+ // This string is always ASCII-encoded.
5454
5605
  OPENSSL_EXPORT const char *SSL_state_string_long(const SSL *ssl);
5455
5606
 
5456
5607
  #define SSL_SENT_SHUTDOWN 1
@@ -5514,6 +5665,16 @@ OPENSSL_EXPORT void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx,
5514
5665
  // GREASE. See RFC 8701.
5515
5666
  OPENSSL_EXPORT void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled);
5516
5667
 
5668
+ // SSL_CTX_set_grease_sigalgs_enabled configures whether sockets on `ctx` should
5669
+ // send a GREASE value in signature_algorithms extensions in ClientHello
5670
+ // messages. See RFC 8701.
5671
+ // TODO(crbug.com/526597789): Fold this functionality into
5672
+ // `SSL_CTX_set_grease_enabled` once deployed safely.
5673
+ // TODO(crbug.com/529360100): signature_algorithms extensions in
5674
+ // CertificateRequest messages should also be GREASE'd.
5675
+ OPENSSL_EXPORT void SSL_CTX_set_grease_sigalgs_enabled(SSL_CTX *ctx,
5676
+ int enabled);
5677
+
5517
5678
  // SSL_CTX_set_permute_extensions configures whether sockets on `ctx` should
5518
5679
  // permute extensions. For now, this is only implemented for the ClientHello.
5519
5680
  OPENSSL_EXPORT void SSL_CTX_set_permute_extensions(SSL_CTX *ctx, int enabled);
@@ -5738,7 +5899,7 @@ OPENSSL_EXPORT int SSL_get_shared_sigalgs(SSL *ssl, int idx, int *psign,
5738
5899
  // i2d_SSL_SESSION serializes `in`, as described in `i2d_SAMPLE`.
5739
5900
  //
5740
5901
  // Use `SSL_SESSION_to_bytes` instead.
5741
- OPENSSL_EXPORT int i2d_SSL_SESSION(SSL_SESSION *in, uint8_t **pp);
5902
+ OPENSSL_EXPORT int i2d_SSL_SESSION(const SSL_SESSION *in, uint8_t **pp);
5742
5903
 
5743
5904
  // d2i_SSL_SESSION parses a serialized session from the `len` bytes pointed to
5744
5905
  // by `*inp`, as described in `d2i_SAMPLE`.
@@ -5786,6 +5947,9 @@ OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_expansion(SSL *ssl);
5786
5947
  // SSL_get_server_tmp_key returns zero.
5787
5948
  OPENSSL_EXPORT int SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key);
5788
5949
 
5950
+ // SSL_get_peer_tmp_key returns zero.
5951
+ OPENSSL_EXPORT int SSL_get_peer_tmp_key(SSL *ssl, EVP_PKEY **out_key);
5952
+
5789
5953
  // SSL_CTX_set_tmp_dh returns 1.
5790
5954
  OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh);
5791
5955
 
@@ -6224,7 +6388,6 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg);
6224
6388
  #define SSL_CURVE_SECP384R1 SSL_GROUP_SECP384R1
6225
6389
  #define SSL_CURVE_SECP521R1 SSL_GROUP_SECP521R1
6226
6390
  #define SSL_CURVE_X25519 SSL_GROUP_X25519
6227
- #define SSL_CURVE_X25519_KYBER768_DRAFT00 SSL_GROUP_X25519_KYBER768_DRAFT00
6228
6391
 
6229
6392
  // SSL_get_curve_id calls `SSL_get_group_id`.
6230
6393
  OPENSSL_EXPORT uint16_t SSL_get_curve_id(const SSL *ssl);
@@ -6325,6 +6488,22 @@ enum ssl_compliance_policy_t BORINGSSL_ENUM_INT {
6325
6488
  // guarantee it. Careful reading of SP 800-52r2 is recommended.
6326
6489
  ssl_compliance_policy_fips_202205,
6327
6490
 
6491
+ // ssl_compliance_policy_fips_202609 configures a TLS connection to use:
6492
+ // * TLS 1.2 or 1.3
6493
+ // * For TLS 1.2, only ECDHE_[RSA|ECDSA]_WITH_AES_*_GCM_SHA*.
6494
+ // * For TLS 1.3, only AES-GCM
6495
+ // * X25519MLKEM768 or ML-KEM-1024, or P-256 or P-384 for key agreement,
6496
+ // selecting X25519MLKEM768 or ML-KEM-1024 based on client preference.
6497
+ // * For server signatures, only PKCS#1/PSS with SHA256/384/512, or ECDSA
6498
+ // with P-256 or P-384 and SHA256/SHA384.
6499
+ //
6500
+ // Note: this policy can be configured even if BoringSSL has not been built in
6501
+ // FIPS mode. Call `FIPS_mode` to check that.
6502
+ //
6503
+ // Note: this setting aids with compliance with NIST requirements but does not
6504
+ // guarantee it. Careful reading of SP 800-52r2 is recommended.
6505
+ ssl_compliance_policy_fips_202609,
6506
+
6328
6507
  // ssl_compliance_policy_wpa3_192_202304 configures a TLS connection to use:
6329
6508
  // * TLS 1.2 or 1.3.
6330
6509
  // * For TLS 1.2, only TLS_ECDHE_[ECDSA|RSA]_WITH_AES_256_GCM_SHA384.
@@ -6808,19 +6987,6 @@ OPENSSL_EXPORT bool SSL_get_traffic_secrets(
6808
6987
  const SSL *ssl, Span<const uint8_t> *out_read_traffic_secret,
6809
6988
  Span<const uint8_t> *out_write_traffic_secret);
6810
6989
 
6811
- // SSL_CTX_set_aes_hw_override_for_testing sets `override_value` to
6812
- // override checking for aes hardware support for testing. If `override_value`
6813
- // is set to true, the library will behave as if aes hardware support is
6814
- // present. If it is set to false, the library will behave as if aes hardware
6815
- // support is not present.
6816
- OPENSSL_EXPORT void SSL_CTX_set_aes_hw_override_for_testing(
6817
- SSL_CTX *ctx, bool override_value);
6818
-
6819
- // SSL_set_aes_hw_override_for_testing acts the same as
6820
- // `SSL_CTX_set_aes_override_for_testing` but only configures a single `SSL*`.
6821
- OPENSSL_EXPORT void SSL_set_aes_hw_override_for_testing(SSL *ssl,
6822
- bool override_value);
6823
-
6824
6990
  BSSL_NAMESPACE_END
6825
6991
 
6826
6992
  } // extern C++
@@ -7063,6 +7229,9 @@ BSSL_NAMESPACE_END
7063
7229
  #define SSL_R_UNSUPPORTED_CERTIFICATE 334
7064
7230
  #define SSL_R_MISSING_KEY 335
7065
7231
  #define SSL_R_INVALID_RAW_PUBLIC_KEY 336
7232
+ #define SSL_R_UNUSABLE_ECH_CONFIG_LIST 337
7233
+ #define SSL_R_INVALID_CIPHER_FLAGS 338
7234
+ #define SSL_R_DUPLICATE_CIPHER 339
7066
7235
  #define SSL_R_SSLV3_ALERT_CLOSE_NOTIFY 1000
7067
7236
  #define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
7068
7237
  #define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020