grpc 1.12.0 → 1.13.0.pre1
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 +314 -23
- data/include/grpc/impl/codegen/fork.h +4 -4
- data/include/grpc/impl/codegen/grpc_types.h +1 -1
- data/include/grpc/impl/codegen/port_platform.h +3 -0
- data/src/boringssl/err_data.c +256 -246
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +367 -272
- data/src/core/ext/filters/client_channel/lb_policy.h +1 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +11 -9
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +42 -32
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +36 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +36 -102
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +37 -32
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +22 -19
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
- 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/round_robin/round_robin.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver.h +1 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +3 -3
- 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_wrapper.cc +0 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +4 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +3 -3
- data/src/core/ext/filters/http/client_authority_filter.cc +5 -4
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +4 -4
- data/src/core/ext/filters/http/server/http_server_filter.cc +123 -131
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +9 -8
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +19 -19
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +10 -6
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +4 -3
- data/src/core/ext/transport/chttp2/transport/parsing.cc +14 -12
- data/src/core/ext/transport/chttp2/transport/writing.cc +6 -6
- data/src/core/lib/channel/channel_stack.cc +0 -5
- data/src/core/lib/channel/channel_stack.h +1 -1
- data/src/core/lib/channel/channel_stack_builder.cc +0 -3
- data/src/core/lib/channel/channel_stack_builder.h +0 -2
- data/src/core/lib/channel/channel_trace.cc +3 -3
- data/src/core/lib/channel/channelz_registry.cc +77 -0
- data/src/core/lib/channel/channelz_registry.h +99 -0
- data/src/core/lib/channel/handshaker.cc +20 -1
- data/src/core/lib/debug/stats.h +7 -0
- data/src/core/lib/debug/stats_data.cc +5 -0
- data/src/core/lib/debug/stats_data.h +120 -0
- data/src/core/lib/debug/trace.h +11 -9
- data/src/core/lib/gprpp/fork.cc +260 -0
- data/src/core/lib/gprpp/fork.h +79 -0
- data/src/core/lib/gprpp/memory.h +12 -0
- data/src/core/lib/gprpp/orphanable.h +2 -6
- data/src/core/lib/gprpp/ref_counted.h +2 -6
- data/src/core/lib/gprpp/thd.h +0 -3
- data/src/core/lib/gprpp/thd_posix.cc +4 -53
- data/src/core/lib/gprpp/thd_windows.cc +0 -7
- data/src/core/lib/http/httpcli_security_connector.cc +1 -3
- data/src/core/lib/iomgr/combiner.cc +19 -2
- data/src/core/lib/iomgr/combiner.h +1 -1
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +2 -2
- data/src/core/lib/iomgr/ev_epollex_linux.cc +59 -3
- data/src/core/lib/iomgr/ev_epollsig_linux.cc +1 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +2 -2
- data/src/core/lib/iomgr/ev_posix.cc +11 -4
- data/src/core/lib/iomgr/ev_posix.h +6 -0
- data/src/core/lib/iomgr/exec_ctx.cc +9 -9
- data/src/core/lib/iomgr/exec_ctx.h +39 -20
- data/src/core/lib/iomgr/fork_posix.cc +30 -18
- data/src/core/lib/iomgr/iomgr_posix.cc +2 -2
- data/src/core/lib/iomgr/polling_entity.cc +11 -2
- data/src/core/lib/iomgr/pollset_custom.cc +2 -2
- data/src/core/lib/iomgr/port.h +38 -1
- data/src/core/lib/iomgr/resolve_address.h +1 -1
- data/src/core/lib/iomgr/resolve_address_posix.cc +1 -1
- data/src/core/lib/iomgr/resource_quota.cc +1 -1
- data/src/core/lib/iomgr/sockaddr_posix.h +1 -1
- data/src/core/lib/iomgr/socket_factory_posix.cc +1 -1
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -1
- data/src/core/lib/iomgr/tcp_client_custom.cc +3 -3
- data/src/core/lib/iomgr/tcp_client_posix.cc +3 -2
- data/src/core/lib/iomgr/tcp_custom.cc +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +18 -10
- data/src/core/lib/iomgr/tcp_server_posix.cc +9 -8
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +1 -1
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +16 -4
- data/src/core/lib/iomgr/timer.h +1 -1
- data/src/core/lib/iomgr/timer_generic.cc +113 -41
- data/src/core/lib/iomgr/timer_manager.cc +1 -1
- data/src/core/lib/security/credentials/credentials.h +1 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +88 -115
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +16 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +10 -6
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -1
- data/src/core/lib/security/security_connector/alts_security_connector.cc +2 -1
- data/src/core/lib/security/security_connector/security_connector.cc +7 -7
- data/src/core/lib/security/transport/security_handshaker.cc +1 -0
- data/src/core/lib/security/util/json_util.cc +4 -0
- data/src/core/lib/slice/slice_buffer.cc +15 -3
- data/src/core/lib/surface/call.cc +31 -17
- data/src/core/lib/surface/call.h +5 -0
- data/src/core/lib/surface/channel.cc +2 -5
- data/src/core/lib/surface/completion_queue.cc +1 -3
- data/src/core/lib/surface/completion_queue.h +0 -1
- data/src/core/lib/surface/init.cc +7 -8
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/byte_stream.cc +1 -1
- data/src/core/lib/transport/transport.cc +2 -1
- data/src/core/lib/transport/transport.h +4 -8
- data/src/core/lib/transport/transport_op_string.cc +1 -1
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +19 -7
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +10 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +28 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +3 -0
- data/src/core/tsi/fake_transport_security.cc +1 -0
- data/src/core/tsi/ssl_transport_security.cc +238 -110
- data/src/core/tsi/transport_security.cc +14 -0
- data/src/core/tsi/transport_security.h +2 -0
- data/src/core/tsi/transport_security_interface.h +11 -1
- data/src/ruby/bin/math_client.rb +17 -9
- data/src/ruby/lib/grpc/generic/rpc_server.rb +2 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +4 -1
- data/third_party/boringssl/crypto/asn1/a_int.c +33 -28
- data/third_party/boringssl/crypto/asn1/a_mbstr.c +24 -22
- data/third_party/boringssl/crypto/asn1/a_utf8.c +13 -11
- data/third_party/boringssl/crypto/asn1/asn1_locl.h +3 -0
- data/third_party/boringssl/crypto/bio/fd.c +1 -0
- data/third_party/boringssl/crypto/bio/file.c +2 -0
- data/third_party/boringssl/crypto/bn_extra/convert.c +6 -5
- data/third_party/boringssl/crypto/bytestring/ber.c +1 -4
- data/third_party/boringssl/crypto/bytestring/cbb.c +116 -16
- data/third_party/boringssl/crypto/bytestring/cbs.c +150 -20
- data/third_party/boringssl/crypto/cipher_extra/e_aesccm.c +171 -0
- data/third_party/boringssl/crypto/cipher_extra/e_rc2.c +2 -0
- data/third_party/boringssl/crypto/cipher_extra/e_tls.c +1 -2
- data/third_party/boringssl/crypto/cpu-aarch64-fuchsia.c +55 -0
- data/third_party/boringssl/crypto/cpu-aarch64-linux.c +2 -1
- data/third_party/boringssl/crypto/dsa/dsa.c +16 -54
- data/third_party/boringssl/crypto/fipsmodule/bcm.c +11 -542
- data/third_party/boringssl/crypto/fipsmodule/bn/add.c +33 -64
- data/third_party/boringssl/crypto/fipsmodule/bn/asm/x86_64-gcc.c +4 -3
- data/third_party/boringssl/crypto/fipsmodule/bn/bn.c +122 -70
- data/third_party/boringssl/crypto/fipsmodule/bn/bytes.c +32 -71
- data/third_party/boringssl/crypto/fipsmodule/bn/cmp.c +58 -112
- data/third_party/boringssl/crypto/fipsmodule/bn/div.c +198 -122
- data/third_party/boringssl/crypto/fipsmodule/bn/exponentiation.c +31 -65
- data/third_party/boringssl/crypto/fipsmodule/bn/generic.c +2 -1
- data/third_party/boringssl/crypto/fipsmodule/bn/internal.h +98 -15
- data/third_party/boringssl/crypto/fipsmodule/bn/jacobi.c +1 -1
- data/third_party/boringssl/crypto/fipsmodule/bn/montgomery.c +124 -81
- data/third_party/boringssl/crypto/fipsmodule/bn/montgomery_inv.c +8 -30
- data/third_party/boringssl/crypto/fipsmodule/bn/mul.c +303 -347
- data/third_party/boringssl/crypto/fipsmodule/bn/prime.c +2 -3
- data/third_party/boringssl/crypto/fipsmodule/bn/random.c +3 -4
- data/third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.c +199 -222
- data/third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.h +27 -47
- data/third_party/boringssl/crypto/fipsmodule/bn/shift.c +45 -28
- data/third_party/boringssl/crypto/fipsmodule/bn/sqrt.c +1 -1
- data/third_party/boringssl/crypto/fipsmodule/cipher/e_aes.c +10 -10
- data/third_party/boringssl/crypto/fipsmodule/des/internal.h +2 -0
- data/third_party/boringssl/crypto/fipsmodule/ec/ec.c +78 -47
- data/third_party/boringssl/crypto/fipsmodule/ec/ec_key.c +35 -54
- data/third_party/boringssl/crypto/fipsmodule/ec/ec_montgomery.c +3 -10
- data/third_party/boringssl/crypto/fipsmodule/ec/internal.h +36 -22
- data/third_party/boringssl/crypto/fipsmodule/ec/oct.c +59 -90
- data/third_party/boringssl/crypto/fipsmodule/ec/p224-64.c +29 -48
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.c +17 -26
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.h +15 -11
- data/third_party/boringssl/crypto/fipsmodule/ec/simple.c +45 -51
- data/third_party/boringssl/crypto/fipsmodule/ec/{util-64.c → util.c} +0 -5
- data/third_party/boringssl/crypto/fipsmodule/ec/wnaf.c +144 -264
- data/third_party/boringssl/crypto/fipsmodule/ecdsa/ecdsa.c +78 -56
- data/third_party/boringssl/crypto/fipsmodule/modes/ccm.c +256 -0
- data/third_party/boringssl/crypto/fipsmodule/modes/internal.h +36 -32
- data/third_party/boringssl/crypto/fipsmodule/rand/ctrdrbg.c +9 -7
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa.c +16 -10
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa_impl.c +255 -102
- data/third_party/boringssl/crypto/fipsmodule/self_check/self_check.c +581 -0
- data/third_party/boringssl/crypto/fipsmodule/tls/internal.h +39 -0
- data/third_party/boringssl/crypto/fipsmodule/tls/kdf.c +165 -0
- data/third_party/boringssl/crypto/internal.h +65 -2
- data/third_party/boringssl/crypto/mem.c +0 -2
- data/third_party/boringssl/crypto/obj/obj.c +6 -73
- data/third_party/boringssl/crypto/thread_pthread.c +35 -5
- data/third_party/boringssl/crypto/x509/a_strex.c +11 -11
- data/third_party/boringssl/crypto/x509/x_name.c +13 -0
- data/third_party/boringssl/include/openssl/aead.h +4 -0
- data/third_party/boringssl/include/openssl/asn1.h +1 -3
- data/third_party/boringssl/include/openssl/base.h +1 -14
- data/third_party/boringssl/include/openssl/bio.h +1 -1
- data/third_party/boringssl/include/openssl/bn.h +49 -15
- data/third_party/boringssl/include/openssl/bytestring.h +49 -24
- data/third_party/boringssl/include/openssl/crypto.h +4 -0
- data/third_party/boringssl/include/openssl/ec_key.h +7 -3
- data/third_party/boringssl/include/openssl/err.h +9 -9
- data/third_party/boringssl/include/openssl/evp.h +1 -1
- data/third_party/boringssl/include/openssl/rsa.h +34 -10
- data/third_party/boringssl/include/openssl/ssl.h +160 -17
- data/third_party/boringssl/include/openssl/stack.h +1 -1
- data/third_party/boringssl/include/openssl/tls1.h +10 -2
- data/third_party/boringssl/include/openssl/x509.h +3 -0
- data/third_party/boringssl/ssl/d1_both.cc +16 -2
- data/third_party/boringssl/ssl/dtls_method.cc +1 -1
- data/third_party/boringssl/ssl/handoff.cc +285 -0
- data/third_party/boringssl/ssl/handshake.cc +26 -12
- data/third_party/boringssl/ssl/handshake_client.cc +65 -31
- data/third_party/boringssl/ssl/handshake_server.cc +14 -2
- data/third_party/boringssl/ssl/internal.h +132 -79
- data/third_party/boringssl/ssl/s3_both.cc +2 -2
- data/third_party/boringssl/ssl/s3_lib.cc +3 -1
- data/third_party/boringssl/ssl/s3_pkt.cc +0 -18
- data/third_party/boringssl/ssl/ssl_aead_ctx.cc +1 -4
- data/third_party/boringssl/ssl/ssl_asn1.cc +47 -43
- data/third_party/boringssl/ssl/ssl_cipher.cc +8 -8
- data/third_party/boringssl/ssl/ssl_key_share.cc +3 -1
- data/third_party/boringssl/ssl/ssl_lib.cc +83 -14
- data/third_party/boringssl/ssl/ssl_privkey.cc +6 -0
- data/third_party/boringssl/ssl/ssl_stat.cc +6 -6
- data/third_party/boringssl/ssl/ssl_versions.cc +12 -85
- data/third_party/boringssl/ssl/ssl_x509.cc +59 -61
- data/third_party/boringssl/ssl/t1_enc.cc +73 -124
- data/third_party/boringssl/ssl/t1_lib.cc +367 -41
- data/third_party/boringssl/ssl/tls13_both.cc +8 -0
- data/third_party/boringssl/ssl/tls13_client.cc +98 -184
- data/third_party/boringssl/ssl/tls13_enc.cc +88 -158
- data/third_party/boringssl/ssl/tls13_server.cc +91 -137
- data/third_party/boringssl/ssl/tls_method.cc +0 -17
- data/third_party/boringssl/ssl/tls_record.cc +1 -10
- data/third_party/boringssl/third_party/fiat/curve25519.c +921 -2753
- data/third_party/boringssl/third_party/fiat/curve25519_tables.h +7880 -0
- data/third_party/boringssl/third_party/fiat/internal.h +32 -20
- data/third_party/boringssl/third_party/fiat/p256.c +1824 -0
- metadata +64 -64
- data/src/core/lib/channel/channel_trace_registry.cc +0 -80
- data/src/core/lib/channel/channel_trace_registry.h +0 -43
- data/src/core/lib/gpr/fork.cc +0 -78
- data/src/core/lib/gpr/fork.h +0 -35
- data/src/core/tsi/transport_security_adapter.cc +0 -235
- data/src/core/tsi/transport_security_adapter.h +0 -41
- data/src/ruby/bin/apis/google/protobuf/empty.rb +0 -29
- data/src/ruby/bin/apis/pubsub_demo.rb +0 -241
- data/src/ruby/bin/apis/tech/pubsub/proto/pubsub.rb +0 -159
- data/src/ruby/bin/apis/tech/pubsub/proto/pubsub_services.rb +0 -88
- data/src/ruby/pb/test/client.rb +0 -764
- data/src/ruby/pb/test/server.rb +0 -252
- data/third_party/boringssl/crypto/curve25519/x25519-x86_64.c +0 -247
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-64.c +0 -1674
@@ -56,6 +56,7 @@
|
|
56
56
|
|
57
57
|
#include <openssl/x509.h>
|
58
58
|
|
59
|
+
#include <inttypes.h>
|
59
60
|
#include <string.h>
|
60
61
|
|
61
62
|
#include <openssl/asn1.h>
|
@@ -63,6 +64,7 @@
|
|
63
64
|
#include <openssl/obj.h>
|
64
65
|
|
65
66
|
#include "charmap.h"
|
67
|
+
#include "../asn1/asn1_locl.h"
|
66
68
|
|
67
69
|
/*
|
68
70
|
* ASN1_STRING_print_ex() and X509_NAME_print_ex(). Enhanced string and name
|
@@ -105,22 +107,20 @@ typedef int char_io (void *arg, const void *buf, int len);
|
|
105
107
|
|
106
108
|
#define HEX_SIZE(type) (sizeof(type)*2)
|
107
109
|
|
108
|
-
static int do_esc_char(
|
110
|
+
static int do_esc_char(uint32_t c, unsigned char flags, char *do_quotes,
|
109
111
|
char_io *io_ch, void *arg)
|
110
112
|
{
|
111
113
|
unsigned char chflgs, chtmp;
|
112
|
-
char tmphex[HEX_SIZE(
|
114
|
+
char tmphex[HEX_SIZE(uint32_t) + 3];
|
113
115
|
|
114
|
-
if (c > 0xffffffffL)
|
115
|
-
return -1;
|
116
116
|
if (c > 0xffff) {
|
117
|
-
BIO_snprintf(tmphex, sizeof tmphex, "\\W%
|
117
|
+
BIO_snprintf(tmphex, sizeof tmphex, "\\W%08" PRIX32, c);
|
118
118
|
if (!io_ch(arg, tmphex, 10))
|
119
119
|
return -1;
|
120
120
|
return 10;
|
121
121
|
}
|
122
122
|
if (c > 0xff) {
|
123
|
-
BIO_snprintf(tmphex, sizeof tmphex, "\\U%
|
123
|
+
BIO_snprintf(tmphex, sizeof tmphex, "\\U%04" PRIX32, c);
|
124
124
|
if (!io_ch(arg, tmphex, 6))
|
125
125
|
return -1;
|
126
126
|
return 6;
|
@@ -180,7 +180,7 @@ static int do_buf(unsigned char *buf, int buflen,
|
|
180
180
|
{
|
181
181
|
int i, outlen, len;
|
182
182
|
unsigned char orflags, *p, *q;
|
183
|
-
|
183
|
+
uint32_t c;
|
184
184
|
p = buf;
|
185
185
|
q = buf + buflen;
|
186
186
|
outlen = 0;
|
@@ -191,14 +191,14 @@ static int do_buf(unsigned char *buf, int buflen,
|
|
191
191
|
orflags = 0;
|
192
192
|
switch (type & BUF_TYPE_WIDTH_MASK) {
|
193
193
|
case 4:
|
194
|
-
c = ((
|
195
|
-
c |= ((
|
196
|
-
c |= ((
|
194
|
+
c = ((uint32_t)*p++) << 24;
|
195
|
+
c |= ((uint32_t)*p++) << 16;
|
196
|
+
c |= ((uint32_t)*p++) << 8;
|
197
197
|
c |= *p++;
|
198
198
|
break;
|
199
199
|
|
200
200
|
case 2:
|
201
|
-
c = ((
|
201
|
+
c = ((uint32_t)*p++) << 8;
|
202
202
|
c |= *p++;
|
203
203
|
break;
|
204
204
|
|
@@ -539,3 +539,16 @@ int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
|
|
539
539
|
{
|
540
540
|
return ne->set;
|
541
541
|
}
|
542
|
+
|
543
|
+
int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder,
|
544
|
+
size_t *pderlen)
|
545
|
+
{
|
546
|
+
/* Make sure encoding is valid */
|
547
|
+
if (i2d_X509_NAME(nm, NULL) <= 0)
|
548
|
+
return 0;
|
549
|
+
if (pder != NULL)
|
550
|
+
*pder = (unsigned char *)nm->bytes->data;
|
551
|
+
if (pderlen != NULL)
|
552
|
+
*pderlen = nm->bytes->length;
|
553
|
+
return 1;
|
554
|
+
}
|
@@ -117,6 +117,10 @@ OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_siv(void);
|
|
117
117
|
// https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02
|
118
118
|
OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void);
|
119
119
|
|
120
|
+
// EVP_aead_aes_128_ccm_bluetooth is AES-128-CCM with M=4 and L=2, as decribed
|
121
|
+
// in the Bluetooth Core Specification v5.0, Volume 6, Part E, Section 1.
|
122
|
+
OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth(void);
|
123
|
+
|
120
124
|
// EVP_has_aes_hardware returns one if we enable hardware support for fast and
|
121
125
|
// constant-time AES-GCM.
|
122
126
|
OPENSSL_EXPORT int EVP_has_aes_hardware(void);
|
@@ -708,9 +708,6 @@ DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
|
|
708
708
|
DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
|
709
709
|
DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
|
710
710
|
|
711
|
-
OPENSSL_EXPORT int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
|
712
|
-
OPENSSL_EXPORT int UTF8_putc(unsigned char *str, int len, unsigned long value);
|
713
|
-
|
714
711
|
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
|
715
712
|
|
716
713
|
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
|
@@ -740,6 +737,7 @@ OPENSSL_EXPORT int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a);
|
|
740
737
|
OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, const char *sn, const char *ln);
|
741
738
|
|
742
739
|
OPENSSL_EXPORT int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
|
740
|
+
OPENSSL_EXPORT int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v);
|
743
741
|
OPENSSL_EXPORT long ASN1_INTEGER_get(const ASN1_INTEGER *a);
|
744
742
|
OPENSSL_EXPORT ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
|
745
743
|
OPENSSL_EXPORT BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai,BIGNUM *bn);
|
@@ -151,7 +151,7 @@ extern "C" {
|
|
151
151
|
// A consumer may use this symbol in the preprocessor to temporarily build
|
152
152
|
// against multiple revisions of BoringSSL at the same time. It is not
|
153
153
|
// recommended to do so for longer than is necessary.
|
154
|
-
#define BORINGSSL_API_VERSION
|
154
|
+
#define BORINGSSL_API_VERSION 7
|
155
155
|
|
156
156
|
#if defined(BORINGSSL_SHARED_LIBRARY)
|
157
157
|
|
@@ -223,19 +223,6 @@ extern "C" {
|
|
223
223
|
#endif
|
224
224
|
#endif
|
225
225
|
|
226
|
-
// Have a generic fall-through for different versions of C/C++.
|
227
|
-
#if defined(__cplusplus) && __cplusplus >= 201703L
|
228
|
-
#define OPENSSL_FALLTHROUGH [[fallthrough]]
|
229
|
-
#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__)
|
230
|
-
#define OPENSSL_FALLTHROUGH [[clang::fallthrough]]
|
231
|
-
#elif defined(__cplusplus) && __cplusplus >= 201103L && __GNUC__ >= 7
|
232
|
-
#define OPENSSL_FALLTHROUGH [[gnu::fallthrough]]
|
233
|
-
#elif __GNUC__ >= 7 // gcc 7
|
234
|
-
#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough))
|
235
|
-
#else // C++11 on gcc 6, and all other cases
|
236
|
-
#define OPENSSL_FALLTHROUGH
|
237
|
-
#endif
|
238
|
-
|
239
226
|
// CRYPTO_THREADID is a dummy value.
|
240
227
|
typedef int CRYPTO_THREADID;
|
241
228
|
|
@@ -347,7 +347,7 @@ OPENSSL_EXPORT int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len,
|
|
347
347
|
// Memory BIOs.
|
348
348
|
//
|
349
349
|
// Memory BIOs can be used as a read-only source (with |BIO_new_mem_buf|) or a
|
350
|
-
// writable sink (with |BIO_new|, |BIO_s_mem| and |
|
350
|
+
// writable sink (with |BIO_new|, |BIO_s_mem| and |BIO_mem_contents|). Data
|
351
351
|
// written to a writable, memory BIO can be recalled by reading from it.
|
352
352
|
//
|
353
353
|
// Calling |BIO_reset| on a read-only BIO resets it to the original contents.
|
@@ -459,6 +459,7 @@ OPENSSL_EXPORT int BN_is_odd(const BIGNUM *bn);
|
|
459
459
|
// BN_is_pow2 returns 1 if |a| is a power of two, and 0 otherwise.
|
460
460
|
OPENSSL_EXPORT int BN_is_pow2(const BIGNUM *a);
|
461
461
|
|
462
|
+
|
462
463
|
// Bitwise operations.
|
463
464
|
|
464
465
|
// BN_lshift sets |r| equal to |a| << n. The |a| and |r| arguments may be the
|
@@ -495,6 +496,11 @@ OPENSSL_EXPORT int BN_is_bit_set(const BIGNUM *a, int n);
|
|
495
496
|
// on success or zero if |n| is greater than the length of |a| already.
|
496
497
|
OPENSSL_EXPORT int BN_mask_bits(BIGNUM *a, int n);
|
497
498
|
|
499
|
+
// BN_count_low_zero_bits returns the number of low-order zero bits in |bn|, or
|
500
|
+
// the number of factors of two which divide it. It returns zero if |bn| is
|
501
|
+
// zero.
|
502
|
+
OPENSSL_EXPORT int BN_count_low_zero_bits(const BIGNUM *bn);
|
503
|
+
|
498
504
|
|
499
505
|
// Modulo arithmetic.
|
500
506
|
|
@@ -788,8 +794,10 @@ int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a,
|
|
788
794
|
// BN_MONT_CTX contains the precomputed values needed to work in a specific
|
789
795
|
// Montgomery domain.
|
790
796
|
|
791
|
-
//
|
792
|
-
|
797
|
+
// BN_MONT_CTX_new_for_modulus returns a fresh |BN_MONT_CTX| given the modulus,
|
798
|
+
// |mod| or NULL on error.
|
799
|
+
OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod,
|
800
|
+
BN_CTX *ctx);
|
793
801
|
|
794
802
|
// BN_MONT_CTX_free frees memory associated with |mont|.
|
795
803
|
OPENSSL_EXPORT void BN_MONT_CTX_free(BN_MONT_CTX *mont);
|
@@ -799,11 +807,6 @@ OPENSSL_EXPORT void BN_MONT_CTX_free(BN_MONT_CTX *mont);
|
|
799
807
|
OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,
|
800
808
|
const BN_MONT_CTX *from);
|
801
809
|
|
802
|
-
// BN_MONT_CTX_set sets up a Montgomery context given the modulus, |mod|. It
|
803
|
-
// returns one on success and zero on error.
|
804
|
-
OPENSSL_EXPORT int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod,
|
805
|
-
BN_CTX *ctx);
|
806
|
-
|
807
810
|
// BN_MONT_CTX_set_locked takes |lock| and checks whether |*pmont| is NULL. If
|
808
811
|
// so, it creates a new |BN_MONT_CTX| and sets the modulus for it to |mod|. It
|
809
812
|
// then stores it as |*pmont|. It returns one on success and zero on error.
|
@@ -891,21 +894,52 @@ OPENSSL_EXPORT int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1,
|
|
891
894
|
const BIGNUM *p2, const BIGNUM *m,
|
892
895
|
BN_CTX *ctx, const BN_MONT_CTX *mont);
|
893
896
|
|
897
|
+
// BN_MONT_CTX_new returns a fresh |BN_MONT_CTX| or NULL on allocation failure.
|
898
|
+
// Use |BN_MONT_CTX_new_for_modulus| instead.
|
899
|
+
OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new(void);
|
900
|
+
|
901
|
+
// BN_MONT_CTX_set sets up a Montgomery context given the modulus, |mod|. It
|
902
|
+
// returns one on success and zero on error. Use |BN_MONT_CTX_new_for_modulus|
|
903
|
+
// instead.
|
904
|
+
OPENSSL_EXPORT int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod,
|
905
|
+
BN_CTX *ctx);
|
906
|
+
|
894
907
|
|
895
908
|
// Private functions
|
896
909
|
|
897
910
|
struct bignum_st {
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
911
|
+
// d is a pointer to an array of |width| |BN_BITS2|-bit chunks in
|
912
|
+
// little-endian order. This stores the absolute value of the number.
|
913
|
+
BN_ULONG *d;
|
914
|
+
// width is the number of elements of |d| which are valid. This value is not
|
915
|
+
// necessarily minimal; the most-significant words of |d| may be zero.
|
916
|
+
// |width| determines a potentially loose upper-bound on the absolute value
|
917
|
+
// of the |BIGNUM|.
|
918
|
+
//
|
919
|
+
// Functions taking |BIGNUM| inputs must compute the same answer for all
|
920
|
+
// possible widths. |bn_minimal_width|, |bn_set_minimal_width|, and other
|
921
|
+
// helpers may be used to recover the minimal width, provided it is not
|
922
|
+
// secret. If it is secret, use a different algorithm. Functions may output
|
923
|
+
// minimal or non-minimal |BIGNUM|s depending on secrecy requirements, but
|
924
|
+
// those which cause widths to unboundedly grow beyond the minimal value
|
925
|
+
// should be documented such.
|
926
|
+
//
|
927
|
+
// Note this is different from historical |BIGNUM| semantics.
|
928
|
+
int width;
|
929
|
+
// dmax is number of elements of |d| which are allocated.
|
930
|
+
int dmax;
|
931
|
+
// neg is one if the number if negative and zero otherwise.
|
932
|
+
int neg;
|
933
|
+
// flags is a bitmask of |BN_FLG_*| values
|
934
|
+
int flags;
|
904
935
|
};
|
905
936
|
|
906
937
|
struct bn_mont_ctx_st {
|
907
|
-
|
908
|
-
BIGNUM
|
938
|
+
// RR is R^2, reduced modulo |N|. It is used to convert to Montgomery form.
|
939
|
+
BIGNUM RR;
|
940
|
+
// N is the modulus. It is always stored in minimal form, so |N.top|
|
941
|
+
// determines R.
|
942
|
+
BIGNUM N;
|
909
943
|
BN_ULONG n0[2]; // least significant words of (R*Ri-1)/N
|
910
944
|
};
|
911
945
|
|
@@ -164,34 +164,36 @@ OPENSSL_EXPORT int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out);
|
|
164
164
|
#define CBS_ASN1_UNIVERSALSTRING 0x1cu
|
165
165
|
#define CBS_ASN1_BMPSTRING 0x1eu
|
166
166
|
|
167
|
+
// CBS_ASN1_TAG_SHIFT is how much the in-memory representation shifts the class
|
168
|
+
// and constructed bits from the DER serialization. This allows representing tag
|
169
|
+
// numbers beyond 31.
|
170
|
+
//
|
171
|
+
// Consumers must use the following constants to decompose or assemble tags.
|
172
|
+
#define CBS_ASN1_TAG_SHIFT 24
|
173
|
+
|
167
174
|
// CBS_ASN1_CONSTRUCTED may be ORed into a tag to toggle the constructed
|
168
175
|
// bit. |CBS| and |CBB| APIs consider the constructed bit to be part of the
|
169
176
|
// tag.
|
170
|
-
#define CBS_ASN1_CONSTRUCTED 0x20u
|
177
|
+
#define CBS_ASN1_CONSTRUCTED (0x20u << CBS_ASN1_TAG_SHIFT)
|
171
178
|
|
172
|
-
// The following values specify the
|
173
|
-
//
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
// to allow for tag numbers beyond 31 in the future.
|
179
|
-
#define CBS_ASN1_APPLICATION 0x40u
|
180
|
-
#define CBS_ASN1_CONTEXT_SPECIFIC 0x80u
|
181
|
-
#define CBS_ASN1_PRIVATE 0xc0u
|
179
|
+
// The following values specify the tag class and may be ORed into a tag number
|
180
|
+
// to produce the final tag. If none is used, the tag will be UNIVERSAL.
|
181
|
+
#define CBS_ASN1_UNIVERSAL (0u << CBS_ASN1_TAG_SHIFT)
|
182
|
+
#define CBS_ASN1_APPLICATION (0x40u << CBS_ASN1_TAG_SHIFT)
|
183
|
+
#define CBS_ASN1_CONTEXT_SPECIFIC (0x80u << CBS_ASN1_TAG_SHIFT)
|
184
|
+
#define CBS_ASN1_PRIVATE (0xc0u << CBS_ASN1_TAG_SHIFT)
|
182
185
|
|
183
|
-
// CBS_ASN1_CLASS_MASK may be ANDed with a tag to query its class.
|
184
|
-
|
186
|
+
// CBS_ASN1_CLASS_MASK may be ANDed with a tag to query its class. This will
|
187
|
+
// give one of the four values above.
|
188
|
+
#define CBS_ASN1_CLASS_MASK (0xc0u << CBS_ASN1_TAG_SHIFT)
|
185
189
|
|
186
190
|
// CBS_ASN1_TAG_NUMBER_MASK may be ANDed with a tag to query its number.
|
187
|
-
#define CBS_ASN1_TAG_NUMBER_MASK
|
191
|
+
#define CBS_ASN1_TAG_NUMBER_MASK ((1u << (5 + CBS_ASN1_TAG_SHIFT)) - 1)
|
188
192
|
|
189
193
|
// CBS_get_asn1 sets |*out| to the contents of DER-encoded, ASN.1 element (not
|
190
194
|
// including tag and length bytes) and advances |cbs| over it. The ASN.1
|
191
195
|
// element must match |tag_value|. It returns one on success and zero
|
192
196
|
// on error.
|
193
|
-
//
|
194
|
-
// Tag numbers greater than 30 are not supported (i.e. short form only).
|
195
197
|
OPENSSL_EXPORT int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value);
|
196
198
|
|
197
199
|
// CBS_get_asn1_element acts like |CBS_get_asn1| but |out| will include the
|
@@ -209,16 +211,12 @@ OPENSSL_EXPORT int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value);
|
|
209
211
|
// (not including tag and length bytes), sets |*out_tag| to the tag number, and
|
210
212
|
// advances |*cbs|. It returns one on success and zero on error. Either of |out|
|
211
213
|
// and |out_tag| may be NULL to ignore the value.
|
212
|
-
//
|
213
|
-
// Tag numbers greater than 30 are not supported (i.e. short form only).
|
214
214
|
OPENSSL_EXPORT int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag);
|
215
215
|
|
216
216
|
// CBS_get_any_asn1_element sets |*out| to contain the next ASN.1 element from
|
217
217
|
// |*cbs| (including header bytes) and advances |*cbs|. It sets |*out_tag| to
|
218
218
|
// the tag number and |*out_header_len| to the length of the ASN.1 header. Each
|
219
219
|
// of |out|, |out_tag|, and |out_header_len| may be NULL to ignore the value.
|
220
|
-
//
|
221
|
-
// Tag numbers greater than 30 are not supported (i.e. short form only).
|
222
220
|
OPENSSL_EXPORT int CBS_get_any_asn1_element(CBS *cbs, CBS *out,
|
223
221
|
unsigned *out_tag,
|
224
222
|
size_t *out_header_len);
|
@@ -237,6 +235,10 @@ OPENSSL_EXPORT int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out,
|
|
237
235
|
// in 64 bits.
|
238
236
|
OPENSSL_EXPORT int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out);
|
239
237
|
|
238
|
+
// CBS_get_asn1_bool gets an ASN.1 BOOLEAN from |cbs| and sets |*out| to zero
|
239
|
+
// or one based on its value. It returns one on success or zero on error.
|
240
|
+
OPENSSL_EXPORT int CBS_get_asn1_bool(CBS *cbs, int *out);
|
241
|
+
|
240
242
|
// CBS_get_optional_asn1 gets an optional explicitly-tagged element from |cbs|
|
241
243
|
// tagged with |tag| and sets |*out| to its contents. If present and if
|
242
244
|
// |out_present| is not NULL, it sets |*out_present| to one, otherwise zero. It
|
@@ -281,6 +283,13 @@ OPENSSL_EXPORT int CBS_is_valid_asn1_bitstring(const CBS *cbs);
|
|
281
283
|
// is indexed starting from zero.
|
282
284
|
OPENSSL_EXPORT int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit);
|
283
285
|
|
286
|
+
// CBS_asn1_oid_to_text interprets |cbs| as DER-encoded ASN.1 OBJECT IDENTIFIER
|
287
|
+
// contents (not including the element framing) and returns the ASCII
|
288
|
+
// representation (e.g., "1.2.840.113554.4.1.72585") in a newly-allocated
|
289
|
+
// string, or NULL on failure. The caller must release the result with
|
290
|
+
// |OPENSSL_free|.
|
291
|
+
OPENSSL_EXPORT char *CBS_asn1_oid_to_text(const CBS *cbs);
|
292
|
+
|
284
293
|
|
285
294
|
// CRYPTO ByteBuilder.
|
286
295
|
//
|
@@ -396,9 +405,7 @@ OPENSSL_EXPORT int CBB_add_u24_length_prefixed(CBB *cbb, CBB *out_contents);
|
|
396
405
|
|
397
406
|
// CBB_add_asn1 sets |*out_contents| to a |CBB| into which the contents of an
|
398
407
|
// ASN.1 object can be written. The |tag| argument will be used as the tag for
|
399
|
-
// the object.
|
400
|
-
// single octet identifiers are supported. It returns one on success or zero
|
401
|
-
// on error.
|
408
|
+
// the object. It returns one on success or zero on error.
|
402
409
|
OPENSSL_EXPORT int CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned tag);
|
403
410
|
|
404
411
|
// CBB_add_bytes appends |len| bytes from |data| to |cbb|. It returns one on
|
@@ -447,6 +454,15 @@ OPENSSL_EXPORT void CBB_discard_child(CBB *cbb);
|
|
447
454
|
// error.
|
448
455
|
OPENSSL_EXPORT int CBB_add_asn1_uint64(CBB *cbb, uint64_t value);
|
449
456
|
|
457
|
+
// CBB_add_asn1_octet_string writes an ASN.1 OCTET STRING into |cbb| with the
|
458
|
+
// given contents. It returns one on success and zero on error.
|
459
|
+
OPENSSL_EXPORT int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data,
|
460
|
+
size_t data_len);
|
461
|
+
|
462
|
+
// CBB_add_asn1_bool writes an ASN.1 BOOLEAN into |cbb| which is true iff
|
463
|
+
// |value| is non-zero. It returns one on success and zero on error.
|
464
|
+
OPENSSL_EXPORT int CBB_add_asn1_bool(CBB *cbb, int value);
|
465
|
+
|
450
466
|
// CBB_add_asn1_oid_from_text decodes |len| bytes from |text| as an ASCII OID
|
451
467
|
// representation, e.g. "1.2.840.113554.4.1.72585", and writes the DER-encoded
|
452
468
|
// contents to |cbb|. It returns one on success and zero on malloc failure or if
|
@@ -454,10 +470,19 @@ OPENSSL_EXPORT int CBB_add_asn1_uint64(CBB *cbb, uint64_t value);
|
|
454
470
|
// the element's contents.
|
455
471
|
//
|
456
472
|
// This function considers OID strings with components which do not fit in a
|
457
|
-
// |
|
473
|
+
// |uint64_t| to be invalid.
|
458
474
|
OPENSSL_EXPORT int CBB_add_asn1_oid_from_text(CBB *cbb, const char *text,
|
459
475
|
size_t len);
|
460
476
|
|
477
|
+
// CBB_flush_asn1_set_of calls |CBB_flush| on |cbb| and then reorders the
|
478
|
+
// contents for a DER-encoded ASN.1 SET OF type. It returns one on success and
|
479
|
+
// zero on failure. DER canonicalizes SET OF contents by sorting
|
480
|
+
// lexicographically by encoding. Call this function when encoding a SET OF
|
481
|
+
// type in an order that is not already known to be canonical.
|
482
|
+
//
|
483
|
+
// Note a SET type has a slightly different ordering than a SET OF.
|
484
|
+
OPENSSL_EXPORT int CBB_flush_asn1_set_of(CBB *cbb);
|
485
|
+
|
461
486
|
|
462
487
|
#if defined(__cplusplus)
|
463
488
|
} // extern C
|
@@ -58,6 +58,10 @@ OPENSSL_EXPORT int CRYPTO_has_asm(void);
|
|
58
58
|
// which case it returns one.
|
59
59
|
OPENSSL_EXPORT int FIPS_mode(void);
|
60
60
|
|
61
|
+
// BORINGSSL_self_test triggers the FIPS KAT-based self tests. It returns one
|
62
|
+
// on success and zero on error.
|
63
|
+
OPENSSL_EXPORT int BORINGSSL_self_test(void);
|
64
|
+
|
61
65
|
|
62
66
|
// Deprecated functions.
|
63
67
|
|
@@ -116,14 +116,16 @@ OPENSSL_EXPORT int EC_KEY_is_opaque(const EC_KEY *key);
|
|
116
116
|
OPENSSL_EXPORT const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
|
117
117
|
|
118
118
|
// EC_KEY_set_group sets the |EC_GROUP| object that |key| will use to |group|.
|
119
|
-
// It returns one on success and zero otherwise.
|
119
|
+
// It returns one on success and zero otherwise. If |key| already has a group,
|
120
|
+
// it is an error to change to a different one.
|
120
121
|
OPENSSL_EXPORT int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
|
121
122
|
|
122
123
|
// EC_KEY_get0_private_key returns a pointer to the private key inside |key|.
|
123
124
|
OPENSSL_EXPORT const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
|
124
125
|
|
125
126
|
// EC_KEY_set_private_key sets the private key of |key| to |priv|. It returns
|
126
|
-
// one on success and zero otherwise.
|
127
|
+
// one on success and zero otherwise. |key| must already have had a group
|
128
|
+
// configured (see |EC_KEY_set_group| and |EC_KEY_new_by_curve_name|).
|
127
129
|
OPENSSL_EXPORT int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
|
128
130
|
|
129
131
|
// EC_KEY_get0_public_key returns a pointer to the public key point inside
|
@@ -131,7 +133,9 @@ OPENSSL_EXPORT int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
|
|
131
133
|
OPENSSL_EXPORT const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
|
132
134
|
|
133
135
|
// EC_KEY_set_public_key sets the public key of |key| to |pub|, by copying it.
|
134
|
-
// It returns one on success and zero otherwise.
|
136
|
+
// It returns one on success and zero otherwise. |key| must already have had a
|
137
|
+
// group configured (see |EC_KEY_set_group| and |EC_KEY_new_by_curve_name|), and
|
138
|
+
// |pub| must also belong to that group.
|
135
139
|
OPENSSL_EXPORT int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
|
136
140
|
|
137
141
|
#define EC_PKEY_NO_PARAMETERS 0x001
|
@@ -262,14 +262,6 @@ OPENSSL_EXPORT void ERR_print_errors_fp(FILE *file);
|
|
262
262
|
// ERR_clear_error clears the error queue for the current thread.
|
263
263
|
OPENSSL_EXPORT void ERR_clear_error(void);
|
264
264
|
|
265
|
-
// ERR_remove_thread_state clears the error queue for the current thread if
|
266
|
-
// |tid| is NULL. Otherwise it calls |assert(0)|, because it's no longer
|
267
|
-
// possible to delete the error queue for other threads.
|
268
|
-
//
|
269
|
-
// Error queues are thread-local data and are deleted automatically. You do not
|
270
|
-
// need to call this function. Use |ERR_clear_error|.
|
271
|
-
OPENSSL_EXPORT void ERR_remove_thread_state(const CRYPTO_THREADID *tid);
|
272
|
-
|
273
265
|
// ERR_set_mark "marks" the most recent error for use with |ERR_pop_to_mark|.
|
274
266
|
// It returns one if an error was marked and zero if there are no errors.
|
275
267
|
OPENSSL_EXPORT int ERR_set_mark(void);
|
@@ -382,6 +374,14 @@ enum {
|
|
382
374
|
// ERR_remove_state calls |ERR_clear_error|.
|
383
375
|
OPENSSL_EXPORT void ERR_remove_state(unsigned long pid);
|
384
376
|
|
377
|
+
// ERR_remove_thread_state clears the error queue for the current thread if
|
378
|
+
// |tid| is NULL. Otherwise it calls |assert(0)|, because it's no longer
|
379
|
+
// possible to delete the error queue for other threads.
|
380
|
+
//
|
381
|
+
// Use |ERR_clear_error| instead. Note error queues are deleted automatically on
|
382
|
+
// thread exit. You do not need to call this function to release memory.
|
383
|
+
OPENSSL_EXPORT void ERR_remove_thread_state(const CRYPTO_THREADID *tid);
|
384
|
+
|
385
385
|
// ERR_func_error_string returns the string "OPENSSL_internal".
|
386
386
|
OPENSSL_EXPORT const char *ERR_func_error_string(uint32_t packed_error);
|
387
387
|
|
@@ -395,7 +395,7 @@ OPENSSL_EXPORT const char *ERR_func_error_string(uint32_t packed_error);
|
|
395
395
|
//
|
396
396
|
// TODO(fork): remove this function.
|
397
397
|
OPENSSL_EXPORT char *ERR_error_string(uint32_t packed_error, char *buf);
|
398
|
-
#define ERR_ERROR_STRING_BUF_LEN
|
398
|
+
#define ERR_ERROR_STRING_BUF_LEN 120
|
399
399
|
|
400
400
|
// ERR_GET_FUNC returns zero. BoringSSL errors do not report a function code.
|
401
401
|
#define ERR_GET_FUNC(packed_error) 0
|