grpc 1.57.0.pre1 → 1.58.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (403) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +534 -284
  3. data/include/grpc/event_engine/event_engine.h +0 -1
  4. data/include/grpc/event_engine/memory_allocator.h +2 -2
  5. data/include/grpc/impl/channel_arg_names.h +371 -0
  6. data/include/grpc/impl/grpc_types.h +1 -353
  7. data/include/grpc/module.modulemap +1 -0
  8. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
  9. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +2 -1
  10. data/src/core/ext/filters/client_channel/client_channel.cc +7 -3
  11. data/src/core/ext/filters/client_channel/http_proxy.cc +1 -1
  12. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +10 -5
  13. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
  14. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
  15. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +5 -3
  16. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +4 -2
  17. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +115 -109
  18. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +0 -5
  19. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +7 -2
  20. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +2 -1
  21. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
  22. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +1 -1
  23. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +11 -3
  24. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +6 -1
  25. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +8 -5
  26. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
  27. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +102 -11
  28. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +9 -4
  29. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -1
  30. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_plugin.cc +6 -0
  31. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +41 -14
  32. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
  33. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +3 -2
  34. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
  35. data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
  36. data/src/core/ext/filters/client_channel/retry_service_config.cc +1 -1
  37. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +1 -1
  38. data/src/core/ext/filters/client_channel/subchannel.cc +9 -5
  39. data/src/core/ext/filters/client_channel/subchannel.h +8 -2
  40. data/src/core/ext/filters/deadline/deadline_filter.cc +1 -1
  41. data/src/core/ext/filters/http/client/http_client_filter.cc +1 -0
  42. data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
  43. data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -0
  44. data/src/core/ext/filters/http/server/http_server_filter.cc +1 -1
  45. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -0
  46. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +4 -7
  47. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -0
  48. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -12
  49. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +357 -358
  50. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -18
  51. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +63 -4
  52. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +7 -2
  53. data/src/core/ext/transport/chttp2/transport/internal.h +30 -57
  54. data/src/core/ext/transport/chttp2/transport/parsing.cc +16 -7
  55. data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +80 -0
  56. data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +55 -0
  57. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +98 -0
  58. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +73 -0
  59. data/src/core/ext/transport/chttp2/transport/writing.cc +81 -89
  60. data/src/core/ext/transport/inproc/inproc_transport.cc +1 -0
  61. data/src/core/ext/xds/xds_client_grpc.cc +1 -0
  62. data/src/core/ext/xds/xds_http_fault_filter.cc +1 -2
  63. data/src/core/ext/xds/xds_http_fault_filter.h +1 -2
  64. data/src/core/ext/xds/xds_http_filters.h +2 -4
  65. data/src/core/ext/xds/xds_http_rbac_filter.cc +3 -8
  66. data/src/core/ext/xds/xds_http_rbac_filter.h +1 -2
  67. data/src/core/ext/xds/xds_http_stateful_session_filter.cc +1 -2
  68. data/src/core/ext/xds/xds_http_stateful_session_filter.h +1 -2
  69. data/src/core/ext/xds/xds_lb_policy_registry.cc +3 -6
  70. data/src/core/ext/xds/xds_routing.cc +2 -2
  71. data/src/core/ext/xds/xds_transport_grpc.cc +1 -0
  72. data/src/core/lib/avl/avl.h +10 -173
  73. data/src/core/lib/channel/call_tracer.cc +289 -0
  74. data/src/core/lib/channel/call_tracer.h +35 -0
  75. data/src/core/lib/channel/channel_args.cc +84 -79
  76. data/src/core/lib/channel/channel_args.h +29 -17
  77. data/src/core/lib/channel/connected_channel.cc +0 -1
  78. data/src/core/lib/channel/promise_based_filter.cc +4 -1
  79. data/src/core/lib/compression/compression_internal.cc +8 -4
  80. data/src/core/lib/debug/stats_data.cc +93 -21
  81. data/src/core/lib/debug/stats_data.h +41 -0
  82. data/src/core/lib/event_engine/ares_resolver.cc +712 -0
  83. data/src/core/lib/event_engine/ares_resolver.h +150 -0
  84. data/src/core/lib/event_engine/cf_engine/cf_engine.cc +9 -3
  85. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +2 -2
  86. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +229 -0
  87. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +117 -0
  88. data/src/core/lib/event_engine/forkable.cc +15 -1
  89. data/src/core/lib/event_engine/forkable.h +15 -0
  90. data/src/core/lib/event_engine/grpc_polled_fd.h +73 -0
  91. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +25 -3
  92. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +10 -1
  93. data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +197 -0
  94. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +3 -3
  95. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +47 -1
  96. data/src/core/lib/event_engine/posix_engine/posix_engine.h +12 -1
  97. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -0
  98. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +2 -0
  99. data/src/core/lib/event_engine/thread_pool/thread_count.cc +58 -0
  100. data/src/core/lib/event_engine/thread_pool/thread_count.h +161 -0
  101. data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +7 -0
  102. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +86 -111
  103. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +15 -61
  104. data/src/core/lib/event_engine/windows/windows_endpoint.cc +3 -4
  105. data/src/core/lib/experiments/config.cc +14 -0
  106. data/src/core/lib/experiments/experiments.cc +141 -304
  107. data/src/core/lib/experiments/experiments.h +16 -17
  108. data/src/core/lib/gprpp/ref_counted.h +3 -1
  109. data/src/core/lib/gprpp/ref_counted_string.cc +44 -0
  110. data/src/core/lib/gprpp/ref_counted_string.h +146 -0
  111. data/src/core/lib/gprpp/time.h +2 -2
  112. data/src/core/lib/gprpp/work_serializer.cc +36 -0
  113. data/src/core/lib/gprpp/work_serializer.h +5 -0
  114. data/src/core/lib/http/httpcli_security_connector.cc +1 -0
  115. data/src/core/lib/iomgr/buffer_list.cc +2 -0
  116. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +7 -22
  117. data/src/core/lib/iomgr/tcp_posix.cc +3 -3
  118. data/src/core/lib/promise/detail/basic_seq.h +1 -372
  119. data/src/core/lib/promise/detail/seq_state.h +2076 -0
  120. data/src/core/lib/promise/seq.h +19 -2
  121. data/src/core/lib/promise/sleep.h +5 -10
  122. data/src/core/lib/promise/try_seq.h +34 -2
  123. data/src/core/lib/resource_quota/api.cc +1 -0
  124. data/src/core/lib/resource_quota/arena.cc +2 -0
  125. data/src/core/lib/resource_quota/arena.h +42 -8
  126. data/src/core/lib/resource_quota/memory_quota.cc +0 -1
  127. data/src/core/lib/resource_quota/resource_quota.h +1 -0
  128. data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
  129. data/src/core/lib/security/authorization/rbac_policy.h +1 -1
  130. data/src/core/lib/security/credentials/external/aws_request_signer.cc +8 -0
  131. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -0
  132. data/src/core/lib/security/credentials/jwt/json_token.cc +17 -0
  133. data/src/core/lib/security/credentials/jwt/json_token.h +4 -0
  134. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +42 -0
  135. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +1 -0
  136. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -0
  137. data/src/core/lib/security/credentials/tls/tls_credentials.cc +1 -0
  138. data/src/core/lib/security/credentials/xds/xds_credentials.cc +1 -0
  139. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -0
  140. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
  141. data/src/core/lib/security/security_connector/ssl_utils.cc +1 -0
  142. data/src/core/lib/security/transport/client_auth_filter.cc +8 -5
  143. data/src/core/lib/security/transport/security_handshaker.cc +1 -0
  144. data/src/core/lib/security/transport/server_auth_filter.cc +2 -0
  145. data/src/core/lib/surface/call.cc +32 -8
  146. data/src/core/lib/surface/channel.cc +1 -0
  147. data/src/core/lib/surface/completion_queue.cc +10 -0
  148. data/src/core/lib/surface/init.cc +1 -0
  149. data/src/core/lib/surface/server.cc +67 -64
  150. data/src/core/lib/surface/server.h +1 -15
  151. data/src/core/lib/surface/version.cc +2 -2
  152. data/src/core/tsi/alts/crypt/aes_gcm.cc +27 -2
  153. data/src/core/tsi/ssl_transport_security.cc +11 -0
  154. data/src/ruby/ext/grpc/rb_channel.c +1 -53
  155. data/src/ruby/lib/grpc/generic/active_call.rb +9 -14
  156. data/src/ruby/lib/grpc/version.rb +1 -1
  157. data/src/ruby/pb/test/client.rb +16 -0
  158. data/src/ruby/spec/generic/rpc_server_spec.rb +3 -3
  159. data/third_party/abseil-cpp/absl/algorithm/container.h +3 -2
  160. data/third_party/abseil-cpp/absl/base/attributes.h +58 -5
  161. data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
  162. data/third_party/abseil-cpp/absl/base/casts.h +8 -8
  163. data/third_party/abseil-cpp/absl/base/config.h +89 -106
  164. data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +26 -1
  165. data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -2
  166. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +50 -39
  167. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +2 -1
  168. data/third_party/abseil-cpp/absl/base/internal/prefetch.h +17 -18
  169. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +32 -3
  170. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +24 -4
  171. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +31 -73
  172. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +9 -8
  173. data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +11 -11
  174. data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +23 -32
  175. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +2 -3
  176. data/third_party/abseil-cpp/absl/base/options.h +1 -1
  177. data/third_party/abseil-cpp/absl/base/policy_checks.h +3 -3
  178. data/third_party/abseil-cpp/absl/base/prefetch.h +198 -0
  179. data/third_party/abseil-cpp/absl/container/fixed_array.h +54 -29
  180. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -1
  181. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -2
  182. data/third_party/abseil-cpp/absl/container/inlined_vector.h +167 -79
  183. data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
  184. data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +3 -21
  185. data/third_party/abseil-cpp/absl/container/internal/container_memory.h +1 -1
  186. data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +46 -0
  187. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -0
  188. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +85 -26
  189. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +35 -18
  190. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +70 -29
  191. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +437 -236
  192. data/third_party/abseil-cpp/absl/crc/crc32c.h +8 -1
  193. data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +14 -8
  194. data/third_party/abseil-cpp/absl/crc/internal/crc.cc +4 -35
  195. data/third_party/abseil-cpp/absl/crc/internal/crc.h +2 -10
  196. data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +1 -1
  197. data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +1 -1
  198. data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +4 -4
  199. data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +8 -10
  200. data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +17 -19
  201. data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +8 -8
  202. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +2 -1
  203. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +59 -23
  204. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +1 -1
  205. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +1 -1
  206. data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +1 -1
  207. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +43 -19
  208. data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -0
  209. data/third_party/abseil-cpp/absl/flags/commandlineflag.h +1 -1
  210. data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc +1 -1
  211. data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -2
  212. data/third_party/abseil-cpp/absl/flags/internal/flag.h +16 -15
  213. data/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc +1 -1
  214. data/third_party/abseil-cpp/absl/flags/marshalling.cc +43 -2
  215. data/third_party/abseil-cpp/absl/flags/marshalling.h +5 -0
  216. data/third_party/abseil-cpp/absl/functional/any_invocable.h +9 -1
  217. data/third_party/abseil-cpp/absl/functional/bind_front.h +1 -1
  218. data/third_party/abseil-cpp/absl/functional/function_ref.h +3 -3
  219. data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +37 -24
  220. data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +19 -9
  221. data/third_party/abseil-cpp/absl/hash/hash.h +7 -4
  222. data/third_party/abseil-cpp/absl/hash/internal/hash.h +38 -15
  223. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +6 -0
  224. data/third_party/abseil-cpp/absl/meta/type_traits.h +48 -373
  225. data/third_party/abseil-cpp/absl/numeric/bits.h +4 -4
  226. data/third_party/abseil-cpp/absl/numeric/int128.cc +20 -8
  227. data/third_party/abseil-cpp/absl/numeric/int128.h +36 -39
  228. data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +0 -3
  229. data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +47 -30
  230. data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +4 -3
  231. data/third_party/abseil-cpp/absl/random/internal/generate_real.h +1 -1
  232. data/third_party/abseil-cpp/absl/random/internal/platform.h +1 -1
  233. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +4 -0
  234. data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +1 -1
  235. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +1 -1
  236. data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +1 -1
  237. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +4 -0
  238. data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +12 -24
  239. data/third_party/abseil-cpp/absl/status/status.cc +11 -7
  240. data/third_party/abseil-cpp/absl/status/status.h +11 -2
  241. data/third_party/abseil-cpp/absl/status/statusor.h +22 -8
  242. data/third_party/abseil-cpp/absl/strings/ascii.cc +54 -6
  243. data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -4
  244. data/third_party/abseil-cpp/absl/strings/charconv.h +2 -2
  245. data/third_party/abseil-cpp/absl/strings/cord.cc +1 -2
  246. data/third_party/abseil-cpp/absl/strings/cord.h +32 -5
  247. data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +23 -1
  248. data/third_party/abseil-cpp/absl/strings/cord_analysis.h +18 -0
  249. data/third_party/abseil-cpp/absl/strings/cord_buffer.h +2 -5
  250. data/third_party/abseil-cpp/absl/strings/escaping.cc +10 -32
  251. data/third_party/abseil-cpp/absl/strings/escaping.h +1 -1
  252. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +2 -4
  253. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +3 -3
  254. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +0 -1
  255. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +15 -13
  256. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +13 -4
  257. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +8 -0
  258. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +5 -3
  259. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +4 -7
  260. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +8 -0
  261. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +2 -2
  262. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +46 -20
  263. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +1 -34
  264. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +2 -1
  265. data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +23 -0
  266. data/third_party/abseil-cpp/absl/strings/internal/escaping.h +1 -0
  267. data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +2 -77
  268. data/third_party/abseil-cpp/absl/strings/internal/memutil.h +4 -112
  269. data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +1 -1
  270. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +10 -31
  271. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -8
  272. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +5 -20
  273. data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +1 -0
  274. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +1 -1
  275. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +9 -9
  276. data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +56 -6
  277. data/third_party/abseil-cpp/absl/strings/match.cc +87 -0
  278. data/third_party/abseil-cpp/absl/strings/match.h +19 -0
  279. data/third_party/abseil-cpp/absl/strings/numbers.cc +154 -122
  280. data/third_party/abseil-cpp/absl/strings/numbers.h +1 -6
  281. data/third_party/abseil-cpp/absl/strings/str_cat.cc +7 -50
  282. data/third_party/abseil-cpp/absl/strings/str_cat.h +83 -15
  283. data/third_party/abseil-cpp/absl/strings/str_format.h +6 -3
  284. data/third_party/abseil-cpp/absl/strings/str_split.cc +9 -6
  285. data/third_party/abseil-cpp/absl/strings/string_view.cc +26 -4
  286. data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +5 -0
  287. data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +63 -43
  288. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +111 -0
  289. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.h +63 -0
  290. data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +11 -7
  291. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +225 -0
  292. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +122 -114
  293. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +12 -8
  294. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +10 -1
  295. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +167 -0
  296. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.h +60 -0
  297. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +122 -0
  298. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.h +65 -0
  299. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +91 -0
  300. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.h +56 -0
  301. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +19 -113
  302. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +42 -0
  303. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.h +90 -0
  304. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +151 -0
  305. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.h +70 -0
  306. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +407 -411
  307. data/third_party/abseil-cpp/absl/synchronization/mutex.h +152 -118
  308. data/third_party/abseil-cpp/absl/time/clock.cc +6 -7
  309. data/third_party/abseil-cpp/absl/time/duration.cc +24 -26
  310. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -0
  311. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
  312. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +3 -3
  313. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +8 -6
  314. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +6 -3
  315. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +4 -2
  316. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +4 -0
  317. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +322 -295
  318. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +8 -17
  319. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +51 -33
  320. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +7 -2
  321. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +128 -2
  322. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +1 -1
  323. data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +5 -1
  324. data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +34 -34
  325. data/third_party/abseil-cpp/absl/time/time.cc +9 -2
  326. data/third_party/abseil-cpp/absl/time/time.h +115 -15
  327. data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -52
  328. data/third_party/abseil-cpp/absl/types/internal/span.h +2 -2
  329. data/third_party/abseil-cpp/absl/types/internal/variant.h +2 -2
  330. data/third_party/abseil-cpp/absl/types/optional.h +15 -13
  331. data/third_party/abseil-cpp/absl/types/span.h +1 -2
  332. data/third_party/boringssl-with-bazel/err_data.c +15 -14
  333. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +7 -3
  334. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c +7 -7
  335. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +7 -3
  336. data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +5 -5
  337. data/third_party/boringssl-with-bazel/src/crypto/bio/errno.c +92 -0
  338. data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +4 -48
  339. data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +11 -6
  340. data/third_party/boringssl-with-bazel/src/crypto/bio/internal.h +16 -6
  341. data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +2 -2
  342. data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +9 -0
  343. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +1 -1
  344. data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +3 -7
  345. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +0 -2
  346. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c +0 -1
  347. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.c +0 -2
  348. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.c +0 -1
  349. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.c +93 -0
  350. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.c +1 -1
  351. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.c +0 -1
  352. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c +0 -2
  353. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c +4 -0
  354. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c +5 -0
  355. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +9 -14
  356. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +4 -6
  357. data/third_party/boringssl-with-bazel/src/crypto/err/err.c +10 -11
  358. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/check.c +37 -8
  359. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/dh.c +38 -19
  360. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +7 -0
  361. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +39 -16
  362. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/service_indicator.c +4 -7
  363. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +7 -0
  364. data/third_party/boringssl-with-bazel/src/crypto/internal.h +13 -21
  365. data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +6 -23
  366. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +4 -0
  367. data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +5 -0
  368. data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -6
  369. data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +0 -3
  370. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c +1 -3
  371. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +2 -3
  372. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +9 -1
  373. data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +11 -1
  374. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -1
  375. data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +7 -9
  376. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +6 -2
  377. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +22 -20
  378. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +4 -0
  379. data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +20 -12
  380. data/third_party/boringssl-with-bazel/src/include/openssl/target.h +50 -3
  381. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +0 -4
  382. data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +2 -2
  383. data/third_party/boringssl-with-bazel/src/ssl/ssl_file.cc +4 -4
  384. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +2 -0
  385. metadata +39 -31
  386. data/src/core/lib/promise/detail/basic_join.h +0 -197
  387. data/src/core/lib/promise/detail/switch.h +0 -1455
  388. data/src/core/lib/promise/try_join.h +0 -82
  389. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -403
  390. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_freebsd.c +0 -62
  391. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm.c +0 -38
  392. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_openbsd.c +0 -31
  393. data/third_party/re2/util/benchmark.h +0 -156
  394. data/third_party/re2/util/flags.h +0 -26
  395. data/third_party/re2/util/malloc_counter.h +0 -19
  396. data/third_party/re2/util/pcre.cc +0 -1025
  397. data/third_party/re2/util/pcre.h +0 -681
  398. data/third_party/re2/util/test.h +0 -50
  399. data/third_party/upb/upb/mini_table.h +0 -36
  400. data/third_party/zlib/gzclose.c +0 -25
  401. data/third_party/zlib/gzlib.c +0 -639
  402. data/third_party/zlib/gzread.c +0 -650
  403. data/third_party/zlib/gzwrite.c +0 -677
@@ -57,7 +57,7 @@
57
57
  #include <openssl/err.h>
58
58
  #include <openssl/x509.h>
59
59
 
60
- #ifndef OPENSSL_NO_STDIO
60
+
61
61
  int X509_STORE_set_default_paths(X509_STORE *ctx) {
62
62
  X509_LOOKUP *lookup;
63
63
 
@@ -106,5 +106,3 @@ int X509_STORE_load_locations(X509_STORE *ctx, const char *file,
106
106
  }
107
107
  return 1;
108
108
  }
109
-
110
- #endif
@@ -173,13 +173,12 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(const X509V3_EXT_METHOD *method,
173
173
  case GEN_IPADD:
174
174
  p = gen->d.ip->data;
175
175
  if (gen->d.ip->length == 4) {
176
- BIO_snprintf(oline, sizeof(oline), "%d.%d.%d.%d", p[0], p[1], p[2],
177
- p[3]);
176
+ snprintf(oline, sizeof(oline), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
178
177
  } else if (gen->d.ip->length == 16) {
179
178
  oline[0] = 0;
180
179
  for (i = 0; i < 8; i++) {
181
180
  uint16_t v = ((uint16_t)p[0] << 8) | p[1];
182
- BIO_snprintf(htmp, sizeof(htmp), "%X", v);
181
+ snprintf(htmp, sizeof(htmp), "%X", v);
183
182
  p += 2;
184
183
  OPENSSL_strlcat(oline, htmp, sizeof(oline));
185
184
  if (i != 7) {
@@ -58,6 +58,7 @@
58
58
 
59
59
  #include <stddef.h>
60
60
  #include <stdint.h>
61
+ #include <stdlib.h>
61
62
  #include <sys/types.h>
62
63
 
63
64
  #if defined(__MINGW32__)
@@ -108,7 +109,7 @@ extern "C" {
108
109
  // A consumer may use this symbol in the preprocessor to temporarily build
109
110
  // against multiple revisions of BoringSSL at the same time. It is not
110
111
  // recommended to do so for longer than is necessary.
111
- #define BORINGSSL_API_VERSION 24
112
+ #define BORINGSSL_API_VERSION 26
112
113
 
113
114
  #if defined(BORINGSSL_SHARED_LIBRARY)
114
115
 
@@ -383,6 +384,13 @@ typedef struct x509_trust_st X509_TRUST;
383
384
 
384
385
  typedef void *OPENSSL_BLOCK;
385
386
 
387
+ // BSSL_CHECK aborts if |condition| is not true.
388
+ #define BSSL_CHECK(condition) \
389
+ do { \
390
+ if (!(condition)) { \
391
+ abort(); \
392
+ } \
393
+ } while (0);
386
394
 
387
395
  #if defined(__cplusplus)
388
396
  } // extern C
@@ -431,12 +431,14 @@ OPENSSL_EXPORT int BIO_set_mem_eof_return(BIO *bio, int eof_value);
431
431
  // |BIO_reset| attempts to seek the file pointer to the start of file using
432
432
  // |lseek|.
433
433
 
434
+ #if !defined(OPENSSL_NO_POSIX_IO)
434
435
  // BIO_s_fd returns a |BIO_METHOD| for file descriptor fds.
435
436
  OPENSSL_EXPORT const BIO_METHOD *BIO_s_fd(void);
436
437
 
437
438
  // BIO_new_fd creates a new file descriptor BIO wrapping |fd|. If |close_flag|
438
439
  // is non-zero, then |fd| will be closed when the BIO is.
439
440
  OPENSSL_EXPORT BIO *BIO_new_fd(int fd, int close_flag);
441
+ #endif
440
442
 
441
443
  // BIO_set_fd sets the file descriptor of |bio| to |fd|. If |close_flag| is
442
444
  // non-zero then |fd| will be closed when |bio| is. It returns one on success
@@ -540,12 +542,14 @@ OPENSSL_EXPORT long BIO_seek(BIO *bio, long offset);
540
542
  // TODO(davidben): Add separate APIs and fix the internals to use |SOCKET|s
541
543
  // around rather than rely on int casts.
542
544
 
545
+ #if !defined(OPENSSL_NO_SOCK)
543
546
  OPENSSL_EXPORT const BIO_METHOD *BIO_s_socket(void);
544
547
 
545
548
  // BIO_new_socket allocates and initialises a fresh BIO which will read and
546
549
  // write to the socket |fd|. If |close_flag| is |BIO_CLOSE| then closing the
547
550
  // BIO will close |fd|. It returns the fresh |BIO| or NULL on error.
548
551
  OPENSSL_EXPORT BIO *BIO_new_socket(int fd, int close_flag);
552
+ #endif // !OPENSSL_NO_SOCK
549
553
 
550
554
 
551
555
  // Connect BIOs.
@@ -553,6 +557,7 @@ OPENSSL_EXPORT BIO *BIO_new_socket(int fd, int close_flag);
553
557
  // A connection BIO creates a network connection and transfers data over the
554
558
  // resulting socket.
555
559
 
560
+ #if !defined(OPENSSL_NO_SOCK)
556
561
  OPENSSL_EXPORT const BIO_METHOD *BIO_s_connect(void);
557
562
 
558
563
  // BIO_new_connect returns a BIO that connects to the given hostname and port.
@@ -580,12 +585,17 @@ OPENSSL_EXPORT int BIO_set_conn_port(BIO *bio, const char *port_str);
580
585
  OPENSSL_EXPORT int BIO_set_conn_int_port(BIO *bio, const int *port);
581
586
 
582
587
  // BIO_set_nbio sets whether |bio| will use non-blocking I/O operations. It
583
- // returns one on success and zero otherwise.
588
+ // returns one on success and zero otherwise. This only works for connect BIOs
589
+ // and must be called before |bio| is connected to take effect.
590
+ //
591
+ // For socket and fd BIOs, callers must configure blocking vs. non-blocking I/O
592
+ // using the underlying platform APIs.
584
593
  OPENSSL_EXPORT int BIO_set_nbio(BIO *bio, int on);
585
594
 
586
595
  // BIO_do_connect connects |bio| if it has not been connected yet. It returns
587
596
  // one on success and <= 0 otherwise.
588
597
  OPENSSL_EXPORT int BIO_do_connect(BIO *bio);
598
+ #endif // !OPENSSL_NO_SOCK
589
599
 
590
600
 
591
601
  // Datagram BIOs.
@@ -193,7 +193,9 @@ OPENSSL_EXPORT int DH_generate_parameters_ex(DH *dh, int prime_bits,
193
193
  // Diffie-Hellman operations.
194
194
 
195
195
  // DH_generate_key generates a new, random, private key and stores it in
196
- // |dh|. It returns one on success and zero on error.
196
+ // |dh|, if |dh| does not already have a private key. Otherwise, it updates
197
+ // |dh|'s public key to match the private key. It returns one on success and
198
+ // zero on error.
197
199
  OPENSSL_EXPORT int DH_generate_key(DH *dh);
198
200
 
199
201
  // DH_compute_key_padded calculates the shared key between |dh| and |peers_key|
@@ -351,5 +353,6 @@ BSSL_NAMESPACE_END
351
353
  #define DH_R_NO_PRIVATE_VALUE 103
352
354
  #define DH_R_DECODE_ERROR 104
353
355
  #define DH_R_ENCODE_ERROR 105
356
+ #define DH_R_INVALID_PARAMETERS 106
354
357
 
355
358
  #endif // OPENSSL_HEADER_DH_H
@@ -340,24 +340,22 @@ OPENSSL_EXPORT int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r,
340
340
 
341
341
  // Hash-to-curve.
342
342
  //
343
- // The following functions implement primitives from
344
- // draft-irtf-cfrg-hash-to-curve-16. The |dst| parameter in each function is the
345
- // domain separation tag and must be unique for each protocol and between the
346
- // |hash_to_curve| and |hash_to_scalar| variants. See section 3.1 of the spec
347
- // for additional guidance on this parameter.
343
+ // The following functions implement primitives from RFC 9380. The |dst|
344
+ // parameter in each function is the domain separation tag and must be unique
345
+ // for each protocol and between the |hash_to_curve| and |hash_to_scalar|
346
+ // variants. See section 3.1 of the spec for additional guidance on this
347
+ // parameter.
348
348
 
349
349
  // EC_hash_to_curve_p256_xmd_sha256_sswu hashes |msg| to a point on |group| and
350
350
  // writes the result to |out|, implementing the P256_XMD:SHA-256_SSWU_RO_ suite
351
- // from draft-irtf-cfrg-hash-to-curve-16. It returns one on success and zero on
352
- // error.
351
+ // from RFC 9380. It returns one on success and zero on error.
353
352
  OPENSSL_EXPORT int EC_hash_to_curve_p256_xmd_sha256_sswu(
354
353
  const EC_GROUP *group, EC_POINT *out, const uint8_t *dst, size_t dst_len,
355
354
  const uint8_t *msg, size_t msg_len);
356
355
 
357
356
  // EC_hash_to_curve_p384_xmd_sha384_sswu hashes |msg| to a point on |group| and
358
357
  // writes the result to |out|, implementing the P384_XMD:SHA-384_SSWU_RO_ suite
359
- // from draft-irtf-cfrg-hash-to-curve-16. It returns one on success and zero on
360
- // error.
358
+ // from RFC 9380. It returns one on success and zero on error.
361
359
  OPENSSL_EXPORT int EC_hash_to_curve_p384_xmd_sha384_sswu(
362
360
  const EC_GROUP *group, EC_POINT *out, const uint8_t *dst, size_t dst_len,
363
361
  const uint8_t *msg, size_t msg_len);
@@ -140,6 +140,10 @@ OPENSSL_EXPORT void EVP_HPKE_KEY_free(EVP_HPKE_KEY *key);
140
140
  OPENSSL_EXPORT int EVP_HPKE_KEY_copy(EVP_HPKE_KEY *dst,
141
141
  const EVP_HPKE_KEY *src);
142
142
 
143
+ // EVP_HPKE_KEY_move sets |out|, which must be initialized or in the zero state,
144
+ // to the key in |in|. |in| is mutated and left in the zero state.
145
+ OPENSSL_EXPORT void EVP_HPKE_KEY_move(EVP_HPKE_KEY *out, EVP_HPKE_KEY *in);
146
+
143
147
  // EVP_HPKE_KEY_init decodes |priv_key| as a private key for |kem| and
144
148
  // initializes |key| with the result. It returns one on success and zero if
145
149
  // |priv_key| was invalid. On success, the caller must call
@@ -389,8 +393,8 @@ using ScopedEVP_HPKE_CTX =
389
393
  internal::StackAllocated<EVP_HPKE_CTX, void, EVP_HPKE_CTX_zero,
390
394
  EVP_HPKE_CTX_cleanup>;
391
395
  using ScopedEVP_HPKE_KEY =
392
- internal::StackAllocated<EVP_HPKE_KEY, void, EVP_HPKE_KEY_zero,
393
- EVP_HPKE_KEY_cleanup>;
396
+ internal::StackAllocatedMovable<EVP_HPKE_KEY, void, EVP_HPKE_KEY_zero,
397
+ EVP_HPKE_KEY_cleanup, EVP_HPKE_KEY_move>;
394
398
 
395
399
  BORINGSSL_MAKE_DELETER(EVP_HPKE_CTX, EVP_HPKE_CTX_free)
396
400
  BORINGSSL_MAKE_DELETER(EVP_HPKE_KEY, EVP_HPKE_KEY_free)
@@ -114,36 +114,37 @@ class Span : private internal::SpanBase<const T> {
114
114
 
115
115
  template <typename C, typename = EnableIfContainer<C>,
116
116
  typename = std::enable_if_t<std::is_const<T>::value, C>>
117
- Span(const C &container) : data_(container.data()), size_(container.size()) {}
117
+ constexpr Span(const C &container)
118
+ : data_(container.data()), size_(container.size()) {}
118
119
 
119
120
  template <typename C, typename = EnableIfContainer<C>,
120
121
  typename = std::enable_if_t<!std::is_const<T>::value, C>>
121
- explicit Span(C &container)
122
+ constexpr explicit Span(C &container)
122
123
  : data_(container.data()), size_(container.size()) {}
123
124
 
124
- T *data() const { return data_; }
125
- size_t size() const { return size_; }
126
- bool empty() const { return size_ == 0; }
125
+ constexpr T *data() const { return data_; }
126
+ constexpr size_t size() const { return size_; }
127
+ constexpr bool empty() const { return size_ == 0; }
127
128
 
128
- T *begin() const { return data_; }
129
- const T *cbegin() const { return data_; }
130
- T *end() const { return data_ + size_; }
131
- const T *cend() const { return end(); }
129
+ constexpr T *begin() const { return data_; }
130
+ constexpr const T *cbegin() const { return data_; }
131
+ constexpr T *end() const { return data_ + size_; }
132
+ constexpr const T *cend() const { return end(); }
132
133
 
133
- T &front() const {
134
+ constexpr T &front() const {
134
135
  if (size_ == 0) {
135
136
  abort();
136
137
  }
137
138
  return data_[0];
138
139
  }
139
- T &back() const {
140
+ constexpr T &back() const {
140
141
  if (size_ == 0) {
141
142
  abort();
142
143
  }
143
144
  return data_[size_ - 1];
144
145
  }
145
146
 
146
- T &operator[](size_t i) const {
147
+ constexpr T &operator[](size_t i) const {
147
148
  if (i >= size_) {
148
149
  abort();
149
150
  }
@@ -151,7 +152,7 @@ class Span : private internal::SpanBase<const T> {
151
152
  }
152
153
  T &at(size_t i) const { return (*this)[i]; }
153
154
 
154
- Span subspan(size_t pos = 0, size_t len = npos) const {
155
+ constexpr Span subspan(size_t pos = 0, size_t len = npos) const {
155
156
  if (pos > size_) {
156
157
  // absl::Span throws an exception here. Note std::span and Chromium
157
158
  // base::span additionally forbid pos + len being out of range, with a
@@ -163,14 +164,14 @@ class Span : private internal::SpanBase<const T> {
163
164
  return Span(data_ + pos, std::min(size_ - pos, len));
164
165
  }
165
166
 
166
- Span first(size_t len) {
167
+ constexpr Span first(size_t len) const {
167
168
  if (len > size_) {
168
169
  abort();
169
170
  }
170
171
  return Span(data_, len);
171
172
  }
172
173
 
173
- Span last(size_t len) {
174
+ constexpr Span last(size_t len) const {
174
175
  if (len > size_) {
175
176
  abort();
176
177
  }
@@ -186,27 +187,28 @@ template <typename T>
186
187
  const size_t Span<T>::npos;
187
188
 
188
189
  template <typename T>
189
- Span<T> MakeSpan(T *ptr, size_t size) {
190
+ constexpr Span<T> MakeSpan(T *ptr, size_t size) {
190
191
  return Span<T>(ptr, size);
191
192
  }
192
193
 
193
194
  template <typename C>
194
- auto MakeSpan(C &c) -> decltype(MakeSpan(c.data(), c.size())) {
195
+ constexpr auto MakeSpan(C &c) -> decltype(MakeSpan(c.data(), c.size())) {
195
196
  return MakeSpan(c.data(), c.size());
196
197
  }
197
198
 
198
199
  template <typename T>
199
- Span<const T> MakeConstSpan(T *ptr, size_t size) {
200
+ constexpr Span<const T> MakeConstSpan(T *ptr, size_t size) {
200
201
  return Span<const T>(ptr, size);
201
202
  }
202
203
 
203
204
  template <typename C>
204
- auto MakeConstSpan(const C &c) -> decltype(MakeConstSpan(c.data(), c.size())) {
205
+ constexpr auto MakeConstSpan(const C &c)
206
+ -> decltype(MakeConstSpan(c.data(), c.size())) {
205
207
  return MakeConstSpan(c.data(), c.size());
206
208
  }
207
209
 
208
210
  template <typename T, size_t size>
209
- Span<const T> MakeConstSpan(T (&array)[size]) {
211
+ constexpr Span<const T> MakeConstSpan(T (&array)[size]) {
210
212
  return array;
211
213
  }
212
214
 
@@ -303,6 +303,7 @@ OPENSSL_EXPORT int SSL_get_rfd(const SSL *ssl);
303
303
  // socket |BIO|.
304
304
  OPENSSL_EXPORT int SSL_get_wfd(const SSL *ssl);
305
305
 
306
+ #if !defined(OPENSSL_NO_SOCK)
306
307
  // SSL_set_fd configures |ssl| to read from and write to |fd|. It returns one
307
308
  // on success and zero on allocation error. The caller retains ownership of
308
309
  // |fd|.
@@ -321,6 +322,7 @@ OPENSSL_EXPORT int SSL_set_rfd(SSL *ssl, int fd);
321
322
  //
322
323
  // On Windows, |fd| is cast to a |SOCKET| and used with Winsock APIs.
323
324
  OPENSSL_EXPORT int SSL_set_wfd(SSL *ssl, int fd);
325
+ #endif // !OPENSSL_NO_SOCK
324
326
 
325
327
  // SSL_do_handshake continues the current handshake. If there is none or the
326
328
  // handshake has completed or False Started, it returns one. Otherwise, it
@@ -5110,12 +5112,14 @@ OPENSSL_EXPORT int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key);
5110
5112
  // |ec_key|'s curve. The remainder of |ec_key| is ignored.
5111
5113
  OPENSSL_EXPORT int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key);
5112
5114
 
5115
+ #if !defined(OPENSSL_NO_FILESYSTEM)
5113
5116
  // SSL_add_dir_cert_subjects_to_stack lists files in directory |dir|. It calls
5114
5117
  // |SSL_add_file_cert_subjects_to_stack| on each file and returns one on success
5115
5118
  // or zero on error. This function is only available from the libdecrepit
5116
5119
  // library.
5117
5120
  OPENSSL_EXPORT int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *out,
5118
5121
  const char *dir);
5122
+ #endif
5119
5123
 
5120
5124
  // SSL_CTX_enable_tls_channel_id calls |SSL_CTX_set_tls_channel_id_enabled|.
5121
5125
  OPENSSL_EXPORT int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx);
@@ -337,20 +337,28 @@ OPENSSL_EXPORT OPENSSL_STACK *OPENSSL_sk_deep_copy(
337
337
  typedef OPENSSL_STACK _STACK;
338
338
 
339
339
  // The following functions call the corresponding |OPENSSL_sk_*| function.
340
- OPENSSL_EXPORT OPENSSL_STACK *sk_new_null(void);
341
- OPENSSL_EXPORT size_t sk_num(const OPENSSL_STACK *sk);
342
- OPENSSL_EXPORT void *sk_value(const OPENSSL_STACK *sk, size_t i);
343
- OPENSSL_EXPORT void sk_free(OPENSSL_STACK *sk);
344
- OPENSSL_EXPORT size_t sk_push(OPENSSL_STACK *sk, void *p);
345
- OPENSSL_EXPORT void *sk_pop(OPENSSL_STACK *sk);
346
-
347
- // sk_pop_free behaves like |sk_pop_free_ex| but performs an invalid function
348
- // pointer cast. It exists because some existing callers called |sk_pop_free|
349
- // directly.
340
+ OPENSSL_EXPORT OPENSSL_DEPRECATED OPENSSL_STACK *sk_new_null(void);
341
+ OPENSSL_EXPORT OPENSSL_DEPRECATED size_t sk_num(const OPENSSL_STACK *sk);
342
+ OPENSSL_EXPORT OPENSSL_DEPRECATED void *sk_value(const OPENSSL_STACK *sk,
343
+ size_t i);
344
+ OPENSSL_EXPORT OPENSSL_DEPRECATED void sk_free(OPENSSL_STACK *sk);
345
+ OPENSSL_EXPORT OPENSSL_DEPRECATED size_t sk_push(OPENSSL_STACK *sk, void *p);
346
+ OPENSSL_EXPORT OPENSSL_DEPRECATED void *sk_pop(OPENSSL_STACK *sk);
347
+
348
+ // sk_pop_free_ex calls |OPENSSL_sk_pop_free_ex|.
349
+ //
350
+ // TODO(b/291994116): Remove this.
351
+ OPENSSL_EXPORT OPENSSL_DEPRECATED void sk_pop_free_ex(
352
+ OPENSSL_STACK *sk, OPENSSL_sk_call_free_func call_free_func,
353
+ OPENSSL_sk_free_func free_func);
354
+
355
+ // sk_pop_free behaves like |OPENSSL_sk_pop_free_ex| but performs an invalid
356
+ // function pointer cast. It exists because some existing callers called
357
+ // |sk_pop_free| directly.
350
358
  //
351
359
  // TODO(davidben): Migrate callers to bssl::UniquePtr and remove this.
352
- OPENSSL_EXPORT void sk_pop_free(OPENSSL_STACK *sk,
353
- OPENSSL_sk_free_func free_func);
360
+ OPENSSL_EXPORT OPENSSL_DEPRECATED void sk_pop_free(
361
+ OPENSSL_STACK *sk, OPENSSL_sk_free_func free_func);
354
362
 
355
363
 
356
364
  #if !defined(BORINGSSL_NO_CXX)
@@ -70,10 +70,13 @@
70
70
  #define OPENSSL_WINDOWS
71
71
  #endif
72
72
 
73
- // Trusty isn't Linux but currently defines __linux__. As a workaround, we
74
- // exclude it here.
73
+ // Trusty and Android baremetal aren't't Linux but currently define __linux__.
74
+ // As a workaround, we exclude them here.
75
+ //
75
76
  // TODO(b/169780122): Remove this workaround once Trusty no longer defines it.
76
- #if defined(__linux__) && !defined(__TRUSTY__)
77
+ // TODO(b/291101350): Remove this workaround once Android baremetal no longer
78
+ // defines it.
79
+ #if defined(__linux__) && !defined(__TRUSTY__) && !defined(ANDROID_BAREMETAL)
77
80
  #define OPENSSL_LINUX
78
81
  #endif
79
82
 
@@ -81,14 +84,58 @@
81
84
  #define OPENSSL_FUCHSIA
82
85
  #endif
83
86
 
87
+ // Trusty is Android's TEE target. See
88
+ // https://source.android.com/docs/security/features/trusty
89
+ //
90
+ // Defining this on any other platform is not supported. Other embedded
91
+ // platforms must introduce their own defines.
84
92
  #if defined(__TRUSTY__)
85
93
  #define OPENSSL_TRUSTY
94
+ #define OPENSSL_NO_FILESYSTEM
86
95
  #define OPENSSL_NO_POSIX_IO
87
96
  #define OPENSSL_NO_SOCK
88
97
  #define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
89
98
  #endif
90
99
 
100
+ // nanolibc is a particular minimal libc implementation. Defining this on any
101
+ // other platform is not supported. Other embedded platforms must introduce
102
+ // their own defines.
91
103
  #if defined(OPENSSL_NANOLIBC)
104
+ #define OPENSSL_NO_FILESYSTEM
105
+ #define OPENSSL_NO_POSIX_IO
106
+ #define OPENSSL_NO_SOCK
107
+ #define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
108
+ #endif
109
+
110
+ // Android baremetal is an embedded target that uses a subset of bionic.
111
+ // Defining this on any other platform is not supported. Other embedded
112
+ // platforms must introduce their own defines.
113
+ #if defined(ANDROID_BAREMETAL)
114
+ #define OPENSSL_NO_FILESYSTEM
115
+ #define OPENSSL_NO_POSIX_IO
116
+ #define OPENSSL_NO_SOCK
117
+ #define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
118
+ #endif
119
+
120
+ // CROS_EC is an embedded target for ChromeOS Embedded Controller. Defining
121
+ // this on any other platform is not supported. Other embedded platforms must
122
+ // introduce their own defines.
123
+ //
124
+ // https://chromium.googlesource.com/chromiumos/platform/ec/+/HEAD/README.md
125
+ #if defined(CROS_EC)
126
+ #define OPENSSL_NO_FILESYSTEM
127
+ #define OPENSSL_NO_POSIX_IO
128
+ #define OPENSSL_NO_SOCK
129
+ #define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
130
+ #endif
131
+
132
+ // CROS_ZEPHYR is an embedded target for ChromeOS Zephyr Embedded Controller.
133
+ // Defining this on any other platform is not supported. Other embedded
134
+ // platforms must introduce their own defines.
135
+ //
136
+ // https://chromium.googlesource.com/chromiumos/platform/ec/+/HEAD/docs/zephyr/README.md
137
+ #if defined(CROS_ZEPHYR)
138
+ #define OPENSSL_NO_FILESYSTEM
92
139
  #define OPENSSL_NO_POSIX_IO
93
140
  #define OPENSSL_NO_SOCK
94
141
  #define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED
@@ -2864,14 +2864,12 @@ OPENSSL_EXPORT int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type,
2864
2864
  OPENSSL_EXPORT int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
2865
2865
  long argl, char **ret);
2866
2866
 
2867
- #ifndef OPENSSL_NO_STDIO
2868
2867
  OPENSSL_EXPORT int X509_load_cert_file(X509_LOOKUP *ctx, const char *file,
2869
2868
  int type);
2870
2869
  OPENSSL_EXPORT int X509_load_crl_file(X509_LOOKUP *ctx, const char *file,
2871
2870
  int type);
2872
2871
  OPENSSL_EXPORT int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file,
2873
2872
  int type);
2874
- #endif
2875
2873
 
2876
2874
  OPENSSL_EXPORT X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
2877
2875
  OPENSSL_EXPORT void X509_LOOKUP_free(X509_LOOKUP *ctx);
@@ -2880,11 +2878,9 @@ OPENSSL_EXPORT int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type,
2880
2878
  X509_NAME *name, X509_OBJECT *ret);
2881
2879
  OPENSSL_EXPORT int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
2882
2880
 
2883
- #ifndef OPENSSL_NO_STDIO
2884
2881
  OPENSSL_EXPORT int X509_STORE_load_locations(X509_STORE *ctx, const char *file,
2885
2882
  const char *dir);
2886
2883
  OPENSSL_EXPORT int X509_STORE_set_default_paths(X509_STORE *ctx);
2887
- #endif
2888
2884
  OPENSSL_EXPORT int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
2889
2885
  OPENSSL_EXPORT void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
2890
2886
  OPENSSL_EXPORT int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
@@ -1682,8 +1682,8 @@ const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf,
1682
1682
  return "Buffer too small";
1683
1683
  }
1684
1684
 
1685
- BIO_snprintf(buf, len, "%-23s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s\n",
1686
- cipher->name, kx, au, enc, mac);
1685
+ snprintf(buf, len, "%-23s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s\n", cipher->name,
1686
+ kx, au, enc, mac);
1687
1687
  return buf;
1688
1688
  }
1689
1689
 
@@ -199,6 +199,10 @@ static int add_bio_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, BIO *bio,
199
199
  return 1;
200
200
  }
201
201
 
202
+ int SSL_add_bio_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, BIO *bio) {
203
+ return add_bio_cert_subjects_to_stack(out, bio, /*allow_empty=*/true);
204
+ }
205
+
202
206
  STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file) {
203
207
  bssl::UniquePtr<BIO> in(BIO_new_file(file, "r"));
204
208
  if (in == nullptr) {
@@ -222,10 +226,6 @@ int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *out,
222
226
  return SSL_add_bio_cert_subjects_to_stack(out, in.get());
223
227
  }
224
228
 
225
- int SSL_add_bio_cert_subjects_to_stack(STACK_OF(X509_NAME) *out, BIO *bio) {
226
- return add_bio_cert_subjects_to_stack(out, bio, /*allow_empty=*/true);
227
- }
228
-
229
229
  int SSL_use_certificate_file(SSL *ssl, const char *file, int type) {
230
230
  int reason_code;
231
231
  BIO *in;
@@ -1595,6 +1595,7 @@ int SSL_get_wfd(const SSL *ssl) {
1595
1595
  return ret;
1596
1596
  }
1597
1597
 
1598
+ #if !defined(OPENSSL_NO_SOCK)
1598
1599
  int SSL_set_fd(SSL *ssl, int fd) {
1599
1600
  BIO *bio = BIO_new(BIO_s_socket());
1600
1601
  if (bio == NULL) {
@@ -1644,6 +1645,7 @@ int SSL_set_rfd(SSL *ssl, int fd) {
1644
1645
  }
1645
1646
  return 1;
1646
1647
  }
1648
+ #endif // !OPENSSL_NO_SOCK
1647
1649
 
1648
1650
  static size_t copy_finished(void *out, size_t out_len, const uint8_t *in,
1649
1651
  size_t in_len) {