summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bf_lbuf.c
diff options
context:
space:
mode:
authortb <>2022-01-14 08:40:57 +0000
committertb <>2022-01-14 08:40:57 +0000
commitbf7beecb6c75655f21958cd52426578df3f1f307 (patch)
treef4107fef050d8e49767a68206c4485731507efa2 /src/lib/libcrypto/bio/bf_lbuf.c
parent7d1004f306e7f866e13dd01c6e546fd35a43df41 (diff)
downloadopenbsd-bf7beecb6c75655f21958cd52426578df3f1f307.tar.gz
openbsd-bf7beecb6c75655f21958cd52426578df3f1f307.tar.bz2
openbsd-bf7beecb6c75655f21958cd52426578df3f1f307.zip
Implement new-style OpenSSL BIO callbacks
This provides support for new-style BIO callbacks in BIO_{read,write,gets,puts}() and a helper function to work out whether it should call the new or the old style callback. It also adds a few typedefs and minor code cleanup as well as the BIO_{get,set}_callback_ex() from jsing, ok tb
Diffstat (limited to 'src/lib/libcrypto/bio/bf_lbuf.c')
-rw-r--r--src/lib/libcrypto/bio/bf_lbuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bio/bf_lbuf.c b/src/lib/libcrypto/bio/bf_lbuf.c
index 5d9ec0f025..d65150881c 100644
--- a/src/lib/libcrypto/bio/bf_lbuf.c
+++ b/src/lib/libcrypto/bio/bf_lbuf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_lbuf.c,v 1.14 2017/01/29 17:49:22 beck Exp $ */ 1/* $OpenBSD: bf_lbuf.c,v 1.15 2022/01/14 08:40:57 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 *
@@ -69,7 +69,7 @@ static int linebuffer_gets(BIO *h, char *str, int size);
69static long linebuffer_ctrl(BIO *h, int cmd, long arg1, void *arg2); 69static long linebuffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
70static int linebuffer_new(BIO *h); 70static int linebuffer_new(BIO *h);
71static int linebuffer_free(BIO *data); 71static int linebuffer_free(BIO *data);
72static long linebuffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); 72static long linebuffer_callback_ctrl(BIO *h, int cmd, BIO_info_cb *fp);
73 73
74/* A 10k maximum should be enough for most purposes */ 74/* A 10k maximum should be enough for most purposes */
75#define DEFAULT_LINEBUFFER_SIZE 1024*10 75#define DEFAULT_LINEBUFFER_SIZE 1024*10
@@ -348,7 +348,7 @@ malloc_error:
348} 348}
349 349
350static long 350static long
351linebuffer_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) 351linebuffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
352{ 352{
353 long ret = 1; 353 long ret = 1;
354 354