mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
981. [func] The dnssec tools can now take multiple '-r randomfile'
arguments.
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,4 +1,7 @@
|
|||||||
|
|
||||||
|
981. [func] The dnssec tools can now take multiple '-r randomfile'
|
||||||
|
arguments.
|
||||||
|
|
||||||
980. [bug] Incoming zone transfers restarting after an error
|
980. [bug] Incoming zone transfers restarting after an error
|
||||||
could trigger an assertion failure. [RT #1692]
|
could trigger an assertion failure. [RT #1692]
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dnssec-keygen.c,v 1.48 2001/07/10 18:53:09 bwelling Exp $ */
|
/* $Id: dnssec-keygen.c,v 1.49 2001/09/05 23:15:35 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -92,7 +92,6 @@ int
|
|||||||
main(int argc, char **argv) {
|
main(int argc, char **argv) {
|
||||||
char *algname = NULL, *nametype = NULL, *type = NULL;
|
char *algname = NULL, *nametype = NULL, *type = NULL;
|
||||||
char *classname = NULL;
|
char *classname = NULL;
|
||||||
char *randomfile = NULL;
|
|
||||||
char *prog, *endp;
|
char *prog, *endp;
|
||||||
dst_key_t *key = NULL, *oldkey;
|
dst_key_t *key = NULL, *oldkey;
|
||||||
dns_fixedname_t fname;
|
dns_fixedname_t fname;
|
||||||
@@ -173,7 +172,7 @@ main(int argc, char **argv) {
|
|||||||
"[0..15]");
|
"[0..15]");
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
randomfile = isc_commandline_argument;
|
setup_entropy(mctx, isc_commandline_argument, &ectx);
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
endp = NULL;
|
endp = NULL;
|
||||||
@@ -191,7 +190,8 @@ main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_entropy(mctx, randomfile, &ectx);
|
if (ectx == NULL)
|
||||||
|
setup_entropy(mctx, NULL, &ectx);
|
||||||
ret = dst_lib_init(mctx, ectx,
|
ret = dst_lib_init(mctx, ectx,
|
||||||
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY);
|
||||||
if (ret != ISC_R_SUCCESS)
|
if (ret != ISC_R_SUCCESS)
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dnssec-makekeyset.c,v 1.52 2001/05/10 06:04:56 bwelling Exp $ */
|
/* $Id: dnssec-makekeyset.c,v 1.53 2001/09/05 23:15:36 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -129,7 +129,6 @@ int
|
|||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
int i, ch;
|
int i, ch;
|
||||||
char *startstr = NULL, *endstr = NULL;
|
char *startstr = NULL, *endstr = NULL;
|
||||||
char *randomfile = NULL;
|
|
||||||
dns_fixedname_t fdomain;
|
dns_fixedname_t fdomain;
|
||||||
dns_name_t *domain = NULL;
|
dns_name_t *domain = NULL;
|
||||||
char *output = NULL;
|
char *output = NULL;
|
||||||
@@ -181,7 +180,7 @@ main(int argc, char *argv[]) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
randomfile = isc_commandline_argument;
|
setup_entropy(mctx, isc_commandline_argument, &ectx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
@@ -208,7 +207,8 @@ main(int argc, char *argv[]) {
|
|||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
setup_entropy(mctx, randomfile, &ectx);
|
if (ectx == NULL)
|
||||||
|
setup_entropy(mctx, NULL, &ectx);
|
||||||
eflags = ISC_ENTROPY_BLOCKING;
|
eflags = ISC_ENTROPY_BLOCKING;
|
||||||
if (!pseudorandom)
|
if (!pseudorandom)
|
||||||
eflags |= ISC_ENTROPY_GOODONLY;
|
eflags |= ISC_ENTROPY_GOODONLY;
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dnssec-signkey.c,v 1.50 2001/05/10 06:04:57 bwelling Exp $ */
|
/* $Id: dnssec-signkey.c,v 1.51 2001/09/05 23:15:38 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -159,7 +159,6 @@ main(int argc, char *argv[]) {
|
|||||||
char *output = NULL;
|
char *output = NULL;
|
||||||
char *endp;
|
char *endp;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
char *randomfile = NULL;
|
|
||||||
dns_db_t *db;
|
dns_db_t *db;
|
||||||
dns_dbnode_t *node;
|
dns_dbnode_t *node;
|
||||||
dns_dbversion_t *version;
|
dns_dbversion_t *version;
|
||||||
@@ -209,7 +208,7 @@ main(int argc, char *argv[]) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
randomfile = isc_commandline_argument;
|
setup_entropy(mctx, isc_commandline_argument, &ectx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
@@ -241,7 +240,8 @@ main(int argc, char *argv[]) {
|
|||||||
} else
|
} else
|
||||||
rdclass = dns_rdataclass_in;
|
rdclass = dns_rdataclass_in;
|
||||||
|
|
||||||
setup_entropy(mctx, randomfile, &ectx);
|
if (ectx == NULL)
|
||||||
|
setup_entropy(mctx, NULL, &ectx);
|
||||||
eflags = ISC_ENTROPY_BLOCKING;
|
eflags = ISC_ENTROPY_BLOCKING;
|
||||||
if (!pseudorandom)
|
if (!pseudorandom)
|
||||||
eflags |= ISC_ENTROPY_GOODONLY;
|
eflags |= ISC_ENTROPY_GOODONLY;
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dnssec-signzone.c,v 1.139 2001/07/22 06:09:41 mayer Exp $ */
|
/* $Id: dnssec-signzone.c,v 1.140 2001/09/05 23:15:40 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -1500,7 +1500,6 @@ main(int argc, char *argv[]) {
|
|||||||
int i, ch;
|
int i, ch;
|
||||||
char *startstr = NULL, *endstr = NULL, *classname = NULL;
|
char *startstr = NULL, *endstr = NULL, *classname = NULL;
|
||||||
char *origin = NULL, *file = NULL, *output = NULL;
|
char *origin = NULL, *file = NULL, *output = NULL;
|
||||||
char *randomfile = NULL;
|
|
||||||
char *endp;
|
char *endp;
|
||||||
isc_time_t timer_start, timer_finish;
|
isc_time_t timer_start, timer_finish;
|
||||||
signer_key_t *key;
|
signer_key_t *key;
|
||||||
@@ -1552,7 +1551,7 @@ main(int argc, char *argv[]) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
randomfile = isc_commandline_argument;
|
setup_entropy(mctx, isc_commandline_argument, &ectx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
@@ -1596,7 +1595,8 @@ main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_entropy(mctx, randomfile, &ectx);
|
if (ectx == NULL)
|
||||||
|
setup_entropy(mctx, NULL, &ectx);
|
||||||
eflags = ISC_ENTROPY_BLOCKING;
|
eflags = ISC_ENTROPY_BLOCKING;
|
||||||
if (!pseudorandom)
|
if (!pseudorandom)
|
||||||
eflags |= ISC_ENTROPY_GOODONLY;
|
eflags |= ISC_ENTROPY_GOODONLY;
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dnssectool.c,v 1.32 2001/09/05 22:32:05 bwelling Exp $ */
|
/* $Id: dnssectool.c,v 1.33 2001/09/05 23:15:42 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include <isc/buffer.h>
|
#include <isc/buffer.h>
|
||||||
#include <isc/entropy.h>
|
#include <isc/entropy.h>
|
||||||
|
#include <isc/list.h>
|
||||||
|
#include <isc/mem.h>
|
||||||
#include <isc/string.h>
|
#include <isc/string.h>
|
||||||
#include <isc/time.h>
|
#include <isc/time.h>
|
||||||
#include <isc/util.h>
|
#include <isc/util.h>
|
||||||
@@ -41,7 +43,15 @@
|
|||||||
extern int verbose;
|
extern int verbose;
|
||||||
extern const char *program;
|
extern const char *program;
|
||||||
|
|
||||||
static isc_entropysource_t *source = NULL;
|
typedef struct entropysource entropysource_t;
|
||||||
|
|
||||||
|
struct entropysource {
|
||||||
|
isc_entropysource_t *source;
|
||||||
|
isc_mem_t *mctx;
|
||||||
|
ISC_LINK(entropysource_t) link;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ISC_LIST(entropysource_t) sources;
|
||||||
static fatalcallback_t *fatalcallback = NULL;
|
static fatalcallback_t *fatalcallback = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -201,6 +211,8 @@ cleanup_logging(isc_log_t **logp) {
|
|||||||
void
|
void
|
||||||
setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
|
setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
isc_entropysource_t *source = NULL;
|
||||||
|
entropysource_t *elt;
|
||||||
int usekeyboard = ISC_ENTROPY_KEYBOARDMAYBE;
|
int usekeyboard = ISC_ENTROPY_KEYBOARDMAYBE;
|
||||||
|
|
||||||
REQUIRE(ectx != NULL);
|
REQUIRE(ectx != NULL);
|
||||||
@@ -209,6 +221,7 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
|
|||||||
result = isc_entropy_create(mctx, ectx);
|
result = isc_entropy_create(mctx, ectx);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
fatal("could not create entropy object");
|
fatal("could not create entropy object");
|
||||||
|
ISC_LIST_INIT(sources);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (randomfile != NULL && strcmp(randomfile, "keyboard") == 0) {
|
if (randomfile != NULL && strcmp(randomfile, "keyboard") == 0) {
|
||||||
@@ -222,12 +235,27 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
|
|||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
fatal("could not initialize entropy source: %s",
|
fatal("could not initialize entropy source: %s",
|
||||||
isc_result_totext(result));
|
isc_result_totext(result));
|
||||||
|
|
||||||
|
if (source != NULL) {
|
||||||
|
elt = isc_mem_get(mctx, sizeof *elt);
|
||||||
|
if (elt == NULL)
|
||||||
|
fatal("out of memory");
|
||||||
|
elt->source = source;
|
||||||
|
elt->mctx = mctx;
|
||||||
|
ISC_LINK_INIT(elt, link);
|
||||||
|
ISC_LIST_APPEND(sources, elt, link);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cleanup_entropy(isc_entropy_t **ectx) {
|
cleanup_entropy(isc_entropy_t **ectx) {
|
||||||
if (source != NULL)
|
entropysource_t *source;
|
||||||
isc_entropy_destroysource(&source);
|
while (!ISC_LIST_EMPTY(sources)) {
|
||||||
|
source = ISC_LIST_HEAD(sources);
|
||||||
|
ISC_LIST_UNLINK(sources, source, link);
|
||||||
|
isc_entropy_destroysource(&source->source);
|
||||||
|
isc_mem_put(source->mctx, source, sizeof *source);
|
||||||
|
}
|
||||||
isc_entropy_detach(ectx);
|
isc_entropy_detach(ectx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user