mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Add isc_tlsctx_attach()
The implementation is done on top of the reference counting functionality found in OpenSSL/LibreSSL, which allows for avoiding wrapping the object. Adding this function allows using reference counting for TLS contexts in BIND 9's codebase.
This commit is contained in:
@@ -188,6 +188,16 @@ isc_tlsctx_free(isc_tlsctx_t **ctxp) {
|
||||
SSL_CTX_free(ctx);
|
||||
}
|
||||
|
||||
void
|
||||
isc_tlsctx_attach(isc_tlsctx_t *src, isc_tlsctx_t **ptarget) {
|
||||
REQUIRE(src != NULL);
|
||||
REQUIRE(ptarget != NULL && *ptarget == NULL);
|
||||
|
||||
RUNTIME_CHECK(SSL_CTX_up_ref(src) == 1);
|
||||
|
||||
*ptarget = src;
|
||||
}
|
||||
|
||||
#if HAVE_SSL_CTX_SET_KEYLOG_CALLBACK
|
||||
/*
|
||||
* Callback invoked by the SSL library whenever a new TLS pre-master secret
|
||||
|
Reference in New Issue
Block a user