Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20061)
avoid allocation during data processing or with CRYPTO_set_mem_functions()
to control where and how buffers are allocated.
+These functions are no-ops when used with QUIC SSL objects. For QUIC,
+SSL_free_buffers() always fails, and SSL_alloc_buffers() always succeeds.
+
=head1 RETURN VALUES
The following return values can occur:
if (sc == NULL)
return 0;
+ /* QUIC buffers are always 'in use'. */
+ if (IS_QUIC_SSL(ssl))
+ return 0;
+
rl = &sc->rlayer;
return rl->rrlmethod->free_buffers(rl->rrl)
if (sc == NULL)
return 0;
+ /* QUIC always has buffers allocated. */
+ if (IS_QUIC_SSL(ssl))
+ return 1;
+
rl = &sc->rlayer;
return rl->rrlmethod->alloc_buffers(rl->rrl)
|| !TEST_false(SSL_write_early_data(ssl, buf, sizeof(buf), &len)))
goto err;
+ /* Buffer Management */
+ if (!TEST_true(SSL_allocate_buffers(ssl))
+ || !TEST_false(SSL_free_buffers(ssl)))
+ goto err;
+
testresult = 1;
err:
SSL_free(ssl);