connect.c
Go to the documentation of this file.
1 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
2  * All rights reserved.
3  *
4  * This package is an SSL implementation written
5  * by Eric Young (eay@cryptsoft.com).
6  * The implementation was written so as to conform with Netscapes SSL.
7  *
8  * This library is free for commercial and non-commercial use as long as
9  * the following conditions are aheared to. The following conditions
10  * apply to all code found in this distribution, be it the RC4, RSA,
11  * lhash, DES, etc., code; not just the SSL code. The SSL documentation
12  * included with this distribution is covered by the same copyright terms
13  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14  *
15  * Copyright remains Eric Young's, and as such any Copyright notices in
16  * the code are not to be removed.
17  * If this package is used in a product, Eric Young should be given attribution
18  * as the author of the parts of the library used.
19  * This can be in the form of a textual message at program startup or
20  * in documentation (online or textual) provided with the package.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the copyright
26  * notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  * 3. All advertising materials mentioning features or use of this software
31  * must display the following acknowledgement:
32  * "This product includes cryptographic software written by
33  * Eric Young (eay@cryptsoft.com)"
34  * The word 'cryptographic' can be left out if the rouines from the library
35  * being used are not cryptographic related :-).
36  * 4. If you include any Windows specific code (or a derivative thereof) from
37  * the apps directory (application code) you must include an acknowledgement:
38  * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39  *
40  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50  * SUCH DAMAGE.
51  *
52  * The licence and distribution terms for any publically available version or
53  * derivative of this code cannot be changed. i.e. this code cannot simply be
54  * copied and put under another distribution licence
55  * [including the GNU Public Licence.] */
56 
57 #include <openssl/bio.h>
58 
59 #if !defined(OPENSSL_TRUSTY)
60 
61 #include <assert.h>
62 #include <errno.h>
63 #include <string.h>
64 
65 #if !defined(OPENSSL_WINDOWS)
66 #include <sys/socket.h>
67 #include <netinet/in.h>
68 #include <arpa/inet.h>
69 #include <unistd.h>
70 #else
72 #include <winsock2.h>
73 #include <ws2tcpip.h>
75 #endif
76 
77 #include <openssl/err.h>
78 #include <openssl/mem.h>
79 
80 #include "internal.h"
81 #include "../internal.h"
82 
83 
84 enum {
88 };
89 
90 typedef struct bio_connect_st {
91  int state;
92 
94  char *param_port;
95  int nbio;
96 
97  unsigned short port;
98 
99  struct sockaddr_storage them;
100  socklen_t them_length;
101 
102  // the file descriptor is kept in bio->num in order to match the socket
103  // BIO.
104 
105  // info_callback is called when the connection is initially made
106  // callback(BIO,state,ret); The callback should return 'ret', state is for
107  // compatibility with the SSL info_callback.
108  int (*info_callback)(const BIO *bio, int state, int ret);
109 } BIO_CONNECT;
110 
111 #if !defined(OPENSSL_WINDOWS)
112 static int closesocket(int sock) {
113  return close(sock);
114 }
115 #endif
116 
117 // split_host_and_port sets |*out_host| and |*out_port| to the host and port
118 // parsed from |name|. It returns one on success or zero on error. Even when
119 // successful, |*out_port| may be NULL on return if no port was specified.
120 static int split_host_and_port(char **out_host, char **out_port, const char *name) {
121  const char *host, *port = NULL;
122  size_t host_len = 0;
123 
124  *out_host = NULL;
125  *out_port = NULL;
126 
127  if (name[0] == '[') { // bracketed IPv6 address
128  const char *close = strchr(name, ']');
129  if (close == NULL) {
130  return 0;
131  }
132  host = name + 1;
133  host_len = close - host;
134  if (close[1] == ':') { // [IP]:port
135  port = close + 2;
136  } else if (close[1] != 0) {
137  return 0;
138  }
139  } else {
140  const char *colon = strchr(name, ':');
141  if (colon == NULL || strchr(colon + 1, ':') != NULL) { // IPv6 address
142  host = name;
143  host_len = strlen(name);
144  } else { // host:port
145  host = name;
146  host_len = colon - name;
147  port = colon + 1;
148  }
149  }
150 
151  *out_host = OPENSSL_strndup(host, host_len);
152  if (*out_host == NULL) {
153  return 0;
154  }
155  if (port == NULL) {
156  *out_port = NULL;
157  return 1;
158  }
159  *out_port = OPENSSL_strdup(port);
160  if (*out_port == NULL) {
161  OPENSSL_free(*out_host);
162  *out_host = NULL;
163  return 0;
164  }
165  return 1;
166 }
167 
168 static int conn_state(BIO *bio, BIO_CONNECT *c) {
169  int ret = -1, i;
170  int (*cb)(const BIO *, int, int) = NULL;
171 
172  if (c->info_callback != NULL) {
173  cb = c->info_callback;
174  }
175 
176  for (;;) {
177  switch (c->state) {
178  case BIO_CONN_S_BEFORE:
179  // If there's a hostname and a port, assume that both are
180  // exactly what they say. If there is only a hostname, try
181  // (just once) to split it into a hostname and port.
182 
183  if (c->param_hostname == NULL) {
185  goto exit_loop;
186  }
187 
188  if (c->param_port == NULL) {
189  char *host, *port;
190  if (!split_host_and_port(&host, &port, c->param_hostname) ||
191  port == NULL) {
192  OPENSSL_free(host);
195  ERR_add_error_data(2, "host=", c->param_hostname);
196  goto exit_loop;
197  }
198 
199  OPENSSL_free(c->param_port);
200  c->param_port = port;
201  OPENSSL_free(c->param_hostname);
202  c->param_hostname = host;
203  }
204 
206  &bio->num, &c->them, &c->them_length, c->param_hostname,
207  c->param_port)) {
209  ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port);
210  goto exit_loop;
211  }
212 
213  if (c->nbio) {
214  if (!bio_socket_nbio(bio->num, 1)) {
216  ERR_add_error_data(4, "host=", c->param_hostname, ":",
217  c->param_port);
218  goto exit_loop;
219  }
220  }
221 
222  i = 1;
223  ret = setsockopt(bio->num, SOL_SOCKET, SO_KEEPALIVE, (char *)&i,
224  sizeof(i));
225  if (ret < 0) {
228  ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port);
229  goto exit_loop;
230  }
231 
233  ret = connect(bio->num, (struct sockaddr*) &c->them, c->them_length);
234  if (ret < 0) {
235  if (bio_fd_should_retry(ret)) {
237  c->state = BIO_CONN_S_BLOCKED_CONNECT;
239  } else {
242  ERR_add_error_data(4, "host=", c->param_hostname, ":",
243  c->param_port);
244  }
245  goto exit_loop;
246  } else {
247  c->state = BIO_CONN_S_OK;
248  }
249  break;
250 
252  i = bio_sock_error(bio->num);
253  if (i) {
254  if (bio_fd_should_retry(ret)) {
256  c->state = BIO_CONN_S_BLOCKED_CONNECT;
258  ret = -1;
259  } else {
263  ERR_add_error_data(4, "host=", c->param_hostname, ":", c->param_port);
264  ret = 0;
265  }
266  goto exit_loop;
267  } else {
268  c->state = BIO_CONN_S_OK;
269  }
270  break;
271 
272  case BIO_CONN_S_OK:
273  ret = 1;
274  goto exit_loop;
275  default:
276  assert(0);
277  goto exit_loop;
278  }
279 
280  if (cb != NULL) {
281  ret = cb((BIO *)bio, c->state, ret);
282  if (ret == 0) {
283  goto end;
284  }
285  }
286  }
287 
288 exit_loop:
289  if (cb != NULL) {
290  ret = cb((BIO *)bio, c->state, ret);
291  }
292 
293 end:
294  return ret;
295 }
296 
299 
300  if (ret == NULL) {
301  return NULL;
302  }
303  OPENSSL_memset(ret, 0, sizeof(BIO_CONNECT));
304 
305  ret->state = BIO_CONN_S_BEFORE;
306  return ret;
307 }
308 
310  if (c == NULL) {
311  return;
312  }
313 
314  OPENSSL_free(c->param_hostname);
315  OPENSSL_free(c->param_port);
316  OPENSSL_free(c);
317 }
318 
319 static int conn_new(BIO *bio) {
320  bio->init = 0;
321  bio->num = -1;
322  bio->flags = 0;
323  bio->ptr = BIO_CONNECT_new();
324  return bio->ptr != NULL;
325 }
326 
327 static void conn_close_socket(BIO *bio) {
328  BIO_CONNECT *c = (BIO_CONNECT *) bio->ptr;
329 
330  if (bio->num == -1) {
331  return;
332  }
333 
334  // Only do a shutdown if things were established
335  if (c->state == BIO_CONN_S_OK) {
336  shutdown(bio->num, 2);
337  }
338  closesocket(bio->num);
339  bio->num = -1;
340 }
341 
342 static int conn_free(BIO *bio) {
343  if (bio->shutdown) {
344  conn_close_socket(bio);
345  }
346 
348 
349  return 1;
350 }
351 
352 static int conn_read(BIO *bio, char *out, int out_len) {
353  int ret = 0;
354  BIO_CONNECT *data;
355 
356  data = (BIO_CONNECT *)bio->ptr;
357  if (data->state != BIO_CONN_S_OK) {
358  ret = conn_state(bio, data);
359  if (ret <= 0) {
360  return ret;
361  }
362  }
363 
365  ret = recv(bio->num, out, out_len, 0);
367  if (ret <= 0) {
368  if (bio_fd_should_retry(ret)) {
369  BIO_set_retry_read(bio);
370  }
371  }
372 
373  return ret;
374 }
375 
376 static int conn_write(BIO *bio, const char *in, int in_len) {
377  int ret;
378  BIO_CONNECT *data;
379 
380  data = (BIO_CONNECT *)bio->ptr;
381  if (data->state != BIO_CONN_S_OK) {
382  ret = conn_state(bio, data);
383  if (ret <= 0) {
384  return ret;
385  }
386  }
387 
389  ret = send(bio->num, in, in_len, 0);
391  if (ret <= 0) {
392  if (bio_fd_should_retry(ret)) {
393  BIO_set_retry_write(bio);
394  }
395  }
396 
397  return ret;
398 }
399 
400 static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr) {
401  int *ip;
402  long ret = 1;
403  BIO_CONNECT *data;
404 
405  data = (BIO_CONNECT *)bio->ptr;
406 
407  switch (cmd) {
408  case BIO_CTRL_RESET:
409  ret = 0;
410  data->state = BIO_CONN_S_BEFORE;
411  conn_close_socket(bio);
412  bio->flags = 0;
413  break;
415  // use this one to start the connection
416  if (data->state != BIO_CONN_S_OK) {
417  ret = (long)conn_state(bio, data);
418  } else {
419  ret = 1;
420  }
421  break;
422  case BIO_C_SET_CONNECT:
423  if (ptr != NULL) {
424  bio->init = 1;
425  if (num == 0) {
426  OPENSSL_free(data->param_hostname);
427  data->param_hostname = OPENSSL_strdup(ptr);
428  if (data->param_hostname == NULL) {
429  ret = 0;
430  }
431  } else if (num == 1) {
432  OPENSSL_free(data->param_port);
433  data->param_port = OPENSSL_strdup(ptr);
434  if (data->param_port == NULL) {
435  ret = 0;
436  }
437  } else {
438  ret = 0;
439  }
440  }
441  break;
442  case BIO_C_SET_NBIO:
443  data->nbio = (int)num;
444  break;
445  case BIO_C_GET_FD:
446  if (bio->init) {
447  ip = (int *)ptr;
448  if (ip != NULL) {
449  *ip = bio->num;
450  }
451  ret = bio->num;
452  } else {
453  ret = -1;
454  }
455  break;
456  case BIO_CTRL_GET_CLOSE:
457  ret = bio->shutdown;
458  break;
459  case BIO_CTRL_SET_CLOSE:
460  bio->shutdown = (int)num;
461  break;
462  case BIO_CTRL_PENDING:
463  case BIO_CTRL_WPENDING:
464  ret = 0;
465  break;
466  case BIO_CTRL_FLUSH:
467  break;
468  case BIO_CTRL_GET_CALLBACK: {
469  int (**fptr)(const BIO *bio, int state, int xret);
470  fptr = (int (**)(const BIO *bio, int state, int xret))ptr;
471  *fptr = data->info_callback;
472  } break;
473  default:
474  ret = 0;
475  break;
476  }
477  return ret;
478 }
479 
480 static long conn_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) {
481  long ret = 1;
482  BIO_CONNECT *data;
483 
484  data = (BIO_CONNECT *)bio->ptr;
485 
486  switch (cmd) {
488  data->info_callback = (int (*)(const struct bio_st *, int, int))fp;
489  break;
490  default:
491  ret = 0;
492  break;
493  }
494  return ret;
495 }
496 
497 BIO *BIO_new_connect(const char *hostname) {
498  BIO *ret;
499 
501  if (ret == NULL) {
502  return NULL;
503  }
504  if (!BIO_set_conn_hostname(ret, hostname)) {
505  BIO_free(ret);
506  return NULL;
507  }
508  return ret;
509 }
510 
511 static const BIO_METHOD methods_connectp = {
512  BIO_TYPE_CONNECT, "socket connect", conn_write, conn_read,
513  NULL /* puts */, NULL /* gets */, conn_ctrl, conn_new,
515 };
516 
517 const BIO_METHOD *BIO_s_connect(void) { return &methods_connectp; }
518 
519 int BIO_set_conn_hostname(BIO *bio, const char *name) {
520  return BIO_ctrl(bio, BIO_C_SET_CONNECT, 0, (void*) name);
521 }
522 
523 int BIO_set_conn_port(BIO *bio, const char *port_str) {
524  return BIO_ctrl(bio, BIO_C_SET_CONNECT, 1, (void*) port_str);
525 }
526 
527 int BIO_set_conn_int_port(BIO *bio, const int *port) {
528  char buf[DECIMAL_SIZE(int) + 1];
529  BIO_snprintf(buf, sizeof(buf), "%d", *port);
530  return BIO_set_conn_port(bio, buf);
531 }
532 
533 int BIO_set_nbio(BIO *bio, int on) {
534  return BIO_ctrl(bio, BIO_C_SET_NBIO, on, NULL);
535 }
536 
537 int BIO_do_connect(BIO *bio) {
538  return BIO_ctrl(bio, BIO_C_DO_STATE_MACHINE, 0, NULL);
539 }
540 
541 #endif // OPENSSL_TRUSTY
bio_method_st
Definition: bio.h:808
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
bio_info_cb
long(* bio_info_cb)(BIO *bio, int event, const char *parg, int cmd, long larg, long return_value)
Definition: bio.h:246
BIO_CTRL_WPENDING
#define BIO_CTRL_WPENDING
Definition: bio.h:715
BIO_R_NO_HOSTNAME_SPECIFIED
#define BIO_R_NO_HOSTNAME_SPECIFIED
Definition: bio.h:927
internal.h
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
BIO_do_connect
int BIO_do_connect(BIO *bio)
Definition: connect.c:537
bio_st
Definition: bio.h:822
bio_st::ptr
void * ptr
Definition: bio.h:838
bio_connect_st
Definition: connect.c:90
BIO_CONN_S_OK
@ BIO_CONN_S_OK
Definition: connect.c:87
bio_st::flags
int flags
Definition: bio.h:832
BIO_C_GET_FD
#define BIO_C_GET_FD
Definition: bio.h:850
BIO_set_retry_write
#define BIO_set_retry_write
Definition: boringssl_prefix_symbols.h:856
BIO_CONNECT
struct bio_connect_st BIO_CONNECT
BIO_R_UNABLE_TO_CREATE_SOCKET
#define BIO_R_UNABLE_TO_CREATE_SOCKET
Definition: bio.h:932
check_version.warning
string warning
Definition: check_version.py:46
OPENSSL_PUT_ERROR
#define OPENSSL_PUT_ERROR(library, reason)
Definition: err.h:423
bio.h
string.h
bio_st::init
int init
Definition: bio.h:826
BIO_CONN_S_BEFORE
@ BIO_CONN_S_BEFORE
Definition: connect.c:85
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
BIO_FLAGS_SHOULD_RETRY
#define BIO_FLAGS_SHOULD_RETRY
Definition: bio.h:767
BIO_R_KEEPALIVE
#define BIO_R_KEEPALIVE
Definition: bio.h:925
conn_ctrl
static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr)
Definition: connect.c:400
conn_callback_ctrl
static long conn_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp)
Definition: connect.c:480
setup.name
name
Definition: setup.py:542
bio_connect_st::them_length
socklen_t them_length
Definition: connect.c:100
BIO_CONNECT_new
static BIO_CONNECT * BIO_CONNECT_new(void)
Definition: connect.c:297
bio_connect_st::nbio
int nbio
Definition: connect.c:95
bio_connect_st::info_callback
int(* info_callback)(const BIO *bio, int state, int ret)
Definition: connect.c:108
BIO_R_ERROR_SETTING_NBIO
#define BIO_R_ERROR_SETTING_NBIO
Definition: bio.h:922
bio_clear_socket_error
#define bio_clear_socket_error
Definition: boringssl_prefix_symbols.h:2845
conn_write
static int conn_write(BIO *bio, const char *in, int in_len)
Definition: connect.c:376
BIO_s_connect
const BIO_METHOD * BIO_s_connect(void)
Definition: connect.c:517
OPENSSL_memset
static void * OPENSSL_memset(void *dst, int c, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:835
BIO_set_nbio
int BIO_set_nbio(BIO *bio, int on)
Definition: connect.c:533
conn_free
static int conn_free(BIO *bio)
Definition: connect.c:342
BIO_FLAGS_IO_SPECIAL
#define BIO_FLAGS_IO_SPECIAL
Definition: bio.h:765
conn_state
static int conn_state(BIO *bio, BIO_CONNECT *c)
Definition: connect.c:168
split_host_and_port
static int split_host_and_port(char **out_host, char **out_port, const char *name)
Definition: connect.c:120
BIO_C_DO_STATE_MACHINE
#define BIO_C_DO_STATE_MACHINE
Definition: bio.h:846
OPENSSL_malloc
#define OPENSSL_malloc
Definition: boringssl_prefix_symbols.h:1885
bio_connect_st::state
int state
Definition: connect.c:91
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
BIO_CONN_S_BLOCKED_CONNECT
@ BIO_CONN_S_BLOCKED_CONNECT
Definition: connect.c:86
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
BIO_R_NBIO_CONNECT_ERROR
#define BIO_R_NBIO_CONNECT_ERROR
Definition: bio.h:926
BIO_R_CONNECT_ERROR
#define BIO_R_CONNECT_ERROR
Definition: bio.h:921
xds_interop_client.int
int
Definition: xds_interop_client.py:113
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
methods_connectp
static const BIO_METHOD methods_connectp
Definition: connect.c:511
BIO_ctrl
#define BIO_ctrl
Definition: boringssl_prefix_symbols.h:779
conn_new
static int conn_new(BIO *bio)
Definition: connect.c:319
BIO_CTRL_SET_CALLBACK
#define BIO_CTRL_SET_CALLBACK
Definition: bio.h:719
BIO_set_flags
#define BIO_set_flags
Definition: boringssl_prefix_symbols.h:847
regen-readme.cmd
cmd
Definition: regen-readme.py:21
BIO_C_SET_CONNECT
#define BIO_C_SET_CONNECT
Definition: bio.h:845
err.h
bio_sock_error
#define bio_sock_error
Definition: boringssl_prefix_symbols.h:2848
close
#define close
Definition: test-fs.c:48
OPENSSL_MSVC_PRAGMA
OPENSSL_MSVC_PRAGMA(warning(disable:4702))
Definition: e_aes.c:69
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
BIO_new
#define BIO_new
Definition: boringssl_prefix_symbols.h:814
BIO_RR_CONNECT
#define BIO_RR_CONNECT
Definition: bio.h:193
bio_ip_and_port_to_socket_and_addr
#define bio_ip_and_port_to_socket_and_addr
Definition: boringssl_prefix_symbols.h:2847
BIO_set_conn_port
int BIO_set_conn_port(BIO *bio, const char *port_str)
Definition: connect.c:523
bio_st::shutdown
int shutdown
Definition: bio.h:831
BIO_snprintf
#define BIO_snprintf
Definition: boringssl_prefix_symbols.h:864
push
int push(void *desc, unsigned char *buf, unsigned len)
Definition: bloaty/third_party/zlib/test/infcover.c:463
tests.unit._exit_scenarios.port
port
Definition: _exit_scenarios.py:179
BIO_CTRL_GET_CLOSE
#define BIO_CTRL_GET_CLOSE
Definition: bio.h:702
bio_st::num
int num
Definition: bio.h:836
BIO_free
#define BIO_free
Definition: boringssl_prefix_symbols.h:787
BIO_CTRL_FLUSH
#define BIO_CTRL_FLUSH
Definition: bio.h:712
bio_connect_st::param_hostname
char * param_hostname
Definition: connect.c:93
BIO_CTRL_PENDING
#define BIO_CTRL_PENDING
Definition: bio.h:709
bio_connect_st::param_port
char * param_port
Definition: connect.c:94
BIO_CONNECT_free
static void BIO_CONNECT_free(BIO_CONNECT *c)
Definition: connect.c:309
OPENSSL_strdup
#define OPENSSL_strdup
Definition: boringssl_prefix_symbols.h:1891
bio_socket_nbio
#define bio_socket_nbio
Definition: boringssl_prefix_symbols.h:2849
BIO_CTRL_SET_CLOSE
#define BIO_CTRL_SET_CLOSE
Definition: bio.h:706
conn_close_socket
static void conn_close_socket(BIO *bio)
Definition: connect.c:327
bio_fd_should_retry
#define bio_fd_should_retry
Definition: boringssl_prefix_symbols.h:2846
BIO_set_conn_int_port
int BIO_set_conn_int_port(BIO *bio, const int *port)
Definition: connect.c:527
bio_connect_st::port
unsigned short port
Definition: connect.c:97
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
OPENSSL_PUT_SYSTEM_ERROR
#define OPENSSL_PUT_SYSTEM_ERROR()
Definition: err.h:429
bio_st::retry_reason
int retry_reason
Definition: bio.h:833
BIO_set_conn_hostname
int BIO_set_conn_hostname(BIO *bio, const char *name)
Definition: connect.c:519
ERR_add_error_data
#define ERR_add_error_data
Definition: boringssl_prefix_symbols.h:1411
xds_manager.num
num
Definition: xds_manager.py:56
BIO_C_SET_NBIO
#define BIO_C_SET_NBIO
Definition: bio.h:847
BIO_CTRL_RESET
#define BIO_CTRL_RESET
Definition: bio.h:690
DECIMAL_SIZE
#define DECIMAL_SIZE(type)
Definition: mem.h:124
BIO_TYPE_CONNECT
#define BIO_TYPE_CONNECT
Definition: bio.h:785
bio_connect_st::them
struct sockaddr_storage them
Definition: connect.c:99
mem.h
conn_read
static int conn_read(BIO *bio, char *out, int out_len)
Definition: connect.c:352
BIO_CTRL_GET_CALLBACK
#define BIO_CTRL_GET_CALLBACK
Definition: bio.h:722
closesocket
static int closesocket(int sock)
Definition: connect.c:112
OPENSSL_free
#define OPENSSL_free
Definition: boringssl_prefix_symbols.h:1869
OPENSSL_strndup
#define OPENSSL_strndup
Definition: boringssl_prefix_symbols.h:1896
BIO_set_retry_read
#define BIO_set_retry_read
Definition: boringssl_prefix_symbols.h:853
BIO_new_connect
BIO * BIO_new_connect(const char *hostname)
Definition: connect.c:497
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
errno.h
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
state
static struct rpc_state state
Definition: bad_server_response_test.cc:87
BIO_clear_retry_flags
#define BIO_clear_retry_flags
Definition: boringssl_prefix_symbols.h:777
google::protobuf.internal.decoder.long
long
Definition: bloaty/third_party/protobuf/python/google/protobuf/internal/decoder.py:89
BIO_R_NO_PORT_SPECIFIED
#define BIO_R_NO_PORT_SPECIFIED
Definition: bio.h:928


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:54