grpc 1.35.0 → 1.36.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (335) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +60 -57
  3. data/include/grpc/grpc_security.h +16 -11
  4. data/src/core/ext/filters/client_channel/client_channel.cc +32 -26
  5. data/src/core/ext/filters/client_channel/client_channel.h +0 -2
  6. data/src/core/ext/filters/client_channel/config_selector.h +1 -1
  7. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +2 -2
  8. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +3 -5
  9. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -2
  10. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -2
  11. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +1 -1
  12. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +8 -6
  13. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +289 -170
  14. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +5 -0
  15. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +1 -3
  16. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +231 -109
  17. data/src/core/ext/filters/client_channel/resolver.cc +2 -5
  18. data/src/core/ext/filters/client_channel/resolver.h +1 -12
  19. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +36 -45
  20. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +29 -41
  21. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +16 -14
  22. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +18 -15
  23. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +362 -0
  24. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +4 -4
  25. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +22 -74
  26. data/src/core/ext/filters/client_channel/server_address.cc +6 -0
  27. data/src/core/ext/filters/client_channel/server_address.h +31 -0
  28. data/src/core/ext/filters/client_channel/subchannel.cc +2 -2
  29. data/src/core/ext/filters/max_age/max_age_filter.cc +35 -32
  30. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -1
  31. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +47 -22
  32. data/src/core/ext/transport/chttp2/server/chttp2_server.h +11 -2
  33. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +11 -1
  34. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +62 -18
  35. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +0 -1
  36. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +11 -16
  37. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +42 -59
  38. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +3 -2
  39. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +15 -0
  40. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +25 -1
  41. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +75 -0
  42. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +2 -2
  43. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +9 -9
  44. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +7 -7
  45. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +28 -13
  46. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +0 -1
  47. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +11 -5
  48. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +41 -7
  49. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +0 -1
  50. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +23 -21
  51. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +122 -77
  52. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +13 -9
  53. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +37 -5
  54. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +0 -1
  55. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +11 -9
  56. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +44 -27
  57. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +42 -16
  58. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +106 -0
  59. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +0 -1
  60. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +29 -0
  61. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +67 -0
  62. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +13 -16
  63. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +51 -42
  64. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +0 -1
  65. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +16 -13
  66. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +50 -18
  67. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +4 -7
  68. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +0 -17
  69. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +0 -1
  70. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +30 -23
  71. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +85 -73
  72. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -3
  73. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -3
  74. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +0 -1
  75. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -2
  76. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +0 -1
  77. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +21 -4
  78. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +29 -0
  79. data/src/core/ext/upb-generated/{udpa/core/v1 → xds/core/v3}/authority.upb.c +5 -5
  80. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +60 -0
  81. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +52 -0
  82. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +143 -0
  83. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +42 -0
  84. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +84 -0
  85. data/src/core/ext/upb-generated/{udpa/core/v1 → xds/core/v3}/resource.upb.c +9 -9
  86. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +94 -0
  87. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +54 -0
  88. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +166 -0
  89. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +36 -0
  90. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +85 -0
  91. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +168 -171
  92. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +405 -420
  93. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +2 -2
  94. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +12 -9
  95. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +177 -171
  96. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +10 -0
  97. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +88 -88
  98. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +153 -153
  99. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +4 -7
  100. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +33 -20
  101. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +56 -59
  102. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +116 -111
  103. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +129 -121
  104. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +21 -24
  105. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +17 -13
  106. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +747 -724
  107. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +5 -0
  108. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +22 -25
  109. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +51 -0
  110. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +35 -0
  111. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +369 -376
  112. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +12 -16
  113. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +112 -108
  114. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +45 -53
  115. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +177 -180
  116. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +92 -102
  117. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +5 -0
  118. data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +32 -42
  119. data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +30 -40
  120. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +4 -7
  121. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +38 -44
  122. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +30 -33
  123. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +14 -11
  124. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +42 -0
  125. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +35 -0
  126. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +62 -0
  127. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +40 -0
  128. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +45 -0
  129. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +40 -0
  130. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +49 -0
  131. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +35 -0
  132. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +67 -0
  133. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +40 -0
  134. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +50 -0
  135. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +35 -0
  136. data/src/core/ext/xds/xds_api.cc +738 -567
  137. data/src/core/ext/xds/xds_api.h +46 -84
  138. data/src/core/ext/xds/xds_bootstrap.cc +59 -40
  139. data/src/core/ext/xds/xds_bootstrap.h +12 -4
  140. data/src/core/ext/xds/xds_certificate_provider.cc +180 -74
  141. data/src/core/ext/xds/xds_certificate_provider.h +83 -44
  142. data/src/core/ext/xds/xds_client.cc +13 -11
  143. data/src/core/ext/xds/xds_client.h +3 -0
  144. data/src/core/ext/xds/xds_client_stats.cc +2 -1
  145. data/src/core/ext/xds/xds_server_config_fetcher.cc +147 -11
  146. data/src/core/lib/channel/handshaker.cc +2 -5
  147. data/src/core/lib/channel/handshaker.h +1 -1
  148. data/src/core/lib/gpr/log.cc +6 -1
  149. data/src/core/lib/gprpp/mpscq.cc +2 -2
  150. data/src/core/lib/gprpp/ref_counted.h +1 -1
  151. data/src/core/lib/gprpp/sync.h +129 -40
  152. data/src/core/lib/gprpp/time_util.cc +77 -0
  153. data/src/core/lib/gprpp/time_util.h +42 -0
  154. data/src/core/lib/http/httpcli_security_connector.cc +2 -2
  155. data/src/core/lib/iomgr/ev_apple.cc +10 -7
  156. data/src/core/lib/iomgr/ev_epollex_linux.cc +4 -4
  157. data/src/core/lib/iomgr/iomgr_posix.cc +0 -1
  158. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +0 -1
  159. data/src/core/lib/iomgr/sockaddr_utils.cc +1 -1
  160. data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -0
  161. data/src/core/lib/iomgr/tcp_client_posix.cc +1 -1
  162. data/src/core/lib/iomgr/tcp_posix.cc +4 -4
  163. data/src/core/lib/security/authorization/matchers.cc +339 -0
  164. data/src/core/lib/security/authorization/matchers.h +158 -0
  165. data/src/core/lib/security/authorization/mock_cel/activation.h +1 -1
  166. data/src/core/lib/security/authorization/mock_cel/cel_value.h +9 -7
  167. data/src/core/lib/security/credentials/alts/alts_credentials.cc +2 -1
  168. data/src/core/lib/security/credentials/alts/alts_credentials.h +1 -1
  169. data/src/core/lib/security/credentials/credentials.h +2 -1
  170. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -1
  171. data/src/core/lib/security/credentials/external/external_account_credentials.cc +2 -2
  172. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +1 -1
  173. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -1
  174. data/src/core/lib/security/credentials/fake/fake_credentials.cc +1 -1
  175. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +7 -6
  176. data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +2 -2
  177. data/src/core/lib/security/credentials/jwt/json_token.cc +0 -3
  178. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +0 -3
  179. data/src/core/lib/security/credentials/local/local_credentials.cc +2 -1
  180. data/src/core/lib/security/credentials/local/local_credentials.h +1 -1
  181. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +2 -1
  182. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +1 -1
  183. data/src/core/lib/security/credentials/tls/tls_credentials.cc +2 -1
  184. data/src/core/lib/security/credentials/tls/tls_credentials.h +1 -1
  185. data/src/core/lib/security/credentials/xds/xds_credentials.cc +128 -59
  186. data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
  187. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +5 -5
  188. data/src/core/lib/security/security_connector/ssl_utils.cc +3 -0
  189. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +26 -14
  190. data/src/core/lib/security/transport/security_handshaker.cc +1 -3
  191. data/src/core/lib/slice/slice_intern.cc +1 -1
  192. data/src/core/lib/surface/init.cc +13 -15
  193. data/src/core/lib/surface/server.cc +3 -3
  194. data/src/core/lib/surface/server.h +3 -0
  195. data/src/core/lib/surface/version.cc +2 -2
  196. data/src/core/lib/transport/metadata.cc +6 -2
  197. data/src/core/plugin_registry/grpc_plugin_registry.cc +6 -0
  198. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +17 -20
  199. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +16 -21
  200. data/src/core/tsi/fake_transport_security.cc +1 -1
  201. data/src/core/tsi/ssl/session_cache/ssl_session.h +0 -3
  202. data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +0 -2
  203. data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +2 -4
  204. data/src/core/tsi/ssl_transport_security.cc +0 -3
  205. data/src/core/tsi/ssl_transport_security.h +0 -3
  206. data/src/ruby/lib/grpc/version.rb +1 -1
  207. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +7 -0
  208. data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +1 -0
  209. data/third_party/boringssl-with-bazel/err_data.c +725 -723
  210. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +3 -3
  211. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +2 -2
  212. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +5 -5
  213. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +3 -10
  214. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c +3 -3
  215. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +4 -2
  216. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +2 -2
  217. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +15 -14
  218. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +30 -0
  219. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +28 -79
  220. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +39 -85
  221. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +5 -16
  222. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +10 -61
  223. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +0 -2
  224. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +2 -2
  225. data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +4 -0
  226. data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +158 -0
  227. data/third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c +3 -10
  228. data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +8 -9
  229. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +60 -45
  230. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +6 -81
  231. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +87 -0
  232. data/third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-win.c +41 -0
  233. data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/dh_asn1.c +0 -0
  234. data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/params.c +179 -0
  235. data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +25 -0
  236. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +2 -17
  237. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +3 -1
  238. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bn.c +13 -20
  239. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +2 -3
  240. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +9 -1
  241. data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/check.c +0 -0
  242. data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/dh.c +136 -213
  243. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +12 -0
  244. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +9 -1
  245. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +28 -0
  246. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +128 -38
  247. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +0 -7
  248. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +51 -32
  249. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +147 -0
  250. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +18 -29
  251. data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +13 -4
  252. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +10 -7
  253. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c +13 -11
  254. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c +4 -0
  255. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +34 -0
  256. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +4 -0
  257. data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +7 -13
  258. data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +5 -1
  259. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +1 -1
  260. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +10 -7
  261. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_r2x.c +1 -1
  262. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +8 -8
  263. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +1 -1
  264. data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +29 -23
  265. data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +1 -2
  266. data/third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c +2 -2
  267. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +39 -6
  268. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +2 -2
  269. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +3 -3
  270. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +11 -10
  271. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +3 -3
  272. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +25 -25
  273. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +2 -2
  274. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +2 -1
  275. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +40 -20
  276. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c +3 -4
  277. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +25 -36
  278. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +1 -1
  279. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +6 -6
  280. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +6 -6
  281. data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +3 -3
  282. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +652 -545
  283. data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +0 -167
  284. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +10 -5
  285. data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +62 -0
  286. data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +22 -7
  287. data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +15 -0
  288. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +56 -26
  289. data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +1 -0
  290. data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +15 -0
  291. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +12 -2
  292. data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +3 -0
  293. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +2 -1
  294. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +42 -24
  295. data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +27 -8
  296. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +287 -98
  297. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +139 -36
  298. data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +4 -3
  299. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +11 -20
  300. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +10 -5
  301. data/third_party/boringssl-with-bazel/src/ssl/internal.h +37 -16
  302. data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +0 -1
  303. data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +7 -8
  304. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +20 -14
  305. data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +7 -8
  306. data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +2 -2
  307. data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +5 -7
  308. data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +329 -31
  309. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +2 -2
  310. data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +48 -15
  311. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +66 -24
  312. metadata +77 -65
  313. data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h +0 -60
  314. data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c +0 -52
  315. data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h +0 -143
  316. data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c +0 -42
  317. data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h +0 -84
  318. data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h +0 -94
  319. data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c +0 -54
  320. data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h +0 -173
  321. data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c +0 -36
  322. data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h +0 -92
  323. data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.c +0 -42
  324. data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.h +0 -35
  325. data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.c +0 -62
  326. data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.h +0 -40
  327. data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.c +0 -45
  328. data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.h +0 -40
  329. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.c +0 -49
  330. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.h +0 -35
  331. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.c +0 -68
  332. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.h +0 -40
  333. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.c +0 -51
  334. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.h +0 -35
  335. data/src/core/lib/iomgr/iomgr_posix.h +0 -26
@@ -52,8 +52,8 @@ class XdsServerCredentials final : public grpc_server_credentials {
52
52
  : grpc_server_credentials(kCredentialsTypeXds),
53
53
  fallback_credentials_(std::move(fallback_credentials)) {}
54
54
 
55
- RefCountedPtr<grpc_server_security_connector> create_security_connector()
56
- override;
55
+ RefCountedPtr<grpc_server_security_connector> create_security_connector(
56
+ const grpc_channel_args* /* args */) override;
57
57
 
58
58
  private:
59
59
  RefCountedPtr<grpc_server_credentials> fallback_credentials_;
@@ -62,7 +62,7 @@ class XdsServerCredentials final : public grpc_server_credentials {
62
62
  bool TestOnlyXdsVerifySubjectAlternativeNames(
63
63
  const char* const* subject_alternative_names,
64
64
  size_t subject_alternative_names_size,
65
- const std::vector<XdsApi::StringMatcher>& matchers);
65
+ const std::vector<StringMatcher>& matchers);
66
66
 
67
67
  } // namespace grpc_core
68
68
 
@@ -51,14 +51,14 @@ RefCountedPtr<grpc_auth_context> TestOnlyMakeInsecureAuthContext() {
51
51
  // check_call_host and cancel_check_call_host are no-ops since we want to
52
52
  // provide an insecure channel.
53
53
  bool InsecureChannelSecurityConnector::check_call_host(
54
- absl::string_view host, grpc_auth_context* auth_context,
55
- grpc_closure* on_call_host_checked, grpc_error** error) {
54
+ absl::string_view /*host*/, grpc_auth_context* /*auth_context*/,
55
+ grpc_closure* /*on_call_host_checked*/, grpc_error** error) {
56
56
  *error = GRPC_ERROR_NONE;
57
57
  return true;
58
58
  }
59
59
 
60
60
  void InsecureChannelSecurityConnector::cancel_check_call_host(
61
- grpc_closure* on_call_host_checked, grpc_error* error) {
61
+ grpc_closure* /*on_call_host_checked*/, grpc_error* error) {
62
62
  GRPC_ERROR_UNREF(error);
63
63
  }
64
64
 
@@ -76,7 +76,7 @@ void InsecureChannelSecurityConnector::add_handshakers(
76
76
  }
77
77
 
78
78
  void InsecureChannelSecurityConnector::check_peer(
79
- tsi_peer peer, grpc_endpoint* ep,
79
+ tsi_peer peer, grpc_endpoint* /*ep*/,
80
80
  RefCountedPtr<grpc_auth_context>* auth_context,
81
81
  grpc_closure* on_peer_checked) {
82
82
  *auth_context = MakeAuthContext();
@@ -104,7 +104,7 @@ void InsecureServerSecurityConnector::add_handshakers(
104
104
  }
105
105
 
106
106
  void InsecureServerSecurityConnector::check_peer(
107
- tsi_peer peer, grpc_endpoint* ep,
107
+ tsi_peer peer, grpc_endpoint* /*ep*/,
108
108
  grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
109
109
  grpc_closure* on_peer_checked) {
110
110
  *auth_context = MakeAuthContext();
@@ -395,6 +395,9 @@ grpc_security_status grpc_ssl_tsi_client_handshaker_factory_init(
395
395
  const char* root_certs;
396
396
  const tsi_ssl_root_certs_store* root_store;
397
397
  if (pem_root_certs == nullptr) {
398
+ gpr_log(GPR_INFO,
399
+ "No root certificates specified; use ones stored in system default "
400
+ "locations instead");
398
401
  // Use default root certificates.
399
402
  root_certs = grpc_core::DefaultSslRootStore::GetPemRootCerts();
400
403
  if (root_certs == nullptr) {
@@ -136,9 +136,20 @@ TlsChannelSecurityConnector::TlsChannelSecurityConnector(
136
136
  if (options_->watch_identity_pair()) {
137
137
  watched_identity_cert_name = options_->identity_cert_name();
138
138
  }
139
- distributor->WatchTlsCertificates(std::move(watcher_ptr),
140
- watched_root_cert_name,
141
- watched_identity_cert_name);
139
+ // We will use the root certs stored in system default locations if not
140
+ // watching root certs on the client side. We will handle this case
141
+ // differently here, because "watching a default roots without the identity
142
+ // certs" is a valid case(and hence we will need to call
143
+ // OnCertificatesChanged), but it requires nothing from the provider, and
144
+ // hence no need to register the watcher.
145
+ bool use_default_roots = !options_->watch_root_cert();
146
+ if (use_default_roots && !options_->watch_identity_pair()) {
147
+ watcher_ptr->OnCertificatesChanged(absl::nullopt, absl::nullopt);
148
+ } else {
149
+ distributor->WatchTlsCertificates(std::move(watcher_ptr),
150
+ watched_root_cert_name,
151
+ watched_identity_cert_name);
152
+ }
142
153
  }
143
154
 
144
155
  TlsChannelSecurityConnector::~TlsChannelSecurityConnector() {
@@ -148,7 +159,9 @@ TlsChannelSecurityConnector::~TlsChannelSecurityConnector() {
148
159
  // Cancel all the watchers.
149
160
  grpc_tls_certificate_distributor* distributor =
150
161
  options_->certificate_distributor();
151
- distributor->CancelTlsCertificatesWatch(certificate_watcher_);
162
+ if (distributor != nullptr) {
163
+ distributor->CancelTlsCertificatesWatch(certificate_watcher_);
164
+ }
152
165
  if (client_handshaker_factory_ != nullptr) {
153
166
  tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
154
167
  }
@@ -327,16 +340,12 @@ void TlsChannelSecurityConnector::TlsChannelCertificateWatcher::
327
340
  if (key_cert_pairs.has_value()) {
328
341
  security_connector_->pem_key_cert_pair_list_ = std::move(key_cert_pairs);
329
342
  }
330
- bool root_being_watched = security_connector_->options_->watch_root_cert();
331
- bool root_has_value = security_connector_->pem_root_certs_.has_value();
332
- bool identity_being_watched =
333
- security_connector_->options_->watch_identity_pair();
334
- bool identity_has_value =
343
+ const bool root_ready = !security_connector_->options_->watch_root_cert() ||
344
+ security_connector_->pem_root_certs_.has_value();
345
+ const bool identity_ready =
346
+ !security_connector_->options_->watch_identity_pair() ||
335
347
  security_connector_->pem_key_cert_pair_list_.has_value();
336
- if ((root_being_watched && root_has_value && identity_being_watched &&
337
- identity_has_value) ||
338
- (root_being_watched && root_has_value && !identity_being_watched) ||
339
- (!root_being_watched && identity_being_watched && identity_has_value)) {
348
+ if (root_ready && identity_ready) {
340
349
  if (security_connector_->UpdateHandshakerFactoryLocked() !=
341
350
  GRPC_SECURITY_OK) {
342
351
  gpr_log(GPR_ERROR, "Update handshaker factory failed.");
@@ -383,9 +392,11 @@ TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() {
383
392
  if (pem_key_cert_pair_list_.has_value()) {
384
393
  pem_key_cert_pair = ConvertToTsiPemKeyCertPair(*pem_key_cert_pair_list_);
385
394
  }
395
+ bool use_default_roots = !options_->watch_root_cert();
386
396
  grpc_security_status status = grpc_ssl_tsi_client_handshaker_factory_init(
387
397
  pem_key_cert_pair,
388
- pem_root_certs.empty() ? nullptr : pem_root_certs.c_str(),
398
+ pem_root_certs.empty() || use_default_roots ? nullptr
399
+ : pem_root_certs.c_str(),
389
400
  skip_server_certificate_verification,
390
401
  grpc_get_tsi_tls_version(options_->min_tls_version()),
391
402
  grpc_get_tsi_tls_version(options_->max_tls_version()), ssl_session_cache_,
@@ -516,6 +527,7 @@ TlsServerSecurityConnector::TlsServerSecurityConnector(
516
527
  if (options_->watch_identity_pair()) {
517
528
  watched_identity_cert_name = options_->identity_cert_name();
518
529
  }
530
+ // Server side won't use default system roots at any time.
519
531
  distributor->WatchTlsCertificates(std::move(watcher_ptr),
520
532
  watched_root_cert_name,
521
533
  watched_identity_cert_name);
@@ -84,7 +84,7 @@ class SecurityHandshaker : public Handshaker {
84
84
  tsi_handshaker* handshaker_;
85
85
  RefCountedPtr<grpc_security_connector> connector_;
86
86
 
87
- gpr_mu mu_;
87
+ Mutex mu_;
88
88
 
89
89
  bool is_shutdown_ = false;
90
90
  // Endpoint and read buffer to destroy after a shutdown.
@@ -120,14 +120,12 @@ SecurityHandshaker::SecurityHandshaker(tsi_handshaker* handshaker,
120
120
  max_frame_size_ = grpc_channel_arg_get_integer(
121
121
  arg, {0, 0, std::numeric_limits<int>::max()});
122
122
  }
123
- gpr_mu_init(&mu_);
124
123
  grpc_slice_buffer_init(&outgoing_);
125
124
  GRPC_CLOSURE_INIT(&on_peer_checked_, &SecurityHandshaker::OnPeerCheckedFn,
126
125
  this, grpc_schedule_on_exec_ctx);
127
126
  }
128
127
 
129
128
  SecurityHandshaker::~SecurityHandshaker() {
130
- gpr_mu_destroy(&mu_);
131
129
  tsi_handshaker_destroy(handshaker_);
132
130
  tsi_handshaker_result_destroy(handshaker_result_);
133
131
  if (endpoint_to_destroy_ != nullptr) {
@@ -69,7 +69,7 @@ static bool g_forced_hash_seed = false;
69
69
 
70
70
  InternedSliceRefcount::~InternedSliceRefcount() {
71
71
  slice_shard* shard = &g_shards[SHARD_IDX(this->hash)];
72
- MutexLock lock(&shard->mu);
72
+ MutexLockForGprMu lock(&shard->mu);
73
73
  InternedSliceRefcount** prev_next;
74
74
  InternedSliceRefcount* cur;
75
75
  for (prev_next = &shard->strs[TABLE_IDX(this->hash, shard->capacity)],
@@ -63,16 +63,15 @@ extern void grpc_register_built_in_plugins(void);
63
63
  #define MAX_PLUGINS 128
64
64
 
65
65
  static gpr_once g_basic_init = GPR_ONCE_INIT;
66
- static gpr_mu g_init_mu;
66
+ static grpc_core::Mutex* g_init_mu;
67
67
  static int g_initializations;
68
- static gpr_cv* g_shutting_down_cv;
68
+ static grpc_core::CondVar* g_shutting_down_cv;
69
69
  static bool g_shutting_down;
70
70
 
71
71
  static void do_basic_init(void) {
72
72
  gpr_log_verbosity_init();
73
- gpr_mu_init(&g_init_mu);
74
- g_shutting_down_cv = static_cast<gpr_cv*>(malloc(sizeof(gpr_cv)));
75
- gpr_cv_init(g_shutting_down_cv);
73
+ g_init_mu = new grpc_core::Mutex();
74
+ g_shutting_down_cv = new grpc_core::CondVar();
76
75
  g_shutting_down = false;
77
76
  grpc_register_built_in_plugins();
78
77
  grpc_cq_global_init();
@@ -130,11 +129,11 @@ void grpc_init(void) {
130
129
  int i;
131
130
  gpr_once_init(&g_basic_init, do_basic_init);
132
131
 
133
- grpc_core::MutexLock lock(&g_init_mu);
132
+ grpc_core::MutexLock lock(g_init_mu);
134
133
  if (++g_initializations == 1) {
135
134
  if (g_shutting_down) {
136
135
  g_shutting_down = false;
137
- gpr_cv_broadcast(g_shutting_down_cv);
136
+ g_shutting_down_cv->SignalAll();
138
137
  }
139
138
  grpc_core::Fork::GlobalInit();
140
139
  grpc_fork_handlers_auto_register();
@@ -196,14 +195,14 @@ void grpc_shutdown_internal_locked(void) {
196
195
  grpc_core::ExecCtx::GlobalShutdown();
197
196
  grpc_core::ApplicationCallbackExecCtx::GlobalShutdown();
198
197
  g_shutting_down = false;
199
- gpr_cv_broadcast(g_shutting_down_cv);
198
+ g_shutting_down_cv->SignalAll();
200
199
  // Absolute last action will be to delete static metadata context.
201
200
  grpc_destroy_static_metadata_ctx();
202
201
  }
203
202
 
204
203
  void grpc_shutdown_internal(void* /*ignored*/) {
205
204
  GRPC_API_TRACE("grpc_shutdown_internal", 0, ());
206
- grpc_core::MutexLock lock(&g_init_mu);
205
+ grpc_core::MutexLock lock(g_init_mu);
207
206
  // We have released lock from the shutdown thread and it is possible that
208
207
  // another grpc_init has been called, and do nothing if that is the case.
209
208
  if (--g_initializations != 0) {
@@ -214,7 +213,7 @@ void grpc_shutdown_internal(void* /*ignored*/) {
214
213
 
215
214
  void grpc_shutdown(void) {
216
215
  GRPC_API_TRACE("grpc_shutdown(void)", 0, ());
217
- grpc_core::MutexLock lock(&g_init_mu);
216
+ grpc_core::MutexLock lock(g_init_mu);
218
217
 
219
218
  if (--g_initializations == 0) {
220
219
  grpc_core::ApplicationCallbackExecCtx* acec =
@@ -243,7 +242,7 @@ void grpc_shutdown(void) {
243
242
 
244
243
  void grpc_shutdown_blocking(void) {
245
244
  GRPC_API_TRACE("grpc_shutdown_blocking(void)", 0, ());
246
- grpc_core::MutexLock lock(&g_init_mu);
245
+ grpc_core::MutexLock lock(g_init_mu);
247
246
  if (--g_initializations == 0) {
248
247
  g_shutting_down = true;
249
248
  grpc_shutdown_internal_locked();
@@ -253,16 +252,15 @@ void grpc_shutdown_blocking(void) {
253
252
  int grpc_is_initialized(void) {
254
253
  int r;
255
254
  gpr_once_init(&g_basic_init, do_basic_init);
256
- grpc_core::MutexLock lock(&g_init_mu);
255
+ grpc_core::MutexLock lock(g_init_mu);
257
256
  r = g_initializations > 0;
258
257
  return r;
259
258
  }
260
259
 
261
260
  void grpc_maybe_wait_for_async_shutdown(void) {
262
261
  gpr_once_init(&g_basic_init, do_basic_init);
263
- grpc_core::MutexLock lock(&g_init_mu);
262
+ grpc_core::MutexLock lock(g_init_mu);
264
263
  while (g_shutting_down) {
265
- gpr_cv_wait(g_shutting_down_cv, &g_init_mu,
266
- gpr_inf_future(GPR_CLOCK_REALTIME));
264
+ g_shutting_down_cv->Wait(g_init_mu);
267
265
  }
268
266
  }
@@ -513,7 +513,7 @@ grpc_resource_user* CreateDefaultResourceUser(const grpc_channel_args* args) {
513
513
  }
514
514
 
515
515
  RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
516
- Server* server, const grpc_channel_args* args) {
516
+ const grpc_channel_args* args) {
517
517
  RefCountedPtr<channelz::ServerNode> channelz_node;
518
518
  if (grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_CHANNELZ,
519
519
  GRPC_ENABLE_CHANNELZ_DEFAULT)) {
@@ -534,7 +534,7 @@ RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
534
534
  Server::Server(const grpc_channel_args* args)
535
535
  : channel_args_(grpc_channel_args_copy(args)),
536
536
  default_resource_user_(CreateDefaultResourceUser(args)),
537
- channelz_node_(CreateChannelzNode(this, args)) {}
537
+ channelz_node_(CreateChannelzNode(args)) {}
538
538
 
539
539
  Server::~Server() {
540
540
  grpc_channel_args_destroy(channel_args_);
@@ -796,7 +796,7 @@ void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
796
796
  {
797
797
  // Wait for startup to be finished. Locks mu_global.
798
798
  MutexLock lock(&mu_global_);
799
- starting_cv_.WaitUntil(&mu_global_, [this] { return !starting_; });
799
+ WaitUntil(&starting_cv_, &mu_global_, [this] { return !starting_; });
800
800
  // Stay locked, and gather up some stuff to do.
801
801
  GPR_ASSERT(grpc_cq_begin_op(cq, tag));
802
802
  if (shutdown_published_) {
@@ -415,12 +415,15 @@ struct grpc_server_config_fetcher {
415
415
  class WatcherInterface {
416
416
  public:
417
417
  virtual ~WatcherInterface() = default;
418
+ // Ownership of \a args is transferred.
418
419
  virtual void UpdateConfig(grpc_channel_args* args) = 0;
419
420
  };
420
421
 
421
422
  virtual ~grpc_server_config_fetcher() = default;
422
423
 
424
+ // Ownership of \a args is transferred.
423
425
  virtual void StartWatch(std::string listening_address,
426
+ grpc_channel_args* args,
424
427
  std::unique_ptr<WatcherInterface> watcher) = 0;
425
428
  virtual void CancelWatch(WatcherInterface* watcher) = 0;
426
429
  virtual grpc_pollset_set* interested_parties() = 0;
@@ -23,6 +23,6 @@
23
23
 
24
24
  #include <grpc/grpc.h>
25
25
 
26
- const char* grpc_version_string(void) { return "14.0.0"; }
26
+ const char* grpc_version_string(void) { return "15.0.0"; }
27
27
 
28
- const char* grpc_g_stands_for(void) { return "gecko"; }
28
+ const char* grpc_g_stands_for(void) { return "gummybear"; }
@@ -252,7 +252,7 @@ void grpc_mdctx_global_shutdown() {
252
252
  if (shard->count != 0) {
253
253
  gpr_log(GPR_ERROR, "WARNING: %" PRIuPTR " metadata elements were leaked",
254
254
  shard->count);
255
- for (int i = 0; i < shard->capacity; i++) {
255
+ for (size_t i = 0; i < shard->capacity; i++) {
256
256
  for (InternedMetadata* md = shard->elems[i].next; md;
257
257
  md = md->bucket_next()) {
258
258
  char* key_str = grpc_slice_to_c_string(md->key());
@@ -596,7 +596,7 @@ static void* set_user_data(UserData* ud, void (*destroy_func)(void*),
596
596
  grpc_core::ReleasableMutexLock lock(&ud->mu_user_data);
597
597
  if (ud->destroy_user_data.Load(grpc_core::MemoryOrder::RELAXED)) {
598
598
  /* user data can only be set once */
599
- lock.Unlock();
599
+ lock.Release();
600
600
  if (destroy_func != nullptr) {
601
601
  destroy_func(data);
602
602
  }
@@ -673,6 +673,10 @@ void grpc_mdelem_do_unref(grpc_mdelem gmd DEBUG_ARGS) {
673
673
 
674
674
  void grpc_mdelem_on_final_unref(grpc_mdelem_data_storage storage, void* ptr,
675
675
  uint32_t hash DEBUG_ARGS) {
676
+ #ifndef NDEBUG
677
+ (void)file;
678
+ (void)line;
679
+ #endif
676
680
  switch (storage) {
677
681
  case GRPC_MDELEM_STORAGE_EXTERNAL:
678
682
  case GRPC_MDELEM_STORAGE_STATIC:
@@ -82,6 +82,10 @@ void grpc_lb_policy_xds_cluster_manager_init(void);
82
82
  void grpc_lb_policy_xds_cluster_manager_shutdown(void);
83
83
  void grpc_resolver_xds_init(void);
84
84
  void grpc_resolver_xds_shutdown(void);
85
+ namespace grpc_core {
86
+ void GoogleCloud2ProdResolverInit();
87
+ void GoogleCloud2ProdResolverShutdown();
88
+ }
85
89
  #endif
86
90
 
87
91
  void grpc_register_built_in_plugins(void) {
@@ -142,5 +146,7 @@ void grpc_register_built_in_plugins(void) {
142
146
  grpc_lb_policy_xds_cluster_manager_shutdown);
143
147
  grpc_register_plugin(grpc_resolver_xds_init,
144
148
  grpc_resolver_xds_shutdown);
149
+ grpc_register_plugin(grpc_core::GoogleCloud2ProdResolverInit,
150
+ grpc_core::GoogleCloud2ProdResolverShutdown);
145
151
  #endif
146
152
  }
@@ -69,9 +69,9 @@ typedef struct alts_grpc_handshaker_client {
69
69
  grpc_closure on_handshaker_service_resp_recv;
70
70
  /* Buffers containing information to be sent (or received) to (or from) the
71
71
  * handshaker service. */
72
- grpc_byte_buffer* send_buffer;
73
- grpc_byte_buffer* recv_buffer;
74
- grpc_status_code status;
72
+ grpc_byte_buffer* send_buffer = nullptr;
73
+ grpc_byte_buffer* recv_buffer = nullptr;
74
+ grpc_status_code status = GRPC_STATUS_OK;
75
75
  /* Initial metadata to be received from handshaker service. */
76
76
  grpc_metadata_array recv_initial_metadata;
77
77
  /* A callback function provided by an application to be invoked when response
@@ -95,15 +95,15 @@ typedef struct alts_grpc_handshaker_client {
95
95
  /** callback for receiving handshake call status */
96
96
  grpc_closure on_status_received;
97
97
  /** gRPC status code of handshake call */
98
- grpc_status_code handshake_status_code;
98
+ grpc_status_code handshake_status_code = GRPC_STATUS_OK;
99
99
  /** gRPC status details of handshake call */
100
100
  grpc_slice handshake_status_details;
101
101
  /* mu synchronizes all fields below including their internal fields. */
102
- gpr_mu mu;
102
+ grpc_core::Mutex mu;
103
103
  /* indicates if the handshaker call's RECV_STATUS_ON_CLIENT op is done. */
104
- bool receive_status_finished;
104
+ bool receive_status_finished = false;
105
105
  /* if non-null, contains arguments to complete a TSI next callback. */
106
- recv_message_result* pending_recv_message_result;
106
+ recv_message_result* pending_recv_message_result = nullptr;
107
107
  /* Maximum frame size used by frame protector. */
108
108
  size_t max_frame_size;
109
109
  } alts_grpc_handshaker_client;
@@ -140,8 +140,7 @@ static void alts_grpc_handshaker_client_unref(
140
140
  grpc_alts_credentials_options_destroy(client->options);
141
141
  gpr_free(client->buffer);
142
142
  grpc_slice_unref_internal(client->handshake_status_details);
143
- gpr_mu_destroy(&client->mu);
144
- gpr_free(client);
143
+ delete client;
145
144
  }
146
145
  }
147
146
 
@@ -695,24 +694,24 @@ alts_handshaker_client* alts_grpc_handshaker_client_create(
695
694
  gpr_log(GPR_ERROR, "Invalid arguments to alts_handshaker_client_create()");
696
695
  return nullptr;
697
696
  }
698
- alts_grpc_handshaker_client* client =
699
- static_cast<alts_grpc_handshaker_client*>(gpr_zalloc(sizeof(*client)));
700
- gpr_mu_init(&client->mu);
697
+ alts_grpc_handshaker_client* client = new alts_grpc_handshaker_client();
698
+ memset(&client->base, 0, sizeof(client->base));
699
+ client->base.vtable =
700
+ vtable_for_testing == nullptr ? &vtable : vtable_for_testing;
701
701
  gpr_ref_init(&client->refs, 1);
702
- client->grpc_caller = grpc_call_start_batch_and_execute;
703
702
  client->handshaker = handshaker;
703
+ client->grpc_caller = grpc_call_start_batch_and_execute;
704
+ grpc_metadata_array_init(&client->recv_initial_metadata);
704
705
  client->cb = cb;
705
706
  client->user_data = user_data;
706
- client->send_buffer = nullptr;
707
- client->recv_buffer = nullptr;
708
707
  client->options = grpc_alts_credentials_options_copy(options);
709
708
  client->target_name = grpc_slice_copy(target_name);
710
- client->recv_bytes = grpc_empty_slice();
711
- grpc_metadata_array_init(&client->recv_initial_metadata);
712
709
  client->is_client = is_client;
713
- client->max_frame_size = max_frame_size;
710
+ client->recv_bytes = grpc_empty_slice();
714
711
  client->buffer_size = TSI_ALTS_INITIAL_BUFFER_SIZE;
715
712
  client->buffer = static_cast<unsigned char*>(gpr_zalloc(client->buffer_size));
713
+ client->handshake_status_details = grpc_empty_slice();
714
+ client->max_frame_size = max_frame_size;
716
715
  grpc_slice slice = grpc_slice_from_copied_string(handshaker_service_url);
717
716
  client->call =
718
717
  strcmp(handshaker_service_url, ALTS_HANDSHAKER_SERVICE_URL_FOR_TESTING) ==
@@ -722,8 +721,6 @@ alts_handshaker_client* alts_grpc_handshaker_client_create(
722
721
  channel, nullptr, GRPC_PROPAGATE_DEFAULTS, interested_parties,
723
722
  grpc_slice_from_static_string(ALTS_SERVICE_METHOD), &slice,
724
723
  GRPC_MILLIS_INF_FUTURE, nullptr);
725
- client->base.vtable =
726
- vtable_for_testing == nullptr ? &vtable : vtable_for_testing;
727
724
  GRPC_CLOSURE_INIT(&client->on_handshaker_service_resp_recv, grpc_cb, client,
728
725
  grpc_schedule_on_exec_ctx);
729
726
  GRPC_CLOSURE_INIT(&client->on_status_received, on_status_received, client,