diff --git a/bin/named/include/named/server.h b/bin/named/include/named/server.h index 2d1fab43af..6fb1240bd4 100644 --- a/bin/named/include/named/server.h +++ b/bin/named/include/named/server.h @@ -55,8 +55,9 @@ struct ns_server { dns_viewlist_t viewlist; ns_interfacemgr_t * interfacemgr; dns_db_t * in_roothints; - dns_tkey_ctx_t * tkeyctx; + dns_tkeyctx_t * tkeyctx; isc_timer_t * interface_timer; + isc_entropy_t * entropy; isc_mutex_t reload_event_lock; isc_event_t * reload_event; diff --git a/bin/named/server.c b/bin/named/server.c index 228f8156f5..13bc45d385 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1309,8 +1310,9 @@ load_configuration(const char *filename, ns_server_t *server, * Load the TKEY information from the configuration. */ { - dns_tkey_ctx_t *t = NULL; - CHECKM(dns_tkeyctx_fromconfig(cctx, ns_g_mctx, &t), + dns_tkeyctx_t *t = NULL; + CHECKM(dns_tkeyctx_fromconfig(cctx, ns_g_mctx, server->entropy, + &t), "configuring TKEY"); if (server->tkeyctx != NULL) dns_tkeyctx_destroy(&server->tkeyctx); @@ -1552,10 +1554,15 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) { ISC_R_NOMEMORY : ISC_R_SUCCESS, "allocating reload event"); - CHECKFATAL(dst_lib_init(ns_g_mctx), "initializing DST"); + CHECKFATAL(isc_entropy_create(ns_g_mctx, &server->entropy), + "initializing entropy pool"); + + CHECKFATAL(dst_lib_init(ns_g_mctx, server->entropy, 0), + "initializing DST"); server->tkeyctx = NULL; - CHECKFATAL(dns_tkeyctx_create(ns_g_mctx, &server->tkeyctx), + CHECKFATAL(dns_tkeyctx_create(ns_g_mctx, server->entropy, + &server->tkeyctx), "creating TKEY context"); /* @@ -1592,6 +1599,9 @@ ns_server_destroy(ns_server_t **serverp) { dst_lib_destroy(); + if (server->entropy != NULL) + isc_entropy_detach(&server->entropy); + isc_event_free(&server->reload_event); INSIST(ISC_LIST_EMPTY(server->viewlist));