summaryrefslogtreecommitdiff
path: root/bin/dnssec/dnssec-signzone.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dnssec/dnssec-signzone.c')
-rw-r--r--bin/dnssec/dnssec-signzone.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c
index 86c3aee7095e9..d312bec27596c 100644
--- a/bin/dnssec/dnssec-signzone.c
+++ b/bin/dnssec/dnssec-signzone.c
@@ -1,5 +1,5 @@
/*
- * Portions Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -650,7 +650,7 @@ hashlist_add(hashlist_t *l, const unsigned char *hash, size_t len)
fatal("unable to grow hashlist: out of memory");
}
memset(l->hashbuf + l->entries * l->length, 0, l->length);
- memcpy(l->hashbuf + l->entries * l->length, hash, len);
+ memmove(l->hashbuf + l->entries * l->length, hash, len);
l->entries++;
}
@@ -665,7 +665,8 @@ hashlist_add_dns_name(hashlist_t *l, /*const*/ dns_name_t *name,
unsigned int len;
size_t i;
- len = isc_iterated_hash(hash, hashalg, iterations, salt, salt_length,
+ len = isc_iterated_hash(hash, hashalg, iterations,
+ salt, (int)salt_length,
name->ndata, name->length);
if (verbose) {
dns_name_format(name, nametext, sizeof nametext);
@@ -717,7 +718,7 @@ static const unsigned char *
hashlist_findnext(const hashlist_t *l,
const unsigned char hash[NSEC3_MAX_HASH_LENGTH])
{
- unsigned int entries = l->entries;
+ size_t entries = l->entries;
const unsigned char *next = bsearch(hash, l->hashbuf, l->entries,
l->length, hashlist_comp);
INSIST(next != NULL);
@@ -729,8 +730,8 @@ hashlist_findnext(const hashlist_t *l,
next = l->hashbuf;
if (next[l->length - 1] == 0)
break;
- } while (entries-- > 1);
- INSIST(entries != 0);
+ } while (entries-- > 1U);
+ INSIST(entries != 0U);
return (next);
}
@@ -1614,7 +1615,8 @@ verifyzone(void) {
fprintf(stderr, "No self signing KSK found. Using "
"self signed ZSK's for active "
"algorithm list.\n");
- memcpy(ksk_algorithms, self_algorithms, sizeof(ksk_algorithms));
+ memmove(ksk_algorithms, self_algorithms,
+ sizeof(ksk_algorithms));
if (!allzsksigned)
fprintf(stderr, "warning: not all ZSK's are self "
"signed.\n");
@@ -2234,7 +2236,7 @@ nsecify(void) {
static void
addnsec3param(const unsigned char *salt, size_t salt_length,
- unsigned int iterations)
+ dns_iterations_t iterations)
{
dns_dbnode_t *node = NULL;
dns_rdata_nsec3param_t nsec3param;
@@ -2254,7 +2256,7 @@ addnsec3param(const unsigned char *salt, size_t salt_length,
nsec3param.flags = 0;
nsec3param.hash = unknownalg ? DNS_NSEC3_UNKNOWNALG : dns_hash_sha1;
nsec3param.iterations = iterations;
- nsec3param.salt_length = salt_length;
+ nsec3param.salt_length = (unsigned char)salt_length;
DE_CONST(salt, nsec3param.salt);
isc_buffer_init(&b, nsec3parambuf, sizeof(nsec3parambuf));
@@ -2551,7 +2553,7 @@ remove_duplicates(void) {
* Generate NSEC3 records for the zone.
*/
static void
-nsec3ify(unsigned int hashalg, unsigned int iterations,
+nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
const unsigned char *salt, size_t salt_length, hashlist_t *hashlist)
{
dns_dbiterator_t *dbiter = NULL;
@@ -3082,7 +3084,7 @@ set_nsec3params(isc_boolean_t update_chain, isc_boolean_t set_salt,
"Use -u to update it.");
} else if (!set_salt) {
salt_length = orig_saltlen;
- memcpy(saltbuf, orig_salt, orig_saltlen);
+ memmove(saltbuf, orig_salt, orig_saltlen);
salt = saltbuf;
}