grpc 1.35.0.pre1 → 1.37.1
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.
- checksums.yaml +4 -4
- data/Makefile +121 -89
- data/include/grpc/grpc.h +15 -1
- data/include/grpc/grpc_security.h +16 -11
- data/include/grpc/impl/codegen/port_platform.h +2 -0
- data/src/core/ext/filters/client_channel/client_channel.cc +359 -331
- data/src/core/ext/filters/client_channel/client_channel.h +0 -2
- data/src/core/ext/filters/client_channel/client_channel_factory.h +2 -1
- data/src/core/ext/filters/client_channel/config_selector.h +9 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +9 -4
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +24 -142
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +15 -10
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy.cc +3 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +3 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +8 -6
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +23 -0
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +27 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +289 -170
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +5 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +8 -25
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +232 -110
- data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +27 -67
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +10 -9
- data/src/core/ext/filters/client_channel/resolver.cc +5 -5
- data/src/core/ext/filters/client_channel/resolver.h +1 -12
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +36 -45
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +3 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +34 -50
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +16 -14
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +18 -15
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +377 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +307 -155
- data/src/core/ext/filters/client_channel/server_address.cc +9 -0
- data/src/core/ext/filters/client_channel/server_address.h +31 -0
- data/src/core/ext/filters/client_channel/subchannel.cc +69 -146
- data/src/core/ext/filters/client_channel/subchannel.h +63 -95
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +16 -2
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +10 -8
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +1 -1
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +500 -0
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +39 -0
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +189 -0
- data/src/core/ext/filters/fault_injection/service_config_parser.h +85 -0
- data/src/core/ext/filters/max_age/max_age_filter.cc +35 -32
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +3 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +1 -1
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +3 -2
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +490 -178
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +11 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +11 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +1 -1
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +62 -18
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +39 -7
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +12 -1
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +5 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/internal.h +1 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +406 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +1459 -0
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +350 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1348 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +11 -16
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +42 -59
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +25 -1
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +75 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +9 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +28 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +6 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +25 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +11 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +41 -7
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +23 -21
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +122 -77
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +13 -9
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +37 -5
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +144 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +488 -0
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +141 -0
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +452 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +11 -9
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +44 -27
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +57 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +150 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +29 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +67 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +79 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +268 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +78 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +281 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +41 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +113 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +19 -21
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +64 -51
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +16 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +50 -18
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +4 -7
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +0 -17
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +30 -23
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +85 -73
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -3
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -3
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -2
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +93 -0
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +323 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +36 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +90 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +124 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +21 -4
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +29 -0
- data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c +33 -0
- data/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h +77 -0
- data/src/core/ext/upb-generated/{udpa/core/v1 → xds/core/v3}/authority.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +60 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +52 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +143 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +42 -0
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +84 -0
- data/src/core/ext/upb-generated/{udpa/core/v1 → xds/core/v3}/resource.upb.c +9 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +94 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +54 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +166 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +36 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +85 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +354 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +140 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +168 -171
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +383 -0
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +115 -0
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +405 -420
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +2 -2
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +12 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +177 -171
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +88 -88
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +153 -153
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +10 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +4 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +33 -20
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +56 -59
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +116 -111
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +129 -121
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +21 -24
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +141 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +141 -0
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +17 -13
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +753 -724
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +22 -25
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +102 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +120 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +76 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +371 -377
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +12 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +112 -108
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +45 -53
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +177 -180
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +92 -102
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +32 -42
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +30 -40
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +4 -7
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +38 -44
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +130 -0
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +30 -33
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +8 -7
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +9 -9
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +9 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +8 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +8 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +9 -8
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +8 -8
- data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c +44 -0
- data/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +42 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +62 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +67 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +35 -0
- data/src/core/ext/xds/xds_api.cc +2149 -666
- data/src/core/ext/xds/xds_api.h +321 -119
- data/src/core/ext/xds/xds_bootstrap.cc +80 -45
- data/src/core/ext/xds/xds_bootstrap.h +17 -5
- data/src/core/ext/xds/xds_certificate_provider.cc +180 -74
- data/src/core/ext/xds/xds_certificate_provider.h +83 -44
- data/src/core/ext/xds/xds_client.cc +181 -34
- data/src/core/ext/xds/xds_client.h +29 -0
- data/src/core/ext/xds/xds_client_stats.cc +2 -1
- data/src/core/ext/xds/xds_client_stats.h +2 -2
- data/src/core/ext/xds/xds_http_fault_filter.cc +226 -0
- data/src/core/ext/xds/xds_http_fault_filter.h +63 -0
- data/src/core/ext/xds/xds_http_filters.cc +114 -0
- data/src/core/ext/xds/xds_http_filters.h +130 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +425 -24
- data/src/core/lib/channel/channel_stack.cc +12 -0
- data/src/core/lib/channel/channel_stack.h +7 -0
- data/src/core/lib/channel/channelz.cc +92 -4
- data/src/core/lib/channel/channelz.h +30 -1
- data/src/core/lib/channel/channelz_registry.cc +14 -0
- data/src/core/lib/channel/handshaker.cc +2 -44
- data/src/core/lib/channel/handshaker.h +1 -18
- data/src/core/lib/channel/status_util.cc +12 -2
- data/src/core/lib/channel/status_util.h +5 -0
- data/src/core/lib/gpr/log.cc +6 -1
- data/src/core/lib/gpr/sync_abseil.cc +3 -6
- data/src/core/lib/gpr/sync_windows.cc +2 -2
- data/src/core/lib/gprpp/atomic.h +3 -3
- data/src/core/lib/gprpp/dual_ref_counted.h +3 -3
- data/src/core/lib/gprpp/mpscq.cc +2 -2
- data/src/core/lib/gprpp/ref_counted.h +1 -1
- data/src/core/lib/gprpp/ref_counted_ptr.h +2 -0
- data/src/core/lib/gprpp/sync.h +129 -40
- data/src/core/lib/gprpp/thd.h +1 -1
- data/src/core/lib/gprpp/time_util.cc +77 -0
- data/src/core/lib/gprpp/time_util.h +42 -0
- data/src/core/lib/http/httpcli_security_connector.cc +2 -2
- data/src/core/lib/iomgr/buffer_list.h +1 -1
- data/src/core/lib/iomgr/cfstream_handle.cc +2 -2
- data/src/core/lib/iomgr/error.h +1 -1
- data/src/core/lib/iomgr/ev_apple.cc +11 -8
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -3
- data/src/core/lib/iomgr/ev_epollex_linux.cc +4 -4
- data/src/core/lib/iomgr/ev_posix.cc +3 -3
- data/src/core/lib/iomgr/exec_ctx.cc +6 -2
- data/src/core/lib/iomgr/iomgr_posix.cc +0 -1
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +0 -1
- data/src/core/lib/iomgr/resource_quota.cc +1 -1
- data/src/core/lib/iomgr/sockaddr_utils.cc +121 -1
- data/src/core/lib/iomgr/sockaddr_utils.h +25 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -0
- data/src/core/lib/iomgr/tcp_client_posix.cc +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +5 -8
- data/src/core/lib/iomgr/tcp_uv.cc +2 -2
- data/src/core/lib/iomgr/timer_generic.cc +2 -2
- data/src/core/lib/iomgr/timer_manager.cc +1 -1
- data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +1 -1
- data/src/core/lib/matchers/matchers.cc +339 -0
- data/src/core/lib/matchers/matchers.h +160 -0
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +2 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.h +1 -1
- data/src/core/lib/security/credentials/credentials.h +2 -1
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +2 -2
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +1 -1
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -1
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +1 -1
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +7 -6
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +2 -2
- data/src/core/lib/security/credentials/jwt/json_token.cc +0 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +0 -3
- data/src/core/lib/security/credentials/local/local_credentials.cc +2 -1
- data/src/core/lib/security/credentials/local/local_credentials.h +1 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +2 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +1 -1
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +2 -1
- data/src/core/lib/security/credentials/tls/tls_credentials.h +1 -1
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +128 -59
- data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +5 -5
- data/src/core/lib/security/security_connector/ssl_utils.cc +9 -4
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +32 -14
- data/src/core/lib/security/transport/security_handshaker.cc +33 -5
- data/src/core/lib/security/transport/server_auth_filter.cc +7 -0
- data/src/core/lib/slice/slice_intern.cc +5 -6
- data/src/core/lib/surface/channel.h +3 -3
- data/src/core/lib/surface/completion_queue.cc +1 -1
- data/src/core/lib/surface/init.cc +13 -15
- data/src/core/lib/surface/lame_client.cc +38 -19
- data/src/core/lib/surface/lame_client.h +4 -3
- data/src/core/lib/surface/server.cc +43 -36
- data/src/core/lib/surface/server.h +76 -14
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/metadata.cc +6 -2
- data/src/core/lib/transport/metadata_batch.cc +27 -0
- data/src/core/lib/transport/metadata_batch.h +14 -0
- data/src/core/plugin_registry/grpc_plugin_registry.cc +12 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +18 -24
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +16 -21
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +1 -3
- data/src/core/tsi/fake_transport_security.cc +11 -2
- data/src/core/tsi/ssl/session_cache/ssl_session.h +0 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +0 -2
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +2 -4
- data/src/core/tsi/ssl_transport_security.cc +0 -3
- data/src/core/tsi/ssl_transport_security.h +0 -3
- data/src/ruby/ext/grpc/extconf.rb +9 -1
- data/src/ruby/ext/grpc/rb_channel.c +10 -1
- data/src/ruby/ext/grpc/rb_channel_credentials.c +11 -1
- data/src/ruby/ext/grpc/rb_channel_credentials.h +4 -0
- data/src/ruby/ext/grpc/rb_compression_options.c +1 -1
- data/src/ruby/ext/grpc/rb_enable_cpp.cc +1 -1
- data/src/ruby/ext/grpc/rb_grpc.c +4 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +4 -1
- data/src/ruby/ext/grpc/rb_server.c +13 -1
- data/src/ruby/ext/grpc/rb_server_credentials.c +19 -3
- data/src/ruby/ext/grpc/rb_server_credentials.h +4 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +215 -0
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.h +35 -0
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +169 -0
- data/src/ruby/ext/grpc/rb_xds_server_credentials.h +35 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +4 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +7 -0
- data/src/ruby/spec/call_spec.rb +1 -1
- data/src/ruby/spec/channel_credentials_spec.rb +32 -0
- data/src/ruby/spec/channel_spec.rb +17 -6
- data/src/ruby/spec/client_auth_spec.rb +27 -1
- data/src/ruby/spec/errors_spec.rb +1 -1
- data/src/ruby/spec/generic/active_call_spec.rb +2 -2
- data/src/ruby/spec/generic/client_stub_spec.rb +4 -4
- data/src/ruby/spec/generic/rpc_server_spec.rb +1 -1
- data/src/ruby/spec/server_credentials_spec.rb +25 -0
- data/src/ruby/spec/server_spec.rb +22 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +1 -0
- data/third_party/boringssl-with-bazel/err_data.c +715 -713
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +3 -10
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +15 -14
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +30 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +28 -79
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +39 -85
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +5 -16
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c +10 -61
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +158 -0
- data/third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c +3 -10
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +8 -9
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +60 -45
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +6 -81
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +87 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-win.c +41 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu-arm-linux.c +11 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu-arm.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/dh_asn1.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → dh_extra}/params.c +179 -0
- data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +25 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +2 -17
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/bn.c +13 -20
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +2 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +21 -13
- data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/check.c +0 -0
- data/third_party/boringssl-with-bazel/src/crypto/{dh → fipsmodule/dh}/dh.c +136 -213
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +12 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +28 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +135 -43
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +0 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +51 -32
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +147 -0
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +18 -29
- data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +13 -4
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c +10 -7
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c +13 -11
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +34 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +7 -13
- data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +1 -29
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c +10 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_r2x.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +29 -23
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c +22 -17
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +39 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +11 -10
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +25 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +40 -20
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +25 -36
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +6 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +3 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +652 -545
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +0 -167
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +10 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +62 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +22 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +19 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cpu.h +22 -32
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +56 -26
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +15 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +12 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +2 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +67 -33
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +27 -8
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +287 -99
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +139 -36
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +4 -3
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +11 -20
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +10 -5
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +37 -16
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +0 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +7 -8
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +20 -14
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +7 -8
- data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +5 -7
- data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +362 -50
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +48 -15
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +66 -24
- data/third_party/xxhash/xxhash.h +5443 -0
- metadata +140 -84
- data/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h +0 -60
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c +0 -52
- data/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h +0 -143
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c +0 -42
- data/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h +0 -84
- data/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h +0 -94
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c +0 -54
- data/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h +0 -173
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c +0 -36
- data/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h +0 -92
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.c +0 -42
- data/src/core/ext/upbdefs-generated/udpa/core/v1/authority.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.c +0 -62
- data/src/core/ext/upbdefs-generated/udpa/core/v1/collection_entry.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.c +0 -45
- data/src/core/ext/upbdefs-generated/udpa/core/v1/context_params.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.c +0 -49
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.c +0 -68
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_locator.upbdefs.h +0 -40
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.c +0 -51
- data/src/core/ext/upbdefs-generated/udpa/core/v1/resource_name.upbdefs.h +0 -35
- data/src/core/lib/iomgr/iomgr_posix.h +0 -26
- data/src/core/lib/security/authorization/authorization_engine.cc +0 -177
- data/src/core/lib/security/authorization/authorization_engine.h +0 -84
- data/src/core/lib/security/authorization/evaluate_args.cc +0 -148
- data/src/core/lib/security/authorization/evaluate_args.h +0 -59
- data/src/core/lib/security/authorization/mock_cel/activation.h +0 -57
- data/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +0 -44
- data/src/core/lib/security/authorization/mock_cel/cel_expression.h +0 -69
- data/src/core/lib/security/authorization/mock_cel/cel_value.h +0 -97
- data/src/core/lib/security/authorization/mock_cel/evaluator_core.h +0 -67
- data/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h +0 -57
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -504
- data/third_party/upb/upb/json_decode.c +0 -1443
- data/third_party/upb/upb/json_decode.h +0 -23
- data/third_party/upb/upb/json_encode.c +0 -713
- data/third_party/upb/upb/json_encode.h +0 -36
@@ -63,10 +63,13 @@
|
|
63
63
|
#include <openssl/mem.h>
|
64
64
|
|
65
65
|
#include "../internal.h"
|
66
|
+
#include "asn1_locl.h"
|
66
67
|
|
67
68
|
|
68
69
|
static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out,
|
69
70
|
const ASN1_ITEM *it, int tag, int aclass);
|
71
|
+
static int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
|
72
|
+
const ASN1_ITEM *it);
|
70
73
|
static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out,
|
71
74
|
int skcontlen, const ASN1_ITEM *item,
|
72
75
|
int do_sort, int iclass);
|
@@ -76,16 +79,9 @@ static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out,
|
|
76
79
|
const ASN1_ITEM *it, int flags);
|
77
80
|
|
78
81
|
/*
|
79
|
-
* Top level i2d equivalents
|
80
|
-
* indefinite length constructed encoding, where appropriate
|
82
|
+
* Top level i2d equivalents
|
81
83
|
*/
|
82
84
|
|
83
|
-
int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out,
|
84
|
-
const ASN1_ITEM *it)
|
85
|
-
{
|
86
|
-
return asn1_item_flags_i2d(val, out, it, ASN1_TFLG_NDEF);
|
87
|
-
}
|
88
|
-
|
89
85
|
int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
|
90
86
|
{
|
91
87
|
return asn1_item_flags_i2d(val, out, it, 0);
|
@@ -128,9 +124,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
128
124
|
const ASN1_ITEM *it, int tag, int aclass)
|
129
125
|
{
|
130
126
|
const ASN1_TEMPLATE *tt = NULL;
|
131
|
-
|
132
|
-
int i, seqcontlen, seqlen, ndef = 1;
|
133
|
-
const ASN1_COMPAT_FUNCS *cf;
|
127
|
+
int i, seqcontlen, seqlen;
|
134
128
|
const ASN1_EXTERN_FUNCS *ef;
|
135
129
|
const ASN1_AUX *aux = it->funcs;
|
136
130
|
ASN1_aux_cb *asn1_cb = 0;
|
@@ -151,9 +145,25 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
151
145
|
break;
|
152
146
|
|
153
147
|
case ASN1_ITYPE_MSTRING:
|
148
|
+
/*
|
149
|
+
* It never makes sense for multi-strings to have implicit tagging, so
|
150
|
+
* if tag != -1, then this looks like an error in the template.
|
151
|
+
*/
|
152
|
+
if (tag != -1) {
|
153
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_BAD_TEMPLATE);
|
154
|
+
return -1;
|
155
|
+
}
|
154
156
|
return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
|
155
157
|
|
156
158
|
case ASN1_ITYPE_CHOICE:
|
159
|
+
/*
|
160
|
+
* It never makes sense for CHOICE types to have implicit tagging, so if
|
161
|
+
* tag != -1, then this looks like an error in the template.
|
162
|
+
*/
|
163
|
+
if (tag != -1) {
|
164
|
+
OPENSSL_PUT_ERROR(ASN1, ASN1_R_BAD_TEMPLATE);
|
165
|
+
return -1;
|
166
|
+
}
|
157
167
|
if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
|
158
168
|
return 0;
|
159
169
|
i = asn1_get_choice_selector(pval, it);
|
@@ -174,26 +184,6 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
174
184
|
ef = it->funcs;
|
175
185
|
return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
|
176
186
|
|
177
|
-
case ASN1_ITYPE_COMPAT:
|
178
|
-
/* old style hackery... */
|
179
|
-
cf = it->funcs;
|
180
|
-
if (out)
|
181
|
-
p = *out;
|
182
|
-
i = cf->asn1_i2d(*pval, out);
|
183
|
-
/*
|
184
|
-
* Fixup for IMPLICIT tag: note this messes up for tags > 30, but so
|
185
|
-
* did the old code. Tags > 30 are very rare anyway.
|
186
|
-
*/
|
187
|
-
if (out && (tag != -1))
|
188
|
-
*p = aclass | tag | (*p & V_ASN1_CONSTRUCTED);
|
189
|
-
return i;
|
190
|
-
|
191
|
-
case ASN1_ITYPE_NDEF_SEQUENCE:
|
192
|
-
/* Use indefinite length constructed if requested */
|
193
|
-
if (aclass & ASN1_TFLG_NDEF)
|
194
|
-
ndef = 2;
|
195
|
-
OPENSSL_FALLTHROUGH;
|
196
|
-
|
197
187
|
case ASN1_ITYPE_SEQUENCE:
|
198
188
|
i = asn1_enc_restore(&seqcontlen, out, pval, it);
|
199
189
|
/* An error occurred */
|
@@ -228,11 +218,11 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
228
218
|
seqcontlen += tmplen;
|
229
219
|
}
|
230
220
|
|
231
|
-
seqlen = ASN1_object_size(
|
221
|
+
seqlen = ASN1_object_size(/*constructed=*/1, seqcontlen, tag);
|
232
222
|
if (!out || seqlen == -1)
|
233
223
|
return seqlen;
|
234
224
|
/* Output SEQUENCE header */
|
235
|
-
ASN1_put_object(out,
|
225
|
+
ASN1_put_object(out, /*constructed=*/1, seqcontlen, tag, aclass);
|
236
226
|
for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
|
237
227
|
const ASN1_TEMPLATE *seqtt;
|
238
228
|
ASN1_VALUE **pseqval;
|
@@ -243,8 +233,6 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
243
233
|
/* FIXME: check for errors in enhanced version */
|
244
234
|
asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
|
245
235
|
}
|
246
|
-
if (ndef == 2)
|
247
|
-
ASN1_put_eoc(out);
|
248
236
|
if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
|
249
237
|
return 0;
|
250
238
|
return seqlen;
|
@@ -259,7 +247,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
259
247
|
static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
260
248
|
const ASN1_TEMPLATE *tt, int tag, int iclass)
|
261
249
|
{
|
262
|
-
int i, ret, flags, ttag, tclass
|
250
|
+
int i, ret, flags, ttag, tclass;
|
263
251
|
size_t j;
|
264
252
|
flags = tt->flags;
|
265
253
|
/*
|
@@ -295,12 +283,6 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
295
283
|
* class and iclass is any flags passed to this function.
|
296
284
|
*/
|
297
285
|
|
298
|
-
/* if template and arguments require ndef, use it */
|
299
|
-
if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
|
300
|
-
ndef = 2;
|
301
|
-
else
|
302
|
-
ndef = 1;
|
303
|
-
|
304
286
|
if (flags & ASN1_TFLG_SK_MASK) {
|
305
287
|
/* SET OF, SEQUENCE OF */
|
306
288
|
STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval;
|
@@ -345,12 +327,12 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
345
327
|
return -1;
|
346
328
|
skcontlen += tmplen;
|
347
329
|
}
|
348
|
-
sklen = ASN1_object_size(
|
330
|
+
sklen = ASN1_object_size(/*constructed=*/1, skcontlen, sktag);
|
349
331
|
if (sklen == -1)
|
350
332
|
return -1;
|
351
333
|
/* If EXPLICIT need length of surrounding tag */
|
352
334
|
if (flags & ASN1_TFLG_EXPTAG)
|
353
|
-
ret = ASN1_object_size(
|
335
|
+
ret = ASN1_object_size(/*constructed=*/1, sklen, ttag);
|
354
336
|
else
|
355
337
|
ret = sklen;
|
356
338
|
|
@@ -360,18 +342,12 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
360
342
|
/* Now encode this lot... */
|
361
343
|
/* EXPLICIT tag */
|
362
344
|
if (flags & ASN1_TFLG_EXPTAG)
|
363
|
-
ASN1_put_object(out,
|
345
|
+
ASN1_put_object(out, /*constructed=*/1, sklen, ttag, tclass);
|
364
346
|
/* SET or SEQUENCE and IMPLICIT tag */
|
365
|
-
ASN1_put_object(out,
|
347
|
+
ASN1_put_object(out, /*constructed=*/1, skcontlen, sktag, skaclass);
|
366
348
|
/* And the stuff itself */
|
367
349
|
asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
|
368
350
|
isset, iclass);
|
369
|
-
if (ndef == 2) {
|
370
|
-
ASN1_put_eoc(out);
|
371
|
-
if (flags & ASN1_TFLG_EXPTAG)
|
372
|
-
ASN1_put_eoc(out);
|
373
|
-
}
|
374
|
-
|
375
351
|
return ret;
|
376
352
|
}
|
377
353
|
|
@@ -382,13 +358,11 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
|
382
358
|
if (!i)
|
383
359
|
return 0;
|
384
360
|
/* Find length of EXPLICIT tag */
|
385
|
-
ret = ASN1_object_size(
|
361
|
+
ret = ASN1_object_size(/*constructed=*/1, i, ttag);
|
386
362
|
if (out && ret != -1) {
|
387
363
|
/* Output tag and item */
|
388
|
-
ASN1_put_object(out,
|
364
|
+
ASN1_put_object(out, /*constructed=*/1, i, ttag, tclass);
|
389
365
|
ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
|
390
|
-
if (ndef == 2)
|
391
|
-
ASN1_put_eoc(out);
|
392
366
|
}
|
393
367
|
return ret;
|
394
368
|
}
|
@@ -487,7 +461,6 @@ static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out,
|
|
487
461
|
int len;
|
488
462
|
int utype;
|
489
463
|
int usetag;
|
490
|
-
int ndef = 0;
|
491
464
|
|
492
465
|
utype = it->utype;
|
493
466
|
|
@@ -513,12 +486,6 @@ static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out,
|
|
513
486
|
if (len == -1)
|
514
487
|
return 0;
|
515
488
|
|
516
|
-
/* -2 return is special meaning use ndef */
|
517
|
-
if (len == -2) {
|
518
|
-
ndef = 2;
|
519
|
-
len = 0;
|
520
|
-
}
|
521
|
-
|
522
489
|
/* If not implicitly tagged get tag from underlying type */
|
523
490
|
if (tag == -1)
|
524
491
|
tag = utype;
|
@@ -526,23 +493,20 @@ static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out,
|
|
526
493
|
/* Output tag+length followed by content octets */
|
527
494
|
if (out) {
|
528
495
|
if (usetag)
|
529
|
-
ASN1_put_object(out,
|
496
|
+
ASN1_put_object(out, /*constructed=*/0, len, tag, aclass);
|
530
497
|
asn1_ex_i2c(pval, *out, &utype, it);
|
531
|
-
|
532
|
-
ASN1_put_eoc(out);
|
533
|
-
else
|
534
|
-
*out += len;
|
498
|
+
*out += len;
|
535
499
|
}
|
536
500
|
|
537
501
|
if (usetag)
|
538
|
-
return ASN1_object_size(
|
502
|
+
return ASN1_object_size(/*constructed=*/0, len, tag);
|
539
503
|
return len;
|
540
504
|
}
|
541
505
|
|
542
506
|
/* Produce content octets from a structure */
|
543
507
|
|
544
|
-
int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
|
545
|
-
|
508
|
+
static int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
|
509
|
+
const ASN1_ITEM *it)
|
546
510
|
{
|
547
511
|
ASN1_BOOLEAN *tbool = NULL;
|
548
512
|
ASN1_STRING *strtmp;
|
@@ -551,10 +515,10 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
|
|
551
515
|
const unsigned char *cont;
|
552
516
|
unsigned char c;
|
553
517
|
int len;
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
518
|
+
|
519
|
+
/* Historically, |it->funcs| for primitive types contained an
|
520
|
+
* |ASN1_PRIMITIVE_FUNCS| table of callbacks. */
|
521
|
+
assert(it->funcs == NULL);
|
558
522
|
|
559
523
|
/* Should type be omitted? */
|
560
524
|
if ((it->itype != ASN1_ITYPE_PRIMITIVE)
|
@@ -642,16 +606,6 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
|
|
642
606
|
default:
|
643
607
|
/* All based on ASN1_STRING and handled the same */
|
644
608
|
strtmp = (ASN1_STRING *)*pval;
|
645
|
-
/* Special handling for NDEF */
|
646
|
-
if ((it->size == ASN1_TFLG_NDEF)
|
647
|
-
&& (strtmp->flags & ASN1_STRING_FLAG_NDEF)) {
|
648
|
-
if (cout) {
|
649
|
-
strtmp->data = cout;
|
650
|
-
strtmp->length = 0;
|
651
|
-
}
|
652
|
-
/* Special return code */
|
653
|
-
return -2;
|
654
|
-
}
|
655
609
|
cont = strtmp->data;
|
656
610
|
len = strtmp->length;
|
657
611
|
|
@@ -56,6 +56,8 @@
|
|
56
56
|
|
57
57
|
#include <openssl/asn1.h>
|
58
58
|
|
59
|
+
#include <assert.h>
|
60
|
+
|
59
61
|
#include <openssl/asn1t.h>
|
60
62
|
#include <openssl/mem.h>
|
61
63
|
|
@@ -77,7 +79,6 @@ void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine)
|
|
77
79
|
{
|
78
80
|
const ASN1_TEMPLATE *tt = NULL, *seqtt;
|
79
81
|
const ASN1_EXTERN_FUNCS *ef;
|
80
|
-
const ASN1_COMPAT_FUNCS *cf;
|
81
82
|
const ASN1_AUX *aux = it->funcs;
|
82
83
|
ASN1_aux_cb *asn1_cb;
|
83
84
|
int i;
|
@@ -124,19 +125,12 @@ void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine)
|
|
124
125
|
}
|
125
126
|
break;
|
126
127
|
|
127
|
-
case ASN1_ITYPE_COMPAT:
|
128
|
-
cf = it->funcs;
|
129
|
-
if (cf && cf->asn1_free)
|
130
|
-
cf->asn1_free(*pval);
|
131
|
-
break;
|
132
|
-
|
133
128
|
case ASN1_ITYPE_EXTERN:
|
134
129
|
ef = it->funcs;
|
135
130
|
if (ef && ef->asn1_ex_free)
|
136
131
|
ef->asn1_ex_free(pval, it);
|
137
132
|
break;
|
138
133
|
|
139
|
-
case ASN1_ITYPE_NDEF_SEQUENCE:
|
140
134
|
case ASN1_ITYPE_SEQUENCE:
|
141
135
|
if (!asn1_refcount_dec_and_test_zero(pval, it))
|
142
136
|
return;
|
@@ -190,14 +184,9 @@ void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
|
|
190
184
|
void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
191
185
|
{
|
192
186
|
int utype;
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
if (pf && pf->prim_free) {
|
197
|
-
pf->prim_free(pval, it);
|
198
|
-
return;
|
199
|
-
}
|
200
|
-
}
|
187
|
+
/* Historically, |it->funcs| for primitive types contained an
|
188
|
+
* |ASN1_PRIMITIVE_FUNCS| table of calbacks. */
|
189
|
+
assert(it == NULL || it->funcs == NULL);
|
201
190
|
/* Special case: if 'it' is NULL free contents of ASN1_TYPE */
|
202
191
|
if (!it) {
|
203
192
|
ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
|
@@ -70,7 +70,9 @@
|
|
70
70
|
static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
71
71
|
int combine);
|
72
72
|
static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
73
|
+
static int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
|
73
74
|
static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
|
75
|
+
static int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
74
76
|
static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
75
77
|
|
76
78
|
ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it)
|
@@ -92,7 +94,6 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
|
92
94
|
int combine)
|
93
95
|
{
|
94
96
|
const ASN1_TEMPLATE *tt = NULL;
|
95
|
-
const ASN1_COMPAT_FUNCS *cf;
|
96
97
|
const ASN1_EXTERN_FUNCS *ef;
|
97
98
|
const ASN1_AUX *aux = it->funcs;
|
98
99
|
ASN1_aux_cb *asn1_cb;
|
@@ -103,11 +104,6 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
|
103
104
|
else
|
104
105
|
asn1_cb = 0;
|
105
106
|
|
106
|
-
#ifdef CRYPTO_MDEBUG
|
107
|
-
if (it->sname)
|
108
|
-
CRYPTO_push_info(it->sname);
|
109
|
-
#endif
|
110
|
-
|
111
107
|
switch (it->itype) {
|
112
108
|
|
113
109
|
case ASN1_ITYPE_EXTERN:
|
@@ -118,15 +114,6 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
|
118
114
|
}
|
119
115
|
break;
|
120
116
|
|
121
|
-
case ASN1_ITYPE_COMPAT:
|
122
|
-
cf = it->funcs;
|
123
|
-
if (cf && cf->asn1_new) {
|
124
|
-
*pval = cf->asn1_new();
|
125
|
-
if (!*pval)
|
126
|
-
goto memerr;
|
127
|
-
}
|
128
|
-
break;
|
129
|
-
|
130
117
|
case ASN1_ITYPE_PRIMITIVE:
|
131
118
|
if (it->templates) {
|
132
119
|
if (!ASN1_template_new(pval, it->templates))
|
@@ -146,10 +133,6 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
|
146
133
|
if (!i)
|
147
134
|
goto auxerr;
|
148
135
|
if (i == 2) {
|
149
|
-
#ifdef CRYPTO_MDEBUG
|
150
|
-
if (it->sname)
|
151
|
-
CRYPTO_pop_info();
|
152
|
-
#endif
|
153
136
|
return 1;
|
154
137
|
}
|
155
138
|
}
|
@@ -164,17 +147,12 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
|
164
147
|
goto auxerr2;
|
165
148
|
break;
|
166
149
|
|
167
|
-
case ASN1_ITYPE_NDEF_SEQUENCE:
|
168
150
|
case ASN1_ITYPE_SEQUENCE:
|
169
151
|
if (asn1_cb) {
|
170
152
|
i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
|
171
153
|
if (!i)
|
172
154
|
goto auxerr;
|
173
155
|
if (i == 2) {
|
174
|
-
#ifdef CRYPTO_MDEBUG
|
175
|
-
if (it->sname)
|
176
|
-
CRYPTO_pop_info();
|
177
|
-
#endif
|
178
156
|
return 1;
|
179
157
|
}
|
180
158
|
}
|
@@ -195,30 +173,18 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
|
195
173
|
goto auxerr2;
|
196
174
|
break;
|
197
175
|
}
|
198
|
-
#ifdef CRYPTO_MDEBUG
|
199
|
-
if (it->sname)
|
200
|
-
CRYPTO_pop_info();
|
201
|
-
#endif
|
202
176
|
return 1;
|
203
177
|
|
204
178
|
memerr2:
|
205
179
|
asn1_item_combine_free(pval, it, combine);
|
206
180
|
memerr:
|
207
181
|
OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE);
|
208
|
-
#ifdef CRYPTO_MDEBUG
|
209
|
-
if (it->sname)
|
210
|
-
CRYPTO_pop_info();
|
211
|
-
#endif
|
212
182
|
return 0;
|
213
183
|
|
214
184
|
auxerr2:
|
215
185
|
asn1_item_combine_free(pval, it, combine);
|
216
186
|
auxerr:
|
217
187
|
OPENSSL_PUT_ERROR(ASN1, ASN1_R_AUX_ERROR);
|
218
|
-
#ifdef CRYPTO_MDEBUG
|
219
|
-
if (it->sname)
|
220
|
-
CRYPTO_pop_info();
|
221
|
-
#endif
|
222
188
|
return 0;
|
223
189
|
|
224
190
|
}
|
@@ -248,16 +214,14 @@ static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
|
248
214
|
asn1_primitive_clear(pval, it);
|
249
215
|
break;
|
250
216
|
|
251
|
-
case ASN1_ITYPE_COMPAT:
|
252
217
|
case ASN1_ITYPE_CHOICE:
|
253
218
|
case ASN1_ITYPE_SEQUENCE:
|
254
|
-
case ASN1_ITYPE_NDEF_SEQUENCE:
|
255
219
|
*pval = NULL;
|
256
220
|
break;
|
257
221
|
}
|
258
222
|
}
|
259
223
|
|
260
|
-
int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
|
224
|
+
static int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
|
261
225
|
{
|
262
226
|
const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
|
263
227
|
int ret;
|
@@ -271,10 +235,6 @@ int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
|
|
271
235
|
*pval = NULL;
|
272
236
|
return 1;
|
273
237
|
}
|
274
|
-
#ifdef CRYPTO_MDEBUG
|
275
|
-
if (tt->field_name)
|
276
|
-
CRYPTO_push_info(tt->field_name);
|
277
|
-
#endif
|
278
238
|
/* If SET OF or SEQUENCE OF, its a STACK */
|
279
239
|
if (tt->flags & ASN1_TFLG_SK_MASK) {
|
280
240
|
STACK_OF(ASN1_VALUE) *skval;
|
@@ -291,10 +251,6 @@ int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
|
|
291
251
|
/* Otherwise pass it back to the item routine */
|
292
252
|
ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE);
|
293
253
|
done:
|
294
|
-
#ifdef CRYPTO_MDEBUG
|
295
|
-
if (it->sname)
|
296
|
-
CRYPTO_pop_info();
|
297
|
-
#endif
|
298
254
|
return ret;
|
299
255
|
}
|
300
256
|
|
@@ -312,7 +268,7 @@ static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt)
|
|
312
268
|
* all the old functions.
|
313
269
|
*/
|
314
270
|
|
315
|
-
int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
271
|
+
static int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
316
272
|
{
|
317
273
|
ASN1_TYPE *typ;
|
318
274
|
ASN1_STRING *str;
|
@@ -321,11 +277,9 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
|
321
277
|
if (!it)
|
322
278
|
return 0;
|
323
279
|
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
return pf->prim_new(pval, it);
|
328
|
-
}
|
280
|
+
/* Historically, |it->funcs| for primitive types contained an
|
281
|
+
* |ASN1_PRIMITIVE_FUNCS| table of calbacks. */
|
282
|
+
assert(it->funcs == NULL);
|
329
283
|
|
330
284
|
if (it->itype == ASN1_ITYPE_MSTRING)
|
331
285
|
utype = -1;
|
@@ -368,14 +322,9 @@ int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
|
368
322
|
static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it)
|
369
323
|
{
|
370
324
|
int utype;
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
pf->prim_clear(pval, it);
|
375
|
-
else
|
376
|
-
*pval = NULL;
|
377
|
-
return;
|
378
|
-
}
|
325
|
+
/* Historically, |it->funcs| for primitive types contained an
|
326
|
+
* |ASN1_PRIMITIVE_FUNCS| table of calbacks. */
|
327
|
+
assert(it == NULL || it->funcs == NULL);
|
379
328
|
if (!it || (it->itype == ASN1_ITYPE_MSTRING))
|
380
329
|
utype = -1;
|
381
330
|
else
|