HomeFreeBSD

KTLS: Check for unprocessed receive records in ktls_configure_crypto.

Description

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

(cherry picked from commit eee55a22b20214ca41cd6b1bbea79b863c8c11ac)
(cherry picked from commit 400229e8d97cda4e198c5640dca6a0a6b70a659e)

Approved by: re (gjb)

Details

Provenance
jhbAuthored on Feb 24 2022, 6:12 PM
Parents
rG1b098094f086: Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD.
Branches
Unknown
Tags
Unknown