grpc 1.34.0 → 1.42.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 (1545) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +978 -2868
  3. data/etc/roots.pem +592 -899
  4. data/include/grpc/byte_buffer.h +1 -1
  5. data/include/grpc/byte_buffer_reader.h +1 -1
  6. data/include/grpc/compression.h +1 -1
  7. data/include/grpc/event_engine/README.md +38 -0
  8. data/include/grpc/event_engine/endpoint_config.h +43 -0
  9. data/include/grpc/event_engine/event_engine.h +375 -0
  10. data/include/grpc/event_engine/internal/memory_allocator_impl.h +98 -0
  11. data/include/grpc/event_engine/memory_allocator.h +210 -0
  12. data/include/grpc/event_engine/port.h +39 -0
  13. data/include/grpc/fork.h +1 -1
  14. data/include/grpc/grpc.h +49 -4
  15. data/include/grpc/grpc_posix.h +5 -2
  16. data/include/grpc/grpc_security.h +127 -14
  17. data/include/grpc/grpc_security_constants.h +16 -0
  18. data/include/grpc/impl/codegen/atm.h +5 -3
  19. data/include/grpc/impl/codegen/atm_gcc_atomic.h +2 -0
  20. data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
  21. data/include/grpc/impl/codegen/atm_windows.h +6 -0
  22. data/include/grpc/impl/codegen/byte_buffer.h +3 -1
  23. data/include/grpc/impl/codegen/byte_buffer_reader.h +2 -0
  24. data/include/grpc/impl/codegen/compression_types.h +2 -0
  25. data/include/grpc/impl/codegen/connectivity_state.h +2 -0
  26. data/include/grpc/impl/codegen/fork.h +2 -0
  27. data/include/grpc/impl/codegen/gpr_slice.h +2 -0
  28. data/include/grpc/impl/codegen/gpr_types.h +2 -0
  29. data/include/grpc/impl/codegen/grpc_types.h +49 -25
  30. data/include/grpc/impl/codegen/log.h +2 -2
  31. data/include/grpc/impl/codegen/port_platform.h +81 -22
  32. data/include/grpc/impl/codegen/propagation_bits.h +2 -0
  33. data/include/grpc/impl/codegen/slice.h +2 -0
  34. data/include/grpc/impl/codegen/status.h +2 -0
  35. data/include/grpc/impl/codegen/sync.h +8 -5
  36. data/include/grpc/impl/codegen/sync_abseil.h +2 -0
  37. data/include/grpc/impl/codegen/sync_custom.h +2 -0
  38. data/include/grpc/impl/codegen/sync_generic.h +3 -0
  39. data/include/grpc/impl/codegen/sync_posix.h +4 -2
  40. data/include/grpc/impl/codegen/sync_windows.h +6 -0
  41. data/include/grpc/module.modulemap +14 -14
  42. data/include/grpc/slice.h +1 -1
  43. data/include/grpc/slice_buffer.h +3 -3
  44. data/include/grpc/status.h +1 -1
  45. data/include/grpc/support/atm.h +1 -1
  46. data/include/grpc/support/atm_gcc_atomic.h +1 -1
  47. data/include/grpc/support/atm_gcc_sync.h +1 -1
  48. data/include/grpc/support/atm_windows.h +1 -1
  49. data/include/grpc/support/log.h +1 -1
  50. data/include/grpc/support/port_platform.h +1 -1
  51. data/include/grpc/support/sync.h +4 -4
  52. data/include/grpc/support/sync_abseil.h +1 -1
  53. data/include/grpc/support/sync_custom.h +1 -1
  54. data/include/grpc/support/sync_generic.h +1 -1
  55. data/include/grpc/support/sync_posix.h +1 -1
  56. data/include/grpc/support/sync_windows.h +1 -1
  57. data/include/grpc/support/time.h +9 -9
  58. data/src/core/ext/filters/census/grpc_context.cc +1 -0
  59. data/src/core/ext/filters/client_channel/backend_metric.cc +20 -24
  60. data/src/core/ext/filters/client_channel/backup_poller.cc +5 -4
  61. data/src/core/ext/filters/client_channel/backup_poller.h +1 -0
  62. data/src/core/ext/filters/client_channel/channel_connectivity.cc +158 -202
  63. data/src/core/ext/filters/client_channel/client_channel.cc +2009 -3145
  64. data/src/core/ext/filters/client_channel/client_channel.h +559 -60
  65. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +6 -5
  66. data/src/core/ext/filters/client_channel/client_channel_channelz.h +2 -2
  67. data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -1
  68. data/src/core/ext/filters/client_channel/client_channel_factory.h +18 -19
  69. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +18 -14
  70. data/src/core/ext/filters/client_channel/config_selector.cc +2 -1
  71. data/src/core/ext/filters/client_channel/config_selector.h +33 -9
  72. data/src/core/ext/filters/client_channel/connector.h +19 -19
  73. data/src/core/ext/filters/client_channel/dynamic_filters.cc +190 -0
  74. data/src/core/ext/filters/client_channel/dynamic_filters.h +99 -0
  75. data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +24 -142
  76. data/src/core/ext/filters/client_channel/global_subchannel_pool.h +15 -11
  77. data/src/core/ext/filters/client_channel/health/health_check_client.cc +53 -50
  78. data/src/core/ext/filters/client_channel/health/health_check_client.h +35 -33
  79. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +37 -34
  80. data/src/core/ext/filters/client_channel/http_connect_handshaker.h +10 -2
  81. data/src/core/ext/filters/client_channel/http_proxy.cc +36 -20
  82. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +6 -2
  83. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +12 -21
  84. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +246 -166
  85. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +4 -0
  86. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +1 -1
  87. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -2
  88. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +3 -5
  89. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +2 -2
  90. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -3
  91. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +5 -6
  92. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
  93. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +37 -30
  94. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +53 -55
  95. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +757 -0
  96. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +37 -0
  97. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +2502 -0
  98. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +16 -18
  99. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +3 -3
  100. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +24 -27
  101. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +385 -135
  102. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +0 -8
  103. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +29 -0
  104. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +57 -71
  105. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +43 -64
  106. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +1362 -0
  107. data/src/core/ext/filters/client_channel/lb_policy.cc +6 -17
  108. data/src/core/ext/filters/client_channel/lb_policy.h +93 -93
  109. data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -1
  110. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +8 -11
  111. data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
  112. data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +27 -67
  113. data/src/core/ext/filters/client_channel/local_subchannel_pool.h +10 -9
  114. data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +139 -0
  115. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +76 -88
  116. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -33
  117. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +31 -0
  118. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +10 -9
  119. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +26 -23
  120. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +473 -74
  121. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +27 -2
  122. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc +28 -0
  123. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
  124. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +45 -35
  125. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +43 -46
  126. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -5
  127. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +384 -0
  128. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +22 -35
  129. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +466 -254
  130. data/src/core/ext/filters/client_channel/resolver.cc +5 -5
  131. data/src/core/ext/filters/client_channel/resolver.h +4 -15
  132. data/src/core/ext/filters/client_channel/resolver_factory.h +8 -6
  133. data/src/core/ext/filters/client_channel/resolver_registry.cc +43 -44
  134. data/src/core/ext/filters/client_channel/resolver_registry.h +2 -2
  135. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +42 -252
  136. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +25 -54
  137. data/src/core/ext/filters/client_channel/retry_filter.cc +2573 -0
  138. data/src/core/ext/filters/{workarounds/workaround_cronet_compression_filter.h → client_channel/retry_filter.h} +9 -6
  139. data/src/core/ext/filters/client_channel/retry_service_config.cc +316 -0
  140. data/src/core/ext/filters/client_channel/retry_service_config.h +96 -0
  141. data/src/core/ext/filters/client_channel/retry_throttle.cc +20 -49
  142. data/src/core/ext/filters/client_channel/retry_throttle.h +3 -1
  143. data/src/core/ext/filters/client_channel/server_address.cc +10 -1
  144. data/src/core/ext/filters/client_channel/server_address.h +31 -0
  145. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +54 -40
  146. data/src/core/ext/filters/client_channel/subchannel.cc +179 -329
  147. data/src/core/ext/filters/client_channel/subchannel.h +101 -158
  148. data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +38 -9
  149. data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +21 -10
  150. data/src/core/ext/filters/client_idle/client_idle_filter.cc +47 -223
  151. data/src/core/ext/filters/client_idle/idle_filter_state.cc +96 -0
  152. data/src/core/ext/filters/client_idle/idle_filter_state.h +66 -0
  153. data/src/core/ext/filters/deadline/deadline_filter.cc +33 -34
  154. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +503 -0
  155. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +39 -0
  156. data/src/core/ext/filters/fault_injection/service_config_parser.cc +181 -0
  157. data/src/core/ext/filters/fault_injection/service_config_parser.h +85 -0
  158. data/src/core/ext/filters/http/client/http_client_filter.cc +77 -69
  159. data/src/core/ext/filters/http/client_authority_filter.cc +19 -19
  160. data/src/core/ext/filters/http/http_filters_plugin.cc +53 -68
  161. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +42 -35
  162. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +29 -30
  163. data/src/core/ext/filters/http/server/http_server_filter.cc +104 -95
  164. data/src/core/ext/filters/max_age/max_age_filter.cc +71 -68
  165. data/src/core/ext/filters/message_size/message_size_filter.cc +43 -41
  166. data/src/core/ext/filters/message_size/message_size_filter.h +2 -2
  167. data/src/core/ext/{filters/client_channel → service_config}/service_config.cc +17 -16
  168. data/src/core/ext/{filters/client_channel → service_config}/service_config.h +11 -10
  169. data/src/core/ext/{filters/client_channel → service_config}/service_config_call_data.h +23 -19
  170. data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.cc +9 -9
  171. data/src/core/ext/{filters/client_channel → service_config}/service_config_parser.h +15 -10
  172. data/src/core/ext/transport/chttp2/alpn/alpn.cc +2 -1
  173. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +37 -23
  174. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +9 -7
  175. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +42 -35
  176. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +32 -16
  177. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +51 -62
  178. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +664 -236
  179. data/src/core/ext/transport/chttp2/server/chttp2_server.h +11 -2
  180. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +13 -5
  181. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +25 -11
  182. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +61 -22
  183. data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +4 -2
  184. data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -1
  185. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -0
  186. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +264 -223
  187. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +16 -2
  188. data/src/core/ext/transport/chttp2/transport/context_list.cc +4 -5
  189. data/src/core/ext/transport/chttp2/transport/context_list.h +5 -6
  190. data/src/core/ext/transport/chttp2/transport/flow_control.cc +59 -40
  191. data/src/core/ext/transport/chttp2/transport/flow_control.h +23 -17
  192. data/src/core/ext/transport/chttp2/transport/frame_data.cc +28 -24
  193. data/src/core/ext/transport/chttp2/transport/frame_data.h +11 -10
  194. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +21 -20
  195. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +7 -6
  196. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +13 -13
  197. data/src/core/ext/transport/chttp2/transport/frame_ping.h +8 -6
  198. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +12 -15
  199. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +7 -6
  200. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +49 -17
  201. data/src/core/ext/transport/chttp2/transport/frame_settings.h +9 -7
  202. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +22 -19
  203. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +5 -6
  204. data/src/core/ext/transport/chttp2/transport/hpack_constants.h +41 -0
  205. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +311 -665
  206. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +240 -70
  207. data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +107 -0
  208. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +86 -0
  209. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +69 -0
  210. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +865 -1172
  211. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +100 -81
  212. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +146 -0
  213. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +137 -0
  214. data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +46 -0
  215. data/src/core/{lib/transport/authority_override.h → ext/transport/chttp2/transport/hpack_utils.h} +8 -12
  216. data/src/core/ext/transport/chttp2/transport/internal.h +40 -33
  217. data/src/core/ext/transport/chttp2/transport/parsing.cc +156 -286
  218. data/src/core/ext/transport/chttp2/transport/popularity_count.h +60 -0
  219. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +2 -2
  220. data/src/core/ext/transport/chttp2/transport/varint.cc +13 -7
  221. data/src/core/ext/transport/chttp2/transport/varint.h +39 -28
  222. data/src/core/ext/transport/chttp2/transport/writing.cc +69 -54
  223. data/src/core/ext/transport/inproc/inproc_transport.cc +204 -160
  224. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +406 -0
  225. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +1591 -0
  226. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +1 -1
  227. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +2 -1
  228. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +3 -3
  229. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +15 -2
  230. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +48 -49
  231. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +245 -56
  232. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +371 -0
  233. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1554 -0
  234. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +16 -16
  235. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +66 -21
  236. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +178 -142
  237. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +795 -314
  238. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +4 -4
  239. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +21 -7
  240. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +25 -24
  241. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +70 -23
  242. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +29 -29
  243. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +138 -47
  244. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +5 -5
  245. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +23 -8
  246. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +147 -75
  247. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +522 -96
  248. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +27 -27
  249. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +116 -49
  250. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +3 -3
  251. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +15 -2
  252. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +9 -9
  253. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +42 -14
  254. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +63 -63
  255. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +228 -63
  256. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +57 -56
  257. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +244 -98
  258. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +5 -5
  259. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +25 -11
  260. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +125 -57
  261. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +533 -89
  262. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +3 -4
  263. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +15 -2
  264. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +46 -0
  265. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +133 -0
  266. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +8 -8
  267. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +17 -4
  268. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +15 -8
  269. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +56 -9
  270. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +35 -0
  271. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +96 -0
  272. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +16 -17
  273. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +81 -40
  274. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +56 -22
  275. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +223 -34
  276. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +32 -32
  277. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +137 -72
  278. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +3 -3
  279. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +19 -5
  280. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +48 -38
  281. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +276 -103
  282. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +51 -45
  283. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +203 -62
  284. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +48 -0
  285. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +177 -0
  286. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +10 -9
  287. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +55 -22
  288. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +144 -0
  289. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +536 -0
  290. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +153 -0
  291. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +550 -0
  292. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +51 -44
  293. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +165 -43
  294. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +35 -16
  295. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +148 -40
  296. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +339 -279
  297. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +1466 -543
  298. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +10 -10
  299. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +48 -10
  300. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +6 -7
  301. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +32 -6
  302. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +29 -0
  303. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +73 -0
  304. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +79 -0
  305. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +298 -0
  306. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +79 -0
  307. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +303 -0
  308. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +42 -0
  309. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +123 -0
  310. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +151 -112
  311. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +693 -244
  312. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +1 -2
  313. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +2 -1
  314. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +52 -32
  315. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +231 -59
  316. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +15 -18
  317. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +51 -28
  318. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +45 -44
  319. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +178 -74
  320. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +2 -2
  321. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +15 -2
  322. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +2 -2
  323. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +15 -2
  324. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +58 -51
  325. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +221 -135
  326. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +2 -5
  327. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +15 -2
  328. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +2 -5
  329. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +15 -2
  330. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +9 -10
  331. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +46 -19
  332. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +2 -4
  333. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +15 -2
  334. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +2 -2
  335. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +15 -2
  336. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +121 -0
  337. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +468 -0
  338. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +60 -0
  339. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +205 -0
  340. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +9 -8
  341. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +44 -14
  342. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +36 -0
  343. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +96 -0
  344. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +4 -4
  345. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +15 -2
  346. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +3 -3
  347. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +15 -2
  348. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +10 -9
  349. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +51 -12
  350. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +10 -11
  351. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +31 -6
  352. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +46 -0
  353. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +136 -0
  354. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +11 -11
  355. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +41 -4
  356. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +15 -15
  357. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +96 -11
  358. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +19 -19
  359. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +77 -14
  360. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +1 -1
  361. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +2 -1
  362. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +6 -6
  363. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +30 -5
  364. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +10 -10
  365. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +41 -4
  366. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +5 -5
  367. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +15 -2
  368. data/src/core/ext/upb-generated/google/api/annotations.upb.c +1 -1
  369. data/src/core/ext/upb-generated/google/api/annotations.upb.h +2 -1
  370. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +62 -62
  371. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +227 -84
  372. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +86 -69
  373. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +256 -72
  374. data/src/core/ext/upb-generated/google/api/http.upb.c +18 -18
  375. data/src/core/ext/upb-generated/google/api/http.upb.h +47 -10
  376. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +4 -4
  377. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +15 -2
  378. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +154 -154
  379. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +645 -320
  380. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +4 -4
  381. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +15 -2
  382. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +2 -2
  383. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +15 -2
  384. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +15 -15
  385. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +44 -7
  386. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +4 -4
  387. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +15 -2
  388. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +19 -19
  389. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +119 -10
  390. data/src/core/ext/upb-generated/google/rpc/status.upb.c +5 -5
  391. data/src/core/ext/upb-generated/google/rpc/status.upb.h +18 -5
  392. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +12 -12
  393. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +19 -5
  394. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +63 -63
  395. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +220 -87
  396. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +8 -8
  397. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +36 -9
  398. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +5 -5
  399. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +28 -3
  400. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +31 -31
  401. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +146 -35
  402. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +55 -0
  403. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +154 -0
  404. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +8 -8
  405. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +41 -4
  406. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +4 -6
  407. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +15 -2
  408. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +1 -1
  409. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +2 -1
  410. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +4 -4
  411. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +17 -4
  412. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +3 -3
  413. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +15 -2
  414. data/src/core/ext/upb-generated/validate/validate.upb.c +243 -227
  415. data/src/core/ext/upb-generated/validate/validate.upb.h +626 -253
  416. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +58 -0
  417. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +182 -0
  418. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +28 -0
  419. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +66 -0
  420. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +52 -0
  421. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +155 -0
  422. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +42 -0
  423. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +90 -0
  424. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +36 -0
  425. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +100 -0
  426. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +54 -0
  427. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +178 -0
  428. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +36 -0
  429. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +91 -0
  430. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +58 -0
  431. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +130 -0
  432. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +33 -0
  433. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +83 -0
  434. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +354 -0
  435. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +140 -0
  436. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +15 -7
  437. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +168 -170
  438. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +424 -0
  439. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +120 -0
  440. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +467 -429
  441. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +12 -2
  442. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +12 -9
  443. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +156 -109
  444. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +25 -0
  445. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +89 -88
  446. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +156 -153
  447. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +240 -168
  448. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +20 -0
  449. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +4 -7
  450. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +59 -0
  451. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +40 -0
  452. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +37 -20
  453. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +52 -0
  454. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +35 -0
  455. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +56 -59
  456. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +90 -63
  457. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +10 -0
  458. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +137 -122
  459. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +5 -0
  460. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +136 -120
  461. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +90 -0
  462. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +35 -0
  463. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +31 -26
  464. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +141 -0
  465. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +70 -0
  466. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +152 -0
  467. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +75 -0
  468. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +69 -51
  469. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
  470. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +748 -681
  471. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +15 -0
  472. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +22 -25
  473. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +51 -0
  474. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +35 -0
  475. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +102 -0
  476. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +55 -0
  477. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +123 -0
  478. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +45 -0
  479. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +79 -0
  480. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +35 -0
  481. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +435 -379
  482. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +10 -0
  483. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +12 -16
  484. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +121 -91
  485. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +5 -0
  486. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +45 -53
  487. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +182 -180
  488. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +92 -102
  489. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +5 -0
  490. data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +32 -42
  491. data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +30 -40
  492. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +4 -7
  493. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +38 -44
  494. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +163 -0
  495. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +55 -0
  496. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +64 -0
  497. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +50 -0
  498. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +14 -13
  499. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +56 -0
  500. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +35 -0
  501. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +35 -32
  502. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +30 -33
  503. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +63 -0
  504. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +40 -0
  505. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +8 -7
  506. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +100 -100
  507. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +9 -8
  508. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +8 -8
  509. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +8 -8
  510. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +9 -8
  511. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +8 -8
  512. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +4 -4
  513. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +5 -4
  514. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +19 -23
  515. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +4 -3
  516. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +5 -3
  517. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +5 -4
  518. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +182 -157
  519. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +75 -0
  520. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +50 -0
  521. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +43 -0
  522. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +35 -0
  523. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +63 -0
  524. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +40 -0
  525. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +46 -0
  526. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +40 -0
  527. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +50 -0
  528. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +35 -0
  529. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +68 -0
  530. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +40 -0
  531. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +51 -0
  532. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +35 -0
  533. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +45 -0
  534. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +35 -0
  535. data/src/core/ext/xds/certificate_provider_factory.h +1 -1
  536. data/src/core/ext/xds/certificate_provider_registry.cc +2 -2
  537. data/src/core/ext/xds/certificate_provider_store.cc +10 -7
  538. data/src/core/ext/xds/certificate_provider_store.h +15 -10
  539. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +28 -3
  540. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +3 -6
  541. data/src/core/ext/xds/xds_api.cc +2654 -808
  542. data/src/core/ext/xds/xds_api.h +460 -154
  543. data/src/core/ext/xds/xds_bootstrap.cc +139 -188
  544. data/src/core/ext/xds/xds_bootstrap.h +34 -18
  545. data/src/core/ext/xds/xds_certificate_provider.cc +237 -72
  546. data/src/core/ext/xds/xds_certificate_provider.h +104 -27
  547. data/src/core/ext/xds/xds_channel_args.h +5 -2
  548. data/src/core/ext/xds/xds_channel_stack_modifier.cc +113 -0
  549. data/src/core/ext/xds/xds_channel_stack_modifier.h +52 -0
  550. data/src/core/ext/xds/xds_client.cc +985 -429
  551. data/src/core/ext/xds/xds_client.h +100 -51
  552. data/src/core/ext/xds/xds_client_stats.cc +18 -16
  553. data/src/core/ext/xds/xds_client_stats.h +12 -11
  554. data/src/core/ext/xds/xds_http_fault_filter.cc +227 -0
  555. data/src/core/ext/xds/xds_http_fault_filter.h +64 -0
  556. data/src/core/ext/xds/xds_http_filters.cc +116 -0
  557. data/src/core/ext/xds/xds_http_filters.h +133 -0
  558. data/src/core/ext/xds/xds_server_config_fetcher.cc +544 -0
  559. data/src/core/lib/{iomgr → address_utils}/parse_address.cc +72 -68
  560. data/src/core/lib/{iomgr → address_utils}/parse_address.h +20 -16
  561. data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.cc +131 -15
  562. data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.h +37 -7
  563. data/src/core/lib/avl/avl.cc +5 -5
  564. data/src/core/lib/backoff/backoff.cc +1 -1
  565. data/src/core/lib/channel/call_tracer.h +85 -0
  566. data/src/core/lib/channel/channel_args.cc +34 -15
  567. data/src/core/lib/channel/channel_args.h +9 -0
  568. data/src/core/lib/channel/channel_stack.cc +27 -12
  569. data/src/core/lib/channel/channel_stack.h +18 -10
  570. data/src/core/lib/channel/channel_stack_builder.cc +6 -16
  571. data/src/core/lib/channel/channel_stack_builder.h +1 -9
  572. data/src/core/lib/channel/channel_trace.cc +5 -4
  573. data/src/core/lib/channel/channel_trace.h +3 -2
  574. data/src/core/lib/channel/channelz.cc +162 -63
  575. data/src/core/lib/channel/channelz.h +62 -31
  576. data/src/core/lib/channel/channelz_registry.cc +22 -7
  577. data/src/core/lib/channel/channelz_registry.h +1 -2
  578. data/src/core/lib/channel/connected_channel.cc +6 -7
  579. data/src/core/lib/channel/connected_channel.h +1 -2
  580. data/src/core/lib/channel/context.h +3 -0
  581. data/src/core/lib/channel/handshaker.cc +13 -53
  582. data/src/core/lib/channel/handshaker.h +7 -25
  583. data/src/core/lib/channel/handshaker_factory.h +10 -2
  584. data/src/core/lib/channel/handshaker_registry.cc +15 -70
  585. data/src/core/lib/channel/handshaker_registry.h +29 -12
  586. data/src/core/lib/channel/status_util.cc +12 -2
  587. data/src/core/lib/channel/status_util.h +11 -2
  588. data/src/core/lib/compression/algorithm_metadata.h +1 -0
  589. data/src/core/lib/compression/compression.cc +2 -2
  590. data/src/core/lib/compression/compression_args.cc +11 -7
  591. data/src/core/lib/compression/compression_internal.cc +4 -6
  592. data/src/core/lib/compression/compression_internal.h +1 -1
  593. data/src/core/lib/compression/message_compress.cc +2 -2
  594. data/src/core/lib/compression/stream_compression.cc +2 -1
  595. data/src/core/lib/compression/stream_compression.h +3 -2
  596. data/src/core/lib/compression/stream_compression_gzip.cc +2 -1
  597. data/src/core/lib/compression/stream_compression_gzip.h +1 -1
  598. data/src/core/lib/compression/stream_compression_identity.cc +2 -1
  599. data/src/core/lib/compression/stream_compression_identity.h +1 -1
  600. data/src/core/lib/config/core_configuration.cc +96 -0
  601. data/src/core/lib/config/core_configuration.h +146 -0
  602. data/src/core/lib/debug/stats.cc +1 -1
  603. data/src/core/lib/debug/stats.h +4 -3
  604. data/src/core/lib/debug/stats_data.cc +15 -14
  605. data/src/core/lib/debug/stats_data.h +14 -13
  606. data/src/core/lib/debug/trace.cc +1 -0
  607. data/src/core/lib/debug/trace.h +2 -1
  608. data/src/core/lib/event_engine/endpoint_config.cc +45 -0
  609. data/src/core/lib/event_engine/endpoint_config_internal.h +42 -0
  610. data/src/core/lib/event_engine/event_engine.cc +50 -0
  611. data/src/core/lib/event_engine/sockaddr.cc +40 -0
  612. data/src/core/lib/event_engine/sockaddr.h +44 -0
  613. data/src/core/lib/gpr/alloc.cc +7 -5
  614. data/src/core/lib/gpr/atm.cc +1 -1
  615. data/src/core/lib/gpr/cpu_posix.cc +1 -1
  616. data/src/core/lib/gpr/env_linux.cc +1 -2
  617. data/src/core/lib/gpr/env_posix.cc +2 -3
  618. data/src/core/lib/gpr/log.cc +61 -19
  619. data/src/core/lib/gpr/log_android.cc +3 -2
  620. data/src/core/lib/gpr/log_linux.cc +10 -5
  621. data/src/core/lib/gpr/log_posix.cc +9 -4
  622. data/src/core/lib/gpr/log_windows.cc +3 -1
  623. data/src/core/lib/gpr/murmur_hash.cc +4 -2
  624. data/src/core/lib/gpr/spinlock.h +10 -2
  625. data/src/core/lib/gpr/string.cc +24 -23
  626. data/src/core/lib/gpr/string.h +7 -8
  627. data/src/core/lib/gpr/sync.cc +6 -6
  628. data/src/core/lib/gpr/sync_abseil.cc +10 -12
  629. data/src/core/lib/gpr/sync_posix.cc +3 -3
  630. data/src/core/lib/gpr/sync_windows.cc +2 -2
  631. data/src/core/lib/gpr/time.cc +15 -14
  632. data/src/core/lib/gpr/time_windows.cc +3 -2
  633. data/src/core/lib/gpr/tls.h +119 -40
  634. data/src/core/lib/gpr/tmpfile_posix.cc +1 -2
  635. data/src/core/lib/gpr/useful.h +79 -32
  636. data/src/core/lib/gpr/wrap_memcpy.cc +2 -1
  637. data/src/core/lib/gprpp/arena.cc +2 -1
  638. data/src/core/lib/gprpp/arena.h +18 -7
  639. data/src/core/lib/gprpp/atomic_utils.h +47 -0
  640. data/src/core/lib/gprpp/bitset.h +188 -0
  641. data/src/core/lib/gprpp/chunked_vector.h +211 -0
  642. data/src/core/lib/gprpp/construct_destruct.h +39 -0
  643. data/src/core/lib/gprpp/dual_ref_counted.h +28 -29
  644. data/src/core/lib/gprpp/fork.cc +14 -12
  645. data/src/core/lib/gprpp/fork.h +4 -4
  646. data/src/core/lib/gprpp/global_config.h +1 -2
  647. data/src/core/lib/gprpp/global_config_env.cc +7 -7
  648. data/src/core/lib/gprpp/global_config_generic.h +2 -2
  649. data/src/core/lib/gprpp/manual_constructor.h +9 -6
  650. data/src/core/lib/gprpp/match.h +73 -0
  651. data/src/core/lib/gprpp/memory.h +9 -3
  652. data/src/core/lib/gprpp/mpscq.cc +9 -9
  653. data/src/core/lib/gprpp/mpscq.h +6 -5
  654. data/src/core/lib/gprpp/orphanable.h +6 -6
  655. data/src/core/lib/gprpp/overload.h +59 -0
  656. data/src/core/lib/gprpp/ref_counted.h +48 -34
  657. data/src/core/lib/gprpp/ref_counted_ptr.h +11 -1
  658. data/src/core/lib/gprpp/status_helper.cc +427 -0
  659. data/src/core/lib/gprpp/status_helper.h +194 -0
  660. data/src/core/lib/gprpp/sync.h +106 -43
  661. data/src/core/lib/gprpp/table.h +411 -0
  662. data/src/core/lib/gprpp/thd.h +1 -1
  663. data/src/core/lib/gprpp/thd_posix.cc +11 -6
  664. data/src/core/lib/gprpp/thd_windows.cc +7 -12
  665. data/src/core/lib/gprpp/time_util.cc +77 -0
  666. data/src/core/lib/gprpp/time_util.h +42 -0
  667. data/src/core/lib/http/format_request.cc +1 -0
  668. data/src/core/lib/http/format_request.h +1 -0
  669. data/src/core/lib/http/httpcli.cc +203 -185
  670. data/src/core/lib/http/httpcli.h +5 -3
  671. data/src/core/lib/http/httpcli_security_connector.cc +19 -18
  672. data/src/core/lib/http/parser.cc +19 -20
  673. data/src/core/lib/http/parser.h +5 -4
  674. data/src/core/lib/iomgr/buffer_list.cc +10 -11
  675. data/src/core/lib/iomgr/buffer_list.h +6 -8
  676. data/src/core/lib/iomgr/call_combiner.cc +46 -21
  677. data/src/core/lib/iomgr/call_combiner.h +12 -14
  678. data/src/core/lib/iomgr/cfstream_handle.cc +6 -6
  679. data/src/core/lib/iomgr/cfstream_handle.h +1 -1
  680. data/src/core/lib/iomgr/closure.h +7 -6
  681. data/src/core/lib/iomgr/combiner.cc +25 -36
  682. data/src/core/lib/iomgr/combiner.h +3 -2
  683. data/src/core/lib/iomgr/dualstack_socket_posix.cc +1 -0
  684. data/src/core/lib/iomgr/endpoint.cc +1 -5
  685. data/src/core/lib/iomgr/endpoint.h +3 -5
  686. data/src/core/lib/iomgr/endpoint_cfstream.cc +27 -39
  687. data/src/core/lib/iomgr/endpoint_cfstream.h +1 -1
  688. data/src/core/lib/iomgr/endpoint_pair.h +1 -0
  689. data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +32 -0
  690. data/src/core/lib/iomgr/endpoint_pair_posix.cc +15 -11
  691. data/src/core/lib/iomgr/endpoint_pair_windows.cc +17 -9
  692. data/src/core/lib/iomgr/error.cc +277 -105
  693. data/src/core/lib/iomgr/error.h +280 -114
  694. data/src/core/lib/iomgr/error_cfstream.cc +10 -4
  695. data/src/core/lib/iomgr/error_cfstream.h +2 -2
  696. data/src/core/lib/iomgr/error_internal.h +7 -2
  697. data/src/core/lib/iomgr/ev_apple.cc +16 -13
  698. data/src/core/lib/iomgr/ev_apple.h +1 -1
  699. data/src/core/lib/iomgr/ev_epoll1_linux.cc +53 -53
  700. data/src/core/lib/iomgr/ev_epollex_linux.cc +81 -81
  701. data/src/core/lib/iomgr/ev_poll_posix.cc +70 -68
  702. data/src/core/lib/iomgr/ev_posix.cc +13 -13
  703. data/src/core/lib/iomgr/ev_posix.h +9 -9
  704. data/src/core/lib/iomgr/event_engine/closure.cc +77 -0
  705. data/src/core/lib/iomgr/event_engine/closure.h +42 -0
  706. data/src/core/lib/iomgr/event_engine/endpoint.cc +173 -0
  707. data/src/core/lib/iomgr/event_engine/endpoint.h +52 -0
  708. data/src/core/lib/iomgr/event_engine/iomgr.cc +104 -0
  709. data/src/core/lib/iomgr/event_engine/iomgr.h +42 -0
  710. data/src/core/lib/iomgr/event_engine/pollset.cc +88 -0
  711. data/src/core/lib/iomgr/event_engine/pollset.h +25 -0
  712. data/src/core/lib/iomgr/event_engine/promise.h +51 -0
  713. data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +41 -0
  714. data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +35 -0
  715. data/src/core/lib/iomgr/event_engine/resolver.cc +114 -0
  716. data/src/core/lib/iomgr/event_engine/tcp.cc +293 -0
  717. data/src/core/lib/iomgr/event_engine/timer.cc +62 -0
  718. data/src/core/lib/iomgr/exec_ctx.cc +14 -11
  719. data/src/core/lib/iomgr/exec_ctx.h +21 -28
  720. data/src/core/lib/iomgr/executor/mpmcqueue.cc +15 -16
  721. data/src/core/lib/iomgr/executor/mpmcqueue.h +7 -11
  722. data/src/core/lib/iomgr/executor/threadpool.cc +4 -5
  723. data/src/core/lib/iomgr/executor/threadpool.h +5 -4
  724. data/src/core/lib/iomgr/executor.cc +19 -33
  725. data/src/core/lib/iomgr/executor.h +3 -3
  726. data/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc +2 -2
  727. data/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc +2 -2
  728. data/src/core/lib/iomgr/internal_errqueue.cc +3 -2
  729. data/src/core/lib/iomgr/iocp_windows.cc +1 -0
  730. data/src/core/lib/iomgr/iomgr.cc +6 -4
  731. data/src/core/lib/iomgr/iomgr.h +3 -3
  732. data/src/core/lib/iomgr/iomgr_custom.cc +3 -3
  733. data/src/core/lib/iomgr/iomgr_custom.h +2 -2
  734. data/src/core/lib/iomgr/iomgr_internal.cc +8 -12
  735. data/src/core/lib/iomgr/iomgr_internal.h +6 -5
  736. data/src/core/lib/iomgr/iomgr_posix.cc +3 -2
  737. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +42 -13
  738. data/src/core/lib/iomgr/iomgr_windows.cc +2 -3
  739. data/src/core/lib/iomgr/is_epollexclusive_available.cc +4 -4
  740. data/src/core/lib/iomgr/load_file.cc +6 -6
  741. data/src/core/lib/iomgr/load_file.h +2 -2
  742. data/src/core/lib/iomgr/lockfree_event.cc +38 -15
  743. data/src/core/lib/iomgr/lockfree_event.h +2 -2
  744. data/src/core/lib/iomgr/polling_entity.cc +2 -2
  745. data/src/core/lib/iomgr/pollset.cc +5 -5
  746. data/src/core/lib/iomgr/pollset.h +9 -9
  747. data/src/core/lib/iomgr/pollset_custom.cc +10 -11
  748. data/src/core/lib/iomgr/pollset_custom.h +3 -1
  749. data/src/core/lib/iomgr/pollset_set_custom.cc +2 -3
  750. data/src/core/lib/iomgr/pollset_set_windows.cc +1 -0
  751. data/src/core/lib/iomgr/pollset_windows.cc +5 -5
  752. data/src/core/lib/iomgr/port.h +7 -10
  753. data/src/core/lib/iomgr/python_util.h +4 -3
  754. data/src/core/lib/iomgr/resolve_address.cc +14 -9
  755. data/src/core/lib/iomgr/resolve_address.h +12 -10
  756. data/src/core/lib/iomgr/resolve_address_custom.cc +14 -13
  757. data/src/core/lib/iomgr/resolve_address_custom.h +3 -4
  758. data/src/core/lib/iomgr/resolve_address_posix.cc +10 -14
  759. data/src/core/lib/iomgr/resolve_address_windows.cc +10 -12
  760. data/src/core/lib/iomgr/resource_quota.cc +152 -62
  761. data/src/core/lib/iomgr/resource_quota.h +66 -17
  762. data/src/core/lib/iomgr/sockaddr.h +2 -1
  763. data/src/core/lib/iomgr/socket_factory_posix.cc +8 -7
  764. data/src/core/lib/iomgr/socket_factory_posix.h +1 -0
  765. data/src/core/lib/iomgr/socket_mutator.cc +20 -6
  766. data/src/core/lib/iomgr/socket_mutator.h +27 -3
  767. data/src/core/lib/iomgr/socket_utils_common_posix.cc +29 -27
  768. data/src/core/lib/iomgr/socket_utils_linux.cc +4 -4
  769. data/src/core/lib/iomgr/socket_utils_posix.cc +2 -2
  770. data/src/core/lib/iomgr/socket_utils_posix.h +22 -22
  771. data/src/core/lib/iomgr/socket_utils_windows.cc +2 -2
  772. data/src/core/lib/iomgr/tcp_client.cc +5 -3
  773. data/src/core/lib/iomgr/tcp_client.h +4 -0
  774. data/src/core/lib/iomgr/tcp_client_cfstream.cc +18 -26
  775. data/src/core/lib/iomgr/tcp_client_custom.cc +19 -27
  776. data/src/core/lib/iomgr/tcp_client_posix.cc +56 -47
  777. data/src/core/lib/iomgr/tcp_client_posix.h +8 -6
  778. data/src/core/lib/iomgr/tcp_client_windows.cc +23 -14
  779. data/src/core/lib/iomgr/tcp_custom.cc +46 -55
  780. data/src/core/lib/iomgr/tcp_custom.h +15 -13
  781. data/src/core/lib/iomgr/tcp_posix.cc +119 -145
  782. data/src/core/lib/iomgr/tcp_posix.h +19 -12
  783. data/src/core/lib/iomgr/tcp_server.cc +9 -7
  784. data/src/core/lib/iomgr/tcp_server.h +18 -14
  785. data/src/core/lib/iomgr/tcp_server_custom.cc +63 -73
  786. data/src/core/lib/iomgr/tcp_server_posix.cc +49 -35
  787. data/src/core/lib/iomgr/tcp_server_utils_posix.h +16 -12
  788. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +22 -20
  789. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +11 -12
  790. data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +4 -4
  791. data/src/core/lib/iomgr/tcp_server_windows.cc +40 -36
  792. data/src/core/lib/iomgr/tcp_windows.cc +21 -40
  793. data/src/core/lib/iomgr/tcp_windows.h +4 -3
  794. data/src/core/lib/iomgr/timer.cc +1 -0
  795. data/src/core/lib/iomgr/timer.h +7 -3
  796. data/src/core/lib/iomgr/timer_custom.cc +7 -6
  797. data/src/core/lib/iomgr/timer_custom.h +1 -1
  798. data/src/core/lib/iomgr/timer_generic.cc +32 -62
  799. data/src/core/lib/iomgr/timer_generic.h +1 -0
  800. data/src/core/lib/iomgr/timer_heap.cc +2 -3
  801. data/src/core/lib/iomgr/timer_manager.cc +4 -4
  802. data/src/core/lib/iomgr/unix_sockets_posix.cc +21 -24
  803. data/src/core/lib/iomgr/unix_sockets_posix.h +4 -5
  804. data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +10 -7
  805. data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +3 -3
  806. data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +2 -1
  807. data/src/core/lib/iomgr/wakeup_fd_pipe.cc +6 -7
  808. data/src/core/lib/iomgr/wakeup_fd_posix.cc +4 -3
  809. data/src/core/lib/iomgr/wakeup_fd_posix.h +8 -6
  810. data/src/core/lib/iomgr/work_serializer.cc +4 -4
  811. data/src/core/lib/iomgr/work_serializer.h +18 -2
  812. data/src/core/lib/json/json.h +11 -1
  813. data/src/core/lib/json/json_reader.cc +14 -23
  814. data/src/core/lib/json/json_util.cc +68 -0
  815. data/src/core/lib/json/json_util.h +65 -115
  816. data/src/core/lib/json/json_writer.cc +0 -3
  817. data/src/core/lib/matchers/matchers.cc +327 -0
  818. data/src/core/lib/matchers/matchers.h +160 -0
  819. data/src/core/lib/profiling/basic_timers.cc +8 -6
  820. data/src/core/lib/profiling/stap_timers.cc +2 -2
  821. data/src/core/lib/security/authorization/authorization_engine.h +13 -53
  822. data/src/core/lib/security/authorization/authorization_policy_provider.h +33 -0
  823. data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +46 -0
  824. data/src/core/lib/security/authorization/evaluate_args.cc +126 -66
  825. data/src/core/lib/security/authorization/evaluate_args.h +47 -15
  826. data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +171 -0
  827. data/src/core/lib/security/authorization/sdk_server_authz_filter.h +67 -0
  828. data/src/core/lib/security/context/security_context.cc +15 -11
  829. data/src/core/lib/security/credentials/alts/alts_credentials.cc +2 -1
  830. data/src/core/lib/security/credentials/alts/alts_credentials.h +1 -1
  831. data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
  832. data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +2 -2
  833. data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +2 -2
  834. data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +2 -2
  835. data/src/core/lib/security/credentials/composite/composite_credentials.cc +9 -8
  836. data/src/core/lib/security/credentials/composite/composite_credentials.h +2 -2
  837. data/src/core/lib/security/credentials/credentials.cc +16 -14
  838. data/src/core/lib/security/credentials/credentials.h +11 -5
  839. data/src/core/lib/security/credentials/credentials_metadata.cc +2 -3
  840. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +404 -0
  841. data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +81 -0
  842. data/src/core/lib/security/credentials/external/aws_request_signer.cc +20 -14
  843. data/src/core/lib/security/credentials/external/aws_request_signer.h +2 -3
  844. data/src/core/lib/security/credentials/external/external_account_credentials.cc +270 -54
  845. data/src/core/lib/security/credentials/external/external_account_credentials.h +16 -12
  846. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +8 -8
  847. data/src/core/lib/security/credentials/external/file_external_account_credentials.h +6 -6
  848. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +26 -26
  849. data/src/core/lib/security/credentials/external/url_external_account_credentials.h +13 -12
  850. data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -4
  851. data/src/core/lib/security/credentials/fake/fake_credentials.h +2 -2
  852. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +1 -2
  853. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +92 -31
  854. data/src/core/lib/security/credentials/iam/iam_credentials.cc +4 -3
  855. data/src/core/lib/security/credentials/iam/iam_credentials.h +2 -2
  856. data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +18 -5
  857. data/src/core/lib/security/credentials/jwt/json_token.cc +4 -7
  858. data/src/core/lib/security/credentials/jwt/json_token.h +2 -1
  859. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +34 -17
  860. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +13 -5
  861. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +15 -22
  862. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
  863. data/src/core/lib/security/credentials/local/local_credentials.cc +2 -1
  864. data/src/core/lib/security/credentials/local/local_credentials.h +1 -1
  865. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +57 -66
  866. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +11 -9
  867. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +10 -12
  868. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -2
  869. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +11 -10
  870. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +2 -3
  871. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +12 -15
  872. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +20 -21
  873. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +382 -5
  874. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +74 -1
  875. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +5 -1
  876. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +2 -3
  877. data/src/core/lib/security/credentials/tls/tls_credentials.cc +3 -2
  878. data/src/core/lib/security/credentials/tls/tls_credentials.h +1 -1
  879. data/src/core/lib/security/credentials/tls/tls_utils.cc +123 -0
  880. data/src/core/lib/security/credentials/tls/tls_utils.h +51 -0
  881. data/src/core/lib/security/credentials/xds/xds_credentials.cc +209 -10
  882. data/src/core/lib/security/credentials/xds/xds_credentials.h +27 -9
  883. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +14 -4
  884. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +20 -12
  885. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +50 -17
  886. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +35 -8
  887. data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +1 -0
  888. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +4 -4
  889. data/src/core/lib/security/security_connector/local/local_security_connector.cc +23 -10
  890. data/src/core/lib/security/security_connector/security_connector.cc +12 -6
  891. data/src/core/lib/security/security_connector/security_connector.h +10 -5
  892. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +24 -17
  893. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -2
  894. data/src/core/lib/security/security_connector/ssl_utils.cc +41 -14
  895. data/src/core/lib/security/security_connector/ssl_utils.h +16 -23
  896. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +156 -113
  897. data/src/core/lib/security/security_connector/tls/tls_security_connector.h +67 -52
  898. data/src/core/lib/security/transport/auth_filters.h +1 -0
  899. data/src/core/lib/security/transport/client_auth_filter.cc +27 -21
  900. data/src/core/lib/security/transport/secure_endpoint.cc +10 -20
  901. data/src/core/lib/security/transport/secure_endpoint.h +1 -0
  902. data/src/core/lib/security/transport/security_handshaker.cc +158 -90
  903. data/src/core/lib/security/transport/security_handshaker.h +2 -1
  904. data/src/core/lib/security/transport/server_auth_filter.cc +20 -16
  905. data/src/core/lib/security/transport/tsi_error.cc +5 -6
  906. data/src/core/lib/security/transport/tsi_error.h +2 -1
  907. data/src/core/lib/security/util/json_util.cc +8 -10
  908. data/src/core/lib/security/util/json_util.h +1 -1
  909. data/src/core/lib/slice/percent_encoding.cc +73 -30
  910. data/src/core/lib/slice/percent_encoding.h +29 -28
  911. data/src/core/lib/slice/slice.cc +14 -21
  912. data/src/core/lib/{gpr/tls_pthread.cc → slice/slice_api.cc} +15 -6
  913. data/src/core/lib/slice/slice_buffer.cc +6 -7
  914. data/src/core/lib/slice/slice_intern.cc +19 -27
  915. data/src/core/lib/slice/slice_internal.h +4 -246
  916. data/src/core/lib/slice/slice_refcount.cc +17 -0
  917. data/src/core/lib/slice/slice_refcount.h +121 -0
  918. data/src/core/lib/slice/slice_refcount_base.h +173 -0
  919. data/src/core/lib/slice/slice_split.cc +100 -0
  920. data/src/core/lib/slice/slice_split.h +40 -0
  921. data/src/core/lib/slice/slice_string_helpers.cc +0 -83
  922. data/src/core/lib/slice/slice_string_helpers.h +0 -11
  923. data/src/core/lib/slice/static_slice.cc +529 -0
  924. data/src/core/lib/slice/static_slice.h +331 -0
  925. data/src/core/lib/surface/api_trace.cc +2 -1
  926. data/src/core/lib/surface/api_trace.h +1 -0
  927. data/src/core/lib/surface/builtins.cc +49 -0
  928. data/src/core/lib/surface/builtins.h +26 -0
  929. data/src/core/lib/surface/byte_buffer_reader.cc +1 -1
  930. data/src/core/lib/surface/call.cc +198 -186
  931. data/src/core/lib/surface/call.h +10 -5
  932. data/src/core/lib/surface/call_details.cc +10 -10
  933. data/src/core/lib/surface/call_log_batch.cc +2 -2
  934. data/src/core/lib/surface/channel.cc +57 -51
  935. data/src/core/lib/surface/channel.h +19 -14
  936. data/src/core/lib/surface/channel_init.cc +23 -76
  937. data/src/core/lib/surface/channel_init.h +52 -44
  938. data/src/core/lib/surface/channel_ping.cc +2 -3
  939. data/src/core/lib/surface/channel_stack_type.cc +2 -1
  940. data/src/core/lib/surface/completion_queue.cc +140 -145
  941. data/src/core/lib/surface/completion_queue.h +18 -17
  942. data/src/core/lib/surface/completion_queue_factory.cc +3 -3
  943. data/src/core/lib/surface/completion_queue_factory.h +1 -0
  944. data/src/core/lib/surface/event_string.cc +1 -0
  945. data/src/core/lib/surface/init.cc +18 -65
  946. data/src/core/lib/surface/init.h +10 -2
  947. data/src/core/lib/surface/init_secure.cc +36 -14
  948. data/src/core/lib/surface/lame_client.cc +62 -61
  949. data/src/core/lib/surface/lame_client.h +5 -0
  950. data/src/core/lib/surface/metadata_array.cc +2 -2
  951. data/src/core/lib/surface/server.cc +167 -116
  952. data/src/core/lib/surface/server.h +140 -40
  953. data/src/core/lib/surface/validate_metadata.cc +55 -24
  954. data/src/core/lib/surface/validate_metadata.h +3 -2
  955. data/src/core/lib/surface/version.cc +2 -2
  956. data/src/core/lib/transport/bdp_estimator.cc +1 -1
  957. data/src/core/lib/transport/byte_stream.cc +5 -5
  958. data/src/core/lib/transport/byte_stream.h +9 -8
  959. data/src/core/lib/transport/connectivity_state.cc +9 -6
  960. data/src/core/lib/transport/connectivity_state.h +8 -6
  961. data/src/core/lib/transport/error_utils.cc +64 -27
  962. data/src/core/lib/transport/error_utils.h +13 -7
  963. data/src/core/lib/transport/metadata.cc +47 -22
  964. data/src/core/lib/transport/metadata.h +15 -12
  965. data/src/core/lib/transport/metadata_batch.cc +41 -339
  966. data/src/core/lib/transport/metadata_batch.h +932 -68
  967. data/src/core/lib/transport/parsed_metadata.h +263 -0
  968. data/src/core/lib/transport/pid_controller.cc +4 -4
  969. data/src/core/lib/transport/static_metadata.cc +715 -847
  970. data/src/core/lib/transport/static_metadata.h +115 -379
  971. data/src/core/lib/transport/status_metadata.cc +5 -3
  972. data/src/core/lib/transport/transport.cc +8 -8
  973. data/src/core/lib/transport/transport.h +12 -10
  974. data/src/core/lib/transport/transport_op_string.cc +46 -26
  975. data/src/core/lib/uri/uri_parser.cc +131 -249
  976. data/src/core/lib/uri/uri_parser.h +57 -21
  977. data/src/core/plugin_registry/grpc_plugin_registry.cc +101 -44
  978. data/src/core/tsi/alts/crypt/aes_gcm.cc +6 -3
  979. data/src/core/tsi/alts/crypt/gsec.cc +5 -4
  980. data/src/core/tsi/alts/crypt/gsec.h +5 -0
  981. data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +13 -12
  982. data/src/core/tsi/alts/frame_protector/frame_handler.cc +18 -17
  983. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +27 -33
  984. data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +2 -3
  985. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +57 -51
  986. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
  987. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +2 -1
  988. data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +1 -3
  989. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +2 -2
  990. data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
  991. data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +8 -6
  992. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +6 -6
  993. data/src/core/tsi/fake_transport_security.cc +31 -12
  994. data/src/core/tsi/local_transport_security.cc +36 -73
  995. data/src/core/tsi/ssl/session_cache/ssl_session.h +0 -3
  996. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
  997. data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +20 -55
  998. data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +6 -7
  999. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +2 -2
  1000. data/src/core/tsi/ssl_transport_security.cc +115 -77
  1001. data/src/core/tsi/ssl_transport_security.h +12 -14
  1002. data/src/core/tsi/transport_security.cc +21 -9
  1003. data/src/core/tsi/transport_security.h +16 -1
  1004. data/src/core/tsi/transport_security_grpc.h +1 -0
  1005. data/src/core/tsi/transport_security_interface.h +27 -1
  1006. data/src/ruby/bin/math_services_pb.rb +1 -1
  1007. data/src/ruby/ext/grpc/extconf.rb +21 -8
  1008. data/src/ruby/ext/grpc/rb_byte_buffer.c +2 -1
  1009. data/src/ruby/ext/grpc/rb_call.c +5 -5
  1010. data/src/ruby/ext/grpc/rb_call_credentials.c +5 -5
  1011. data/src/ruby/ext/grpc/rb_channel.c +19 -8
  1012. data/src/ruby/ext/grpc/rb_channel_args.c +2 -2
  1013. data/src/ruby/ext/grpc/rb_channel_credentials.c +15 -5
  1014. data/src/ruby/ext/grpc/rb_channel_credentials.h +5 -0
  1015. data/src/ruby/ext/grpc/rb_completion_queue.c +3 -2
  1016. data/src/ruby/ext/grpc/rb_compression_options.c +6 -5
  1017. data/src/ruby/ext/grpc/rb_enable_cpp.cc +1 -1
  1018. data/src/ruby/ext/grpc/rb_event_thread.c +4 -2
  1019. data/src/ruby/ext/grpc/rb_grpc.c +9 -4
  1020. data/src/ruby/ext/grpc/rb_grpc.h +1 -0
  1021. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +24 -0
  1022. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +50 -14
  1023. data/src/ruby/ext/grpc/rb_server.c +19 -6
  1024. data/src/ruby/ext/grpc/rb_server_credentials.c +22 -6
  1025. data/src/ruby/ext/grpc/rb_server_credentials.h +5 -0
  1026. data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +218 -0
  1027. data/src/ruby/ext/grpc/rb_xds_channel_credentials.h +37 -0
  1028. data/src/ruby/ext/grpc/rb_xds_server_credentials.c +170 -0
  1029. data/src/ruby/ext/grpc/rb_xds_server_credentials.h +37 -0
  1030. data/src/ruby/lib/grpc/generic/client_stub.rb +4 -2
  1031. data/src/ruby/lib/grpc/version.rb +1 -1
  1032. data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +1 -1
  1033. data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +35 -0
  1034. data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -2
  1035. data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +23 -5
  1036. data/src/ruby/spec/call_spec.rb +1 -1
  1037. data/src/ruby/spec/channel_credentials_spec.rb +32 -0
  1038. data/src/ruby/spec/channel_spec.rb +17 -6
  1039. data/src/ruby/spec/client_auth_spec.rb +27 -1
  1040. data/src/ruby/spec/client_server_spec.rb +1 -1
  1041. data/src/ruby/spec/errors_spec.rb +1 -1
  1042. data/src/ruby/spec/generic/active_call_spec.rb +2 -2
  1043. data/src/ruby/spec/generic/client_stub_spec.rb +4 -4
  1044. data/src/ruby/spec/generic/rpc_server_spec.rb +1 -1
  1045. data/src/ruby/spec/pb/codegen/package_option_spec.rb +2 -6
  1046. data/src/ruby/spec/server_credentials_spec.rb +25 -0
  1047. data/src/ruby/spec/server_spec.rb +22 -0
  1048. data/third_party/abseil-cpp/absl/algorithm/container.h +3 -3
  1049. data/third_party/abseil-cpp/absl/base/attributes.h +24 -4
  1050. data/third_party/abseil-cpp/absl/base/call_once.h +2 -9
  1051. data/third_party/abseil-cpp/absl/base/config.h +37 -9
  1052. data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +24 -10
  1053. data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +4 -1
  1054. data/third_party/abseil-cpp/absl/base/internal/endian.h +61 -0
  1055. data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +2 -3
  1056. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +34 -32
  1057. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +16 -6
  1058. data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +11 -2
  1059. data/third_party/abseil-cpp/absl/base/internal/spinlock.h +14 -5
  1060. data/third_party/abseil-cpp/absl/base/internal/spinlock_akaros.inc +2 -2
  1061. data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +3 -3
  1062. data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +2 -2
  1063. data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +11 -11
  1064. data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +5 -5
  1065. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +1 -1
  1066. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +9 -6
  1067. data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +54 -48
  1068. data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +111 -7
  1069. data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +0 -76
  1070. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +1 -3
  1071. data/third_party/abseil-cpp/absl/base/log_severity.h +4 -4
  1072. data/third_party/abseil-cpp/absl/base/macros.h +11 -0
  1073. data/third_party/abseil-cpp/absl/base/optimization.h +10 -7
  1074. data/third_party/abseil-cpp/absl/base/options.h +1 -1
  1075. data/third_party/abseil-cpp/absl/base/port.h +0 -1
  1076. data/third_party/abseil-cpp/absl/base/thread_annotations.h +1 -1
  1077. data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -2
  1078. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +606 -0
  1079. data/third_party/abseil-cpp/absl/container/inlined_vector.h +5 -3
  1080. data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +1 -1
  1081. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +5 -1
  1082. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +2 -1
  1083. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +2 -1
  1084. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +141 -66
  1085. data/third_party/abseil-cpp/absl/container/internal/layout.h +4 -4
  1086. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +197 -0
  1087. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -1
  1088. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +136 -136
  1089. data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +16 -12
  1090. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +5 -2
  1091. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +3 -12
  1092. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +6 -1
  1093. data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +3 -5
  1094. data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +2 -2
  1095. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +2 -2
  1096. data/third_party/abseil-cpp/absl/hash/internal/city.cc +15 -12
  1097. data/third_party/abseil-cpp/absl/hash/internal/city.h +1 -19
  1098. data/third_party/abseil-cpp/absl/hash/internal/hash.cc +25 -10
  1099. data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -37
  1100. data/third_party/abseil-cpp/absl/hash/internal/wyhash.cc +111 -0
  1101. data/third_party/abseil-cpp/absl/hash/internal/wyhash.h +48 -0
  1102. data/third_party/abseil-cpp/absl/meta/type_traits.h +16 -2
  1103. data/third_party/abseil-cpp/absl/numeric/bits.h +177 -0
  1104. data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -3
  1105. data/third_party/abseil-cpp/absl/numeric/internal/bits.h +358 -0
  1106. data/third_party/abseil-cpp/absl/numeric/internal/representation.h +55 -0
  1107. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +18 -0
  1108. data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +396 -0
  1109. data/third_party/abseil-cpp/absl/status/status.cc +29 -22
  1110. data/third_party/abseil-cpp/absl/status/status.h +81 -20
  1111. data/third_party/abseil-cpp/absl/status/statusor.cc +71 -0
  1112. data/third_party/abseil-cpp/absl/status/statusor.h +760 -0
  1113. data/third_party/abseil-cpp/absl/strings/charconv.cc +5 -5
  1114. data/third_party/abseil-cpp/absl/strings/cord.cc +326 -371
  1115. data/third_party/abseil-cpp/absl/strings/cord.h +182 -64
  1116. data/third_party/abseil-cpp/absl/strings/escaping.cc +4 -4
  1117. data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +6 -6
  1118. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +83 -0
  1119. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +387 -17
  1120. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +146 -0
  1121. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +897 -0
  1122. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +589 -0
  1123. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +114 -0
  1124. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +14 -0
  1125. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -0
  1126. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +15 -1
  1127. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +19 -4
  1128. data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +14 -0
  1129. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +36 -18
  1130. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +14 -0
  1131. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +14 -0
  1132. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +14 -0
  1133. data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +15 -40
  1134. data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +64 -0
  1135. data/third_party/abseil-cpp/absl/strings/match.cc +6 -3
  1136. data/third_party/abseil-cpp/absl/strings/match.h +16 -6
  1137. data/third_party/abseil-cpp/absl/strings/numbers.cc +132 -4
  1138. data/third_party/abseil-cpp/absl/strings/numbers.h +10 -10
  1139. data/third_party/abseil-cpp/absl/strings/str_join.h +1 -1
  1140. data/third_party/abseil-cpp/absl/strings/str_split.h +38 -4
  1141. data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +154 -0
  1142. data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +1 -0
  1143. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +2 -1
  1144. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +2 -2
  1145. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +4 -4
  1146. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -65
  1147. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +2 -6
  1148. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +71 -59
  1149. data/third_party/abseil-cpp/absl/synchronization/mutex.h +79 -62
  1150. data/third_party/abseil-cpp/absl/time/clock.cc +146 -130
  1151. data/third_party/abseil-cpp/absl/time/clock.h +2 -2
  1152. data/third_party/abseil-cpp/absl/time/duration.cc +3 -2
  1153. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +7 -11
  1154. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +7 -1
  1155. data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +4 -4
  1156. data/third_party/abseil-cpp/absl/time/time.cc +4 -3
  1157. data/third_party/abseil-cpp/absl/time/time.h +26 -24
  1158. data/third_party/abseil-cpp/absl/types/internal/variant.h +1 -1
  1159. data/third_party/abseil-cpp/absl/types/variant.h +9 -4
  1160. data/third_party/address_sorting/address_sorting_posix.c +1 -0
  1161. data/third_party/boringssl-with-bazel/err_data.c +756 -724
  1162. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +55 -50
  1163. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +22 -23
  1164. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c +0 -2
  1165. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +2 -2
  1166. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +6 -1
  1167. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +5 -5
  1168. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c +16 -23
  1169. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +26 -24
  1170. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c +3 -3
  1171. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c +19 -29
  1172. data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/a_strex.c +269 -272
  1173. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +106 -153
  1174. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +3 -3
  1175. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +22 -10
  1176. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +3 -42
  1177. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c +1 -1
  1178. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +16 -16
  1179. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c +1 -1
  1180. data/third_party/boringssl-with-bazel/src/crypto/{x509 → asn1}/charmap.h +0 -0
  1181. data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +196 -0
  1182. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +35 -86
  1183. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +326 -281
  1184. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +15 -26
  1185. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +20 -75
  1186. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +0 -2
  1187. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +3 -2
  1188. data/third_party/boringssl-with-bazel/src/crypto/asn1/time_support.c +1 -1
  1189. data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +11 -8
  1190. data/third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c +1 -7
  1191. data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +1 -5
  1192. data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +0 -4
  1193. data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +1 -7
  1194. data/third_party/boringssl-with-bazel/src/crypto/bio/pair.c +1 -6
  1195. data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +3 -17
  1196. data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +4 -0
  1197. data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +156 -0
  1198. data/third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c +3 -10
  1199. data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +8 -9
  1200. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c +9 -0
  1201. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +68 -45
  1202. data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +38 -47
  1203. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c +49 -65
  1204. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +6 -81
  1205. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c +1 -88
  1206. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +101 -3
  1207. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +119 -273
  1208. data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +14 -3
  1209. data/third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-win.c +41 -0
  1210. data/third_party/boringssl-with-bazel/src/crypto/cpu-arm-linux.c +11 -2
  1211. data/third_party/boringssl-with-bazel/src/crypto/cpu-arm.c +3 -3
  1212. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +1 -1
  1213. data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +1 -1
  1214. data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/dh_asn1.c +0 -0
  1215. data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/params.c +179 -0
  1216. data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +31 -3
  1217. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +2 -17
  1218. data/third_party/boringssl-with-bazel/src/crypto/err/err.c +87 -80
  1219. data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +9 -0
  1220. data/third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c +32 -34
  1221. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +4 -1
  1222. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bn.c +13 -20
  1223. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +28 -12
  1224. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd_extra.c +3 -2
  1225. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +15 -4
  1226. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/prime.c +0 -4
  1227. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/sqrt.c +5 -9
  1228. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +32 -16
  1229. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +35 -2
  1230. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/des.c +10 -11
  1231. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/des/internal.h +1 -3
  1232. data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/check.c +0 -0
  1233. data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/dh.c +136 -213
  1234. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +9 -0
  1235. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digests.c +10 -2
  1236. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/md32_common.h +87 -160
  1237. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +16 -0
  1238. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +9 -2
  1239. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +0 -4
  1240. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +104 -93
  1241. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/internal.h +39 -0
  1242. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +56 -72
  1243. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +56 -73
  1244. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cbc.c +33 -22
  1245. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cfb.c +9 -8
  1246. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ctr.c +9 -8
  1247. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm.c +17 -13
  1248. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +1 -1
  1249. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +1 -22
  1250. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ofb.c +2 -1
  1251. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +30 -9
  1252. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +123 -44
  1253. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +30 -20
  1254. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +50 -33
  1255. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +65 -41
  1256. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/fips.c +79 -0
  1257. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +161 -9
  1258. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +93 -107
  1259. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +91 -113
  1260. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +50 -86
  1261. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +400 -325
  1262. data/third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c +219 -121
  1263. data/third_party/boringssl-with-bazel/src/crypto/hrss/internal.h +9 -2
  1264. data/third_party/boringssl-with-bazel/src/crypto/internal.h +125 -0
  1265. data/third_party/boringssl-with-bazel/src/crypto/lhash/internal.h +253 -0
  1266. data/third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c +28 -23
  1267. data/third_party/boringssl-with-bazel/src/crypto/mem.c +28 -9
  1268. data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +10 -6
  1269. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c +0 -9
  1270. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c +0 -2
  1271. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c +0 -8
  1272. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c +0 -2
  1273. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c +0 -4
  1274. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/internal.h +16 -7
  1275. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +9 -4
  1276. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c +156 -15
  1277. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +95 -48
  1278. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +11 -8
  1279. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c +13 -11
  1280. data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c +4 -0
  1281. data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +1 -0
  1282. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +4 -0
  1283. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/fuchsia.c +4 -0
  1284. data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/is_fips.c → rand_extra/passive.c} +16 -11
  1285. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +5 -1
  1286. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +4 -0
  1287. data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c +1 -2
  1288. data/third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c +6 -6
  1289. data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +7 -13
  1290. data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +0 -28
  1291. data/third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c +15 -11
  1292. data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +1 -1
  1293. data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -0
  1294. data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +2 -0
  1295. data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +345 -13
  1296. data/third_party/boringssl-with-bazel/src/crypto/x509/name_print.c +246 -0
  1297. data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +20 -5
  1298. data/third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c +10 -5
  1299. data/third_party/boringssl-with-bazel/src/crypto/x509/t_req.c +2 -0
  1300. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +0 -179
  1301. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c +7 -2
  1302. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +24 -47
  1303. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +4 -31
  1304. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +12 -9
  1305. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +1 -5
  1306. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c +1 -0
  1307. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +42 -89
  1308. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +17 -24
  1309. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +2 -0
  1310. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +26 -23
  1311. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +25 -69
  1312. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +54 -74
  1313. data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +61 -23
  1314. data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +2 -4
  1315. data/third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c +3 -0
  1316. data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +21 -19
  1317. data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +3 -16
  1318. data/third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c +21 -34
  1319. data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +15 -13
  1320. data/third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c +2 -0
  1321. data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +23 -21
  1322. data/third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c +2 -2
  1323. data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +25 -22
  1324. data/third_party/boringssl-with-bazel/src/crypto/x509/x_req.c +5 -8
  1325. data/third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c +5 -0
  1326. data/third_party/boringssl-with-bazel/src/crypto/x509/x_val.c +2 -0
  1327. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +50 -14
  1328. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +5 -2
  1329. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +23 -0
  1330. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +1 -0
  1331. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +1 -1
  1332. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +1 -1
  1333. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +1 -0
  1334. data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +4 -3
  1335. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +27 -8
  1336. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +28 -18
  1337. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +6 -3
  1338. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +26 -25
  1339. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +10 -12
  1340. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_crld.c +4 -2
  1341. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +7 -1
  1342. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +40 -20
  1343. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c +3 -4
  1344. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +27 -36
  1345. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ncons.c +112 -55
  1346. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pci.c +2 -1
  1347. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +14 -13
  1348. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +2 -2
  1349. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +7 -6
  1350. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +86 -44
  1351. data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +1 -4
  1352. data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +69 -4
  1353. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +1026 -615
  1354. data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +2 -176
  1355. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +63 -13
  1356. data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +3 -1
  1357. data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +62 -0
  1358. data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +3 -3
  1359. data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +32 -7
  1360. data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +1 -1
  1361. data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +23 -6
  1362. data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +8 -5
  1363. data/third_party/boringssl-with-bazel/src/include/openssl/cpu.h +22 -32
  1364. data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +24 -4
  1365. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +56 -26
  1366. data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +10 -2
  1367. data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +20 -2
  1368. data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +33 -0
  1369. data/third_party/boringssl-with-bazel/src/include/openssl/err.h +3 -2
  1370. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +38 -51
  1371. data/third_party/boringssl-with-bazel/src/{crypto/x509/x509_r2x.c → include/openssl/evp_errors.h} +41 -58
  1372. data/third_party/boringssl-with-bazel/src/include/openssl/hkdf.h +4 -0
  1373. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +350 -0
  1374. data/third_party/boringssl-with-bazel/src/include/openssl/hrss.h +14 -12
  1375. data/third_party/boringssl-with-bazel/src/include/openssl/lhash.h +4 -205
  1376. data/third_party/boringssl-with-bazel/src/include/openssl/mem.h +12 -3
  1377. data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +26 -6
  1378. data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +0 -20
  1379. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +33 -8
  1380. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +9 -1
  1381. data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +5 -2
  1382. data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +104 -63
  1383. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +39 -16
  1384. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +406 -108
  1385. data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +48 -36
  1386. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +1425 -377
  1387. data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +16 -679
  1388. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +188 -49
  1389. data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +16 -18
  1390. data/third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc +1 -1
  1391. data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +1084 -0
  1392. data/third_party/boringssl-with-bazel/src/ssl/{t1_lib.cc → extensions.cc} +847 -622
  1393. data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +298 -22
  1394. data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +92 -44
  1395. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +314 -217
  1396. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +177 -35
  1397. data/third_party/boringssl-with-bazel/src/ssl/internal.h +491 -152
  1398. data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +9 -3
  1399. data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +0 -2
  1400. data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +14 -19
  1401. data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +7 -8
  1402. data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +4 -6
  1403. data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +2 -2
  1404. data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +34 -31
  1405. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +60 -112
  1406. data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +2 -0
  1407. data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +136 -104
  1408. data/third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc +3 -0
  1409. data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +12 -17
  1410. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +7 -3
  1411. data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +28 -23
  1412. data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +5 -7
  1413. data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +79 -34
  1414. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +235 -178
  1415. data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +160 -91
  1416. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +269 -118
  1417. data/third_party/boringssl-with-bazel/src/ssl/tls_method.cc +4 -2
  1418. data/third_party/re2/re2/compile.cc +91 -109
  1419. data/third_party/re2/re2/dfa.cc +27 -39
  1420. data/third_party/re2/re2/filtered_re2.cc +18 -2
  1421. data/third_party/re2/re2/filtered_re2.h +10 -5
  1422. data/third_party/re2/re2/nfa.cc +1 -1
  1423. data/third_party/re2/re2/parse.cc +42 -23
  1424. data/third_party/re2/re2/perl_groups.cc +34 -34
  1425. data/third_party/re2/re2/prefilter.cc +3 -2
  1426. data/third_party/re2/re2/prog.cc +182 -4
  1427. data/third_party/re2/re2/prog.h +28 -9
  1428. data/third_party/re2/re2/re2.cc +87 -118
  1429. data/third_party/re2/re2/re2.h +156 -141
  1430. data/third_party/re2/re2/regexp.cc +12 -5
  1431. data/third_party/re2/re2/regexp.h +8 -2
  1432. data/third_party/re2/re2/set.cc +31 -9
  1433. data/third_party/re2/re2/set.h +9 -4
  1434. data/third_party/re2/re2/simplify.cc +11 -3
  1435. data/third_party/re2/re2/tostring.cc +1 -1
  1436. data/third_party/re2/re2/walker-inl.h +1 -1
  1437. data/third_party/re2/util/mutex.h +2 -2
  1438. data/third_party/re2/util/pcre.h +3 -3
  1439. data/third_party/upb/upb/decode.c +354 -204
  1440. data/third_party/upb/upb/decode.h +50 -3
  1441. data/third_party/upb/upb/decode_fast.c +1053 -0
  1442. data/third_party/upb/upb/decode_fast.h +153 -0
  1443. data/third_party/upb/upb/decode_internal.h +193 -0
  1444. data/third_party/upb/upb/def.c +609 -610
  1445. data/third_party/upb/upb/def.h +57 -50
  1446. data/third_party/upb/upb/def.hpp +66 -123
  1447. data/third_party/upb/upb/encode.c +267 -176
  1448. data/third_party/upb/upb/encode.h +56 -4
  1449. data/third_party/upb/upb/msg.c +304 -84
  1450. data/third_party/upb/upb/msg.h +76 -441
  1451. data/third_party/upb/upb/msg_internal.h +687 -0
  1452. data/third_party/upb/upb/port_def.inc +156 -82
  1453. data/third_party/upb/upb/port_undef.inc +41 -8
  1454. data/third_party/upb/upb/reflection.c +64 -55
  1455. data/third_party/upb/upb/reflection.h +36 -8
  1456. data/third_party/upb/upb/reflection.hpp +37 -0
  1457. data/third_party/upb/upb/table.c +238 -276
  1458. data/third_party/upb/upb/{table.int.h → table_internal.h} +66 -181
  1459. data/third_party/upb/upb/text_encode.c +77 -26
  1460. data/third_party/upb/upb/text_encode.h +30 -1
  1461. data/third_party/upb/upb/upb.c +75 -47
  1462. data/third_party/upb/upb/upb.h +72 -13
  1463. data/third_party/upb/upb/upb.hpp +28 -4
  1464. data/third_party/upb/upb/upb_internal.h +58 -0
  1465. data/third_party/xxhash/xxhash.h +5325 -0
  1466. metadata +287 -137
  1467. data/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc +0 -909
  1468. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +0 -485
  1469. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +0 -179
  1470. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +0 -68
  1471. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +0 -38
  1472. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +0 -355
  1473. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +0 -138
  1474. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +0 -210
  1475. data/src/core/ext/filters/workarounds/workaround_utils.cc +0 -53
  1476. data/src/core/ext/filters/workarounds/workaround_utils.h +0 -39
  1477. data/src/core/ext/transport/chttp2/client/authority.cc +0 -42
  1478. data/src/core/ext/transport/chttp2/client/authority.h +0 -36
  1479. data/src/core/ext/transport/chttp2/transport/hpack_table.cc +0 -242
  1480. data/src/core/ext/transport/chttp2/transport/hpack_table.h +0 -148
  1481. data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +0 -66
  1482. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +0 -58
  1483. data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c +0 -28
  1484. data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h +0 -53
  1485. data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c +0 -52
  1486. data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h +0 -129
  1487. data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c +0 -42
  1488. data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h +0 -77
  1489. data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c +0 -36
  1490. data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h +0 -85
  1491. data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c +0 -54
  1492. data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h +0 -160
  1493. data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c +0 -36
  1494. data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h +0 -84
  1495. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +0 -58
  1496. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +0 -117
  1497. data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.c +0 -42
  1498. data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.h +0 -35
  1499. data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.c +0 -62
  1500. data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.h +0 -40
  1501. data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.c +0 -45
  1502. data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.h +0 -40
  1503. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.c +0 -49
  1504. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.h +0 -35
  1505. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.c +0 -68
  1506. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.h +0 -40
  1507. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.c +0 -51
  1508. data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.h +0 -35
  1509. data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc +0 -265
  1510. data/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h +0 -104
  1511. data/src/core/lib/gpr/arena.h +0 -47
  1512. data/src/core/lib/gpr/tls_gcc.h +0 -52
  1513. data/src/core/lib/gpr/tls_msvc.h +0 -54
  1514. data/src/core/lib/gpr/tls_pthread.h +0 -56
  1515. data/src/core/lib/gpr/tls_stdcpp.h +0 -48
  1516. data/src/core/lib/gprpp/atomic.h +0 -104
  1517. data/src/core/lib/gprpp/map.h +0 -53
  1518. data/src/core/lib/iomgr/endpoint_pair_uv.cc +0 -40
  1519. data/src/core/lib/iomgr/iomgr_posix.h +0 -26
  1520. data/src/core/lib/iomgr/iomgr_uv.cc +0 -43
  1521. data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +0 -88
  1522. data/src/core/lib/iomgr/poller/eventmanager_libuv.h +0 -88
  1523. data/src/core/lib/iomgr/pollset_uv.cc +0 -93
  1524. data/src/core/lib/iomgr/pollset_uv.h +0 -32
  1525. data/src/core/lib/iomgr/sockaddr_custom.h +0 -54
  1526. data/src/core/lib/iomgr/socket_utils_uv.cc +0 -49
  1527. data/src/core/lib/iomgr/tcp_uv.cc +0 -419
  1528. data/src/core/lib/iomgr/timer_uv.cc +0 -66
  1529. data/src/core/lib/iomgr/udp_server.cc +0 -748
  1530. data/src/core/lib/iomgr/udp_server.h +0 -104
  1531. data/src/core/lib/security/authorization/authorization_engine.cc +0 -177
  1532. data/src/core/lib/security/authorization/mock_cel/activation.h +0 -57
  1533. data/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +0 -44
  1534. data/src/core/lib/security/authorization/mock_cel/cel_expression.h +0 -69
  1535. data/src/core/lib/security/authorization/mock_cel/cel_value.h +0 -97
  1536. data/src/core/lib/security/authorization/mock_cel/evaluator_core.h +0 -67
  1537. data/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h +0 -57
  1538. data/src/core/lib/transport/authority_override.cc +0 -38
  1539. data/third_party/abseil-cpp/absl/base/internal/bits.h +0 -219
  1540. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -504
  1541. data/third_party/abseil-cpp/absl/synchronization/internal/mutex_nonprod.inc +0 -249
  1542. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +0 -104
  1543. data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +0 -237
  1544. data/third_party/boringssl-with-bazel/src/crypto/x509/vpm_int.h +0 -71
  1545. data/third_party/upb/upb/port.c +0 -26
@@ -4,21 +4,21 @@
4
4
  * This package is an SSL implementation written
5
5
  * by Eric Young (eay@cryptsoft.com).
6
6
  * The implementation was written so as to conform with Netscapes SSL.
7
- *
7
+ *
8
8
  * This library is free for commercial and non-commercial use as long as
9
9
  * the following conditions are aheared to. The following conditions
10
10
  * apply to all code found in this distribution, be it the RC4, RSA,
11
11
  * lhash, DES, etc., code; not just the SSL code. The SSL documentation
12
12
  * included with this distribution is covered by the same copyright terms
13
13
  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14
- *
14
+ *
15
15
  * Copyright remains Eric Young's, and as such any Copyright notices in
16
16
  * the code are not to be removed.
17
17
  * If this package is used in a product, Eric Young should be given attribution
18
18
  * as the author of the parts of the library used.
19
19
  * This can be in the form of a textual message at program startup or
20
20
  * in documentation (online or textual) provided with the package.
21
- *
21
+ *
22
22
  * Redistribution and use in source and binary forms, with or without
23
23
  * modification, are permitted provided that the following conditions
24
24
  * are met:
@@ -33,10 +33,10 @@
33
33
  * Eric Young (eay@cryptsoft.com)"
34
34
  * The word 'cryptographic' can be left out if the rouines from the library
35
35
  * being used are not cryptographic related :-).
36
- * 4. If you include any Windows specific code (or a derivative thereof) from
36
+ * 4. If you include any Windows specific code (or a derivative thereof) from
37
37
  * the apps directory (application code) you must include an acknowledgement:
38
38
  * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39
- *
39
+ *
40
40
  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41
41
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42
42
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -48,7 +48,7 @@
48
48
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49
49
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50
50
  * SUCH DAMAGE.
51
- *
51
+ *
52
52
  * The licence and distribution terms for any publically available version or
53
53
  * derivative of this code cannot be changed. i.e. this code cannot simply be
54
54
  * copied and put under another distribution licence
@@ -67,628 +67,1073 @@
67
67
 
68
68
  #include <openssl/bn.h>
69
69
 
70
- #ifdef __cplusplus
70
+ #ifdef __cplusplus
71
71
  extern "C" {
72
72
  #endif
73
73
 
74
74
 
75
- /* Legacy ASN.1 library.
76
- *
77
- * This header is part of OpenSSL's ASN.1 implementation. It is retained for
78
- * compatibility but otherwise underdocumented and not actively maintained. Use
79
- * the new |CBS| and |CBB| library in <openssl/bytestring.h> instead. */
80
-
81
-
82
- #define V_ASN1_UNIVERSAL 0x00
83
- #define V_ASN1_APPLICATION 0x40
84
- #define V_ASN1_CONTEXT_SPECIFIC 0x80
85
- #define V_ASN1_PRIVATE 0xc0
86
-
87
- #define V_ASN1_CONSTRUCTED 0x20
88
- #define V_ASN1_PRIMITIVE_TAG 0x1f
89
-
90
- #define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
91
- #define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
92
- #define V_ASN1_ANY -4 /* used in ASN1 template code */
93
-
94
- #define V_ASN1_NEG 0x100 /* negative flag */
95
- /* No supported universal tags may exceed this value, to avoid ambiguity with
96
- * V_ASN1_NEG. */
97
- #define V_ASN1_MAX_UNIVERSAL 0xff
98
-
99
- #define V_ASN1_UNDEF -1
100
- #define V_ASN1_EOC 0
101
- #define V_ASN1_BOOLEAN 1 /**/
102
- #define V_ASN1_INTEGER 2
103
- #define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
104
- #define V_ASN1_BIT_STRING 3
105
- #define V_ASN1_OCTET_STRING 4
106
- #define V_ASN1_NULL 5
107
- #define V_ASN1_OBJECT 6
108
- #define V_ASN1_OBJECT_DESCRIPTOR 7
109
- #define V_ASN1_EXTERNAL 8
110
- #define V_ASN1_REAL 9
111
- #define V_ASN1_ENUMERATED 10
112
- #define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
113
- #define V_ASN1_UTF8STRING 12
114
- #define V_ASN1_SEQUENCE 16
115
- #define V_ASN1_SET 17
116
- #define V_ASN1_NUMERICSTRING 18 /**/
117
- #define V_ASN1_PRINTABLESTRING 19
118
- #define V_ASN1_T61STRING 20
119
- #define V_ASN1_TELETEXSTRING 20 /* alias */
120
- #define V_ASN1_VIDEOTEXSTRING 21 /**/
121
- #define V_ASN1_IA5STRING 22
122
- #define V_ASN1_UTCTIME 23
123
- #define V_ASN1_GENERALIZEDTIME 24 /**/
124
- #define V_ASN1_GRAPHICSTRING 25 /**/
125
- #define V_ASN1_ISO64STRING 26 /**/
126
- #define V_ASN1_VISIBLESTRING 26 /* alias */
127
- #define V_ASN1_GENERALSTRING 27 /**/
128
- #define V_ASN1_UNIVERSALSTRING 28 /**/
129
- #define V_ASN1_BMPSTRING 30
130
-
131
- /* For use with d2i_ASN1_type_bytes() */
132
- #define B_ASN1_NUMERICSTRING 0x0001
133
- #define B_ASN1_PRINTABLESTRING 0x0002
134
- #define B_ASN1_T61STRING 0x0004
135
- #define B_ASN1_TELETEXSTRING 0x0004
136
- #define B_ASN1_VIDEOTEXSTRING 0x0008
137
- #define B_ASN1_IA5STRING 0x0010
138
- #define B_ASN1_GRAPHICSTRING 0x0020
139
- #define B_ASN1_ISO64STRING 0x0040
140
- #define B_ASN1_VISIBLESTRING 0x0040
141
- #define B_ASN1_GENERALSTRING 0x0080
142
- #define B_ASN1_UNIVERSALSTRING 0x0100
143
- #define B_ASN1_OCTET_STRING 0x0200
144
- #define B_ASN1_BIT_STRING 0x0400
145
- #define B_ASN1_BMPSTRING 0x0800
146
- #define B_ASN1_UNKNOWN 0x1000
147
- #define B_ASN1_UTF8STRING 0x2000
148
- #define B_ASN1_UTCTIME 0x4000
149
- #define B_ASN1_GENERALIZEDTIME 0x8000
150
- #define B_ASN1_SEQUENCE 0x10000
151
-
152
- /* For use with ASN1_mbstring_copy() */
153
- #define MBSTRING_FLAG 0x1000
154
- #define MBSTRING_UTF8 (MBSTRING_FLAG)
155
- /* |MBSTRING_ASC| refers to Latin-1, not ASCII. It is used with TeletexString
156
- * which, in turn, is treated as Latin-1 rather than T.61 by OpenSSL and most
157
- * other software. */
158
- #define MBSTRING_ASC (MBSTRING_FLAG|1)
159
- #define MBSTRING_BMP (MBSTRING_FLAG|2)
160
- #define MBSTRING_UNIV (MBSTRING_FLAG|4)
161
-
162
- #define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */
163
- #define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */
164
-
165
- /* These are used internally in the ASN1_OBJECT to keep track of
166
- * whether the names and data need to be free()ed */
167
- #define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
168
- #define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
169
- #define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
170
- struct asn1_object_st
171
- {
172
- const char *sn,*ln;
173
- int nid;
174
- int length;
175
- const unsigned char *data; /* data remains const after init */
176
- int flags; /* Should we free this one */
177
- };
178
-
179
- DEFINE_STACK_OF(ASN1_OBJECT)
75
+ // Legacy ASN.1 library.
76
+ //
77
+ // This header is part of OpenSSL's ASN.1 implementation. It is retained for
78
+ // compatibility but otherwise underdocumented and not actively maintained. Use
79
+ // the new |CBS| and |CBB| library in <openssl/bytestring.h> instead.
80
+
81
+
82
+ // Tag constants.
83
+ //
84
+ // These constants are used in various APIs to specify ASN.1 types and tag
85
+ // components. See the specific API's documentation for details on which values
86
+ // are used and how.
87
+
88
+ // The following constants are tag classes.
89
+ #define V_ASN1_UNIVERSAL 0x00
90
+ #define V_ASN1_APPLICATION 0x40
91
+ #define V_ASN1_CONTEXT_SPECIFIC 0x80
92
+ #define V_ASN1_PRIVATE 0xc0
93
+
94
+ // V_ASN1_CONSTRUCTED indicates an element is constructed, rather than
95
+ // primitive.
96
+ #define V_ASN1_CONSTRUCTED 0x20
97
+
98
+ // V_ASN1_PRIMITIVE_TAG is the highest tag number which can be encoded in a
99
+ // single byte. Note this is unrelated to whether an element is constructed or
100
+ // primitive.
101
+ //
102
+ // TODO(davidben): Make this private.
103
+ #define V_ASN1_PRIMITIVE_TAG 0x1f
104
+
105
+ // V_ASN1_MAX_UNIVERSAL is the highest supported universal tag number. It is
106
+ // necessary to avoid ambiguity with |V_ASN1_NEG| and |MBSTRING_FLAG|.
107
+ //
108
+ // TODO(davidben): Make this private.
109
+ #define V_ASN1_MAX_UNIVERSAL 0xff
110
+
111
+ // V_ASN1_UNDEF is used in some APIs to indicate an ASN.1 element is omitted.
112
+ #define V_ASN1_UNDEF (-1)
113
+
114
+ // V_ASN1_OTHER is used in |ASN1_TYPE| to indicate a non-universal ASN.1 type.
115
+ #define V_ASN1_OTHER (-3)
116
+
117
+ // V_ASN1_ANY is used by the ASN.1 templates to indicate an ANY type.
118
+ #define V_ASN1_ANY (-4)
119
+
120
+ // The following constants are tag numbers for universal types.
121
+ #define V_ASN1_EOC 0
122
+ #define V_ASN1_BOOLEAN 1
123
+ #define V_ASN1_INTEGER 2
124
+ #define V_ASN1_BIT_STRING 3
125
+ #define V_ASN1_OCTET_STRING 4
126
+ #define V_ASN1_NULL 5
127
+ #define V_ASN1_OBJECT 6
128
+ #define V_ASN1_OBJECT_DESCRIPTOR 7
129
+ #define V_ASN1_EXTERNAL 8
130
+ #define V_ASN1_REAL 9
131
+ #define V_ASN1_ENUMERATED 10
132
+ #define V_ASN1_UTF8STRING 12
133
+ #define V_ASN1_SEQUENCE 16
134
+ #define V_ASN1_SET 17
135
+ #define V_ASN1_NUMERICSTRING 18
136
+ #define V_ASN1_PRINTABLESTRING 19
137
+ #define V_ASN1_T61STRING 20
138
+ #define V_ASN1_TELETEXSTRING 20
139
+ #define V_ASN1_VIDEOTEXSTRING 21
140
+ #define V_ASN1_IA5STRING 22
141
+ #define V_ASN1_UTCTIME 23
142
+ #define V_ASN1_GENERALIZEDTIME 24
143
+ #define V_ASN1_GRAPHICSTRING 25
144
+ #define V_ASN1_ISO64STRING 26
145
+ #define V_ASN1_VISIBLESTRING 26
146
+ #define V_ASN1_GENERALSTRING 27
147
+ #define V_ASN1_UNIVERSALSTRING 28
148
+ #define V_ASN1_BMPSTRING 30
149
+
150
+ // The following constants are used for |ASN1_STRING| values that represent
151
+ // negative INTEGER and ENUMERATED values. See |ASN1_STRING| for more details.
152
+ #define V_ASN1_NEG 0x100
153
+ #define V_ASN1_NEG_INTEGER (V_ASN1_INTEGER | V_ASN1_NEG)
154
+ #define V_ASN1_NEG_ENUMERATED (V_ASN1_ENUMERATED | V_ASN1_NEG)
155
+
156
+ // The following constants are bitmask representations of ASN.1 types.
157
+ #define B_ASN1_NUMERICSTRING 0x0001
158
+ #define B_ASN1_PRINTABLESTRING 0x0002
159
+ #define B_ASN1_T61STRING 0x0004
160
+ #define B_ASN1_TELETEXSTRING 0x0004
161
+ #define B_ASN1_VIDEOTEXSTRING 0x0008
162
+ #define B_ASN1_IA5STRING 0x0010
163
+ #define B_ASN1_GRAPHICSTRING 0x0020
164
+ #define B_ASN1_ISO64STRING 0x0040
165
+ #define B_ASN1_VISIBLESTRING 0x0040
166
+ #define B_ASN1_GENERALSTRING 0x0080
167
+ #define B_ASN1_UNIVERSALSTRING 0x0100
168
+ #define B_ASN1_OCTET_STRING 0x0200
169
+ #define B_ASN1_BIT_STRING 0x0400
170
+ #define B_ASN1_BMPSTRING 0x0800
171
+ #define B_ASN1_UNKNOWN 0x1000
172
+ #define B_ASN1_UTF8STRING 0x2000
173
+ #define B_ASN1_UTCTIME 0x4000
174
+ #define B_ASN1_GENERALIZEDTIME 0x8000
175
+ #define B_ASN1_SEQUENCE 0x10000
176
+
177
+ // ASN1_tag2str returns a string representation of |tag|, interpret as a tag
178
+ // number for a universal type, or |V_ASN1_NEG_*|.
179
+ OPENSSL_EXPORT const char *ASN1_tag2str(int tag);
180
180
 
181
- #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
182
- /* This indicates that the ASN1_STRING is not a real value but just a place
183
- * holder for the location where indefinite length constructed data should
184
- * be inserted in the memory buffer
185
- */
186
- #define ASN1_STRING_FLAG_NDEF 0x010
187
181
 
188
- /* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
189
- * type.
190
- */
191
- #define ASN1_STRING_FLAG_MSTRING 0x040
192
- /* This is the base type that holds just about everything :-) */
193
- struct asn1_string_st
194
- {
195
- int length;
196
- int type;
197
- unsigned char *data;
198
- /* The value of the following field depends on the type being
199
- * held. It is mostly being used for BIT_STRING so if the
200
- * input data has a non-zero 'unused bits' value, it will be
201
- * handled correctly */
202
- long flags;
203
- };
204
-
205
- /* ASN1_ENCODING structure: this is used to save the received
206
- * encoding of an ASN1 type. This is useful to get round
207
- * problems with invalid encodings which can break signatures.
208
- */
182
+ // Strings.
183
+ //
184
+ // ASN.1 contains a myriad of string types, as well as types that contain data
185
+ // that may be encoded into a string. This library uses a single type,
186
+ // |ASN1_STRING|, to represent most values.
187
+
188
+ // An asn1_string_st (aka |ASN1_STRING|) represents a value of a string-like
189
+ // ASN.1 type. It contains a type field, and a byte string data field with a
190
+ // type-specific representation.
191
+ //
192
+ // When representing a string value, the type field is one of
193
+ // |V_ASN1_OCTET_STRING|, |V_ASN1_UTF8STRING|, |V_ASN1_NUMERICSTRING|,
194
+ // |V_ASN1_PRINTABLESTRING|, |V_ASN1_T61STRING|, |V_ASN1_VIDEOTEXSTRING|,
195
+ // |V_ASN1_IA5STRING|, |V_ASN1_GRAPHICSTRING|, |V_ASN1_ISO64STRING|,
196
+ // |V_ASN1_VISIBLESTRING|, |V_ASN1_GENERALSTRING|, |V_ASN1_UNIVERSALSTRING|, or
197
+ // |V_ASN1_BMPSTRING|. The data contains the byte representation of of the
198
+ // string.
199
+ //
200
+ // When representing a BIT STRING value, the type field is |V_ASN1_BIT_STRING|.
201
+ // See bit string documentation below for how the data and flags are used.
202
+ //
203
+ // When representing an INTEGER or ENUMERATED value, the type field is one of
204
+ // |V_ASN1_INTEGER|, |V_ASN1_NEG_INTEGER|, |V_ASN1_ENUMERATED|, or
205
+ // |V_ASN1_NEG_ENUMERATED|. See integer documentation below for details.
206
+ //
207
+ // When representing a GeneralizedTime or UTCTime value, the type field is
208
+ // |V_ASN1_GENERALIZEDTIME| or |V_ASN1_UTCTIME|, respectively. The data contains
209
+ // the DER encoding of the value. For example, the UNIX epoch would be
210
+ // "19700101000000Z" for a GeneralizedTime and "700101000000Z" for a UTCTime.
211
+ //
212
+ // |ASN1_STRING|, when stored in an |ASN1_TYPE|, may also represent an element
213
+ // with tag not directly supported by this library. See |ASN1_TYPE| for details.
214
+ //
215
+ // |ASN1_STRING| additionally has the following typedefs: |ASN1_BIT_STRING|,
216
+ // |ASN1_BMPSTRING|, |ASN1_ENUMERATED|, |ASN1_GENERALIZEDTIME|,
217
+ // |ASN1_GENERALSTRING|, |ASN1_IA5STRING|, |ASN1_INTEGER|, |ASN1_OCTET_STRING|,
218
+ // |ASN1_PRINTABLESTRING|, |ASN1_T61STRING|, |ASN1_TIME|,
219
+ // |ASN1_UNIVERSALSTRING|, |ASN1_UTCTIME|, |ASN1_UTF8STRING|, and
220
+ // |ASN1_VISIBLESTRING|. Other than |ASN1_TIME|, these correspond to universal
221
+ // ASN.1 types. |ASN1_TIME| represents a CHOICE of UTCTime and GeneralizedTime,
222
+ // with a cutoff of 2049, as used in Section 4.1.2.5 of RFC 5280.
223
+ //
224
+ // For clarity, callers are encouraged to use the appropriate typedef when
225
+ // available. They are the same type as |ASN1_STRING|, so a caller may freely
226
+ // pass them into functions expecting |ASN1_STRING|, such as
227
+ // |ASN1_STRING_length|.
228
+ //
229
+ // If a function returns an |ASN1_STRING| where the typedef or ASN.1 structure
230
+ // implies constraints on the type field, callers may assume that the type field
231
+ // is correct. However, if a function takes an |ASN1_STRING| as input, callers
232
+ // must ensure the type field matches. These invariants are not captured by the
233
+ // C type system and may not be checked at runtime. For example, callers may
234
+ // assume the output of |X509_get0_serialNumber| has type |V_ASN1_INTEGER| or
235
+ // |V_ASN1_NEG_INTEGER|. Callers must not pass a string of type
236
+ // |V_ASN1_OCTET_STRING| to |X509_set_serialNumber|. Doing so may break
237
+ // invariants on the |X509| object and break the |X509_get0_serialNumber|
238
+ // invariant.
239
+ //
240
+ // TODO(davidben): This is very unfriendly. Getting the type field wrong should
241
+ // not cause memory errors, but it may do strange things. We should add runtime
242
+ // checks to anything that consumes |ASN1_STRING|s from the caller.
243
+ struct asn1_string_st {
244
+ int length;
245
+ int type;
246
+ unsigned char *data;
247
+ long flags;
248
+ };
249
+
250
+ // ASN1_STRING_FLAG_BITS_LEFT indicates, in a BIT STRING |ASN1_STRING|, that
251
+ // flags & 0x7 contains the number of padding bits added to the BIT STRING
252
+ // value. When not set, all trailing zero bits in the last byte are implicitly
253
+ // treated as padding. This behavior is deprecated and should not be used.
254
+ #define ASN1_STRING_FLAG_BITS_LEFT 0x08
255
+
256
+ // ASN1_STRING_type_new returns a newly-allocated empty |ASN1_STRING| object of
257
+ // type |type|, or NULL on error.
258
+ OPENSSL_EXPORT ASN1_STRING *ASN1_STRING_type_new(int type);
259
+
260
+ // ASN1_STRING_new returns a newly-allocated empty |ASN1_STRING| object with an
261
+ // arbitrary type. Prefer one of the type-specific constructors, such as
262
+ // |ASN1_OCTET_STRING_new|, or |ASN1_STRING_type_new|.
263
+ OPENSSL_EXPORT ASN1_STRING *ASN1_STRING_new(void);
264
+
265
+ // ASN1_STRING_free releases memory associated with |str|.
266
+ OPENSSL_EXPORT void ASN1_STRING_free(ASN1_STRING *str);
267
+
268
+ // ASN1_STRING_copy sets |dst| to a copy of |str|. It returns one on success and
269
+ // zero on error.
270
+ OPENSSL_EXPORT int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
271
+
272
+ // ASN1_STRING_dup returns a newly-allocated copy of |str|, or NULL on error.
273
+ OPENSSL_EXPORT ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *str);
274
+
275
+ // ASN1_STRING_type returns the type of |str|. This value will be one of the
276
+ // |V_ASN1_*| constants.
277
+ OPENSSL_EXPORT int ASN1_STRING_type(const ASN1_STRING *str);
278
+
279
+ // ASN1_STRING_get0_data returns a pointer to |str|'s contents. Callers should
280
+ // use |ASN1_STRING_length| to determine the length of the string. The string
281
+ // may have embedded NUL bytes and may not be NUL-terminated.
282
+ OPENSSL_EXPORT const unsigned char *ASN1_STRING_get0_data(
283
+ const ASN1_STRING *str);
284
+
285
+ // ASN1_STRING_data returns a mutable pointer to |str|'s contents. Callers
286
+ // should use |ASN1_STRING_length| to determine the length of the string. The
287
+ // string may have embedded NUL bytes and may not be NUL-terminated.
288
+ //
289
+ // Prefer |ASN1_STRING_get0_data|.
290
+ OPENSSL_EXPORT unsigned char *ASN1_STRING_data(ASN1_STRING *str);
291
+
292
+ // ASN1_STRING_length returns the length of |str|, in bytes.
293
+ OPENSSL_EXPORT int ASN1_STRING_length(const ASN1_STRING *str);
294
+
295
+ // ASN1_STRING_cmp compares |a| and |b|'s type and contents. It returns an
296
+ // integer equal to, less than, or greater than zero if |a| is equal to, less
297
+ // than, or greater than |b|, respectively. This function compares by length,
298
+ // then data, then type. Note the data compared is the |ASN1_STRING| internal
299
+ // representation and the type order is arbitrary. While this comparison is
300
+ // suitable for sorting, callers should not rely on the exact order when |a|
301
+ // and |b| are different types.
302
+ //
303
+ // If |a| or |b| are BIT STRINGs, this function does not compare the
304
+ // |ASN1_STRING_FLAG_BITS_LEFT| flags. Additionally, if |a| and |b| are
305
+ // INTEGERs, this comparison does not order the values numerically. For a
306
+ // numerical comparison, use |ASN1_INTEGER_cmp|.
307
+ //
308
+ // TODO(davidben): The BIT STRING comparison seems like a bug. Fix it?
309
+ OPENSSL_EXPORT int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
310
+
311
+ // ASN1_STRING_set sets the contents of |str| to a copy of |len| bytes from
312
+ // |data|. It returns one on success and zero on error.
313
+ OPENSSL_EXPORT int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
314
+
315
+ // ASN1_STRING_set0 sets the contents of |str| to |len| bytes from |data|. It
316
+ // takes ownership of |data|, which must have been allocated with
317
+ // |OPENSSL_malloc|.
318
+ OPENSSL_EXPORT void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
319
+
320
+ // ASN1_STRING_to_UTF8 converts |in| to UTF-8. On success, sets |*out| to a
321
+ // newly-allocated buffer containing the resulting string and returns the length
322
+ // of the string. The caller must call |OPENSSL_free| to release |*out| when
323
+ // done. On error, it returns a negative number.
324
+ OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out,
325
+ const ASN1_STRING *in);
326
+
327
+ // The following formats define encodings for use with functions like
328
+ // |ASN1_mbstring_copy|.
329
+ #define MBSTRING_FLAG 0x1000
330
+ #define MBSTRING_UTF8 (MBSTRING_FLAG)
331
+ // |MBSTRING_ASC| refers to Latin-1, not ASCII.
332
+ #define MBSTRING_ASC (MBSTRING_FLAG | 1)
333
+ #define MBSTRING_BMP (MBSTRING_FLAG | 2)
334
+ #define MBSTRING_UNIV (MBSTRING_FLAG | 4)
335
+
336
+ // DIRSTRING_TYPE contains the valid string types in an X.509 DirectoryString.
337
+ #define DIRSTRING_TYPE \
338
+ (B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | \
339
+ B_ASN1_UTF8STRING)
340
+
341
+ // PKCS9STRING_TYPE contains the valid string types in a PKCS9String.
342
+ #define PKCS9STRING_TYPE (DIRSTRING_TYPE | B_ASN1_IA5STRING)
343
+
344
+ // ASN1_mbstring_copy converts |len| bytes from |in| to an ASN.1 string. If
345
+ // |len| is -1, |in| must be NUL-terminated and the length is determined by
346
+ // |strlen|. |in| is decoded according to |inform|, which must be one of
347
+ // |MBSTRING_*|. |mask| determines the set of valid output types and is a
348
+ // bitmask containing a subset of |B_ASN1_PRINTABLESTRING|, |B_ASN1_IA5STRING|,
349
+ // |B_ASN1_T61STRING|, |B_ASN1_BMPSTRING|, |B_ASN1_UNIVERSALSTRING|, and
350
+ // |B_ASN1_UTF8STRING|, in that preference order. This function chooses the
351
+ // first output type in |mask| which can represent |in|. It interprets T61String
352
+ // as Latin-1, rather than T.61.
353
+ //
354
+ // If |mask| is zero, |DIRSTRING_TYPE| is used by default.
355
+ //
356
+ // On success, this function returns the |V_ASN1_*| constant corresponding to
357
+ // the selected output type and, if |out| and |*out| are both non-NULL, updates
358
+ // the object at |*out| with the result. If |out| is non-NULL and |*out| is
359
+ // NULL, it instead sets |*out| to a newly-allocated |ASN1_STRING| containing
360
+ // the result. If |out| is NULL, it returns the selected output type without
361
+ // constructing an |ASN1_STRING|. On error, this function returns -1.
362
+ OPENSSL_EXPORT int ASN1_mbstring_copy(ASN1_STRING **out, const uint8_t *in,
363
+ int len, int inform, unsigned long mask);
364
+
365
+ // ASN1_mbstring_ncopy behaves like |ASN1_mbstring_copy| but returns an error if
366
+ // the input is less than |minsize| or greater than |maxsize| codepoints long. A
367
+ // |maxsize| value of zero is ignored. Note the sizes are measured in
368
+ // codepoints, not output bytes.
369
+ OPENSSL_EXPORT int ASN1_mbstring_ncopy(ASN1_STRING **out, const uint8_t *in,
370
+ int len, int inform, unsigned long mask,
371
+ long minsize, long maxsize);
372
+
373
+ // ASN1_STRING_set_by_NID behaves like |ASN1_mbstring_ncopy|, but determines
374
+ // |mask|, |minsize|, and |maxsize| based on |nid|. When |nid| is a recognized
375
+ // X.509 attribute type, it will pick a suitable ASN.1 string type and bounds.
376
+ // For most attribute types, it preferentially chooses UTF8String. If |nid| is
377
+ // unrecognized, it uses UTF8String by default.
378
+ //
379
+ // Slightly unlike |ASN1_mbstring_ncopy|, this function interprets |out| and
380
+ // returns its result as follows: If |out| is NULL, it returns a newly-allocated
381
+ // |ASN1_STRING| containing the result. If |out| is non-NULL and
382
+ // |*out| is NULL, it additionally sets |*out| to the result. If both |out| and
383
+ // |*out| are non-NULL, it instead updates the object at |*out| and returns
384
+ // |*out|. In all cases, it returns NULL on error.
385
+ //
386
+ // This function supports the following NIDs: |NID_countryName|,
387
+ // |NID_dnQualifier|, |NID_domainComponent|, |NID_friendlyName|,
388
+ // |NID_givenName|, |NID_initials|, |NID_localityName|, |NID_ms_csp_name|,
389
+ // |NID_name|, |NID_organizationalUnitName|, |NID_organizationName|,
390
+ // |NID_pkcs9_challengePassword|, |NID_pkcs9_emailAddress|,
391
+ // |NID_pkcs9_unstructuredAddress|, |NID_pkcs9_unstructuredName|,
392
+ // |NID_serialNumber|, |NID_stateOrProvinceName|, and |NID_surname|. Additional
393
+ // NIDs may be registered with |ASN1_STRING_set_by_NID|, but it is recommended
394
+ // to call |ASN1_mbstring_ncopy| directly instead.
395
+ OPENSSL_EXPORT ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
396
+ const unsigned char *in,
397
+ int len, int inform,
398
+ int nid);
399
+
400
+ // STABLE_NO_MASK causes |ASN1_STRING_TABLE_add| to allow types other than
401
+ // UTF8String.
402
+ #define STABLE_NO_MASK 0x02
403
+
404
+ // ASN1_STRING_TABLE_add registers the corresponding parameters with |nid|, for
405
+ // use with |ASN1_STRING_set_by_NID|. It returns one on success and zero on
406
+ // error. It is an error to call this function if |nid| is a built-in NID, or
407
+ // was already registered by a previous call.
408
+ //
409
+ // WARNING: This function affects global state in the library. If two libraries
410
+ // in the same address space register information for the same OID, one call
411
+ // will fail. Prefer directly passing the desired parametrs to
412
+ // |ASN1_mbstring_copy| or |ASN1_mbstring_ncopy| instead.
413
+ OPENSSL_EXPORT int ASN1_STRING_TABLE_add(int nid, long minsize, long maxsize,
414
+ unsigned long mask,
415
+ unsigned long flags);
416
+
417
+ // TODO(davidben): Expand and document function prototypes generated in macros.
418
+
419
+
420
+ // Bit strings.
421
+ //
422
+ // An ASN.1 BIT STRING type represents a string of bits. The string may not
423
+ // necessarily be a whole number of bytes. BIT STRINGs occur in ASN.1 structures
424
+ // in several forms:
425
+ //
426
+ // Some BIT STRINGs represent a bitmask of named bits, such as the X.509 key
427
+ // usage extension in RFC 5280, section 4.2.1.3. For such bit strings, DER
428
+ // imposes an additional restriction that trailing zero bits are removed. Some
429
+ // functions like |ASN1_BIT_STRING_set_bit| help in maintaining this.
430
+ //
431
+ // Other BIT STRINGs are arbitrary strings of bits used as identifiers and do
432
+ // not have this constraint, such as the X.509 issuerUniqueID field.
433
+ //
434
+ // Finally, some structures use BIT STRINGs as a container for byte strings. For
435
+ // example, the signatureValue field in X.509 and the subjectPublicKey field in
436
+ // SubjectPublicKeyInfo are defined as BIT STRINGs with a value specific to the
437
+ // AlgorithmIdentifier. While some unknown algorithm could choose to store
438
+ // arbitrary bit strings, all supported algorithms use a byte string, with bit
439
+ // order matching the DER encoding. Callers interpreting a BIT STRING as a byte
440
+ // string should use |ASN1_BIT_STRING_num_bytes| instead of |ASN1_STRING_length|
441
+ // and reject bit strings that are not a whole number of bytes.
442
+ //
443
+ // This library represents BIT STRINGs as |ASN1_STRING|s with type
444
+ // |V_ASN1_BIT_STRING|. The data contains the encoded form of the BIT STRING,
445
+ // including any padding bits added to round to a whole number of bytes, but
446
+ // excluding the leading byte containing the number of padding bits. If
447
+ // |ASN1_STRING_FLAG_BITS_LEFT| is set, the bottom three bits contains the
448
+ // number of padding bits. For example, DER encodes the BIT STRING {1, 0} as
449
+ // {0x06, 0x80 = 0b10_000000}. The |ASN1_STRING| representation has data of
450
+ // {0x80} and flags of ASN1_STRING_FLAG_BITS_LEFT | 6. If
451
+ // |ASN1_STRING_FLAG_BITS_LEFT| is unset, trailing zero bits are implicitly
452
+ // removed. Callers should not rely this representation when constructing bit
453
+ // strings.
454
+
455
+ // ASN1_BIT_STRING_num_bytes computes the length of |str| in bytes. If |str|'s
456
+ // bit length is a multiple of 8, it sets |*out| to the byte length and returns
457
+ // one. Otherwise, it returns zero.
458
+ //
459
+ // This function may be used with |ASN1_STRING_get0_data| to interpret |str| as
460
+ // a byte string.
461
+ OPENSSL_EXPORT int ASN1_BIT_STRING_num_bytes(const ASN1_BIT_STRING *str,
462
+ size_t *out);
463
+
464
+ // ASN1_BIT_STRING_set calls |ASN1_STRING_set|. It leaves flags unchanged, so
465
+ // the caller must set the number of unused bits.
466
+ //
467
+ // TODO(davidben): Maybe it should? Wrapping a byte string in a bit string is a
468
+ // common use case.
469
+ OPENSSL_EXPORT int ASN1_BIT_STRING_set(ASN1_BIT_STRING *str,
470
+ const unsigned char *d, int length);
471
+
472
+ // ASN1_BIT_STRING_set_bit sets bit |n| of |str| to one if |value| is non-zero
473
+ // and zero if |value| is zero, resizing |str| as needed. It then truncates
474
+ // trailing zeros in |str| to align with the DER represention for a bit string
475
+ // with named bits. It returns one on success and zero on error. |n| is indexed
476
+ // beginning from zero.
477
+ OPENSSL_EXPORT int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *str, int n,
478
+ int value);
479
+
480
+ // ASN1_BIT_STRING_get_bit returns one if bit |n| of |a| is in bounds and set,
481
+ // and zero otherwise. |n| is indexed beginning from zero.
482
+ OPENSSL_EXPORT int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *str, int n);
483
+
484
+ // ASN1_BIT_STRING_check returns one if |str| only contains bits that are set in
485
+ // the |flags_len| bytes pointed by |flags|. Otherwise it returns zero. Bits in
486
+ // |flags| are arranged according to the DER representation, so bit 0
487
+ // corresponds to the MSB of |flags[0]|.
488
+ OPENSSL_EXPORT int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *str,
489
+ const unsigned char *flags,
490
+ int flags_len);
491
+
492
+ // TODO(davidben): Expand and document function prototypes generated in macros.
493
+
494
+
495
+ // Integers and enumerated values.
496
+ //
497
+ // INTEGER and ENUMERATED values are represented as |ASN1_STRING|s where the
498
+ // data contains the big-endian encoding of the absolute value of the integer.
499
+ // The sign bit is encoded in the type: non-negative values have a type of
500
+ // |V_ASN1_INTEGER| or |V_ASN1_ENUMERATED|, while negative values have a type of
501
+ // |V_ASN1_NEG_INTEGER| or |V_ASN1_NEG_ENUMERATED|. Note this differs from DER's
502
+ // two's complement representation.
503
+
504
+ // ASN1_INTEGER_set sets |a| to an INTEGER with value |v|. It returns one on
505
+ // success and zero on error.
506
+ OPENSSL_EXPORT int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
209
507
 
210
- typedef struct ASN1_ENCODING_st
211
- {
212
- unsigned char *enc; /* DER encoding */
213
- long len; /* Length of encoding */
214
- int modified; /* set to 1 if 'enc' is invalid */
215
- /* alias_only is zero if |enc| owns the buffer that it points to
216
- * (although |enc| may still be NULL). If one, |enc| points into a
217
- * buffer that is owned elsewhere. */
218
- unsigned alias_only:1;
219
- /* alias_only_on_next_parse is one iff the next parsing operation
220
- * should avoid taking a copy of the input and rather set
221
- * |alias_only|. */
222
- unsigned alias_only_on_next_parse:1;
223
- } ASN1_ENCODING;
224
-
225
- #define STABLE_FLAGS_MALLOC 0x01
226
- #define STABLE_NO_MASK 0x02
227
- #define DIRSTRING_TYPE \
228
- (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
229
- #define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
230
-
231
- typedef struct asn1_string_table_st {
232
- int nid;
233
- long minsize;
234
- long maxsize;
235
- unsigned long mask;
236
- unsigned long flags;
237
- } ASN1_STRING_TABLE;
238
-
239
- /* size limits: this stuff is taken straight from RFC2459 */
240
-
241
- #define ub_name 32768
242
- #define ub_common_name 64
243
- #define ub_locality_name 128
244
- #define ub_state_name 128
245
- #define ub_organization_name 64
246
- #define ub_organization_unit_name 64
247
- #define ub_title 64
248
- #define ub_email_address 128
249
-
250
- /* Declarations for template structures: for full definitions
251
- * see asn1t.h
252
- */
253
- typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
254
- typedef struct ASN1_TLC_st ASN1_TLC;
255
- /* This is just an opaque pointer */
256
- typedef struct ASN1_VALUE_st ASN1_VALUE;
508
+ // ASN1_INTEGER_set sets |a| to an INTEGER with value |v|. It returns one on
509
+ // success and zero on error.
510
+ OPENSSL_EXPORT int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v);
257
511
 
258
- /* Declare ASN1 functions: the implement macro in in asn1t.h */
512
+ // ASN1_INTEGER_get returns the value of |a| as a |long|, or -1 if |a| is out of
513
+ // range or the wrong type.
514
+ OPENSSL_EXPORT long ASN1_INTEGER_get(const ASN1_INTEGER *a);
259
515
 
260
- #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
516
+ // BN_to_ASN1_INTEGER sets |ai| to an INTEGER with value |bn| and returns |ai|
517
+ // on success or NULL or error. If |ai| is NULL, it returns a newly-allocated
518
+ // |ASN1_INTEGER| on success instead, which the caller must release with
519
+ // |ASN1_INTEGER_free|.
520
+ OPENSSL_EXPORT ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn,
521
+ ASN1_INTEGER *ai);
522
+
523
+ // ASN1_INTEGER_to_BN sets |bn| to the value of |ai| and returns |bn| on success
524
+ // or NULL or error. If |bn| is NULL, it returns a newly-allocated |BIGNUM| on
525
+ // success instead, which the caller must release with |BN_free|.
526
+ OPENSSL_EXPORT BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
527
+
528
+ // ASN1_INTEGER_cmp compares the values of |x| and |y|. It returns an integer
529
+ // equal to, less than, or greater than zero if |x| is equal to, less than, or
530
+ // greater than |y|, respectively.
531
+ OPENSSL_EXPORT int ASN1_INTEGER_cmp(const ASN1_INTEGER *x,
532
+ const ASN1_INTEGER *y);
533
+
534
+ // ASN1_ENUMERATED_set sets |a| to an ENUMERATED with value |v|. It returns one
535
+ // on success and zero on error.
536
+ OPENSSL_EXPORT int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
261
537
 
262
- #define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
263
- DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
538
+ // ASN1_INTEGER_get returns the value of |a| as a |long|, or -1 if |a| is out of
539
+ // range or the wrong type.
540
+ OPENSSL_EXPORT long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
264
541
 
265
- #define DECLARE_ASN1_FUNCTIONS_name(type, name) \
266
- DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
267
- DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
542
+ // BN_to_ASN1_ENUMERATED sets |ai| to an ENUMERATED with value |bn| and returns
543
+ // |ai| on success or NULL or error. If |ai| is NULL, it returns a
544
+ // newly-allocated |ASN1_INTEGER| on success instead, which the caller must
545
+ // release with |ASN1_INTEGER_free|.
546
+ OPENSSL_EXPORT ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn,
547
+ ASN1_ENUMERATED *ai);
548
+
549
+ // ASN1_ENUMERATED_to_BN sets |bn| to the value of |ai| and returns |bn| on
550
+ // success or NULL or error. If |bn| is NULL, it returns a newly-allocated
551
+ // |BIGNUM| on success instead, which the caller must release with |BN_free|.
552
+ OPENSSL_EXPORT BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai,
553
+ BIGNUM *bn);
554
+
555
+ // TODO(davidben): Expand and document function prototypes generated in macros.
556
+
557
+
558
+ // Time.
559
+ //
560
+ // GeneralizedTime and UTCTime values are represented as |ASN1_STRING|s. The
561
+ // type field is |V_ASN1_GENERALIZEDTIME| or |V_ASN1_UTCTIME|, respectively. The
562
+ // data field contains the DER encoding of the value. For example, the UNIX
563
+ // epoch would be "19700101000000Z" for a GeneralizedTime and "700101000000Z"
564
+ // for a UTCTime.
565
+ //
566
+ // ASN.1 does not define how to interpret UTCTime's two-digit year. RFC 5280
567
+ // defines it as a range from 1950 to 2049 for X.509. The library uses the
568
+ // RFC 5280 interpretation. It does not currently enforce the restrictions from
569
+ // BER, and the additional restrictions from RFC 5280, but future versions may.
570
+ // Callers should not rely on fractional seconds and non-UTC time zones.
571
+ //
572
+ // The |ASN1_TIME| typedef represents the X.509 Time type, which is a CHOICE of
573
+ // GeneralizedTime and UTCTime, using UTCTime when the value is in range.
574
+
575
+ // ASN1_UTCTIME_check returns one if |a| is a valid UTCTime and zero otherwise.
576
+ OPENSSL_EXPORT int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
268
577
 
269
- #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
270
- DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
271
- DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
578
+ // ASN1_UTCTIME_set represents |t| as a UTCTime and writes the result to |s|. It
579
+ // returns |s| on success and NULL on error. If |s| is NULL, it returns a
580
+ // newly-allocated |ASN1_UTCTIME| instead.
581
+ //
582
+ // Note this function may fail if the time is out of range for UTCTime.
583
+ OPENSSL_EXPORT ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
584
+
585
+ // ASN1_UTCTIME_adj adds |offset_day| days and |offset_sec| seconds to |t| and
586
+ // writes the result to |s| as a UTCTime. It returns |s| on success and NULL on
587
+ // error. If |s| is NULL, it returns a newly-allocated |ASN1_UTCTIME| instead.
588
+ //
589
+ // Note this function may fail if the time overflows or is out of range for
590
+ // UTCTime.
591
+ OPENSSL_EXPORT ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
592
+ int offset_day, long offset_sec);
593
+
594
+ // ASN1_UTCTIME_set_string sets |s| to a UTCTime whose contents are a copy of
595
+ // |str|. It returns one on success and zero on error or if |str| is not a valid
596
+ // UTCTime.
597
+ //
598
+ // If |s| is NULL, this function validates |str| without copying it.
599
+ OPENSSL_EXPORT int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
272
600
 
273
- #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
274
- OPENSSL_EXPORT type *d2i_##name(type **a, const unsigned char **in, long len); \
275
- OPENSSL_EXPORT int i2d_##name(type *a, unsigned char **out); \
276
- DECLARE_ASN1_ITEM(itname)
601
+ // ASN1_UTCTIME_cmp_time_t compares |s| to |t|. It returns -1 if |s| < |t|, 0 if
602
+ // they are equal, 1 if |s| > |t|, and -2 on error.
603
+ OPENSSL_EXPORT int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
277
604
 
278
- #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
279
- OPENSSL_EXPORT type *d2i_##name(type **a, const unsigned char **in, long len); \
280
- OPENSSL_EXPORT int i2d_##name(const type *a, unsigned char **out); \
281
- DECLARE_ASN1_ITEM(name)
605
+ // ASN1_GENERALIZEDTIME_check returns one if |a| is a valid GeneralizedTime and
606
+ // zero otherwise.
607
+ OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
282
608
 
283
- #define DECLARE_ASN1_NDEF_FUNCTION(name) \
284
- OPENSSL_EXPORT int i2d_##name##_NDEF(name *a, unsigned char **out);
609
+ // ASN1_GENERALIZEDTIME_set represents |t| as a GeneralizedTime and writes the
610
+ // result to |s|. It returns |s| on success and NULL on error. If |s| is NULL,
611
+ // it returns a newly-allocated |ASN1_GENERALIZEDTIME| instead.
612
+ //
613
+ // Note this function may fail if the time is out of range for GeneralizedTime.
614
+ OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(
615
+ ASN1_GENERALIZEDTIME *s, time_t t);
616
+
617
+ // ASN1_GENERALIZEDTIME_adj adds |offset_day| days and |offset_sec| seconds to
618
+ // |t| and writes the result to |s| as a GeneralizedTime. It returns |s| on
619
+ // success and NULL on error. If |s| is NULL, it returns a newly-allocated
620
+ // |ASN1_GENERALIZEDTIME| instead.
621
+ //
622
+ // Note this function may fail if the time overflows or is out of range for
623
+ // GeneralizedTime.
624
+ OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(
625
+ ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, long offset_sec);
626
+
627
+ // ASN1_GENERALIZEDTIME_set_string sets |s| to a GeneralizedTime whose contents
628
+ // are a copy of |str|. It returns one on success and zero on error or if |str|
629
+ // is not a valid GeneralizedTime.
630
+ //
631
+ // If |s| is NULL, this function validates |str| without copying it.
632
+ OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s,
633
+ const char *str);
634
+
635
+ // ASN1_TIME_diff computes |to| - |from|. On success, it sets |*out_days| to the
636
+ // difference in days, rounded towards zero, sets |*out_seconds| to the
637
+ // remainder, and returns one. On error, it returns zero.
638
+ //
639
+ // If |from| is before |to|, both outputs will be <= 0, with at least one
640
+ // negative. If |from| is after |to|, both will be >= 0, with at least one
641
+ // positive. If they are equal, ignoring fractional seconds, both will be zero.
642
+ //
643
+ // Note this function may fail on overflow, or if |from| or |to| cannot be
644
+ // decoded.
645
+ OPENSSL_EXPORT int ASN1_TIME_diff(int *out_days, int *out_seconds,
646
+ const ASN1_TIME *from, const ASN1_TIME *to);
647
+
648
+ // ASN1_TIME_set represents |t| as a GeneralizedTime or UTCTime and writes
649
+ // the result to |s|. As in RFC 5280, section 4.1.2.5, it uses UTCTime when the
650
+ // time fits and GeneralizedTime otherwise. It returns |s| on success and NULL
651
+ // on error. If |s| is NULL, it returns a newly-allocated |ASN1_TIME| instead.
652
+ //
653
+ // Note this function may fail if the time is out of range for GeneralizedTime.
654
+ OPENSSL_EXPORT ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
655
+
656
+ // ASN1_TIME_adj adds |offset_day| days and |offset_sec| seconds to
657
+ // |t| and writes the result to |s|. As in RFC 5280, section 4.1.2.5, it uses
658
+ // UTCTime when the time fits and GeneralizedTime otherwise. It returns |s| on
659
+ // success and NULL on error. If |s| is NULL, it returns a newly-allocated
660
+ // |ASN1_GENERALIZEDTIME| instead.
661
+ //
662
+ // Note this function may fail if the time overflows or is out of range for
663
+ // GeneralizedTime.
664
+ OPENSSL_EXPORT ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day,
665
+ long offset_sec);
666
+
667
+ // ASN1_TIME_check returns one if |t| is a valid UTCTime or GeneralizedTime, and
668
+ // zero otherwise. |t|'s type determines which check is performed. This
669
+ // function does not enforce that UTCTime was used when possible.
670
+ OPENSSL_EXPORT int ASN1_TIME_check(const ASN1_TIME *t);
285
671
 
286
- #define DECLARE_ASN1_FUNCTIONS_const(name) \
287
- DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
288
- DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
672
+ // ASN1_TIME_to_generalizedtime converts |t| to a GeneralizedTime. If |out| is
673
+ // NULL, it returns a newly-allocated |ASN1_GENERALIZEDTIME| on success, or NULL
674
+ // on error. If |out| is non-NULL and |*out| is NULL, it additionally sets
675
+ // |*out| to the result. If |out| and |*out| are non-NULL, it instead updates
676
+ // the object pointed by |*out| and returns |*out| on success or NULL on error.
677
+ OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(
678
+ const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
679
+
680
+ // ASN1_TIME_set_string behaves like |ASN1_UTCTIME_set_string| if |str| is a
681
+ // valid UTCTime, and |ASN1_GENERALIZEDTIME_set_string| if |str| is a valid
682
+ // GeneralizedTime. If |str| is neither, it returns zero.
683
+ OPENSSL_EXPORT int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
289
684
 
290
- #define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
291
- OPENSSL_EXPORT type *name##_new(void); \
292
- OPENSSL_EXPORT void name##_free(type *a);
685
+ // TODO(davidben): Expand and document function prototypes generated in macros.
293
686
 
294
- #define DECLARE_ASN1_PRINT_FUNCTION(stname) \
295
- DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)
296
687
 
297
- #define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
298
- OPENSSL_EXPORT int fname##_print_ctx(BIO *out, stname *x, int indent, \
299
- const ASN1_PCTX *pctx);
688
+ // Arbitrary elements.
300
689
 
301
- typedef void *d2i_of_void(void **, const unsigned char **, long);
302
- typedef int i2d_of_void(const void *, unsigned char **);
690
+ // ASN1_VALUE_st (aka |ASN1_VALUE|) is an opaque type used internally in the
691
+ // library.
692
+ typedef struct ASN1_VALUE_st ASN1_VALUE;
303
693
 
304
- /* The following macros and typedefs allow an ASN1_ITEM
305
- * to be embedded in a structure and referenced. Since
306
- * the ASN1_ITEM pointers need to be globally accessible
307
- * (possibly from shared libraries) they may exist in
308
- * different forms. On platforms that support it the
309
- * ASN1_ITEM structure itself will be globally exported.
310
- * Other platforms will export a function that returns
311
- * an ASN1_ITEM pointer.
312
- *
313
- * To handle both cases transparently the macros below
314
- * should be used instead of hard coding an ASN1_ITEM
315
- * pointer in a structure.
316
- *
317
- * The structure will look like this:
318
- *
319
- * typedef struct SOMETHING_st {
320
- * ...
321
- * ASN1_ITEM_EXP *iptr;
322
- * ...
323
- * } SOMETHING;
324
- *
325
- * It would be initialised as e.g.:
326
- *
327
- * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
328
- *
329
- * and the actual pointer extracted with:
330
- *
331
- * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
332
- *
333
- * Finally an ASN1_ITEM pointer can be extracted from an
334
- * appropriate reference with: ASN1_ITEM_rptr(X509). This
335
- * would be used when a function takes an ASN1_ITEM * argument.
336
- *
337
- */
694
+ // An asn1_type_st (aka |ASN1_TYPE|) represents an arbitrary ASN.1 element,
695
+ // typically used used for ANY types. It contains a |type| field and a |value|
696
+ // union dependent on |type|.
697
+ //
698
+ // WARNING: This struct has a complex representation. Callers must not construct
699
+ // |ASN1_TYPE| values manually. Use |ASN1_TYPE_set| and |ASN1_TYPE_set1|
700
+ // instead. Additionally, callers performing non-trivial operations on this type
701
+ // are encouraged to use |CBS| and |CBB| from <openssl/bytestring.h>, and
702
+ // convert to or from |ASN1_TYPE| with |d2i_ASN1_TYPE| or |i2d_ASN1_TYPE|.
703
+ //
704
+ // The |type| field corresponds to the tag of the ASN.1 element being
705
+ // represented:
706
+ //
707
+ // If |type| is a |V_ASN1_*| constant for an ASN.1 string-like type, as defined
708
+ // by |ASN1_STRING|, the tag matches the constant. |value| contains an
709
+ // |ASN1_STRING| pointer (equivalently, one of the more specific typedefs). See
710
+ // |ASN1_STRING| for details on the representation. Unlike |ASN1_STRING|,
711
+ // |ASN1_TYPE| does not use the |V_ASN1_NEG| flag for negative INTEGER and
712
+ // ENUMERATE values. For a negative value, the |ASN1_TYPE|'s |type| will be
713
+ // |V_ASN1_INTEGER| or |V_ASN1_ENUMERATED|, but |value| will an |ASN1_STRING|
714
+ // whose |type| is |V_ASN1_NEG_INTEGER| or |V_ASN1_NEG_ENUMERATED|.
715
+ //
716
+ // If |type| is |V_ASN1_OBJECT|, the tag is OBJECT IDENTIFIER and |value|
717
+ // contains an |ASN1_OBJECT| pointer.
718
+ //
719
+ // If |type| is |V_ASN1_NULL|, the tag is NULL. |value| contains a NULL pointer.
720
+ //
721
+ // If |type| is |V_ASN1_BOOLEAN|, the tag is BOOLEAN. |value| contains an
722
+ // |ASN1_BOOLEAN|.
723
+ //
724
+ // If |type| is |V_ASN1_SEQUENCE|, |V_ASN1_SET|, or |V_ASN1_OTHER|, the tag is
725
+ // SEQUENCE, SET, or some non-universal tag, respectively. |value| is an
726
+ // |ASN1_STRING| containing the entire element, including the tag and length.
727
+ // The |ASN1_STRING|'s |type| field matches the containing |ASN1_TYPE|'s |type|.
728
+ //
729
+ // Other positive values of |type|, up to |V_ASN1_MAX_UNIVERSAL|, correspond to
730
+ // universal primitive tags not directly supported by this library. |value| is
731
+ // an |ASN1_STRING| containing the body of the element, excluding the tag
732
+ // and length. The |ASN1_STRING|'s |type| field matches the containing
733
+ // |ASN1_TYPE|'s |type|.
734
+ struct asn1_type_st {
735
+ int type;
736
+ union {
737
+ char *ptr;
738
+ ASN1_BOOLEAN boolean;
739
+ ASN1_STRING *asn1_string;
740
+ ASN1_OBJECT *object;
741
+ ASN1_INTEGER *integer;
742
+ ASN1_ENUMERATED *enumerated;
743
+ ASN1_BIT_STRING *bit_string;
744
+ ASN1_OCTET_STRING *octet_string;
745
+ ASN1_PRINTABLESTRING *printablestring;
746
+ ASN1_T61STRING *t61string;
747
+ ASN1_IA5STRING *ia5string;
748
+ ASN1_GENERALSTRING *generalstring;
749
+ ASN1_BMPSTRING *bmpstring;
750
+ ASN1_UNIVERSALSTRING *universalstring;
751
+ ASN1_UTCTIME *utctime;
752
+ ASN1_GENERALIZEDTIME *generalizedtime;
753
+ ASN1_VISIBLESTRING *visiblestring;
754
+ ASN1_UTF8STRING *utf8string;
755
+ // set and sequence are left complete and still contain the entire element.
756
+ ASN1_STRING *set;
757
+ ASN1_STRING *sequence;
758
+ ASN1_VALUE *asn1_value;
759
+ } value;
760
+ };
761
+
762
+ // ASN1_TYPE_get returns the type of |a|, which will be one of the |V_ASN1_*|
763
+ // constants, or zero if |a| is not fully initialized.
764
+ OPENSSL_EXPORT int ASN1_TYPE_get(const ASN1_TYPE *a);
338
765
 
339
- /* ASN1_ITEM pointer exported type */
340
- typedef const ASN1_ITEM ASN1_ITEM_EXP;
766
+ // ASN1_TYPE_set sets |a| to an |ASN1_TYPE| of type |type| and value |value|,
767
+ // releasing the previous contents of |a|.
768
+ //
769
+ // If |type| is |V_ASN1_BOOLEAN|, |a| is set to FALSE if |value| is NULL and
770
+ // TRUE otherwise. If setting |a| to TRUE, |value| may be an invalid pointer,
771
+ // such as (void*)1.
772
+ //
773
+ // If |type| is |V_ASN1_NULL|, |value| must be NULL.
774
+ //
775
+ // For other values of |type|, this function takes ownership of |value|, which
776
+ // must point to an object of the corresponding type. See |ASN1_TYPE| for
777
+ // details.
778
+ OPENSSL_EXPORT void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
341
779
 
342
- /* Macro to obtain ASN1_ITEM pointer from exported type */
343
- #define ASN1_ITEM_ptr(iptr) (iptr)
780
+ // ASN1_TYPE_set1 behaves like |ASN1_TYPE_set| except it does not take ownership
781
+ // of |value|. It returns one on success and zero on error.
782
+ OPENSSL_EXPORT int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
344
783
 
345
- /* Macro to include ASN1_ITEM pointer from base type */
346
- #define ASN1_ITEM_ref(iptr) (&(iptr##_it))
784
+ // ASN1_TYPE_cmp returns zero if |a| and |b| are equal and some non-zero value
785
+ // otherwise. Note this function can only be used for equality checks, not an
786
+ // ordering.
787
+ OPENSSL_EXPORT int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
347
788
 
348
- #define ASN1_ITEM_rptr(ref) (&(ref##_it))
789
+ // TODO(davidben): Most of |ASN1_TYPE|'s APIs are hidden behind macros. Expand
790
+ // the macros, document them, and move them to this section.
791
+
792
+
793
+ // Human-readable output.
794
+ //
795
+ // The following functions output types in some human-readable format. These
796
+ // functions may be used for debugging and logging. However, the output should
797
+ // not be consumed programmatically. They may be ambiguous or lose information.
798
+
799
+ // ASN1_UTCTIME_print writes a human-readable representation of |a| to |out|. It
800
+ // returns one on success and zero on error.
801
+ OPENSSL_EXPORT int ASN1_UTCTIME_print(BIO *out, const ASN1_UTCTIME *a);
802
+
803
+ // ASN1_GENERALIZEDTIME_print writes a human-readable representation of |a| to
804
+ // |out|. It returns one on success and zero on error.
805
+ OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_print(BIO *out,
806
+ const ASN1_GENERALIZEDTIME *a);
807
+
808
+ // ASN1_TIME_print writes a human-readable representation of |a| to |out|. It
809
+ // returns one on success and zero on error.
810
+ OPENSSL_EXPORT int ASN1_TIME_print(BIO *out, const ASN1_TIME *a);
811
+
812
+ // ASN1_STRING_print writes a human-readable representation of |str| to |out|.
813
+ // It returns one on success and zero on error. Unprintable characters are
814
+ // replaced with '.'.
815
+ OPENSSL_EXPORT int ASN1_STRING_print(BIO *out, const ASN1_STRING *str);
816
+
817
+ // ASN1_STRFLGS_ESC_2253 causes characters to be escaped as in RFC 2253, section
818
+ // 2.4.
819
+ #define ASN1_STRFLGS_ESC_2253 1
820
+
821
+ // ASN1_STRFLGS_ESC_CTRL causes all control characters to be escaped.
822
+ #define ASN1_STRFLGS_ESC_CTRL 2
823
+
824
+ // ASN1_STRFLGS_ESC_MSB causes all characters above 127 to be escaped.
825
+ #define ASN1_STRFLGS_ESC_MSB 4
826
+
827
+ // ASN1_STRFLGS_ESC_QUOTE causes the string to be surrounded by quotes, rather
828
+ // than using backslashes, when characters are escaped. Fewer characters will
829
+ // require escapes in this case.
830
+ #define ASN1_STRFLGS_ESC_QUOTE 8
831
+
832
+ // ASN1_STRFLGS_UTF8_CONVERT causes the string to be encoded as UTF-8, with each
833
+ // byte in the UTF-8 encoding treated as an individual character for purposes of
834
+ // escape sequences. If not set, each Unicode codepoint in the string is treated
835
+ // as a character, with wide characters escaped as "\Uxxxx" or "\Wxxxxxxxx".
836
+ // Note this can be ambiguous if |ASN1_STRFLGS_ESC_*| are all unset. In that
837
+ // case, backslashes are not escaped, but wide characters are.
838
+ #define ASN1_STRFLGS_UTF8_CONVERT 0x10
839
+
840
+ // ASN1_STRFLGS_IGNORE_TYPE causes the string type to be ignored. The
841
+ // |ASN1_STRING| in-memory representation will be printed directly.
842
+ #define ASN1_STRFLGS_IGNORE_TYPE 0x20
843
+
844
+ // ASN1_STRFLGS_SHOW_TYPE causes the string type to be included in the output.
845
+ #define ASN1_STRFLGS_SHOW_TYPE 0x40
846
+
847
+ // ASN1_STRFLGS_DUMP_ALL causes all strings to be printed as a hexdump, using
848
+ // RFC 2253 hexstring notation, such as "#0123456789ABCDEF".
849
+ #define ASN1_STRFLGS_DUMP_ALL 0x80
850
+
851
+ // ASN1_STRFLGS_DUMP_UNKNOWN behaves like |ASN1_STRFLGS_DUMP_ALL| but only
852
+ // applies to values of unknown type. If unset, unknown values will print
853
+ // their contents as single-byte characters with escape sequences.
854
+ #define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
855
+
856
+ // ASN1_STRFLGS_DUMP_DER causes hexdumped strings (as determined by
857
+ // |ASN1_STRFLGS_DUMP_ALL| or |ASN1_STRFLGS_DUMP_UNKNOWN|) to print the entire
858
+ // DER element as in RFC 2253, rather than only the contents of the
859
+ // |ASN1_STRING|.
860
+ #define ASN1_STRFLGS_DUMP_DER 0x200
861
+
862
+ // ASN1_STRFLGS_RFC2253 causes the string to be escaped as in RFC 2253,
863
+ // additionally escaping control characters.
864
+ #define ASN1_STRFLGS_RFC2253 \
865
+ (ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | \
866
+ ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | \
867
+ ASN1_STRFLGS_DUMP_DER)
868
+
869
+ // ASN1_STRING_print_ex writes a human-readable representation of |str| to
870
+ // |out|. It returns the number of bytes written on success and -1 on error. If
871
+ // |out| is NULL, it returns the number of bytes it would have written, without
872
+ // writing anything.
873
+ //
874
+ // The |flags| should be a combination of combination of |ASN1_STRFLGS_*|
875
+ // constants. See the documentation for each flag for how it controls the
876
+ // output. If unsure, use |ASN1_STRFLGS_RFC2253|.
877
+ OPENSSL_EXPORT int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str,
878
+ unsigned long flags);
879
+
880
+ // ASN1_STRING_print_ex_fp behaves like |ASN1_STRING_print_ex| but writes to a
881
+ // |FILE| rather than a |BIO|.
882
+ OPENSSL_EXPORT int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str,
883
+ unsigned long flags);
884
+
885
+
886
+ // Deprecated functions.
887
+
888
+ // ASN1_PRINTABLE_type interprets |len| bytes from |s| as a Latin-1 string. It
889
+ // returns the first of |V_ASN1_PRINTABLESTRING|, |V_ASN1_IA5STRING|, or
890
+ // |V_ASN1_T61STRING| that can represent every character. If |len| is negative,
891
+ // |strlen(s)| is used instead.
892
+ //
893
+ // TODO(davidben): Remove this once all copies of Conscrypt have been updated
894
+ // past https://github.com/google/conscrypt/pull/1032.
895
+ OPENSSL_EXPORT int ASN1_PRINTABLE_type(const unsigned char *s, int len);
896
+
897
+ // ASN1_STRING_set_default_mask does nothing.
898
+ OPENSSL_EXPORT void ASN1_STRING_set_default_mask(unsigned long mask);
349
899
 
350
- #define DECLARE_ASN1_ITEM(name) \
351
- extern OPENSSL_EXPORT const ASN1_ITEM name##_it;
900
+ // ASN1_STRING_set_default_mask_asc returns one.
901
+ OPENSSL_EXPORT int ASN1_STRING_set_default_mask_asc(const char *p);
352
902
 
353
- /* Parameters used by ASN1_STRING_print_ex() */
903
+ // ASN1_STRING_get_default_mask returns |B_ASN1_UTF8STRING|.
904
+ OPENSSL_EXPORT unsigned long ASN1_STRING_get_default_mask(void);
354
905
 
355
- /* These determine which characters to escape:
356
- * RFC2253 special characters, control characters and
357
- * MSB set characters
358
- */
906
+ // ASN1_STRING_TABLE_cleanup does nothing.
907
+ OPENSSL_EXPORT void ASN1_STRING_TABLE_cleanup(void);
359
908
 
360
- #define ASN1_STRFLGS_ESC_2253 1
361
- #define ASN1_STRFLGS_ESC_CTRL 2
362
- #define ASN1_STRFLGS_ESC_MSB 4
363
909
 
910
+ // Underdocumented functions.
911
+ //
912
+ // The following functions are not yet documented and organized.
364
913
 
365
- /* This flag determines how we do escaping: normally
366
- * RC2253 backslash only, set this to use backslash and
367
- * quote.
368
- */
914
+ DEFINE_STACK_OF(ASN1_OBJECT)
369
915
 
370
- #define ASN1_STRFLGS_ESC_QUOTE 8
916
+ // ASN1_ENCODING structure: this is used to save the received
917
+ // encoding of an ASN1 type. This is useful to get round
918
+ // problems with invalid encodings which can break signatures.
919
+
920
+ typedef struct ASN1_ENCODING_st {
921
+ unsigned char *enc; // DER encoding
922
+ long len; // Length of encoding
923
+ int modified; // set to 1 if 'enc' is invalid
924
+ // alias_only is zero if |enc| owns the buffer that it points to
925
+ // (although |enc| may still be NULL). If one, |enc| points into a
926
+ // buffer that is owned elsewhere.
927
+ unsigned alias_only : 1;
928
+ // alias_only_on_next_parse is one iff the next parsing operation
929
+ // should avoid taking a copy of the input and rather set
930
+ // |alias_only|.
931
+ unsigned alias_only_on_next_parse : 1;
932
+ } ASN1_ENCODING;
933
+
934
+ // Declarations for template structures: for full definitions
935
+ // see asn1t.h
936
+ typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
937
+ typedef struct ASN1_TLC_st ASN1_TLC;
371
938
 
939
+ // Declare ASN1 functions: the implement macro in in asn1t.h
372
940
 
373
- /* These three flags are internal use only. */
941
+ #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
374
942
 
375
- /* Character is a valid PrintableString character */
376
- #define CHARTYPE_PRINTABLESTRING 0x10
377
- /* Character needs escaping if it is the first character */
378
- #define CHARTYPE_FIRST_ESC_2253 0x20
379
- /* Character needs escaping if it is the last character */
380
- #define CHARTYPE_LAST_ESC_2253 0x40
943
+ #define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
944
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
381
945
 
382
- /* NB the internal flags are safely reused below by flags
383
- * handled at the top level.
384
- */
946
+ #define DECLARE_ASN1_FUNCTIONS_name(type, name) \
947
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
948
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
385
949
 
386
- /* If this is set we convert all character strings
387
- * to UTF8 first
388
- */
950
+ #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
951
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
952
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
389
953
 
390
- #define ASN1_STRFLGS_UTF8_CONVERT 0x10
954
+ #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
955
+ OPENSSL_EXPORT type *d2i_##name(type **a, const unsigned char **in, \
956
+ long len); \
957
+ OPENSSL_EXPORT int i2d_##name(type *a, unsigned char **out); \
958
+ DECLARE_ASN1_ITEM(itname)
391
959
 
392
- /* If this is set we don't attempt to interpret content:
393
- * just assume all strings are 1 byte per character. This
394
- * will produce some pretty odd looking output!
395
- */
960
+ #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
961
+ OPENSSL_EXPORT type *d2i_##name(type **a, const unsigned char **in, \
962
+ long len); \
963
+ OPENSSL_EXPORT int i2d_##name(const type *a, unsigned char **out); \
964
+ DECLARE_ASN1_ITEM(name)
396
965
 
397
- #define ASN1_STRFLGS_IGNORE_TYPE 0x20
966
+ #define DECLARE_ASN1_FUNCTIONS_const(name) \
967
+ DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
968
+ DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
398
969
 
399
- /* If this is set we include the string type in the output */
400
- #define ASN1_STRFLGS_SHOW_TYPE 0x40
970
+ #define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
971
+ OPENSSL_EXPORT type *name##_new(void); \
972
+ OPENSSL_EXPORT void name##_free(type *a);
401
973
 
402
- /* This determines which strings to display and which to
403
- * 'dump' (hex dump of content octets or DER encoding). We can
404
- * only dump non character strings or everything. If we
405
- * don't dump 'unknown' they are interpreted as character
406
- * strings with 1 octet per character and are subject to
407
- * the usual escaping options.
408
- */
974
+ typedef void *d2i_of_void(void **, const unsigned char **, long);
975
+ typedef int i2d_of_void(const void *, unsigned char **);
409
976
 
410
- #define ASN1_STRFLGS_DUMP_ALL 0x80
411
- #define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
977
+ // The following macros and typedefs allow an ASN1_ITEM
978
+ // to be embedded in a structure and referenced. Since
979
+ // the ASN1_ITEM pointers need to be globally accessible
980
+ // (possibly from shared libraries) they may exist in
981
+ // different forms. On platforms that support it the
982
+ // ASN1_ITEM structure itself will be globally exported.
983
+ // Other platforms will export a function that returns
984
+ // an ASN1_ITEM pointer.
985
+ //
986
+ // To handle both cases transparently the macros below
987
+ // should be used instead of hard coding an ASN1_ITEM
988
+ // pointer in a structure.
989
+ //
990
+ // The structure will look like this:
991
+ //
992
+ // typedef struct SOMETHING_st {
993
+ // ...
994
+ // ASN1_ITEM_EXP *iptr;
995
+ // ...
996
+ // } SOMETHING;
997
+ //
998
+ // It would be initialised as e.g.:
999
+ //
1000
+ // SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
1001
+ //
1002
+ // and the actual pointer extracted with:
1003
+ //
1004
+ // const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
1005
+ //
1006
+ // Finally an ASN1_ITEM pointer can be extracted from an
1007
+ // appropriate reference with: ASN1_ITEM_rptr(X509). This
1008
+ // would be used when a function takes an ASN1_ITEM * argument.
1009
+ //
1010
+
1011
+ // ASN1_ITEM pointer exported type
1012
+ typedef const ASN1_ITEM ASN1_ITEM_EXP;
412
1013
 
413
- /* These determine what 'dumping' does, we can dump the
414
- * content octets or the DER encoding: both use the
415
- * RFC2253 #XXXXX notation.
416
- */
1014
+ // Macro to obtain ASN1_ITEM pointer from exported type
1015
+ #define ASN1_ITEM_ptr(iptr) (iptr)
417
1016
 
418
- #define ASN1_STRFLGS_DUMP_DER 0x200
1017
+ // Macro to include ASN1_ITEM pointer from base type
1018
+ #define ASN1_ITEM_ref(iptr) (&(iptr##_it))
419
1019
 
420
- /* All the string flags consistent with RFC2253,
421
- * escaping control characters isn't essential in
422
- * RFC2253 but it is advisable anyway.
423
- */
1020
+ #define ASN1_ITEM_rptr(ref) (&(ref##_it))
424
1021
 
425
- #define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
426
- ASN1_STRFLGS_ESC_CTRL | \
427
- ASN1_STRFLGS_ESC_MSB | \
428
- ASN1_STRFLGS_UTF8_CONVERT | \
429
- ASN1_STRFLGS_DUMP_UNKNOWN | \
430
- ASN1_STRFLGS_DUMP_DER)
1022
+ #define DECLARE_ASN1_ITEM(name) extern OPENSSL_EXPORT const ASN1_ITEM name##_it;
431
1023
 
432
1024
  DEFINE_STACK_OF(ASN1_INTEGER)
433
- DECLARE_ASN1_SET_OF(ASN1_INTEGER)
434
-
435
- struct asn1_type_st
436
- {
437
- int type;
438
- union {
439
- char *ptr;
440
- ASN1_BOOLEAN boolean;
441
- ASN1_STRING * asn1_string;
442
- ASN1_OBJECT * object;
443
- ASN1_INTEGER * integer;
444
- ASN1_ENUMERATED * enumerated;
445
- ASN1_BIT_STRING * bit_string;
446
- ASN1_OCTET_STRING * octet_string;
447
- ASN1_PRINTABLESTRING * printablestring;
448
- ASN1_T61STRING * t61string;
449
- ASN1_IA5STRING * ia5string;
450
- ASN1_GENERALSTRING * generalstring;
451
- ASN1_BMPSTRING * bmpstring;
452
- ASN1_UNIVERSALSTRING * universalstring;
453
- ASN1_UTCTIME * utctime;
454
- ASN1_GENERALIZEDTIME * generalizedtime;
455
- ASN1_VISIBLESTRING * visiblestring;
456
- ASN1_UTF8STRING * utf8string;
457
- /* set and sequence are left complete and still
458
- * contain the set or sequence bytes */
459
- ASN1_STRING * set;
460
- ASN1_STRING * sequence;
461
- ASN1_VALUE * asn1_value;
462
- } value;
463
- };
464
1025
 
465
1026
  DEFINE_STACK_OF(ASN1_TYPE)
466
- DECLARE_ASN1_SET_OF(ASN1_TYPE)
467
1027
 
468
1028
  typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
469
1029
 
470
1030
  DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
471
1031
  DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
472
1032
 
473
- struct X509_algor_st
474
- {
475
- ASN1_OBJECT *algorithm;
476
- ASN1_TYPE *parameter;
477
- } /* X509_ALGOR */;
478
-
479
- DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
480
-
481
- /* This is used to contain a list of bit names */
482
- typedef struct BIT_STRING_BITNAME_st {
483
- int bitnum;
484
- const char *lname;
485
- const char *sname;
486
- } BIT_STRING_BITNAME;
487
-
488
-
489
- #define M_ASN1_STRING_length(x) ((x)->length)
490
- #define M_ASN1_STRING_type(x) ((x)->type)
491
- #define M_ASN1_STRING_data(x) ((x)->data)
492
-
493
- /* Macros for string operations */
494
- #define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\
495
- ASN1_STRING_type_new(V_ASN1_BIT_STRING)
496
- #define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
497
- #define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
498
- ASN1_STRING_dup((const ASN1_STRING *)a)
499
- #define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
500
- (const ASN1_STRING *)a,(const ASN1_STRING *)b)
501
- #define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
502
-
503
- #define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\
504
- ASN1_STRING_type_new(V_ASN1_INTEGER)
505
- #define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a)
506
- #define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)\
507
- ASN1_STRING_dup((const ASN1_STRING *)a)
508
- #define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\
509
- (const ASN1_STRING *)a,(const ASN1_STRING *)b)
510
-
511
- #define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\
512
- ASN1_STRING_type_new(V_ASN1_ENUMERATED)
513
- #define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a)
514
- #define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)\
515
- ASN1_STRING_dup((const ASN1_STRING *)a)
516
- #define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\
517
- (const ASN1_STRING *)a,(const ASN1_STRING *)b)
518
-
519
- #define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\
520
- ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
521
- #define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
522
- #define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
523
- ASN1_STRING_dup((const ASN1_STRING *)a)
524
- #define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
525
- (const ASN1_STRING *)a,(const ASN1_STRING *)b)
526
- #define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
527
- #define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
528
-
529
- #define B_ASN1_TIME \
530
- B_ASN1_UTCTIME | \
531
- B_ASN1_GENERALIZEDTIME
532
-
533
- #define B_ASN1_PRINTABLE \
534
- B_ASN1_NUMERICSTRING| \
535
- B_ASN1_PRINTABLESTRING| \
536
- B_ASN1_T61STRING| \
537
- B_ASN1_IA5STRING| \
538
- B_ASN1_BIT_STRING| \
539
- B_ASN1_UNIVERSALSTRING|\
540
- B_ASN1_BMPSTRING|\
541
- B_ASN1_UTF8STRING|\
542
- B_ASN1_SEQUENCE|\
543
- B_ASN1_UNKNOWN
544
-
545
- #define B_ASN1_DIRECTORYSTRING \
546
- B_ASN1_PRINTABLESTRING| \
547
- B_ASN1_TELETEXSTRING|\
548
- B_ASN1_BMPSTRING|\
549
- B_ASN1_UNIVERSALSTRING|\
550
- B_ASN1_UTF8STRING
1033
+ // M_ASN1_* are legacy aliases for various |ASN1_STRING| functions. Use the
1034
+ // functions themselves.
1035
+ #define M_ASN1_STRING_length(x) ASN1_STRING_length(x)
1036
+ #define M_ASN1_STRING_type(x) ASN1_STRING_type(x)
1037
+ #define M_ASN1_STRING_data(x) ASN1_STRING_data(x)
1038
+ #define M_ASN1_BIT_STRING_new() ASN1_BIT_STRING_new()
1039
+ #define M_ASN1_BIT_STRING_free(a) ASN1_BIT_STRING_free(a)
1040
+ #define M_ASN1_BIT_STRING_dup(a) ASN1_STRING_dup(a)
1041
+ #define M_ASN1_BIT_STRING_cmp(a, b) ASN1_STRING_cmp(a, b)
1042
+ #define M_ASN1_BIT_STRING_set(a, b, c) ASN1_BIT_STRING_set(a, b, c)
1043
+ #define M_ASN1_INTEGER_new() ASN1_INTEGER_new()
1044
+ #define M_ASN1_INTEGER_free(a) ASN1_INTEGER_free(a)
1045
+ #define M_ASN1_INTEGER_dup(a) ASN1_INTEGER_dup(a)
1046
+ #define M_ASN1_INTEGER_cmp(a, b) ASN1_INTEGER_cmp(a, b)
1047
+ #define M_ASN1_ENUMERATED_new() ASN1_ENUMERATED_new()
1048
+ #define M_ASN1_ENUMERATED_free(a) ASN1_ENUMERATED_free(a)
1049
+ #define M_ASN1_ENUMERATED_dup(a) ASN1_STRING_dup(a)
1050
+ #define M_ASN1_ENUMERATED_cmp(a, b) ASN1_STRING_cmp(a, b)
1051
+ #define M_ASN1_OCTET_STRING_new() ASN1_OCTET_STRING_new()
1052
+ #define M_ASN1_OCTET_STRING_free(a) ASN1_OCTET_STRING_free()
1053
+ #define M_ASN1_OCTET_STRING_dup(a) ASN1_OCTET_STRING_dup(a)
1054
+ #define M_ASN1_OCTET_STRING_cmp(a, b) ASN1_OCTET_STRING_cmp(a, b)
1055
+ #define M_ASN1_OCTET_STRING_set(a, b, c) ASN1_OCTET_STRING_set(a, b, c)
1056
+ #define M_ASN1_OCTET_STRING_print(a, b) ASN1_STRING_print(a, b)
1057
+ #define M_ASN1_PRINTABLESTRING_new() ASN1_PRINTABLESTRING_new()
1058
+ #define M_ASN1_PRINTABLESTRING_free(a) ASN1_PRINTABLESTRING_free(a)
1059
+ #define M_ASN1_IA5STRING_new() ASN1_IA5STRING_new()
1060
+ #define M_ASN1_IA5STRING_free(a) ASN1_IA5STRING_free(a)
1061
+ #define M_ASN1_IA5STRING_dup(a) ASN1_STRING_dup(a)
1062
+ #define M_ASN1_UTCTIME_new() ASN1_UTCTIME_new()
1063
+ #define M_ASN1_UTCTIME_free(a) ASN1_UTCTIME_free(a)
1064
+ #define M_ASN1_UTCTIME_dup(a) ASN1_STRING_dup(a)
1065
+ #define M_ASN1_T61STRING_new() ASN1_T61STRING_new()
1066
+ #define M_ASN1_T61STRING_free(a) ASN1_T61STRING_free(a)
1067
+ #define M_ASN1_GENERALIZEDTIME_new() ASN1_GENERALIZEDTIME_new()
1068
+ #define M_ASN1_GENERALIZEDTIME_free(a) ASN1_GENERALIZEDTIME_free(a)
1069
+ #define M_ASN1_GENERALIZEDTIME_dup(a) ASN1_STRING_dup(a)
1070
+ #define M_ASN1_GENERALSTRING_new() ASN1_GENERALSTRING_new()
1071
+ #define M_ASN1_GENERALSTRING_free(a) ASN1_GENERALSTRING_free(a)
1072
+ #define M_ASN1_UNIVERSALSTRING_new() ASN1_UNIVERSALSTRING_new()
1073
+ #define M_ASN1_UNIVERSALSTRING_free(a) ASN1_UNIVERSALSTRING_free(a)
1074
+ #define M_ASN1_BMPSTRING_new() ASN1_BMPSTRING_new()
1075
+ #define M_ASN1_BMPSTRING_free(a) ASN1_BMPSTRING_free(a)
1076
+ #define M_ASN1_VISIBLESTRING_new() ASN1_VISIBLESTRING_new()
1077
+ #define M_ASN1_VISIBLESTRING_free(a) ASN1_VISIBLESTRING_free(a)
1078
+ #define M_ASN1_UTF8STRING_new() ASN1_UTF8STRING_new()
1079
+ #define M_ASN1_UTF8STRING_free(a) ASN1_UTF8STRING_free(a)
1080
+
1081
+ #define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME
1082
+
1083
+ #define B_ASN1_PRINTABLE \
1084
+ B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | \
1085
+ B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | \
1086
+ B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN
1087
+
1088
+ #define B_ASN1_DIRECTORYSTRING \
1089
+ B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | \
1090
+ B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING
551
1091
 
552
1092
  #define B_ASN1_DISPLAYTEXT \
553
- B_ASN1_IA5STRING| \
554
- B_ASN1_VISIBLESTRING| \
555
- B_ASN1_BMPSTRING|\
556
- B_ASN1_UTF8STRING
557
-
558
- #define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
559
- #define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
560
-
561
- #define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
562
- #define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
563
-
564
- #define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
565
- #define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
566
-
567
- #define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
568
- ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
569
- #define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
570
-
571
- #define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
572
- ASN1_STRING_type_new(V_ASN1_T61STRING)
573
- #define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
574
-
575
- #define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
576
- ASN1_STRING_type_new(V_ASN1_IA5STRING)
577
- #define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
578
- #define M_ASN1_IA5STRING_dup(a) \
579
- (ASN1_IA5STRING *)ASN1_STRING_dup((const ASN1_STRING *)a)
580
-
581
- #define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\
582
- ASN1_STRING_type_new(V_ASN1_UTCTIME)
583
- #define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
584
- #define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)\
585
- ASN1_STRING_dup((const ASN1_STRING *)a)
586
-
587
- #define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\
588
- ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
589
- #define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
590
- #define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
591
- (const ASN1_STRING *)a)
592
-
593
- #define M_ASN1_TIME_new() (ASN1_TIME *)\
594
- ASN1_STRING_type_new(V_ASN1_UTCTIME)
595
- #define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
596
- #define M_ASN1_TIME_dup(a) (ASN1_TIME *)\
597
- ASN1_STRING_dup((const ASN1_STRING *)a)
598
-
599
- #define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\
600
- ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
601
- #define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
602
-
603
- #define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\
604
- ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
605
- #define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
606
-
607
- #define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
608
- ASN1_STRING_type_new(V_ASN1_BMPSTRING)
609
- #define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
610
-
611
- #define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\
612
- ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
613
- #define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
614
-
615
- #define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\
616
- ASN1_STRING_type_new(V_ASN1_UTF8STRING)
617
- #define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
1093
+ B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING
618
1094
 
619
1095
  DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
620
1096
 
621
- OPENSSL_EXPORT int ASN1_TYPE_get(const ASN1_TYPE *a);
622
- OPENSSL_EXPORT void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
623
- OPENSSL_EXPORT int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
624
- OPENSSL_EXPORT int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
625
-
626
- OPENSSL_EXPORT ASN1_OBJECT * ASN1_OBJECT_new(void );
627
- OPENSSL_EXPORT void ASN1_OBJECT_free(ASN1_OBJECT *a);
628
- OPENSSL_EXPORT int i2d_ASN1_OBJECT(const ASN1_OBJECT *a,unsigned char **pp);
629
- OPENSSL_EXPORT ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
630
- long length);
631
- OPENSSL_EXPORT ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
632
- long length);
1097
+ OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_new(void);
1098
+ OPENSSL_EXPORT void ASN1_OBJECT_free(ASN1_OBJECT *a);
1099
+ OPENSSL_EXPORT int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp);
1100
+ OPENSSL_EXPORT ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a,
1101
+ const unsigned char **pp,
1102
+ long length);
1103
+ OPENSSL_EXPORT ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a,
1104
+ const unsigned char **pp,
1105
+ long length);
633
1106
 
634
1107
  DECLARE_ASN1_ITEM(ASN1_OBJECT)
635
1108
 
636
- DECLARE_ASN1_SET_OF(ASN1_OBJECT)
637
-
638
- OPENSSL_EXPORT ASN1_STRING * ASN1_STRING_new(void);
639
- OPENSSL_EXPORT void ASN1_STRING_free(ASN1_STRING *a);
640
- OPENSSL_EXPORT int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
641
- OPENSSL_EXPORT ASN1_STRING * ASN1_STRING_dup(const ASN1_STRING *a);
642
- OPENSSL_EXPORT ASN1_STRING * ASN1_STRING_type_new(int type );
643
- OPENSSL_EXPORT int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
644
- /* Since this is used to store all sorts of things, via macros, for now, make
645
- its data void * */
646
- OPENSSL_EXPORT int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
647
- OPENSSL_EXPORT void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
648
- OPENSSL_EXPORT int ASN1_STRING_length(const ASN1_STRING *x);
649
- OPENSSL_EXPORT void ASN1_STRING_length_set(ASN1_STRING *x, int n);
650
- OPENSSL_EXPORT int ASN1_STRING_type(const ASN1_STRING *x);
651
- OPENSSL_EXPORT unsigned char * ASN1_STRING_data(ASN1_STRING *x);
652
- OPENSSL_EXPORT const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
653
-
654
1109
  DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
655
- OPENSSL_EXPORT int i2c_ASN1_BIT_STRING(const ASN1_BIT_STRING *a,unsigned char **pp);
656
- OPENSSL_EXPORT ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp, long length);
657
- OPENSSL_EXPORT int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length );
658
- OPENSSL_EXPORT int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
659
- OPENSSL_EXPORT int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n);
660
- OPENSSL_EXPORT int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, unsigned char *flags, int flags_len);
1110
+ OPENSSL_EXPORT int i2c_ASN1_BIT_STRING(const ASN1_BIT_STRING *a,
1111
+ unsigned char **pp);
1112
+ OPENSSL_EXPORT ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
1113
+ const unsigned char **pp,
1114
+ long length);
661
1115
 
662
- OPENSSL_EXPORT int i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
663
- OPENSSL_EXPORT int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length);
1116
+ OPENSSL_EXPORT int i2d_ASN1_BOOLEAN(ASN1_BOOLEAN a, unsigned char **pp);
1117
+ OPENSSL_EXPORT ASN1_BOOLEAN d2i_ASN1_BOOLEAN(ASN1_BOOLEAN *a,
1118
+ const unsigned char **pp,
1119
+ long length);
664
1120
 
665
1121
  DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
666
- OPENSSL_EXPORT int i2c_ASN1_INTEGER(const ASN1_INTEGER *a,unsigned char **pp);
667
- OPENSSL_EXPORT ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, long length);
668
- OPENSSL_EXPORT ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x);
669
- OPENSSL_EXPORT int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
1122
+ OPENSSL_EXPORT int i2c_ASN1_INTEGER(const ASN1_INTEGER *a, unsigned char **pp);
1123
+ OPENSSL_EXPORT ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,
1124
+ const unsigned char **pp,
1125
+ long length);
1126
+ OPENSSL_EXPORT ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x);
670
1127
 
671
1128
  DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
672
1129
 
673
- OPENSSL_EXPORT int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
674
- OPENSSL_EXPORT ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t);
675
- OPENSSL_EXPORT ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int offset_day, long offset_sec);
676
- OPENSSL_EXPORT int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
677
- OPENSSL_EXPORT int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
678
- #if 0
679
- time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
680
- #endif
681
-
682
- OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
683
- OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t);
684
- OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, long offset_sec);
685
- OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
686
- OPENSSL_EXPORT int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to);
687
-
688
1130
  DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
689
- OPENSSL_EXPORT ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);
690
- OPENSSL_EXPORT int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b);
691
- OPENSSL_EXPORT int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len);
1131
+ OPENSSL_EXPORT ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(
1132
+ const ASN1_OCTET_STRING *a);
1133
+ OPENSSL_EXPORT int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
1134
+ const ASN1_OCTET_STRING *b);
1135
+ OPENSSL_EXPORT int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str,
1136
+ const unsigned char *data, int len);
692
1137
 
693
1138
  DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
694
1139
  DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
@@ -708,95 +1153,60 @@ DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
708
1153
  DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
709
1154
  DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
710
1155
 
711
- DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
712
-
713
- OPENSSL_EXPORT ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
714
- OPENSSL_EXPORT ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s,time_t t, int offset_day, long offset_sec);
715
- OPENSSL_EXPORT int ASN1_TIME_check(const ASN1_TIME *t);
716
- OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
717
- OPENSSL_EXPORT int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
718
-
719
1156
  OPENSSL_EXPORT int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a);
720
1157
  OPENSSL_EXPORT int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a);
721
1158
  OPENSSL_EXPORT int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a);
722
1159
  OPENSSL_EXPORT int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type);
723
- OPENSSL_EXPORT int i2t_ASN1_OBJECT(char *buf,int buf_len, const ASN1_OBJECT *a);
724
-
725
- OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, const char *sn, const char *ln);
726
-
727
- OPENSSL_EXPORT int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
728
- OPENSSL_EXPORT int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v);
729
- OPENSSL_EXPORT long ASN1_INTEGER_get(const ASN1_INTEGER *a);
730
- OPENSSL_EXPORT ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
731
- OPENSSL_EXPORT BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai,BIGNUM *bn);
1160
+ OPENSSL_EXPORT int i2t_ASN1_OBJECT(char *buf, int buf_len,
1161
+ const ASN1_OBJECT *a);
732
1162
 
733
- OPENSSL_EXPORT int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
734
- OPENSSL_EXPORT long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
735
- OPENSSL_EXPORT ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai);
736
- OPENSSL_EXPORT BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai,BIGNUM *bn);
737
-
738
- /* General */
739
- /* given a string, return the correct type, max is the maximum length */
740
- OPENSSL_EXPORT int ASN1_PRINTABLE_type(const unsigned char *s, int max);
1163
+ OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_create(int nid,
1164
+ const unsigned char *data,
1165
+ int len, const char *sn,
1166
+ const char *ln);
741
1167
 
742
1168
  OPENSSL_EXPORT unsigned long ASN1_tag2bit(int tag);
743
1169
 
744
- /* SPECIALS */
745
- OPENSSL_EXPORT int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, int *pclass, long omax);
746
- OPENSSL_EXPORT void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, int xclass);
1170
+ // SPECIALS
1171
+ OPENSSL_EXPORT int ASN1_get_object(const unsigned char **pp, long *plength,
1172
+ int *ptag, int *pclass, long omax);
1173
+ OPENSSL_EXPORT void ASN1_put_object(unsigned char **pp, int constructed,
1174
+ int length, int tag, int xclass);
747
1175
  OPENSSL_EXPORT int ASN1_put_eoc(unsigned char **pp);
748
1176
  OPENSSL_EXPORT int ASN1_object_size(int constructed, int length, int tag);
749
1177
 
750
1178
  OPENSSL_EXPORT void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
751
1179
 
752
- #ifndef OPENSSL_NO_FP_API
753
1180
  OPENSSL_EXPORT void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
754
1181
  OPENSSL_EXPORT int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
755
- OPENSSL_EXPORT int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags);
756
- #endif
757
-
758
- OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
759
1182
 
760
1183
  OPENSSL_EXPORT void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
761
1184
  OPENSSL_EXPORT int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
762
- OPENSSL_EXPORT int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
763
- OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
764
- OPENSSL_EXPORT int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);
765
- OPENSSL_EXPORT int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
766
- OPENSSL_EXPORT int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags);
767
- OPENSSL_EXPORT const char *ASN1_tag2str(int tag);
768
-
769
- /* Used to load and write netscape format cert */
770
1185
 
771
- OPENSSL_EXPORT void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it);
1186
+ // Used to load and write netscape format cert
772
1187
 
773
- OPENSSL_EXPORT ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
1188
+ OPENSSL_EXPORT void *ASN1_item_unpack(const ASN1_STRING *oct,
1189
+ const ASN1_ITEM *it);
774
1190
 
775
- OPENSSL_EXPORT void ASN1_STRING_set_default_mask(unsigned long mask);
776
- OPENSSL_EXPORT int ASN1_STRING_set_default_mask_asc(const char *p);
777
- OPENSSL_EXPORT unsigned long ASN1_STRING_get_default_mask(void);
778
- OPENSSL_EXPORT int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, int inform, unsigned long mask);
779
- OPENSSL_EXPORT int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, int inform, unsigned long mask, long minsize, long maxsize);
780
-
781
- OPENSSL_EXPORT ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in, int inlen, int inform, int nid);
782
- OPENSSL_EXPORT ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
783
- OPENSSL_EXPORT int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
784
- OPENSSL_EXPORT void ASN1_STRING_TABLE_cleanup(void);
1191
+ OPENSSL_EXPORT ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
1192
+ ASN1_OCTET_STRING **oct);
785
1193
 
786
- /* ASN1 template functions */
1194
+ // ASN1 template functions
787
1195
 
788
- /* Old API compatible functions */
1196
+ // Old API compatible functions
789
1197
  OPENSSL_EXPORT ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
790
1198
  OPENSSL_EXPORT void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
791
- OPENSSL_EXPORT ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it);
792
- OPENSSL_EXPORT int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
793
- OPENSSL_EXPORT int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
1199
+ OPENSSL_EXPORT ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val,
1200
+ const unsigned char **in, long len,
1201
+ const ASN1_ITEM *it);
1202
+ OPENSSL_EXPORT int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out,
1203
+ const ASN1_ITEM *it);
794
1204
 
795
1205
  OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf);
796
1206
  OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf);
797
1207
 
798
1208
 
799
- #ifdef __cplusplus
1209
+ #ifdef __cplusplus
800
1210
  }
801
1211
 
802
1212
  extern "C++" {
@@ -809,7 +1219,7 @@ BORINGSSL_MAKE_DELETER(ASN1_TYPE, ASN1_TYPE_free)
809
1219
 
810
1220
  BSSL_NAMESPACE_END
811
1221
 
812
- } /* extern C++ */
1222
+ } // extern C++
813
1223
 
814
1224
  #endif
815
1225
 
@@ -906,5 +1316,6 @@ BSSL_NAMESPACE_END
906
1316
  #define ASN1_R_WRONG_TAG 190
907
1317
  #define ASN1_R_WRONG_TYPE 191
908
1318
  #define ASN1_R_NESTED_TOO_DEEP 192
1319
+ #define ASN1_R_BAD_TEMPLATE 193
909
1320
 
910
1321
  #endif