Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
606
Issues
606
List
Boards
Labels
Service Desk
Milestones
Merge Requests
112
Merge Requests
112
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
7dac8d23
Commit
7dac8d23
authored
Aug 03, 2001
by
Andreas Gustafsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the server would catch an assertion failure if the key statement in rndc.key
was missing the algorithm or secret clause
parent
f4effb70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
14 deletions
+36
-14
bin/named/controlconf.c
bin/named/controlconf.c
+4
-1
lib/isccfg/check.c
lib/isccfg/check.c
+25
-12
lib/isccfg/include/isccfg/check.h
lib/isccfg/include/isccfg/check.h
+7
-1
No files found.
bin/named/controlconf.c
View file @
7dac8d23
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: controlconf.c,v 1.1
8 2001/08/03 05:56:19 marka
Exp $ */
/* $Id: controlconf.c,v 1.1
9 2001/08/03 17:24:08 gson
Exp $ */
#include <config.h>
...
...
@@ -36,6 +36,7 @@
#include <isc/util.h>
#include <isccfg/cfg.h>
#include <isccfg/check.h>
#include <isccc/alist.h>
#include <isccc/cc.h>
...
...
@@ -750,6 +751,8 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
if
(
keyid
->
keyname
==
NULL
)
CHECK
(
ISC_R_NOMEMORY
);
CHECK
(
cfg_check_key
(
key
,
ns_g_lctx
));
(
void
)
cfg_map_get
(
key
,
"algorithm"
,
&
algobj
);
(
void
)
cfg_map_get
(
key
,
"secret"
,
&
secretobj
);
INSIST
(
algobj
!=
NULL
&&
secretobj
!=
NULL
);
...
...
lib/isccfg/check.c
View file @
7dac8d23
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: check.c,v 1.1
3 2001/07/19 16:29:14 bwelling
Exp $ */
/* $Id: check.c,v 1.1
4 2001/08/03 17:24:10 gson
Exp $ */
#include <config.h>
...
...
@@ -294,6 +294,24 @@ check_zoneconf(cfg_obj_t *zconfig, isc_symtab_t *symtab, isc_log_t *logctx) {
return
(
result
);
}
isc_result_t
cfg_check_key
(
cfg_obj_t
*
key
,
isc_log_t
*
logctx
)
{
cfg_obj_t
*
algobj
=
NULL
;
cfg_obj_t
*
secretobj
=
NULL
;
const
char
*
keyname
=
cfg_obj_asstring
(
cfg_map_getname
(
key
));
cfg_map_get
(
key
,
"algorithm"
,
&
algobj
);
cfg_map_get
(
key
,
"secret"
,
&
secretobj
);
if
(
secretobj
==
NULL
||
algobj
==
NULL
)
{
cfg_obj_log
(
key
,
logctx
,
ISC_LOG_ERROR
,
"key '%s' must have both 'secret' and "
"'algorithm' defined"
,
keyname
);
return
ISC_R_FAILURE
;
}
return
ISC_R_SUCCESS
;
}
static
isc_result_t
check_viewconf
(
cfg_obj_t
*
vconfig
,
const
char
*
vname
,
isc_log_t
*
logctx
,
isc_mem_t
*
mctx
)
...
...
@@ -341,10 +359,8 @@ check_viewconf(cfg_obj_t *vconfig, const char *vname, isc_log_t *logctx,
{
cfg_obj_t
*
key
=
cfg_listelt_value
(
element
);
const
char
*
keyname
=
cfg_obj_asstring
(
cfg_map_getname
(
key
));
cfg_obj_t
*
algobj
=
NULL
;
cfg_obj_t
*
secretobj
=
NULL
;
isc_symvalue_t
symvalue
;
symvalue
.
as_pointer
=
NULL
;
tresult
=
isc_symtab_define
(
symtab
,
keyname
,
1
,
symvalue
,
isc_symexists_reject
);
...
...
@@ -356,14 +372,11 @@ check_viewconf(cfg_obj_t *vconfig, const char *vname, isc_log_t *logctx,
isc_symtab_destroy
(
&
symtab
);
return
(
tresult
);
}
cfg_map_get
(
key
,
"algorithm"
,
&
algobj
);
cfg_map_get
(
key
,
"secret"
,
&
secretobj
);
if
(
secretobj
==
NULL
||
algobj
==
NULL
)
{
cfg_obj_log
(
key
,
logctx
,
ISC_LOG_ERROR
,
"key '%s' must have both 'secret' and "
"algorithm defined"
,
keyname
);
result
=
ISC_R_FAILURE
;
tresult
=
cfg_check_key
(
key
,
logctx
);
if
(
result
!=
ISC_R_SUCCESS
)
{
isc_symtab_destroy
(
&
symtab
);
return
(
tresult
);
}
}
...
...
lib/isccfg/include/isccfg/check.h
View file @
7dac8d23
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: check.h,v 1.
3 2001/03/08 00:55:50 bwelling
Exp $ */
/* $Id: check.h,v 1.
4 2001/08/03 17:24:11 gson
Exp $ */
#ifndef ISCCFG_CHECK_H
#define ISCCFG_CHECK_H 1
...
...
@@ -43,6 +43,12 @@ cfg_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx);
* ISC_R_FAILURE
*/
isc_result_t
cfg_check_key
(
cfg_obj_t
*
config
,
isc_log_t
*
logctx
);
/*
* As above, but for a single 'key' statement.
*/
ISC_LANG_ENDDECLS
#endif
/* ISCCFG_CHECK_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment