s_server: correctly handle 2^14 byte long records
authorHubert Kario <hkario@redhat.com>
Thu, 20 Jan 2022 16:35:18 +0000 (17:35 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 24 Jan 2022 14:21:11 +0000 (15:21 +0100)
commite293979b2c23712769bf9c655e8a440bf2d3d44f
tree8794c12056efc1d909a2e0e77d05c8963f99f51d
parent45036df45048c6498efa49d3572869830d05df45
s_server: correctly handle 2^14 byte long records

as the code uses BIO_gets, and it always null terminates the
strings it reads, when it reads a record 2^14 byte long, it actually
returns 2^14-1 bytes to the calling application, in general it returns
size-1 bytes to the caller

This makes the code sub-optimal (as every 2^14 record will need two
BIO_gets() calls) and makes it impossible to use -rev option to test
all plaintext lengths (like in openssl#15706)

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17553)
apps/s_server.c