Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)
/*
* 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);
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;
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);
}
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)