2
0
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:
Brian Wellington
2000-06-09 22:33:52 +00:00
parent 14c5931d3d
commit d4e608c5bc
2 changed files with 16 additions and 5 deletions

View File

@@ -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;

View File

@@ -22,6 +22,7 @@
#include <isc/app.h>
#include <isc/base64.h>
#include <isc/dir.h>
#include <isc/entropy.h>
#include <isc/lex.h>
#include <isc/string.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.
*/
{
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));