diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-04-26 09:42:01 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-05-16 10:46:14 +0200 |
commit | 1417e2b4b45b7753efe9b58bea8fe5557dd316d8 (patch) | |
tree | c140aefba847a42abd399b071c684247c2894be5 | |
parent | 76e18f94a9de17c5720b80c78cc453fae572fb62 (diff) |
Fix BIO_get_ktls_send/recv to return 0 or 1 only
Fixes #18176
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/18178)
(cherry picked from commit 524bac570702a79366b85ff1f66e07d3e002370c)
-rw-r--r-- | doc/man3/BIO_ctrl.pod | 8 | ||||
-rw-r--r-- | include/openssl/bio.h.in | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/doc/man3/BIO_ctrl.pod b/doc/man3/BIO_ctrl.pod index 84efd23746..d07d8db614 100644 --- a/doc/man3/BIO_ctrl.pod +++ b/doc/man3/BIO_ctrl.pod @@ -77,9 +77,9 @@ return a size_t type and are functions, BIO_pending() and BIO_wpending() are macros which call BIO_ctrl(). BIO_get_ktls_send() returns 1 if the BIO is using the Kernel TLS data-path for -sending. Otherwise, it returns zero. It also returns negative values for failure. +sending. Otherwise, it returns zero. BIO_get_ktls_recv() returns 1 if the BIO is using the Kernel TLS data-path for -receiving. Otherwise, it returns zero. It also returns negative values for failure. +receiving. Otherwise, it returns zero. =head1 RETURN VALUES @@ -141,8 +141,8 @@ the case of BIO_seek() on a file BIO for a successful operation. =head1 HISTORY -The BIO_get_ktls_send() and BIO_get_ktls_recv() functions were added in -OpenSSL 3.0. +The BIO_get_ktls_send() and BIO_get_ktls_recv() macros were added in +OpenSSL 3.0. They were modified to never return -1 in OpenSSL 3.0.4. =head1 COPYRIGHT diff --git a/include/openssl/bio.h.in b/include/openssl/bio.h.in index 9c3a868aae..651843b629 100644 --- a/include/openssl/bio.h.in +++ b/include/openssl/bio.h.in @@ -174,9 +174,9 @@ extern "C" { # ifndef OPENSSL_NO_KTLS # define BIO_get_ktls_send(b) \ - BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL) + (BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL) > 0) # define BIO_get_ktls_recv(b) \ - BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL) + (BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL) > 0) # else # define BIO_get_ktls_send(b) (0) # define BIO_get_ktls_recv(b) (0) |