diff options
| author | tb <> | 2022-01-14 08:40:57 +0000 |
|---|---|---|
| committer | tb <> | 2022-01-14 08:40:57 +0000 |
| commit | bf7beecb6c75655f21958cd52426578df3f1f307 (patch) | |
| tree | f4107fef050d8e49767a68206c4485731507efa2 /src/lib/libcrypto/bio/bio_meth.c | |
| parent | 7d1004f306e7f866e13dd01c6e546fd35a43df41 (diff) | |
| download | openbsd-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/bio_meth.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bio_meth.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bio/bio_meth.c b/src/lib/libcrypto/bio/bio_meth.c index b9c07d5111..d7d100df95 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.7 2022/01/07 09:02:17 tb Exp $ */ | 1 | /* $OpenBSD: bio_meth.c,v 1.8 2022/01/14 08:40:57 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
| 4 | * | 4 | * |
| @@ -135,15 +135,13 @@ BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)) | |||
| 135 | long | 135 | long |
| 136 | (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *) | 136 | (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *) |
| 137 | { | 137 | { |
| 138 | return | 138 | return biom->callback_ctrl; |
| 139 | (long (*)(BIO *, int, BIO_info_cb *))biom->callback_ctrl; /* XXX */ | ||
| 140 | } | 139 | } |
| 141 | 140 | ||
| 142 | int | 141 | int |
| 143 | BIO_meth_set_callback_ctrl(BIO_METHOD *biom, | 142 | BIO_meth_set_callback_ctrl(BIO_METHOD *biom, |
| 144 | long (*callback_ctrl)(BIO *, int, BIO_info_cb *)) | 143 | long (*callback_ctrl)(BIO *, int, BIO_info_cb *)) |
| 145 | { | 144 | { |
| 146 | biom->callback_ctrl = | 145 | biom->callback_ctrl = callback_ctrl; |
| 147 | (long (*)(BIO *, int, bio_info_cb *))callback_ctrl; /* XXX */ | ||
| 148 | return 1; | 146 | return 1; |
| 149 | } | 147 | } |
