]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: iostream-openssl - Allow plain_input buffer to remain filled in...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 23 Sep 2020 21:35:30 +0000 (23:35 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 30 Sep 2021 17:08:11 +0000 (17:08 +0000)
src/lib-ssl-iostream/iostream-openssl.c

index e1a8d31b6f7f3746cff03055be728b660c7fb4e0..c44c31265f9f4bdf80805da4101f7cd8772dda47 100644 (file)
@@ -524,22 +524,16 @@ openssl_iostream_bio_input(struct ssl_iostream *ssl_io,
                ssl_io->closed = TRUE;
                return -1;
        }
-       if (i_stream_get_data_size(ssl_io->plain_input) > 0) {
-               i_error("SSL: Too much data in buffered plain input buffer");
-               i_free(ssl_io->plain_stream_errstr);
-               ssl_io->plain_stream_errstr =
-                       i_strdup("SSL: Too much data in buffered plain input buffer");
-               ssl_io->plain_stream_errno = EINVAL;
-               ssl_io->closed = TRUE;
-               return -1;
-       }
        if (bytes_read) {
                if (ssl_io->ostream_flush_waiting_input) {
                        ssl_io->ostream_flush_waiting_input = FALSE;
                        o_stream_set_flush_pending(ssl_io->plain_output, TRUE);
                }
-               if (type != OPENSSL_IOSTREAM_SYNC_TYPE_FIRST_READ &&
-                   type != OPENSSL_IOSTREAM_SYNC_TYPE_CONTINUE_READ)
+       }
+       if (bytes_read || i_stream_get_data_size(ssl_io->plain_input) > 0) {
+               if (i_stream_get_data_size(ssl_io->plain_input) > 0 ||
+                   (type != OPENSSL_IOSTREAM_SYNC_TYPE_FIRST_READ &&
+                    type != OPENSSL_IOSTREAM_SYNC_TYPE_CONTINUE_READ))
                        i_stream_set_input_pending(ssl_io->ssl_input, TRUE);
                ssl_io->want_read = FALSE;
        }