Fix read pipelining
authorMatt Caswell <matt@openssl.org>
Tue, 25 Oct 2022 14:47:36 +0000 (15:47 +0100)
committerPauli <pauli@openssl.org>
Thu, 23 Feb 2023 23:58:19 +0000 (10:58 +1100)
commit1d06598f0e9d9e39f9c206a2520777e696150257
tree275a750c17ce2ee2e56de8ff38ed9c8d11995db0
parentdf9c7ceefef59cc870c80346906471fabec62494
Fix read pipelining

During read pipelining we must ensure that the buffer is sufficiently large
to read enough data to fill our pipelines. We also remove some code that
moved data to the start of the packet if we can. This was unnecessary
because of later code which would end up moving it anyway. The earlier move
was also incorrect in the case that |clearold| was 0. This would cause the
read pipelining code to fail with sufficiently large records.

Fixes #20197

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20208)
ssl/record/rec_layer_s3.c
ssl/record/ssl3_buffer.c