summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bio.h')
-rw-r--r--src/lib/libcrypto/bio/bio.h61
1 files changed, 2 insertions, 59 deletions
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h
index 47e7baf205..8feb98d457 100644
--- a/src/lib/libcrypto/bio/bio.h
+++ b/src/lib/libcrypto/bio/bio.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio.h,v 1.52 2022/01/14 07:59:32 tb Exp $ */ 1/* $OpenBSD: bio.h,v 1.53 2022/01/14 08:18:55 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -205,8 +205,6 @@ extern "C" {
205 */ 205 */
206#define BIO_FLAGS_MEM_RDONLY 0x200 206#define BIO_FLAGS_MEM_RDONLY 0x200
207 207
208typedef struct bio_st BIO;
209
210void BIO_set_flags(BIO *b, int flags); 208void BIO_set_flags(BIO *b, int flags);
211int BIO_test_flags(const BIO *b, int flags); 209int BIO_test_flags(const BIO *b, int flags);
212void BIO_clear_flags(BIO *b, int flags); 210void BIO_clear_flags(BIO *b, int flags);
@@ -272,65 +270,10 @@ int BIO_method_type(const BIO *b);
272typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); 270typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
273typedef int BIO_info_cb(BIO *, int, int); 271typedef int BIO_info_cb(BIO *, int, int);
274 272
275typedef struct bio_method_st { 273typedef struct bio_method_st BIO_METHOD;
276 int type;
277 const char *name;
278 int (*bwrite)(BIO *, const char *, int);
279 int (*bread)(BIO *, char *, int);
280 int (*bputs)(BIO *, const char *);
281 int (*bgets)(BIO *, char *, int);
282 long (*ctrl)(BIO *, int, long, void *);
283 int (*create)(BIO *);
284 int (*destroy)(BIO *);
285 long (*callback_ctrl)(BIO *, int, bio_info_cb *);
286} BIO_METHOD;
287
288struct bio_st {
289 const BIO_METHOD *method;
290 /* bio, mode, argp, argi, argl, ret */
291 long (*callback)(struct bio_st *, int, const char *, int, long, long);
292 char *cb_arg; /* first argument for the callback */
293
294 int init;
295 int shutdown;
296 int flags; /* extra storage */
297 int retry_reason;
298 int num;
299 void *ptr;
300 struct bio_st *next_bio; /* used by filter BIOs */
301 struct bio_st *prev_bio; /* used by filter BIOs */
302 int references;
303 unsigned long num_read;
304 unsigned long num_write;
305
306 CRYPTO_EX_DATA ex_data;
307};
308 274
309DECLARE_STACK_OF(BIO) 275DECLARE_STACK_OF(BIO)
310 276
311typedef struct bio_f_buffer_ctx_struct {
312 /* Buffers are setup like this:
313 *
314 * <---------------------- size ----------------------->
315 * +---------------------------------------------------+
316 * | consumed | remaining | free space |
317 * +---------------------------------------------------+
318 * <-- off --><------- len ------->
319 */
320
321 /* BIO *bio; */ /* this is now in the BIO struct */
322 int ibuf_size; /* how big is the input buffer */
323 int obuf_size; /* how big is the output buffer */
324
325 char *ibuf; /* the char array */
326 int ibuf_len; /* how many bytes are in it */
327 int ibuf_off; /* write/read offset */
328
329 char *obuf; /* the char array */
330 int obuf_len; /* how many bytes are in it */
331 int obuf_off; /* write/read offset */
332} BIO_F_BUFFER_CTX;
333
334/* Prefix and suffix callback in ASN1 BIO */ 277/* Prefix and suffix callback in ASN1 BIO */
335typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg); 278typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg);
336 279