2026-12-02, 10:37:16 -0500, Martin Belanger wrote:
[...]
> kTLS gives three record layer services to net/handshake.
> net/handshake registers for them on the socket when the handshake
> completes:
>
> 1. kTLS shows each received handshake record to net/handshake.
> net/handshake consumes a KeyUpdate. Any other handshake message
> goes to the consumer as today.
> 2. Before the next data record, kTLS sends a KeyUpdate from
> net/handshake, with the current key. kTLS does this when a reply is
> pending (net/handshake set this flag when it processed the received
> KeyUpdate) or when rec_seq reaches a limit that net/handshake set.
> Both are plain checks in kTLS: there is no call into net/handshake
> for each record.
> 3. At a record boundary, kTLS installs the next key that net/handshake
> derives, through tls_set_sw_offload(), the same path as your
> rekey. The sequence number restarts at 0.
I'm struggling to parse this and see what hooks into what.
> kTLS has no secrets, no HKDF and no KeyUpdate logic. As in v6, this is
> for the software path only.
>
> I have a working prototype. kTLS gets about 210 lines of code, instead
> of about 400 in v6. net/handshake gets about 230.
I wonder how you still get 200 lines in net/tls, since socket options
and key computation were a very large chunk of those 400 lines.
--
Sabrina