2
0
mirror of https://github.com/openssl/openssl.git synced 2025-04-12 20:30:52 +08:00

QUIC TX: Do not have QTX handle refcount of BIOs

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)
This commit is contained in:
Hugo Landau 2022-10-31 15:44:08 +00:00
parent c4abf9ebb0
commit cdd3f73236
2 changed files with 4 additions and 14 deletions
include/internal
ssl/quic

@ -240,9 +240,10 @@ size_t ossl_qtx_get_unflushed_pkt_count(OSSL_QTX *qtx);
/*
* Change the BIO being used by the QTX. May be NULL if actual transmission is
* not currently required.
* not currently required. Does not ref the BIO; the caller is responsible for
* ensuring the lifetime of the BIO exceeds the lifetime of the QTX.
*/
int ossl_qtx_set1_bio(OSSL_QTX *qtx, BIO *bio);
void ossl_qtx_set_bio(OSSL_QTX *qtx, BIO *bio);
/* Changes the MDPL. */
int ossl_qtx_set_mdpl(OSSL_QTX *qtx, size_t mdpl);

@ -104,11 +104,6 @@ OSSL_QTX *ossl_qtx_new(const OSSL_QTX_ARGS *args)
if (qtx == NULL)
return 0;
if (args->bio != NULL && !BIO_up_ref(args->bio)) {
OPENSSL_free(qtx);
return 0;
}
qtx->libctx = args->libctx;
qtx->propq = args->propq;
qtx->bio = args->bio;
@ -143,7 +138,6 @@ void ossl_qtx_free(OSSL_QTX *qtx)
for (i = 0; i < QUIC_ENC_LEVEL_NUM; ++i)
ossl_qrl_enc_level_set_discard(&qtx->el_set, i);
BIO_free(qtx->bio);
OPENSSL_free(qtx);
}
@ -864,14 +858,9 @@ int ossl_qtx_pop_net(OSSL_QTX *qtx, BIO_MSG *msg)
return 1;
}
int ossl_qtx_set1_bio(OSSL_QTX *qtx, BIO *bio)
void ossl_qtx_set_bio(OSSL_QTX *qtx, BIO *bio)
{
if (bio != NULL && !BIO_up_ref(bio))
return 0;
BIO_free(qtx->bio);
qtx->bio = bio;
return 1;
}
int ossl_qtx_set_mdpl(OSSL_QTX *qtx, size_t mdpl)