From: Matt Caswell Date: Thu, 21 Jul 2022 16:17:05 +0000 (+0100) Subject: Remove an unnecessary setup of the read buffer X-Git-Tag: openssl-3.2.0-alpha1~2214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f90f85cc018c55d2b73c691f192909e402d1416;p=thirdparty%2Fopenssl.git Remove an unnecessary setup of the read buffer Now everything has been moved to the record layer the additional check for setting up the read buffer is not needed and can be removed. Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18132) --- diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c index 5d618ca0089..0f56db5881c 100644 --- a/ssl/record/methods/tls_common.c +++ b/ssl/record/methods/tls_common.c @@ -172,18 +172,6 @@ int tls_default_read_n(OSSL_RECORD_LAYER *rl, size_t n, size_t max, int extend, return OSSL_RECORD_RETURN_NON_FATAL_ERR; rb = &rl->rbuf; - /* - * TODO(RECLAYER): Once this function is only called from inside the rlayer - * directly, we can probably remove this since it is initialised in - * tls_get_more_records - */ - if (rb->buf == NULL) { - if (!rlayer_setup_read_buffer(rl)) { - /* RLAYERfatal() already called */ - return OSSL_RECORD_RETURN_FATAL; - } - } - left = rb->left; #if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0 align = (size_t)rb->buf + SSL3_RT_HEADER_LENGTH;