bio.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 #include <assert.h>
60 #include <errno.h>
61 #include <limits.h>
62 #include <string.h>
63 
64 #include <openssl/asn1.h>
65 #include <openssl/err.h>
66 #include <openssl/mem.h>
67 #include <openssl/thread.h>
68 
69 #include "../internal.h"
70 
71 
73  BIO *ret = OPENSSL_malloc(sizeof(BIO));
74  if (ret == NULL) {
76  return NULL;
77  }
78 
79  OPENSSL_memset(ret, 0, sizeof(BIO));
80  ret->method = method;
81  ret->shutdown = 1;
82  ret->references = 1;
83 
84  if (method->create != NULL && !method->create(ret)) {
86  return NULL;
87  }
88 
89  return ret;
90 }
91 
92 int BIO_free(BIO *bio) {
93  BIO *next_bio;
94 
95  for (; bio != NULL; bio = next_bio) {
97  return 0;
98  }
99 
100  next_bio = BIO_pop(bio);
101 
102  if (bio->method != NULL && bio->method->destroy != NULL) {
103  bio->method->destroy(bio);
104  }
105 
106  OPENSSL_free(bio);
107  }
108  return 1;
109 }
110 
111 int BIO_up_ref(BIO *bio) {
113  return 1;
114 }
115 
116 void BIO_vfree(BIO *bio) {
117  BIO_free(bio);
118 }
119 
120 void BIO_free_all(BIO *bio) {
121  BIO_free(bio);
122 }
123 
124 int BIO_read(BIO *bio, void *buf, int len) {
125  if (bio == NULL || bio->method == NULL || bio->method->bread == NULL) {
127  return -2;
128  }
129  if (!bio->init) {
131  return -2;
132  }
133  if (len <= 0) {
134  return 0;
135  }
136  int ret = bio->method->bread(bio, buf, len);
137  if (ret > 0) {
138  bio->num_read += ret;
139  }
140  return ret;
141 }
142 
143 int BIO_gets(BIO *bio, char *buf, int len) {
144  if (bio == NULL || bio->method == NULL || bio->method->bgets == NULL) {
146  return -2;
147  }
148  if (!bio->init) {
150  return -2;
151  }
152  if (len <= 0) {
153  return 0;
154  }
155  int ret = bio->method->bgets(bio, buf, len);
156  if (ret > 0) {
157  bio->num_read += ret;
158  }
159  return ret;
160 }
161 
162 int BIO_write(BIO *bio, const void *in, int inl) {
163  if (bio == NULL || bio->method == NULL || bio->method->bwrite == NULL) {
165  return -2;
166  }
167  if (!bio->init) {
169  return -2;
170  }
171  if (inl <= 0) {
172  return 0;
173  }
174  int ret = bio->method->bwrite(bio, in, inl);
175  if (ret > 0) {
176  bio->num_write += ret;
177  }
178  return ret;
179 }
180 
181 int BIO_write_all(BIO *bio, const void *data, size_t len) {
182  const uint8_t *data_u8 = data;
183  while (len > 0) {
184  int ret = BIO_write(bio, data_u8, len > INT_MAX ? INT_MAX : (int)len);
185  if (ret <= 0) {
186  return 0;
187  }
188  data_u8 += ret;
189  len -= ret;
190  }
191  return 1;
192 }
193 
194 int BIO_puts(BIO *bio, const char *in) {
195  return BIO_write(bio, in, strlen(in));
196 }
197 
198 int BIO_flush(BIO *bio) {
199  return BIO_ctrl(bio, BIO_CTRL_FLUSH, 0, NULL);
200 }
201 
202 long BIO_ctrl(BIO *bio, int cmd, long larg, void *parg) {
203  if (bio == NULL) {
204  return 0;
205  }
206 
207  if (bio->method == NULL || bio->method->ctrl == NULL) {
209  return -2;
210  }
211 
212  return bio->method->ctrl(bio, cmd, larg, parg);
213 }
214 
215 char *BIO_ptr_ctrl(BIO *b, int cmd, long larg) {
216  char *p = NULL;
217 
218  if (BIO_ctrl(b, cmd, larg, (void *)&p) <= 0) {
219  return NULL;
220  }
221 
222  return p;
223 }
224 
225 long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg) {
226  int i = iarg;
227 
228  return BIO_ctrl(b, cmd, larg, (void *)&i);
229 }
230 
231 int BIO_reset(BIO *bio) {
232  return BIO_ctrl(bio, BIO_CTRL_RESET, 0, NULL);
233 }
234 
235 int BIO_eof(BIO *bio) {
236  return BIO_ctrl(bio, BIO_CTRL_EOF, 0, NULL);
237 }
238 
239 void BIO_set_flags(BIO *bio, int flags) {
240  bio->flags |= flags;
241 }
242 
243 int BIO_test_flags(const BIO *bio, int flags) {
244  return bio->flags & flags;
245 }
246 
247 int BIO_should_read(const BIO *bio) {
248  return BIO_test_flags(bio, BIO_FLAGS_READ);
249 }
250 
251 int BIO_should_write(const BIO *bio) {
252  return BIO_test_flags(bio, BIO_FLAGS_WRITE);
253 }
254 
255 int BIO_should_retry(const BIO *bio) {
257 }
258 
259 int BIO_should_io_special(const BIO *bio) {
261 }
262 
263 int BIO_get_retry_reason(const BIO *bio) { return bio->retry_reason; }
264 
265 void BIO_set_retry_reason(BIO *bio, int reason) { bio->retry_reason = reason; }
266 
267 void BIO_clear_flags(BIO *bio, int flags) {
268  bio->flags &= ~flags;
269 }
270 
273 }
274 
277 }
278 
280 
282  return bio->flags & kRetryFlags;
283 }
284 
286  bio->flags &= ~kRetryFlags;
287  bio->retry_reason = 0;
288 }
289 
290 int BIO_method_type(const BIO *bio) { return bio->method->type; }
291 
295  bio->retry_reason = bio->next_bio->retry_reason;
296 }
297 
298 long BIO_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) {
299  if (bio == NULL) {
300  return 0;
301  }
302 
303  if (bio->method == NULL || bio->method->callback_ctrl == NULL) {
305  return 0;
306  }
307 
308  return bio->method->callback_ctrl(bio, cmd, fp);
309 }
310 
311 size_t BIO_pending(const BIO *bio) {
312  const long r = BIO_ctrl((BIO *) bio, BIO_CTRL_PENDING, 0, NULL);
313  assert(r >= 0);
314 
315  if (r < 0) {
316  return 0;
317  }
318  return r;
319 }
320 
321 size_t BIO_ctrl_pending(const BIO *bio) {
322  return BIO_pending(bio);
323 }
324 
325 size_t BIO_wpending(const BIO *bio) {
326  const long r = BIO_ctrl((BIO *) bio, BIO_CTRL_WPENDING, 0, NULL);
327  assert(r >= 0);
328 
329  if (r < 0) {
330  return 0;
331  }
332  return r;
333 }
334 
335 int BIO_set_close(BIO *bio, int close_flag) {
336  return BIO_ctrl(bio, BIO_CTRL_SET_CLOSE, close_flag, NULL);
337 }
338 
339 OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio) {
340  return bio->num_read;
341 }
342 
344  return bio->num_write;
345 }
346 
347 BIO *BIO_push(BIO *bio, BIO *appended_bio) {
348  BIO *last_bio;
349 
350  if (bio == NULL) {
351  return bio;
352  }
353 
354  last_bio = bio;
355  while (last_bio->next_bio != NULL) {
356  last_bio = last_bio->next_bio;
357  }
358 
359  last_bio->next_bio = appended_bio;
360  return bio;
361 }
362 
363 BIO *BIO_pop(BIO *bio) {
364  BIO *ret;
365 
366  if (bio == NULL) {
367  return NULL;
368  }
369  ret = bio->next_bio;
370  bio->next_bio = NULL;
371  return ret;
372 }
373 
374 BIO *BIO_next(BIO *bio) {
375  if (!bio) {
376  return NULL;
377  }
378  return bio->next_bio;
379 }
380 
381 BIO *BIO_find_type(BIO *bio, int type) {
382  int method_type, mask;
383 
384  if (!bio) {
385  return NULL;
386  }
387  mask = type & 0xff;
388 
389  do {
390  if (bio->method != NULL) {
391  method_type = bio->method->type;
392 
393  if (!mask) {
394  if (method_type & type) {
395  return bio;
396  }
397  } else if (method_type == type) {
398  return bio;
399  }
400  }
401  bio = bio->next_bio;
402  } while (bio != NULL);
403 
404  return NULL;
405 }
406 
407 int BIO_indent(BIO *bio, unsigned indent, unsigned max_indent) {
408  if (indent > max_indent) {
409  indent = max_indent;
410  }
411 
412  while (indent--) {
413  if (BIO_puts(bio, " ") != 1) {
414  return 0;
415  }
416  }
417  return 1;
418 }
419 
420 static int print_bio(const char *str, size_t len, void *bio) {
421  return BIO_write((BIO *)bio, str, len);
422 }
423 
424 void ERR_print_errors(BIO *bio) {
426 }
427 
428 // bio_read_all reads everything from |bio| and prepends |prefix| to it. On
429 // success, |*out| is set to an allocated buffer (which should be freed with
430 // |OPENSSL_free|), |*out_len| is set to its length and one is returned. The
431 // buffer will contain |prefix| followed by the contents of |bio|. On failure,
432 // zero is returned.
433 //
434 // The function will fail if the size of the output would equal or exceed
435 // |max_len|.
436 static int bio_read_all(BIO *bio, uint8_t **out, size_t *out_len,
437  const uint8_t *prefix, size_t prefix_len,
438  size_t max_len) {
439  static const size_t kChunkSize = 4096;
440 
441  size_t len = prefix_len + kChunkSize;
442  if (len > max_len) {
443  len = max_len;
444  }
445  if (len < prefix_len) {
446  return 0;
447  }
448  *out = OPENSSL_malloc(len);
449  if (*out == NULL) {
450  return 0;
451  }
452  OPENSSL_memcpy(*out, prefix, prefix_len);
453  size_t done = prefix_len;
454 
455  for (;;) {
456  if (done == len) {
457  OPENSSL_free(*out);
458  return 0;
459  }
460  const size_t todo = len - done;
461  assert(todo < INT_MAX);
462  const int n = BIO_read(bio, *out + done, todo);
463  if (n == 0) {
464  *out_len = done;
465  return 1;
466  } else if (n == -1) {
467  OPENSSL_free(*out);
468  return 0;
469  }
470 
471  done += n;
472  if (len < max_len && len - done < kChunkSize / 2) {
473  len += kChunkSize;
474  if (len < kChunkSize || len > max_len) {
475  len = max_len;
476  }
477  uint8_t *new_buf = OPENSSL_realloc(*out, len);
478  if (new_buf == NULL) {
479  OPENSSL_free(*out);
480  return 0;
481  }
482  *out = new_buf;
483  }
484  }
485 }
486 
487 // bio_read_full reads |len| bytes |bio| and writes them into |out|. It
488 // tolerates partial reads from |bio| and returns one on success or zero if a
489 // read fails before |len| bytes are read. On failure, it additionally sets
490 // |*out_eof_on_first_read| to whether the error was due to |bio| returning zero
491 // on the first read. |out_eof_on_first_read| may be NULL to discard the value.
492 static int bio_read_full(BIO *bio, uint8_t *out, int *out_eof_on_first_read,
493  size_t len) {
494  int first_read = 1;
495  while (len > 0) {
496  int todo = len <= INT_MAX ? (int)len : INT_MAX;
497  int ret = BIO_read(bio, out, todo);
498  if (ret <= 0) {
499  if (out_eof_on_first_read != NULL) {
500  *out_eof_on_first_read = first_read && ret == 0;
501  }
502  return 0;
503  }
504  out += ret;
505  len -= (size_t)ret;
506  first_read = 0;
507  }
508 
509  return 1;
510 }
511 
512 // For compatibility with existing |d2i_*_bio| callers, |BIO_read_asn1| uses
513 // |ERR_LIB_ASN1| errors.
518 
519 int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) {
520  uint8_t header[6];
521 
522  static const size_t kInitialHeaderLen = 2;
523  int eof_on_first_read;
524  if (!bio_read_full(bio, header, &eof_on_first_read, kInitialHeaderLen)) {
525  if (eof_on_first_read) {
526  // Historically, OpenSSL returned |ASN1_R_HEADER_TOO_LONG| when
527  // |d2i_*_bio| could not read anything. CPython conditions on this to
528  // determine if |bio| was empty.
530  } else {
532  }
533  return 0;
534  }
535 
536  const uint8_t tag = header[0];
537  const uint8_t length_byte = header[1];
538 
539  if ((tag & 0x1f) == 0x1f) {
540  // Long form tags are not supported.
542  return 0;
543  }
544 
545  size_t len, header_len;
546  if ((length_byte & 0x80) == 0) {
547  // Short form length.
548  len = length_byte;
549  header_len = kInitialHeaderLen;
550  } else {
551  const size_t num_bytes = length_byte & 0x7f;
552 
553  if ((tag & 0x20 /* constructed */) != 0 && num_bytes == 0) {
554  // indefinite length.
555  if (!bio_read_all(bio, out, out_len, header, kInitialHeaderLen,
556  max_len)) {
558  return 0;
559  }
560  return 1;
561  }
562 
563  if (num_bytes == 0 || num_bytes > 4) {
565  return 0;
566  }
567 
568  if (!bio_read_full(bio, header + kInitialHeaderLen, NULL, num_bytes)) {
570  return 0;
571  }
572  header_len = kInitialHeaderLen + num_bytes;
573 
574  uint32_t len32 = 0;
575  for (unsigned i = 0; i < num_bytes; i++) {
576  len32 <<= 8;
577  len32 |= header[kInitialHeaderLen + i];
578  }
579 
580  if (len32 < 128) {
581  // Length should have used short-form encoding.
583  return 0;
584  }
585 
586  if ((len32 >> ((num_bytes-1)*8)) == 0) {
587  // Length should have been at least one byte shorter.
589  return 0;
590  }
591 
592  len = len32;
593  }
594 
595  if (len + header_len < len ||
596  len + header_len > max_len ||
597  len > INT_MAX) {
599  return 0;
600  }
601  len += header_len;
602  *out_len = len;
603 
604  *out = OPENSSL_malloc(len);
605  if (*out == NULL) {
607  return 0;
608  }
609  OPENSSL_memcpy(*out, header, header_len);
610  if (!bio_read_full(bio, (*out) + header_len, NULL, len - header_len)) {
612  OPENSSL_free(*out);
613  return 0;
614  }
615 
616  return 1;
617 }
618 
621 }
622 
623 int BIO_set_write_buffer_size(BIO *bio, int buffer_size) { return 0; }
624 
626 static int g_index = BIO_TYPE_START;
627 
628 int BIO_get_new_index(void) {
630  // If |g_index| exceeds 255, it will collide with the flags bits.
631  int ret = g_index > 255 ? -1 : g_index++;
633  return ret;
634 }
635 
636 BIO_METHOD *BIO_meth_new(int type, const char *name) {
638  if (method == NULL) {
639  return NULL;
640  }
641  OPENSSL_memset(method, 0, sizeof(BIO_METHOD));
642  method->type = type;
643  method->name = name;
644  return method;
645 }
646 
649 }
650 
652  int (*create)(BIO *)) {
653  method->create = create;
654  return 1;
655 }
656 
658  int (*destroy)(BIO *)) {
659  method->destroy = destroy;
660  return 1;
661 }
662 
664  int (*write)(BIO *, const char *, int)) {
665  method->bwrite = write;
666  return 1;
667 }
668 
670  int (*read)(BIO *, char *, int)) {
671  method->bread = read;
672  return 1;
673 }
674 
676  int (*gets)(BIO *, char *, int)) {
677  method->bgets = gets;
678  return 1;
679 }
680 
682  long (*ctrl)(BIO *, int, long, void *)) {
683  method->ctrl = ctrl;
684  return 1;
685 }
686 
687 void BIO_set_data(BIO *bio, void *ptr) { bio->ptr = ptr; }
688 
689 void *BIO_get_data(BIO *bio) { return bio->ptr; }
690 
691 void BIO_set_init(BIO *bio, int init) { bio->init = init; }
692 
693 int BIO_get_init(BIO *bio) { return bio->init; }
694 
695 void BIO_set_shutdown(BIO *bio, int shutdown) { bio->shutdown = shutdown; }
696 
697 int BIO_get_shutdown(BIO *bio) { return bio->shutdown; }
698 
699 int BIO_meth_set_puts(BIO_METHOD *method, int (*puts)(BIO *, const char *)) {
700  // Ignore the parameter. We implement |BIO_puts| using |BIO_write|.
701  return 1;
702 }
bio_method_st
Definition: bio.h:808
BIO_ctrl_pending
size_t BIO_ctrl_pending(const BIO *bio)
Definition: bio.c:321
xds_interop_client.str
str
Definition: xds_interop_client.py:487
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
BIO_test_flags
int BIO_test_flags(const BIO *bio, int flags)
Definition: bio.c:243
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
CRYPTO_STATIC_MUTEX_INIT
#define CRYPTO_STATIC_MUTEX_INIT
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:536
BIO_CTRL_WPENDING
#define BIO_CTRL_WPENDING
Definition: bio.h:715
BIO_free
int BIO_free(BIO *bio)
Definition: bio.c:92
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
bio_st::next_bio
BIO * next_bio
Definition: bio.h:841
init
const char * init
Definition: upb/upb/bindings/lua/main.c:49
BIO_set_retry_write
void BIO_set_retry_write(BIO *bio)
Definition: bio.c:275
BIO_write_all
int BIO_write_all(BIO *bio, const void *data, size_t len)
Definition: bio.c:181
bio_method_st::destroy
int(* destroy)(BIO *)
Definition: bio.h:818
bio_method_st::callback_ctrl
long(* callback_ctrl)(BIO *, int, bio_info_cb)
Definition: bio.h:819
print_bio
static int print_bio(const char *str, size_t len, void *bio)
Definition: bio.c:420
bio_read_full
static int bio_read_full(BIO *bio, uint8_t *out, int *out_eof_on_first_read, size_t len)
Definition: bio.c:492
bio_st
Definition: bio.h:822
bio_st::ptr
void * ptr
Definition: bio.h:838
BIO_eof
int BIO_eof(BIO *bio)
Definition: bio.c:235
bio_st::flags
int flags
Definition: bio.h:832
BIO_set_data
void BIO_set_data(BIO *bio, void *ptr)
Definition: bio.c:687
BIO_R_UNINITIALIZED
#define BIO_R_UNINITIALIZED
Definition: bio.h:933
CRYPTO_STATIC_MUTEX_unlock_write
#define CRYPTO_STATIC_MUTEX_unlock_write
Definition: boringssl_prefix_symbols.h:1135
BIO_reset
int BIO_reset(BIO *bio)
Definition: bio.c:231
write
#define write
Definition: test-fs.c:47
BIO_read
int BIO_read(BIO *bio, void *buf, int len)
Definition: bio.c:124
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
OPENSSL_realloc
#define OPENSSL_realloc
Definition: boringssl_prefix_symbols.h:1889
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_meth_set_ctrl
int BIO_meth_set_ctrl(BIO_METHOD *method, long(*ctrl)(BIO *, int, long, void *))
Definition: bio.c:681
BIO_free_all
void BIO_free_all(BIO *bio)
Definition: bio.c:120
setup.name
name
Definition: setup.py:542
BIO_get_retry_reason
int BIO_get_retry_reason(const BIO *bio)
Definition: bio.c:263
bio_method_st::bwrite
int(* bwrite)(BIO *, const char *, int)
Definition: bio.h:811
g_index
static int g_index
Definition: bio.c:626
kChunkSize
static constexpr size_t kChunkSize
Definition: chunked_vector_fuzzer.cc:29
BIO_TYPE_START
#define BIO_TYPE_START
Definition: bio.h:806
method_type
zend_class_entry * method_type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/message.c:2232
xds_manager.p
p
Definition: xds_manager.py:60
python_utils.upload_rbe_results.indent
indent
Definition: upload_rbe_results.py:183
ERR_print_errors_cb
#define ERR_print_errors_cb
Definition: boringssl_prefix_symbols.h:1436
BIO_get_data
void * BIO_get_data(BIO *bio)
Definition: bio.c:689
BIO_int_ctrl
long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg)
Definition: bio.c:225
BIO_meth_set_read
int BIO_meth_set_read(BIO_METHOD *method, int(*read)(BIO *, char *, int))
Definition: bio.c:669
BIO_meth_set_destroy
int BIO_meth_set_destroy(BIO_METHOD *method, int(*destroy)(BIO *))
Definition: bio.c:657
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
BIO_pending
size_t BIO_pending(const BIO *bio)
Definition: bio.c:311
bio_method_st::ctrl
long(* ctrl)(BIO *, int, long, void *)
Definition: bio.h:816
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_wpending
size_t BIO_wpending(const BIO *bio)
Definition: bio.c:325
bio_st::num_write
size_t num_write
Definition: bio.h:842
BIO_new
BIO * BIO_new(const BIO_METHOD *method)
Definition: bio.c:72
BIO_number_read
OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio)
Definition: bio.c:339
BIO_clear_flags
void BIO_clear_flags(BIO *bio, int flags)
Definition: bio.c:267
BIO_set_init
void BIO_set_init(BIO *bio, int init)
Definition: bio.c:691
BIO_FLAGS_IO_SPECIAL
#define BIO_FLAGS_IO_SPECIAL
Definition: bio.h:765
BIO_CTRL_EOF
#define BIO_CTRL_EOF
Definition: bio.h:693
BIO_meth_free
void BIO_meth_free(BIO_METHOD *method)
Definition: bio.c:647
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
OPENSSL_malloc
#define OPENSSL_malloc
Definition: boringssl_prefix_symbols.h:1885
ASN1_R_DECODE_ERROR
#define ASN1_R_DECODE_ERROR
Definition: asn1.h:1952
CRYPTO_STATIC_MUTEX
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:533
BIO_set_shutdown
void BIO_set_shutdown(BIO *bio, int shutdown)
Definition: bio.c:695
ASN1_R_HEADER_TOO_LONG
#define ASN1_R_HEADER_TOO_LONG
Definition: asn1.h:1966
BIO_gets
int BIO_gets(BIO *bio, char *buf, int len)
Definition: bio.c:143
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
ERR_print_errors
void ERR_print_errors(BIO *bio)
Definition: bio.c:424
BIO_next
BIO * BIO_next(BIO *bio)
Definition: bio.c:374
BIO_set_close
int BIO_set_close(BIO *bio, int close_flag)
Definition: bio.c:335
generic_client_interceptor.create
def create(intercept_call)
Definition: generic_client_interceptor.py:55
xds_interop_client.int
int
Definition: xds_interop_client.py:113
BIO_callback_ctrl
long BIO_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp)
Definition: bio.c:298
BIO_should_retry
int BIO_should_retry(const BIO *bio)
Definition: bio.c:255
ASN1_R_NOT_ENOUGH_DATA
#define ASN1_R_NOT_ENOUGH_DATA
Definition: asn1.h:2005
BIO_flush
int BIO_flush(BIO *bio)
Definition: bio.c:198
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
bio_st::method
const BIO_METHOD * method
Definition: bio.h:823
BIO_copy_next_retry
void BIO_copy_next_retry(BIO *bio)
Definition: bio.c:292
BIO_push
BIO * BIO_push(BIO *bio, BIO *appended_bio)
Definition: bio.c:347
BIO_FLAGS_READ
#define BIO_FLAGS_READ
Definition: bio.h:763
BIO_number_written
OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio)
Definition: bio.c:343
CRYPTO_STATIC_MUTEX_lock_write
#define CRYPTO_STATIC_MUTEX_lock_write
Definition: boringssl_prefix_symbols.h:1133
BIO_get_new_index
int BIO_get_new_index(void)
Definition: bio.c:628
OPENSSL_memcpy
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:819
header
struct absl::base_internal::@2940::AllocList::Header header
BIO_method_type
int BIO_method_type(const BIO *bio)
Definition: bio.c:290
done
struct tab * done
Definition: bloaty/third_party/zlib/examples/enough.c:176
regen-readme.cmd
cmd
Definition: regen-readme.py:21
err.h
BIO_write
int BIO_write(BIO *bio, const void *in, int inl)
Definition: bio.c:162
BIO_puts
int BIO_puts(BIO *bio, const char *in)
Definition: bio.c:194
BIO_should_read
int BIO_should_read(const BIO *bio)
Definition: bio.c:247
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
BIO_meth_set_gets
int BIO_meth_set_gets(BIO_METHOD *method, int(*gets)(BIO *, char *, int))
Definition: bio.c:675
OPENSSL_DECLARE_ERROR_REASON
#define OPENSSL_DECLARE_ERROR_REASON(lib, reason)
Definition: err.h:459
bio_method_st::type
int type
Definition: bio.h:809
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
bio_st::shutdown
int shutdown
Definition: bio.h:831
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
BIO_find_type
BIO * BIO_find_type(BIO *bio, int type)
Definition: bio.c:381
BIO_set_retry_read
void BIO_set_retry_read(BIO *bio)
Definition: bio.c:271
BIO_meth_set_puts
int BIO_meth_set_puts(BIO_METHOD *method, int(*puts)(BIO *, const char *))
Definition: bio.c:699
BIO_meth_set_create
int BIO_meth_set_create(BIO_METHOD *method, int(*create)(BIO *))
Definition: bio.c:651
BIO_should_io_special
int BIO_should_io_special(const BIO *bio)
Definition: bio.c:259
bio_read_all
static int bio_read_all(BIO *bio, uint8_t **out, size_t *out_len, const uint8_t *prefix, size_t prefix_len, size_t max_len)
Definition: bio.c:436
BIO_CTRL_FLUSH
#define BIO_CTRL_FLUSH
Definition: bio.h:712
BIO_get_retry_flags
int BIO_get_retry_flags(BIO *bio)
Definition: bio.c:281
BIO_read_asn1
int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len)
Definition: bio.c:519
read
int read(izstream &zs, T *x, Items items)
Definition: bloaty/third_party/zlib/contrib/iostream2/zstream.h:115
BIO_CTRL_PENDING
#define BIO_CTRL_PENDING
Definition: bio.h:709
BIO_ptr_ctrl
char * BIO_ptr_ctrl(BIO *b, int cmd, long larg)
Definition: bio.c:215
kRetryFlags
static const int kRetryFlags
Definition: bio.c:279
absl::flags_internal
Definition: abseil-cpp/absl/flags/commandlineflag.h:40
BIO_CTRL_SET_CLOSE
#define BIO_CTRL_SET_CLOSE
Definition: bio.h:706
BIO_FLAGS_WRITE
#define BIO_FLAGS_WRITE
Definition: bio.h:764
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
fix_build_deps.r
r
Definition: fix_build_deps.py:491
bio_st::retry_reason
int retry_reason
Definition: bio.h:833
BIO_clear_retry_flags
void BIO_clear_retry_flags(BIO *bio)
Definition: bio.c:285
prefix
static const char prefix[]
Definition: head_of_line_blocking.cc:28
OPENSSL_EXPORT
#define OPENSSL_EXPORT
Definition: base.h:222
BIO_indent
int BIO_indent(BIO *bio, unsigned indent, unsigned max_indent)
Definition: bio.c:407
BIO_ctrl
long BIO_ctrl(BIO *bio, int cmd, long larg, void *parg)
Definition: bio.c:202
BIO_set_retry_special
void BIO_set_retry_special(BIO *bio)
Definition: bio.c:619
BIO_pop
BIO * BIO_pop(BIO *bio)
Definition: bio.c:363
BIO_up_ref
int BIO_up_ref(BIO *bio)
Definition: bio.c:111
BIO_vfree
void BIO_vfree(BIO *bio)
Definition: bio.c:116
BIO_FLAGS_RWS
#define BIO_FLAGS_RWS
Definition: bio.h:766
BIO_set_write_buffer_size
int BIO_set_write_buffer_size(BIO *bio, int buffer_size)
Definition: bio.c:623
g_index_lock
static struct CRYPTO_STATIC_MUTEX g_index_lock
Definition: bio.c:625
BIO_CTRL_RESET
#define BIO_CTRL_RESET
Definition: bio.h:690
BIO_meth_new
BIO_METHOD * BIO_meth_new(int type, const char *name)
Definition: bio.c:636
CRYPTO_refcount_inc
#define CRYPTO_refcount_inc
Definition: boringssl_prefix_symbols.h:1191
flags
uint32_t flags
Definition: retry_filter.cc:632
mem.h
BIO_set_flags
void BIO_set_flags(BIO *bio, int flags)
Definition: bio.c:239
BIO_should_write
int BIO_should_write(const BIO *bio)
Definition: bio.c:251
BIO_get_shutdown
int BIO_get_shutdown(BIO *bio)
Definition: bio.c:697
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
BIO_get_init
int BIO_get_init(BIO *bio)
Definition: bio.c:693
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
bio_st::references
CRYPTO_refcount_t references
Definition: bio.h:837
BIO_set_retry_reason
void BIO_set_retry_reason(BIO *bio, int reason)
Definition: bio.c:265
method
NSString * method
Definition: ProtoMethod.h:28
thread.h
ASN1_R_TOO_LONG
#define ASN1_R_TOO_LONG
Definition: asn1.h:2020
OPENSSL_free
#define OPENSSL_free
Definition: boringssl_prefix_symbols.h:1869
mkowners.todo
todo
Definition: mkowners.py:209
versiongenerate.buffer_size
int buffer_size
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/xcode/Scripts/versiongenerate.py:65
errno.h
destroy
static std::function< void(void *, Slot *)> destroy
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:42
bio_method_st::bread
int(* bread)(BIO *, char *, int)
Definition: bio.h:812
bio_st::num_read
size_t num_read
Definition: bio.h:842
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
bio_method_st::bgets
int(* bgets)(BIO *, char *, int)
Definition: bio.h:815
asn1.h
BIO_R_UNSUPPORTED_METHOD
#define BIO_R_UNSUPPORTED_METHOD
Definition: bio.h:934
ERR_R_MALLOC_FAILURE
#define ERR_R_MALLOC_FAILURE
Definition: err.h:371
BIO_meth_set_write
int BIO_meth_set_write(BIO_METHOD *method, int(*write)(BIO *, const char *, int))
Definition: bio.c:663
CRYPTO_refcount_dec_and_test_zero
#define CRYPTO_refcount_dec_and_test_zero
Definition: boringssl_prefix_symbols.h:1190


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