Add support for KTLS receive for TLS 1.1-1.2 on FreeBSD.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 31 Oct 2019 23:49:40 +0000 (16:49 -0700)
committerMatt Caswell <matt@openssl.org>
Mon, 31 Aug 2020 08:34:19 +0000 (09:34 +0100)
commit0a90a90c4626dab3b6931e6a1e0bba9419720146
tree5f54cc11f91b35bf10c1cc1e557cb4f39c3c77db
parent3e5826061baa7948ab1d2835357403d16470108d
Add support for KTLS receive for TLS 1.1-1.2 on FreeBSD.

Similar to KTLS receive for Linux, KTLS receive for FreeBSD is enabled
by passing a session key to the kernel via a new socket option.  Once
KTLS receive is enabled on a socket, the socket returns records via
recvmsg().  A control message attached to each record supplies the
original TLS header, and the decrypted plaintext is returned in the
data buffer passed to recvmsg().

To support the case that the userland buffer may already contain
pending encrypted records (which is already handled by Linux's KTLS
receive), the socket option structure for FreeBSD has been extended to
include the initial sequence number.

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