Gilles Peskine cc856a2c0e 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:03:20 +01:00
..
.jenkins
configs crypto_config.h: Don't list mechanisms that are not implemented 2024-12-24 20:03:29 +01:00
git-scripts Header updates 2023-11-03 12:21:36 +00:00
include Move some test helpers out of Mbed TLS 2024-11-14 14:17:28 +00:00
opt-testcases Switch to generated handshake tests 2025-03-03 21:03:22 +01:00
scripts Handshake defragmentation: reassemble incrementally 2025-03-05 17:03:20 +01:00
src Move some test helpers out of Mbed TLS 2024-11-14 14:17:28 +00:00
suites Update documentation regarding metatest 2025-02-20 14:51:26 +00:00
.gitignore New generated file: tests/opt-testcases/handshake-generated.sh 2025-03-03 20:58:32 +01:00
CMakeLists.txt New generated file: tests/opt-testcases/handshake-generated.sh 2025-03-03 20:58:32 +01:00
compat-in-docker.sh Header updates 2023-11-03 12:21:36 +00:00
compat.sh Adjust file path for translate_ciphers.py 2024-10-15 12:41:42 +01:00
context-info.sh Update directory-climbing path in context-info.sh 2024-07-08 15:36:48 +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 20:58:32 +01:00
ssl-opt.sh Move most TLS handshake defragmentation tests to a separate file 2025-03-03 21:00:48 +01:00