Remove an unnecessary setup of the read buffer
authorMatt Caswell <matt@openssl.org>
Thu, 21 Jul 2022 16:17:05 +0000 (17:17 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 18 Aug 2022 15:38:13 +0000 (16:38 +0100)
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 <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

ssl/record/methods/tls_common.c

index 5d618ca00893ca5c591f4d722d9744e4c5b0b55f..0f56db5881c8da2c02c80e66246dfaab19185883 100644 (file)
@@ -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;