summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio
diff options
context:
space:
mode:
authortb <>2018-02-20 18:17:17 +0000
committertb <>2018-02-20 18:17:17 +0000
commit9f288b2cd2768e52d60e3a2722ef5e6aed658dd9 (patch)
tree7548473eeb672688c0f5e8fc0df37c168595c8a1 /src/lib/libcrypto/bio
parentd6ccb786c626f058c506c0058b1bb76a87e3801c (diff)
downloadopenbsd-9f288b2cd2768e52d60e3a2722ef5e6aed658dd9.tar.gz
openbsd-9f288b2cd2768e52d60e3a2722ef5e6aed658dd9.tar.bz2
openbsd-9f288b2cd2768e52d60e3a2722ef5e6aed658dd9.zip
Provide BIO_meth_{g,s}et_callback_ctrl()
with & ok jsing
Diffstat (limited to 'src/lib/libcrypto/bio')
-rw-r--r--src/lib/libcrypto/bio/bio.h6
-rw-r--r--src/lib/libcrypto/bio/bio_meth.c18
2 files changed, 22 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h
index 2d46535096..0a05d64929 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.37 2018/02/20 18:13:31 tb Exp $ */ 1/* $OpenBSD: bio.h,v 1.38 2018/02/20 18:17:17 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 *
@@ -270,6 +270,7 @@ const char * BIO_method_name(const BIO *b);
270int BIO_method_type(const BIO *b); 270int BIO_method_type(const BIO *b);
271 271
272typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); 272typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
273typedef int BIO_info_cb(BIO *, int, int);
273 274
274typedef struct bio_method_st { 275typedef struct bio_method_st {
275 int type; 276 int type;
@@ -350,6 +351,9 @@ int (*BIO_meth_get_create(BIO_METHOD *biom))(BIO *);
350int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *)); 351int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *));
351int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *); 352int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *);
352int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)); 353int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
354long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, BIO_info_cb *);
355int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
356 long (*callback_ctrl)(BIO *, int, BIO_info_cb *));
353 357
354/* connect BIO stuff */ 358/* connect BIO stuff */
355#define BIO_CONN_S_BEFORE 1 359#define BIO_CONN_S_BEFORE 1
diff --git a/src/lib/libcrypto/bio/bio_meth.c b/src/lib/libcrypto/bio/bio_meth.c
index 1fc0df534b..2eb6794f02 100644
--- a/src/lib/libcrypto/bio/bio_meth.c
+++ b/src/lib/libcrypto/bio/bio_meth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_meth.c,v 1.3 2018/02/20 18:13:31 tb Exp $ */ 1/* $OpenBSD: bio_meth.c,v 1.4 2018/02/20 18:17:17 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -129,3 +129,19 @@ BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *))
129 biom->destroy = destroy; 129 biom->destroy = destroy;
130 return 1; 130 return 1;
131} 131}
132
133long
134(*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, BIO_info_cb *)
135{
136 return
137 (long (*)(BIO *, int, BIO_info_cb*))biom->callback_ctrl; /* XXX */
138}
139
140int
141BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
142 long (*callback_ctrl)(BIO *, int, BIO_info_cb *))
143{
144 biom->callback_ctrl =
145 (long (*)(BIO *, int, bio_info_cb *))callback_ctrl; /* XXX */
146 return 1;
147}