summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2024-11-25 16:06:47 +0100
committerTomas Mraz <tomas@openssl.org>2024-11-28 16:48:43 +0100
commit0bba821881868252bfca4400879682a1648da225 (patch)
tree7d439b3875054dc65550172daca0f8da8cf93d64 /doc
parentUse sk_X509_ATTRIBUTE_deep_copy() to copy attribute stacks in pk7_doit.c (diff)
downloadopenssl-0bba821881868252bfca4400879682a1648da225.tar.xz
openssl-0bba821881868252bfca4400879682a1648da225.zip
Deprecate all BIO_meth_get_*() functions
Their use by applications is inherently unsafe. Fixes #26047 Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from https://github.com/openssl/openssl/pull/26056)
Diffstat (limited to 'doc')
-rw-r--r--doc/man3/BIO_meth_new.pod68
1 files changed, 46 insertions, 22 deletions
diff --git a/doc/man3/BIO_meth_new.pod b/doc/man3/BIO_meth_new.pod
index b532190e5a..e7d5ff6723 100644
--- a/doc/man3/BIO_meth_new.pod
+++ b/doc/man3/BIO_meth_new.pod
@@ -22,59 +22,64 @@ BIO_meth_set_recvmmsg, BIO_meth_get_recvmmsg - Routines to build up BIO methods
void BIO_meth_free(BIO_METHOD *biom);
- int (*BIO_meth_get_write_ex(const BIO_METHOD *biom))(BIO *, const char *, size_t,
- size_t *);
- int (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int);
int BIO_meth_set_write_ex(BIO_METHOD *biom,
int (*bwrite)(BIO *, const char *, size_t, size_t *));
int BIO_meth_set_write(BIO_METHOD *biom,
int (*write)(BIO *, const char *, int));
- int (*BIO_meth_get_read_ex(const BIO_METHOD *biom))(BIO *, char *, size_t, size_t *);
- int (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int);
int BIO_meth_set_read_ex(BIO_METHOD *biom,
int (*bread)(BIO *, char *, size_t, size_t *));
int BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int));
- int (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *);
int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *));
-
- int (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int);
int BIO_meth_set_gets(BIO_METHOD *biom,
int (*gets)(BIO *, char *, int));
- long (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *);
int BIO_meth_set_ctrl(BIO_METHOD *biom,
long (*ctrl)(BIO *, int, long, void *));
- int (*BIO_meth_get_create(const BIO_METHOD *bion))(BIO *);
int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *));
-
- int (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *);
int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
- long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *);
int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
long (*callback_ctrl)(BIO *, int, BIO_info_cb *));
+ int BIO_meth_set_sendmmsg(BIO_METHOD *biom,
+ ossl_ssize_t (*f) (BIO *, BIO_MSG *, size_t,
+ size_t, uint64_t));
+ int BIO_meth_set_recvmmsg(BIO_METHOD *biom,
+ ossl_ssize_t (*f) (BIO *, BIO_MSG *, size_t,
+ size_t, uint64_t));
+
+The following functions have been deprecated since OpenSSL 3.5:
+
+ int (*BIO_meth_get_write_ex(const BIO_METHOD *biom))(BIO *, const char *, size_t,
+ size_t *);
+ int (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, int);
+
+ int (*BIO_meth_get_read_ex(const BIO_METHOD *biom))(BIO *, char *, size_t, size_t *);
+ int (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int);
+
+ int (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *);
+ int (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int);
+
+ long (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, long, void *);
+
+ int (*BIO_meth_get_create(const BIO_METHOD *bion))(BIO *);
+ int (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *);
+
+ long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, BIO_info_cb *);
+
ossl_ssize_t (*BIO_meth_get_sendmmsg(const BIO_METHOD *biom))(BIO *,
BIO_MSG *,
size_t,
size_t,
uint64_t);
- int BIO_meth_set_sendmmsg(BIO_METHOD *biom,
- ossl_ssize_t (*f) (BIO *, BIO_MSG *, size_t,
- size_t, uint64_t));
-
ossl_ssize_t (*BIO_meth_get_recvmmsg(const BIO_METHOD *biom))(BIO *,
BIO_MSG *,
size_t,
size_t,
uint64_t);
- int BIO_meth_set_recvmmsg(BIO_METHOD *biom,
- ossl_ssize_t (*f) (BIO *, BIO_MSG *, size_t,
- size_t, uint64_t));
-
=head1 DESCRIPTION
@@ -176,13 +181,32 @@ The B<BIO_meth_set> functions return 1 on success or 0 on error.
The B<BIO_meth_get> functions return the corresponding function pointers.
+=head1 BUGS
+
+It is not safe to use C<BIO_meth_get_> functions to reuse the B<BIO>
+implementation of B<BIO>s implemented by OpenSSL itself with
+application-implemented B<BIO>s. Instead either the applications ought to
+implement these functions themselves or they should implement a filter BIO.
+
+For more details please see L<https://github.com/openssl/openssl/issues/26047>.
+
=head1 SEE ALSO
L<bio(7)>, L<BIO_find_type(3)>, L<BIO_ctrl(3)>, L<BIO_read_ex(3)>, L<BIO_new(3)>
=head1 HISTORY
-The functions described here were added in OpenSSL 1.1.0.
+The functions BIO_meth_get_sendmmsg(), BIO_meth_set_sendmmsg(),
+BIO_meth_get_recvmmsg() and BIO_meth_set_recvmmsg() were added in OpenSSL 3.2.
+
+All the other functions described here were added in OpenSSL 1.1.0.
+
+The functions BIO_meth_get_read_ex(), BIO_meth_get_write_ex(),
+BIO_meth_get_write(), BIO_meth_get_read(), BIO_meth_get_puts(),
+BIO_meth_get_gets(), BIO_meth_get_ctrl(), BIO_meth_get_create(),
+BIO_meth_get_destroy(), BIO_meth_get_callback_ctrl(),
+BIO_meth_get_sendmmsg() and BIO_meth_get_recvmmsg() are deprecated since
+OpenSSL 3.5.
=head1 COPYRIGHT