Gilles Peskine e85ece6584 Handshake defragmentation: reassemble incrementally
Reassemble handshake fragments incrementally instead of all at the end. That
is, every time we receive a non-initial handshake fragment, append it to the
initial fragment. Since we only have to deal with at most two handshake
fragments at the same time, this simplifies the code (no re-parsing of a
record) and is a little more memory-efficient (no need to store one record
header per record).

This commit also fixes a bug. The previous code did not calculate offsets
correctly when records use an explicit IV, which is the case in TLS 1.2 with
CBC (encrypt-then-MAC or not), GCM and CCM encryption (i.e. all but null and
ChachaPoly). This led to the wrong data when an encrypted handshake message
was fragmented (Finished or renegotiation). The new code handles this
correctly.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-05 17:02:18 +01:00
..
.jenkins
configs Move zeroize config to TF-PSA-Crypto 2025-02-19 08:03:57 +00:00
git-scripts Header updates 2023-11-03 12:21:36 +00:00
include tests: remove references to DHE-RSA 2025-02-06 10:05:58 +01:00
opt-testcases Switch to generated handshake tests 2025-03-03 16:13:19 +01:00
psa-client-server Refactor tests and programs comment 2024-11-20 16:20:52 +00:00
scripts Handshake defragmentation: reassemble incrementally 2025-03-05 17:02:18 +01:00
src Move psa_test_wrappers.h/c to tf-psa-crypto 2024-12-04 14:25:02 +01:00
suites Update documentation regarding metatest 2025-02-19 15:30:25 +00:00
.gitignore New generated file: tests/opt-testcases/handshake-generated.sh 2025-03-03 16:13:19 +01:00
CMakeLists.txt New generated file: tests/opt-testcases/handshake-generated.sh 2025-03-03 16:13:19 +01:00
compat-in-docker.sh Header updates 2023-11-03 12:21:36 +00:00
compat.sh ssl-opt.sh|compat.sh: remove references to DHE-RSA 2025-02-06 10:05:58 +01:00
context-info.sh Update directory-climbing path in context-info.sh 2024-07-05 15:49:05 +01:00
Descriptions.txt
make-in-docker.sh Header updates 2023-11-03 12:21:36 +00:00
Makefile New generated file: tests/opt-testcases/handshake-generated.sh 2025-03-03 16:13:19 +01:00
ssl-opt.sh Move most TLS handshake defragmentation tests to a separate file 2025-03-03 16:13:19 +01:00