From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 2A92A385AE6D; Mon, 11 Jul 2022 11:51:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A92A385AE6D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Initial support for kernel offload of TLS receive. X-Act-Checkin: newlib-cygwin X-Git-Author: John Baldwin X-Git-Refname: refs/heads/master X-Git-Oldrev: 1da65b89198fafb180ad37c1b61f932be4479443 X-Git-Newrev: 7293d1e7b6f1ef012710b1a2e0e7d89889c782e6 Message-Id: <20220711115154.2A92A385AE6D@sourceware.org> Date: Mon, 11 Jul 2022 11:51:54 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 11:51:54 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D7293d1e7b6f= 1ef012710b1a2e0e7d89889c782e6 commit 7293d1e7b6f1ef012710b1a2e0e7d89889c782e6 Author: John Baldwin Date: Mon Apr 27 23:17:19 2020 +0000 Initial support for kernel offload of TLS receive. =20 - Add a new TCP_RXTLS_ENABLE socket option to set the encryption and authentication algorithms and keys as well as the initial sequence number. =20 - When reading from a socket using KTLS receive, applications must use recvmsg(). Each successful call to recvmsg() will return a single TLS record. A new TCP control message, TLS_GET_RECORD, will contain the TLS record header of the decrypted record. The regular message buffer passed to recvmsg() will receive the decrypted payload. This is similar to the interface used by Linux's KTLS RX except that Linux does not return the full TLS header in the control message. =20 - Add plumbing to the TOE KTLS interface to request either transmit or receive KTLS sessions. =20 - When a socket is using receive KTLS, redirect reads from soreceive_stream() into soreceive_generic(). =20 - Note that this interface is currently only defined for TLS 1.1 and 1.2, though I believe we will be able to reuse the same interface and structures for 1.3. Diff: --- newlib/libc/sys/rtems/include/netinet/tcp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h b/newlib/libc/sys/= rtems/include/netinet/tcp.h index b5f01b3bc..5dc13eca2 100644 --- a/newlib/libc/sys/rtems/include/netinet/tcp.h +++ b/newlib/libc/sys/rtems/include/netinet/tcp.h @@ -178,6 +178,8 @@ struct tcphdr { device */ #define TCP_TXTLS_ENABLE 39 /* TLS framing and encryption for transmit */ #define TCP_TXTLS_MODE 40 /* Transmit TLS mode */ +#define TCP_RXTLS_ENABLE 41 /* TLS framing and encryption for receive */ +#define TCP_RXTLS_MODE 42 /* Receive TLS mode */ #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ #define TCP_DELACK 72 /* socket option for delayed ack */ @@ -388,6 +390,7 @@ struct tcp_function_set { * TCP Control message types */ #define TLS_SET_RECORD_TYPE 1 +#define TLS_GET_RECORD 2 =20 /* * TCP specific variables of interest for tp->t_stats stats(9) accounting.