Fix BIO_get_ktls_send() and BIO_get_ktls_recv() to work again.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 23 Aug 2019 23:42:48 +0000 (16:42 -0700)
committerMatt Caswell <matt@openssl.org>
Thu, 31 Oct 2019 10:24:32 +0000 (10:24 +0000)
commit1ca50aa975fb149a75a3b0411230761376cb5e33
tree73270c37a2e34a63bd1bd232ba006b25a70b083e
parent712c0942939c9aba2f2afadb9e4276b1a3df1345
Fix BIO_get_ktls_send() and BIO_get_ktls_recv() to work again.

This partially reverts 3119ab3c9e6d211c461a245f3744893e17b6c193.  In the
case of a simple openssl s_server instance, the bio in s->wbio is a
BIO_TYPE_BUFFER BIO, not BIO_TYPE_SOCKET.  This caused all of the checks
to fail breaking KTLS.

The default return value of control methods I have looked it is zero
for unknown control requests, so invoking the control requests should
be returning 0 for non-socket BIOs already.

This does still map the requests to 0 at compile time for the non-KTLS
case so that the compiler can optimize the checks away entirely.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10045)
include/openssl/bio.h