mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
use entropy api, tkey cleanup
This commit is contained in:
@@ -55,8 +55,9 @@ struct ns_server {
|
|||||||
dns_viewlist_t viewlist;
|
dns_viewlist_t viewlist;
|
||||||
ns_interfacemgr_t * interfacemgr;
|
ns_interfacemgr_t * interfacemgr;
|
||||||
dns_db_t * in_roothints;
|
dns_db_t * in_roothints;
|
||||||
dns_tkey_ctx_t * tkeyctx;
|
dns_tkeyctx_t * tkeyctx;
|
||||||
isc_timer_t * interface_timer;
|
isc_timer_t * interface_timer;
|
||||||
|
isc_entropy_t * entropy;
|
||||||
|
|
||||||
isc_mutex_t reload_event_lock;
|
isc_mutex_t reload_event_lock;
|
||||||
isc_event_t * reload_event;
|
isc_event_t * reload_event;
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include <isc/app.h>
|
#include <isc/app.h>
|
||||||
#include <isc/base64.h>
|
#include <isc/base64.h>
|
||||||
#include <isc/dir.h>
|
#include <isc/dir.h>
|
||||||
|
#include <isc/entropy.h>
|
||||||
#include <isc/lex.h>
|
#include <isc/lex.h>
|
||||||
#include <isc/string.h>
|
#include <isc/string.h>
|
||||||
#include <isc/task.h>
|
#include <isc/task.h>
|
||||||
@@ -1309,8 +1310,9 @@ load_configuration(const char *filename, ns_server_t *server,
|
|||||||
* Load the TKEY information from the configuration.
|
* Load the TKEY information from the configuration.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
dns_tkey_ctx_t *t = NULL;
|
dns_tkeyctx_t *t = NULL;
|
||||||
CHECKM(dns_tkeyctx_fromconfig(cctx, ns_g_mctx, &t),
|
CHECKM(dns_tkeyctx_fromconfig(cctx, ns_g_mctx, server->entropy,
|
||||||
|
&t),
|
||||||
"configuring TKEY");
|
"configuring TKEY");
|
||||||
if (server->tkeyctx != NULL)
|
if (server->tkeyctx != NULL)
|
||||||
dns_tkeyctx_destroy(&server->tkeyctx);
|
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,
|
ISC_R_NOMEMORY : ISC_R_SUCCESS,
|
||||||
"allocating reload event");
|
"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;
|
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");
|
"creating TKEY context");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1592,6 +1599,9 @@ ns_server_destroy(ns_server_t **serverp) {
|
|||||||
|
|
||||||
dst_lib_destroy();
|
dst_lib_destroy();
|
||||||
|
|
||||||
|
if (server->entropy != NULL)
|
||||||
|
isc_entropy_detach(&server->entropy);
|
||||||
|
|
||||||
isc_event_free(&server->reload_event);
|
isc_event_free(&server->reload_event);
|
||||||
|
|
||||||
INSIST(ISC_LIST_EMPTY(server->viewlist));
|
INSIST(ISC_LIST_EMPTY(server->viewlist));
|
||||||
|
Reference in New Issue
Block a user