]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
KTLS: Check for unprocessed receive records in ktls_configure_crypto.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 24 Feb 2022 18:12:07 +0000 (10:12 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 19 Oct 2023 18:34:58 +0000 (11:34 -0700)
commiteee55a22b20214ca41cd6b1bbea79b863c8c11ac
tree1fc6c6f325fd2208ad8f6719fbdee8e921924797
parent3de4f78d46c58f23017942967ec74cbc3d2e175d
KTLS: Check for unprocessed receive records in ktls_configure_crypto.

KTLS implementations currently assume that the start of the in-kernel
socket buffer is aligned with the start of a TLS record for the
receive side.  The socket option to enable KTLS specifies the TLS
sequence number of this initial record.

When read ahead is enabled, data can be pending in the SSL read buffer
after negotiating session keys.  This pending data must be examined to
ensurs that the kernel's socket buffer does not contain a partial TLS
record as well as to determine the correct sequence number of the
first TLS record to be processed by the kernel.

In preparation for enabling receive kernel offload for TLS 1.3, move
the existing logic to handle read ahead from t1_enc.c into ktls.c and
invoke it from ktls_configure_crypto().

Obtained from: OpenSSL commit 85773128d0e80cd8dcc772a6931d385b8cf4acd1
crypto/openssl/ssl/ktls.c
crypto/openssl/ssl/ssl_local.h
crypto/openssl/ssl/t1_enc.c
crypto/openssl/ssl/tls13_enc.c