mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 06:49:58 -04:00
Merge branch '3748-rename-tls-caches-creation-functions-v9-18' into 'v9_18'
[9.18] Rename isc_tlsctx_cache_new() to isc_tlsctx_cache_create(), tlsctx_client_session_cache_new() to tlsctx_client_session_create() See merge request isc-projects/bind9!7272
This commit is contained in:
commit
5a4b3491f9
7 changed files with 34 additions and 25 deletions
|
|
@ -644,7 +644,7 @@ make_empty_lookup(void) {
|
|||
ISC_LIST_INIT(looknew->q);
|
||||
ISC_LIST_INIT(looknew->my_server_list);
|
||||
|
||||
looknew->tls_ctx_cache = isc_tlsctx_cache_new(mctx);
|
||||
isc_tlsctx_cache_create(mctx, &looknew->tls_ctx_cache);
|
||||
|
||||
isc_refcount_init(&looknew->references, 1);
|
||||
|
||||
|
|
@ -2908,9 +2908,9 @@ get_create_tls_context(dig_query_t *query, const bool is_https,
|
|||
}
|
||||
#endif /* HAVE_LIBNGHTTP2 */
|
||||
|
||||
sess_cache = isc_tlsctx_client_session_cache_new(
|
||||
mctx, ctx,
|
||||
ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE);
|
||||
isc_tlsctx_client_session_cache_create(
|
||||
mctx, ctx, ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE,
|
||||
&sess_cache);
|
||||
|
||||
result = isc_tlsctx_cache_add(
|
||||
query->lookup->tls_ctx_cache, tlsctxname, transport,
|
||||
|
|
|
|||
|
|
@ -8608,13 +8608,13 @@ load_configuration(const char *filename, named_server_t *server,
|
|||
isc_tlsctx_cache_detach(&server->tlsctx_server_cache);
|
||||
}
|
||||
|
||||
server->tlsctx_server_cache = isc_tlsctx_cache_new(named_g_mctx);
|
||||
isc_tlsctx_cache_create(named_g_mctx, &server->tlsctx_server_cache);
|
||||
|
||||
if (server->tlsctx_client_cache != NULL) {
|
||||
isc_tlsctx_cache_detach(&server->tlsctx_client_cache);
|
||||
}
|
||||
|
||||
server->tlsctx_client_cache = isc_tlsctx_cache_new(named_g_mctx);
|
||||
isc_tlsctx_cache_create(named_g_mctx, &server->tlsctx_client_cache);
|
||||
|
||||
dns_zonemgr_set_tlsctx_cache(server->zonemgr,
|
||||
server->tlsctx_client_cache);
|
||||
|
|
|
|||
|
|
@ -1072,9 +1072,10 @@ get_create_tlsctx(const dns_xfrin_ctx_t *xfr, isc_tlsctx_t **pctx,
|
|||
|
||||
isc_tlsctx_enable_dot_client_alpn(tlsctx);
|
||||
|
||||
sess_cache = isc_tlsctx_client_session_cache_new(
|
||||
isc_tlsctx_client_session_cache_create(
|
||||
xfr->mctx, tlsctx,
|
||||
ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE);
|
||||
ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE,
|
||||
&sess_cache);
|
||||
|
||||
found_store = NULL;
|
||||
result = isc_tlsctx_cache_add(xfr->tlsctx_cache, tlsname,
|
||||
|
|
|
|||
|
|
@ -320,9 +320,10 @@ typedef struct isc_tlsctx_client_session_cache isc_tlsctx_client_session_cache_t
|
|||
* comparable to or surpass the size of a typical DNS message.
|
||||
*/
|
||||
|
||||
isc_tlsctx_client_session_cache_t *
|
||||
isc_tlsctx_client_session_cache_new(isc_mem_t *mctx, isc_tlsctx_t *ctx,
|
||||
const size_t max_entries);
|
||||
void
|
||||
isc_tlsctx_client_session_cache_create(
|
||||
isc_mem_t *mctx, isc_tlsctx_t *ctx, const size_t max_entries,
|
||||
isc_tlsctx_client_session_cache_t **cachep);
|
||||
/*%<
|
||||
* Create a new TLS client session cache object.
|
||||
*
|
||||
|
|
@ -330,6 +331,7 @@ isc_tlsctx_client_session_cache_new(isc_mem_t *mctx, isc_tlsctx_t *ctx,
|
|||
*\li 'mctx' is a valid memory context object;
|
||||
*\li 'ctx' is a valid TLS context object;
|
||||
*\li 'max_entries' is a positive number;
|
||||
*\li 'cachep' is a valid pointer to a pointer which must be equal to NULL.
|
||||
*/
|
||||
|
||||
void
|
||||
|
|
@ -466,13 +468,14 @@ typedef enum {
|
|||
} isc_tlsctx_cache_transport_t;
|
||||
/*%< TLS context cache transport type values. */
|
||||
|
||||
isc_tlsctx_cache_t *
|
||||
isc_tlsctx_cache_new(isc_mem_t *mctx);
|
||||
void
|
||||
isc_tlsctx_cache_create(isc_mem_t *mctx, isc_tlsctx_cache_t **cachep);
|
||||
/*%<
|
||||
* Create a new TLS context cache object.
|
||||
*
|
||||
* Requires:
|
||||
*\li 'mctx' is a valid memory context.
|
||||
*\li 'mctx' is a valid memory context;
|
||||
*\li 'cachep' is a valid pointer to a pointer which must be equal to NULL.
|
||||
*/
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1101,10 +1101,11 @@ struct isc_tlsctx_cache {
|
|||
isc_ht_t *data;
|
||||
};
|
||||
|
||||
isc_tlsctx_cache_t *
|
||||
isc_tlsctx_cache_new(isc_mem_t *mctx) {
|
||||
void
|
||||
isc_tlsctx_cache_create(isc_mem_t *mctx, isc_tlsctx_cache_t **cachep) {
|
||||
isc_tlsctx_cache_t *nc;
|
||||
|
||||
REQUIRE(cachep != NULL && *cachep == NULL);
|
||||
nc = isc_mem_get(mctx, sizeof(*nc));
|
||||
|
||||
*nc = (isc_tlsctx_cache_t){ .magic = TLSCTX_CACHE_MAGIC };
|
||||
|
|
@ -1114,7 +1115,7 @@ isc_tlsctx_cache_new(isc_mem_t *mctx) {
|
|||
isc_ht_init(&nc->data, mctx, 5);
|
||||
isc_rwlock_init(&nc->rwlock, 0, 0);
|
||||
|
||||
return (nc);
|
||||
*cachep = nc;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1390,13 +1391,15 @@ struct isc_tlsctx_client_session_cache {
|
|||
isc_mutex_t lock;
|
||||
};
|
||||
|
||||
isc_tlsctx_client_session_cache_t *
|
||||
isc_tlsctx_client_session_cache_new(isc_mem_t *mctx, isc_tlsctx_t *ctx,
|
||||
const size_t max_entries) {
|
||||
void
|
||||
isc_tlsctx_client_session_cache_create(
|
||||
isc_mem_t *mctx, isc_tlsctx_t *ctx, const size_t max_entries,
|
||||
isc_tlsctx_client_session_cache_t **cachep) {
|
||||
isc_tlsctx_client_session_cache_t *nc;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
REQUIRE(max_entries > 0);
|
||||
REQUIRE(cachep != NULL && *cachep == NULL);
|
||||
|
||||
nc = isc_mem_get(mctx, sizeof(*nc));
|
||||
|
||||
|
|
@ -1411,7 +1414,7 @@ isc_tlsctx_client_session_cache_new(isc_mem_t *mctx, isc_tlsctx_t *ctx,
|
|||
|
||||
nc->magic = TLSCTX_CLIENT_SESSION_CACHE_MAGIC;
|
||||
|
||||
return (nc);
|
||||
*cachep = nc;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -323,9 +323,10 @@ setup_test(void **state) {
|
|||
client_tlsctx = NULL;
|
||||
isc_tlsctx_createclient(&client_tlsctx);
|
||||
isc_tlsctx_enable_http2client_alpn(client_tlsctx);
|
||||
client_sess_cache = isc_tlsctx_client_session_cache_new(
|
||||
isc_tlsctx_client_session_cache_create(
|
||||
mctx, client_tlsctx,
|
||||
ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE);
|
||||
ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE,
|
||||
&client_sess_cache);
|
||||
|
||||
isc_quota_init(&listener_quota, 0);
|
||||
atomic_store(&check_listener_quota, false);
|
||||
|
|
|
|||
|
|
@ -336,9 +336,10 @@ setup_test(void **state __attribute__((unused))) {
|
|||
|
||||
isc_tlsctx_enable_dot_client_alpn(tcp_connect_tlsctx);
|
||||
|
||||
tcp_tlsctx_client_sess_cache = isc_tlsctx_client_session_cache_new(
|
||||
isc_tlsctx_client_session_cache_create(
|
||||
mctx, tcp_connect_tlsctx,
|
||||
ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE);
|
||||
ISC_TLSCTX_CLIENT_SESSION_CACHE_DEFAULT_SIZE,
|
||||
&tcp_tlsctx_client_sess_cache);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue