diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-01-24 09:57:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 09:57:28 +0100 |
commit | 7a83a8dc9122a730a74e5ac644413ae87f94e563 (patch) | |
tree | 4e387ad79b4301cddaa1b473e86a804a24af188b /tests/ossfuzz.sh | |
parent | f04b4450a18e53cb53dbd08750eda518b0aeda4c (diff) |
QUIC: fix decryption with CH fragments with different Destination CID (#2278)
QUIC decryption fails when the Client Hello is split into multiple UDP
packets and these packets have different Destination Connection IDs
(because the server told the client to switch to a different CID; see
RFC 9000 7.2)
```
The Destination Connection ID field from the first Initial packet sent by
a client is used to determine packet protection keys for Initial packets.
[..]
Upon first receiving an Initial or Retry packet from the server, the
client uses the Source Connection ID supplied by the server as the
Destination Connection ID for subsequent packets
```
From a logical point of view, the ciphers used for decryption should be
initialized only once, with the first Initial pkt sent by the client and
kept for later usage with the following packets (if any).
However it seems that we can safely initialize them at each packet, if
we keep using the DCID of the **first** packet sent by the client.
Keep initializing the ciphers at each packet greatly simplifie this patch.
This issue has been undetected for so long because:
* in the vast majority of the cases we only decrypt one packet per flow;
* the available traces with the Client Hello split into multiple packets
(i.e. cases where we need to decrypt at least two packets per flow) were
created in a simple test environment to simulate Post-Quantum handshake,
and in that scenario the client sent all the packets (with the same
DCID) before any reply from the server.
However, in the last months all major browsers started supporting PQ
key, so it is now common to have split CH in real traffic.
Please note that in the attached example, the CH is split into 2
(in-order) fragments (in different UDP packets) and the second one in
turn is divided into 9 (out-of-order) CRYPTO frames; the reassembler
code works out-of-the-box even in this (new) scenario.
Diffstat (limited to 'tests/ossfuzz.sh')
0 files changed, 0 insertions, 0 deletions