From: Evan Hunt Date: Fri, 25 Apr 2014 23:27:03 +0000 (-0700) Subject: [v9_10] revert so 9.10.0 can be tagged X-Git-Tag: v9.10.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bb45e9515f60f4ceaf9ecf1626eeafd7f3b2a59;p=thirdparty%2Fbind9.git [v9_10] revert so 9.10.0 can be tagged (changes for 9.10.1 were inadvertently committed early) --- diff --git a/CHANGES b/CHANGES index d2f2b109966..a0d032f2988 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,3 @@ -3819. [bug] NSEC3 hashes need to be able to be entered and - displayed without padding. This is not a issue for - currently defined algorithms but may be for future - hash algorithms. [RT #27925] - -3818. [bug] Stop lying to the optimizer that 'void *arg' is a - constant in isc_event_allocate. - --- 9.10.0rc2 released --- 3817. [func] The "delve" command is now spelled "delv" to avoid diff --git a/bin/tests/system/checkzone/zones/bad-nsec3-padded.db b/bin/tests/system/checkzone/zones/bad-nsec3-padded.db deleted file mode 100644 index adf26cd1f15..00000000000 --- a/bin/tests/system/checkzone/zones/bad-nsec3-padded.db +++ /dev/null @@ -1,24 +0,0 @@ -; Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") -; -; Permission to use, copy, modify, and/or distribute this software for any -; purpose with or without fee is hereby granted, provided that the above -; copyright notice and this permission notice appear in all copies. -; -; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -; PERFORMANCE OF THIS SOFTWARE. - -$TTL 600 -@ SOA ns hostmaster 2011012708 3600 1200 604800 1200 - NS ns -ns A 192.0.2.1 - -; The following NSEC3 RR is invalid as the Next Hashed Owner Name field -; is padded. See RFC 5155. -0p9mhaveqvm6t7vbl5lop2u3t2rp3tom NSEC3 1 1 12 aabbccdd ( - CPNMU=== MX DNSKEY NS - SOA NSEC3PARAM RRSIG ) diff --git a/bin/tests/system/checkzone/zones/bad-nsec3owner-padded.db b/bin/tests/system/checkzone/zones/bad-nsec3owner-padded.db deleted file mode 100644 index 0a0cf300746..00000000000 --- a/bin/tests/system/checkzone/zones/bad-nsec3owner-padded.db +++ /dev/null @@ -1,22 +0,0 @@ -; Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") -; -; Permission to use, copy, modify, and/or distribute this software for any -; purpose with or without fee is hereby granted, provided that the above -; copyright notice and this permission notice appear in all copies. -; -; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -; PERFORMANCE OF THIS SOFTWARE. - -$TTL 600 -@ SOA ns hostmaster 2011012708 3600 1200 604800 1200 - NS ns -ns A 192.0.2.1 - -; The following NSEC3 RR owner is invalid as the owner name is padded. -CPNMU=== NSEC3 2 1 12 aabbccdd ( CPNMU MX DNSKEY NS - SOA NSEC3PARAM RRSIG ) diff --git a/bin/tests/system/checkzone/zones/good-nsec3-nopadhash.db b/bin/tests/system/checkzone/zones/good-nsec3-nopadhash.db deleted file mode 100644 index 12155142764..00000000000 --- a/bin/tests/system/checkzone/zones/good-nsec3-nopadhash.db +++ /dev/null @@ -1,22 +0,0 @@ -; Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") -; -; Permission to use, copy, modify, and/or distribute this software for any -; purpose with or without fee is hereby granted, provided that the above -; copyright notice and this permission notice appear in all copies. -; -; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -; PERFORMANCE OF THIS SOFTWARE. - -$TTL 600 -@ SOA ns hostmaster 2011012708 3600 1200 604800 1200 - NS ns -ns A 192.0.2.1 - -; a hash that isn't a multiple of 8 characters -CPNMU NSEC3 2 1 12 aabbccdd ( CPNMU MX DNSKEY NS - SOA NSEC3PARAM RRSIG ) diff --git a/bin/tests/tasks/t_tasks.c b/bin/tests/tasks/t_tasks.c index 422b5cc3141..f6d67d36aed 100644 --- a/bin/tests/tasks/t_tasks.c +++ b/bin/tests/tasks/t_tasks.c @@ -88,13 +88,6 @@ my_tick(isc_task_t *task, isc_event_t *event) { * Adapted from RTH's original task_test program */ -static char one[] = "1"; -static char two[] = "2"; -static char three[] = "3"; -static char four[] = "4"; -static char tick[] = "tick"; -static char tock[] = "tock"; - static int t_tasks1(void) { char *p; @@ -165,25 +158,25 @@ t_tasks1(void) { return(T_FAIL); } - isc_result = isc_task_onshutdown(task1, t1_shutdown, one); + isc_result = isc_task_onshutdown(task1, t1_shutdown, "1"); if (isc_result != ISC_R_SUCCESS) { t_info("isc_task_onshutdown failed %d\n", isc_result); return(T_FAIL); } - isc_result = isc_task_onshutdown(task2, t1_shutdown, two); + isc_result = isc_task_onshutdown(task2, t1_shutdown, "2"); if (isc_result != ISC_R_SUCCESS) { t_info("isc_task_onshutdown failed %d\n", isc_result); return(T_FAIL); } - isc_result = isc_task_onshutdown(task3, t1_shutdown, three); + isc_result = isc_task_onshutdown(task3, t1_shutdown, "3"); if (isc_result != ISC_R_SUCCESS) { t_info("isc_task_onshutdown failed %d\n", isc_result); return(T_FAIL); } - isc_result = isc_task_onshutdown(task4, t1_shutdown, four); + isc_result = isc_task_onshutdown(task4, t1_shutdown, "4"); if (isc_result != ISC_R_SUCCESS) { t_info("isc_task_onshutdown failed %d\n", isc_result); return(T_FAIL); @@ -201,7 +194,7 @@ t_tasks1(void) { isc_interval_set(&interval, 1, 0); isc_result = isc_timer_create(timgr, isc_timertype_ticker, &absolute, &interval, - task1, my_tick, tick, &ti1); + task1, my_tick, "tick", &ti1); if (isc_result != ISC_R_SUCCESS) { t_info("isc_timer_create %d\n", isc_result); return(T_UNRESOLVED); @@ -212,7 +205,7 @@ t_tasks1(void) { isc_interval_set(&interval, 1, 0); isc_result = isc_timer_create(timgr, isc_timertype_ticker, &absolute, &interval, - task2, my_tick, tock, &ti2); + task2, my_tick, "tock", &ti2); if (isc_result != ISC_R_SUCCESS) { t_info("isc_timer_create %d\n", isc_result); return(T_UNRESOLVED); @@ -233,7 +226,7 @@ t_tasks1(void) { * structure (socket, timer, task, etc) but this is just a test * program. */ - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -242,7 +235,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -251,7 +244,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -260,7 +253,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -269,7 +262,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -278,7 +271,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -287,7 +280,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -296,7 +289,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -305,7 +298,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, one, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "1", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -314,7 +307,7 @@ t_tasks1(void) { isc_task_send(task1, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, two, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "2", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -323,7 +316,7 @@ t_tasks1(void) { isc_task_send(task2, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, three, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "3", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -332,7 +325,7 @@ t_tasks1(void) { isc_task_send(task3, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, four, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "4", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -341,7 +334,7 @@ t_tasks1(void) { isc_task_send(task4, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, two, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "2", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -350,7 +343,7 @@ t_tasks1(void) { isc_task_send(task2, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, three, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "3", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); @@ -359,7 +352,7 @@ t_tasks1(void) { isc_task_send(task3, &event); - event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, four, + event = isc_event_allocate(mctx, (void *)1, 1, t1_callback, "4", sizeof(*event)); if (event == NULL) { t_info("isc_event_allocate failed\n"); diff --git a/bin/tools/nsec3hash.c b/bin/tools/nsec3hash.c index 1a2a9558bf3..486037ff165 100644 --- a/bin/tools/nsec3hash.c +++ b/bin/tools/nsec3hash.c @@ -116,7 +116,7 @@ main(int argc, char **argv) { region.base = hash; region.length = length; isc_buffer_init(&buffer, text, sizeof(text)); - isc_base32hexnp_totext(®ion, 1, "", &buffer); + isc_base32hex_totext(®ion, 1, "", &buffer); fprintf(stdout, "%.*s (salt=%s, hash=%u, iterations=%u)\n", (int)isc_buffer_usedlength(&buffer), text, argv[1], hash_alg, iterations); return(0); diff --git a/lib/dns/master.c b/lib/dns/master.c index e6b1a0a8032..4b75843dea6 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -91,8 +91,6 @@ #define DNS_MASTER_LHS 2048 #define DNS_MASTER_RHS MINTSIZ -#define CHECKNAMESFAIL(x) (((x) & DNS_MASTER_CHECKNAMESFAIL) != 0) - typedef ISC_LIST(dns_rdatalist_t) rdatalist_head_t; typedef struct dns_incctx dns_incctx_t; @@ -1770,8 +1768,7 @@ load_text(dns_loadctx_t *lctx) { dns_name_format(name, namebuf, sizeof(namebuf)); result = DNS_R_BADOWNERNAME; desc = dns_result_totext(result); - if (CHECKNAMESFAIL(lctx->options) || - type == dns_rdatatype_nsec3) { + if ((lctx->options & DNS_MASTER_CHECKNAMESFAIL) != 0) { (*callbacks->error)(callbacks, "%s:%lu: %s: %s", source, line, diff --git a/lib/dns/message.c b/lib/dns/message.c index a062e951ba3..5137cb11d9b 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -1381,16 +1381,6 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, } else covers = 0; - /* - * Check the ownername of NSEC3 records - */ - if (rdtype == dns_rdatatype_nsec3 && - !dns_rdata_checkowner(name, msg->rdclass, rdtype, - ISC_FALSE)) { - result = DNS_R_BADOWNERNAME; - goto cleanup; - } - /* * If we are doing a dynamic update or this is a meta-type, * don't bother searching for a name, just append this one diff --git a/lib/dns/nsec3.c b/lib/dns/nsec3.c index e66cc5a56fa..00ccf0e7eb0 100644 --- a/lib/dns/nsec3.c +++ b/lib/dns/nsec3.c @@ -253,11 +253,11 @@ dns_nsec3_hashname(dns_fixedname_t *result, if (hash_length != NULL) *hash_length = len; - /* convert the hash to base32hex non-padded */ + /* convert the hash to base32hex */ region.base = rethash; region.length = (unsigned int)len; isc_buffer_init(&namebuffer, nametext, sizeof nametext); - isc_base32hexnp_totext(®ion, 1, "", &namebuffer); + isc_base32hex_totext(®ion, 1, "", &namebuffer); /* convert the hex to a domain name */ dns_fixedname_init(result); @@ -269,8 +269,7 @@ unsigned int dns_nsec3_hashlength(dns_hash_t hash) { switch (hash) { - case dns_hash_sha1: - return(ISC_SHA1_DIGESTLENGTH); + case dns_hash_sha1: return(ISC_SHA1_DIGESTLENGTH); } return (0); } @@ -278,8 +277,7 @@ dns_nsec3_hashlength(dns_hash_t hash) { isc_boolean_t dns_nsec3_supportedhash(dns_hash_t hash) { switch (hash) { - case dns_hash_sha1: - return (ISC_TRUE); + case dns_hash_sha1: return (ISC_TRUE); } return (ISC_FALSE); } diff --git a/lib/dns/rdata/generic/nsec3_50.c b/lib/dns/rdata/generic/nsec3_50.c index 35fcf5d5822..19b94efa06d 100644 --- a/lib/dns/rdata/generic/nsec3_50.c +++ b/lib/dns/rdata/generic/nsec3_50.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009, 2011, 2012, 2014 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2008, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -100,7 +100,7 @@ fromtext_nsec3(ARGS_FROMTEXT) { RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); isc_buffer_init(&b, bm, sizeof(bm)); - RETTOK(isc_base32hexnp_decodestring(DNS_AS_STR(token), &b)); + RETTOK(isc_base32hex_decodestring(DNS_AS_STR(token), &b)); if (isc_buffer_usedlength(&b) > 0xffU) RETTOK(ISC_R_RANGE); RETERR(uint8_tobuffer(isc_buffer_usedlength(&b), target)); @@ -191,7 +191,7 @@ totext_nsec3(ARGS_TOTEXT) { i = sr.length; sr.length = j; - RETERR(isc_base32hexnp_totext(&sr, 1, "", target)); + RETERR(isc_base32hex_totext(&sr, 1, "", target)); sr.length = i - j; if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) == 0) @@ -474,26 +474,15 @@ digest_nsec3(ARGS_DIGEST) { static inline isc_boolean_t checkowner_nsec3(ARGS_CHECKOWNER) { - unsigned char owner[NSEC3_MAX_HASH_LENGTH]; - isc_buffer_t buffer; - dns_label_t label; - REQUIRE(type == 50); - - UNUSED(type); - UNUSED(rdclass); - UNUSED(wildcard); + REQUIRE(type == 50); - /* - * First label is a base32hex string without padding. - */ - dns_name_getlabel(name, 0, &label); - isc_region_consume(&label, 1); - isc_buffer_init(&buffer, owner, sizeof(owner)); - if (isc_base32hexnp_decoderegion(&label, &buffer) == ISC_R_SUCCESS) - return (ISC_TRUE); + UNUSED(name); + UNUSED(type); + UNUSED(rdclass); + UNUSED(wildcard); - return (ISC_FALSE); + return (ISC_TRUE); } static inline isc_boolean_t diff --git a/lib/dns/time.c b/lib/dns/time.c index b3d2c2d0844..d331ca3bfe1 100644 --- a/lib/dns/time.c +++ b/lib/dns/time.c @@ -35,7 +35,7 @@ #include #include -static const int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +static int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; isc_result_t dns_time64_totext(isc_int64_t t, isc_buffer_t *target) { diff --git a/lib/dns/validator.c b/lib/dns/validator.c index 6e09762f60e..9985e62ca6d 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -336,7 +336,7 @@ isdelegation(dns_name_t *name, dns_rdataset_t *rdataset, dns_name_getlabel(&nsec3name, 0, &hashlabel); isc_region_consume(&hashlabel, 1); isc_buffer_init(&buffer, owner, sizeof(owner)); - result = isc_base32hexnp_decoderegion(&hashlabel, &buffer); + result = isc_base32hex_decoderegion(&hashlabel, &buffer); if (result != ISC_R_SUCCESS) { dns_rdataset_disassociate(&set); continue; diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 279a3304040..c90488ed8a2 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -16242,12 +16242,10 @@ dns_zone_checknames(dns_zone_t *zone, dns_name_t *name, dns_rdata_t *rdata) { REQUIRE(DNS_ZONE_VALID(zone)); - if (!DNS_ZONE_OPTION(zone, DNS_ZONEOPT_CHECKNAMES) && - rdata->type != dns_rdatatype_nsec3) + if (!DNS_ZONE_OPTION(zone, DNS_ZONEOPT_CHECKNAMES)) return (ISC_R_SUCCESS); - if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_CHECKNAMESFAIL) || - rdata->type == dns_rdatatype_nsec3) { + if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_CHECKNAMESFAIL)) { level = ISC_LOG_ERROR; fail = ISC_TRUE; } diff --git a/lib/isc/base32.c b/lib/isc/base32.c index 2ee99b18242..ad0b0da569e 100644 --- a/lib/isc/base32.c +++ b/lib/isc/base32.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: base32.c,v 1.6.698.1 2012/02/15 05:00:16 marka Exp $ */ +/* $Id: base32.c,v 1.6 2009/10/21 01:22:29 each Exp $ */ /*! \file */ @@ -54,7 +54,7 @@ static const char base32hex[] = static isc_result_t base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, - isc_buffer_t *target, const char base[], char pad) + isc_buffer_t *target, const char base[]) { char buf[9]; unsigned int loops = 0; @@ -67,8 +67,8 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, buf[0] = base[((source->base[0]>>3)&0x1f)]; /* 5 + */ if (source->length == 1) { buf[1] = base[(source->base[0]<<2)&0x1c]; - buf[2] = buf[3] = buf[4] = pad; - buf[5] = buf[6] = buf[7] = pad; + buf[2] = buf[3] = buf[4] = '='; + buf[5] = buf[6] = buf[7] = '='; RETERR(str_totext(buf, target)); break; } @@ -77,7 +77,7 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, buf[2] = base[((source->base[1]>>1)&0x1f)]; /* 5 + */ if (source->length == 2) { buf[3] = base[(source->base[1]<<4)&0x10]; - buf[4] = buf[5] = buf[6] = buf[7] = pad; + buf[4] = buf[5] = buf[6] = buf[7] = '='; RETERR(str_totext(buf, target)); break; } @@ -85,7 +85,7 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, ((source->base[2]>>4)&0x0f)]; /* 4 + */ if (source->length == 3) { buf[4] = base[(source->base[2]<<1)&0x1e]; - buf[5] = buf[6] = buf[7] = pad; + buf[5] = buf[6] = buf[7] = '='; RETERR(str_totext(buf, target)); break; } @@ -94,7 +94,7 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, buf[5] = base[((source->base[3]>>2)&0x1f)]; /* 5 + */ if (source->length == 4) { buf[6] = base[(source->base[3]<<3)&0x18]; - buf[7] = pad; + buf[7] = '='; RETERR(str_totext(buf, target)); break; } @@ -121,8 +121,7 @@ isc_result_t isc_base32_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target) { - return (base32_totext(source, wordlength, wordbreak, target, - base32, '=')); + return (base32_totext(source, wordlength, wordbreak, target, base32)); } isc_result_t @@ -130,15 +129,7 @@ isc_base32hex_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target) { return (base32_totext(source, wordlength, wordbreak, target, - base32hex, '=')); -} - -isc_result_t -isc_base32hexnp_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target) -{ - return (base32_totext(source, wordlength, wordbreak, target, - base32hex, 0)); + base32hex)); } /*% @@ -152,12 +143,11 @@ typedef struct { int val[8]; const char *base; /*%< Which encoding we are using */ int seen_32; /*%< Number of significant bytes if non zero */ - isc_boolean_t pad; /*%< Expect padding */ } base32_decode_ctx_t; static inline void -base32_decode_init(base32_decode_ctx_t *ctx, int length, const char base[], - isc_boolean_t pad, isc_buffer_t *target) +base32_decode_init(base32_decode_ctx_t *ctx, int length, + const char base[], isc_buffer_t *target) { ctx->digits = 0; ctx->seen_end = ISC_FALSE; @@ -165,7 +155,6 @@ base32_decode_init(base32_decode_ctx_t *ctx, int length, const char base[], ctx->length = length; ctx->target = target; ctx->base = base; - ctx->pad = pad; } static inline isc_result_t @@ -178,25 +167,16 @@ base32_decode_char(base32_decode_ctx_t *ctx, int c) { if ((s = strchr(ctx->base, c)) == NULL) return (ISC_R_BADBASE32); last = (unsigned int)(s - ctx->base); - /* * Handle lower case. */ if (last > 32) last -= 33; - /* * Check that padding is contiguous. */ if (last != 32 && ctx->seen_32 != 0) return (ISC_R_BADBASE32); - - /* - * If padding is not permitted flag padding as a error. - */ - if (last == 32 && !ctx->pad) - return (ISC_R_BADBASE32); - /* * Check that padding starts at the right place and that * bits that should be zero are. @@ -232,7 +212,6 @@ base32_decode_char(base32_decode_ctx_t *ctx, int c) { ctx->seen_32 = 4; break; } - /* * Zero fill pad values. */ @@ -265,33 +244,23 @@ base32_decode_char(base32_decode_ctx_t *ctx, int c) { static inline isc_result_t base32_decode_finish(base32_decode_ctx_t *ctx) { - if (ctx->length > 0) return (ISC_R_UNEXPECTEDEND); - /* - * Add missing padding if required. - */ - if (!ctx->pad && ctx->digits != 0) { - ctx->pad = ISC_TRUE; - do { - RETERR(base32_decode_char(ctx, '=')); - } while (ctx->digits != 0); - } if (ctx->digits != 0) return (ISC_R_BADBASE32); return (ISC_R_SUCCESS); } static isc_result_t -base32_tobuffer(isc_lex_t *lexer, const char base[], isc_boolean_t pad, - isc_buffer_t *target, int length) +base32_tobuffer(isc_lex_t *lexer, const char base[], isc_buffer_t *target, + int length) { base32_decode_ctx_t ctx; isc_textregion_t *tr; isc_token_t token; isc_boolean_t eol; - base32_decode_init(&ctx, length, base, pad, target); + base32_decode_init(&ctx, length, base, target); while (!ctx.seen_end && (ctx.length != 0)) { unsigned int i; @@ -316,26 +285,19 @@ base32_tobuffer(isc_lex_t *lexer, const char base[], isc_boolean_t pad, isc_result_t isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { - return (base32_tobuffer(lexer, base32, ISC_TRUE, target, length)); + return (base32_tobuffer(lexer, base32, target, length)); } isc_result_t isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { - return (base32_tobuffer(lexer, base32hex, ISC_TRUE, target, length)); -} - -isc_result_t -isc_base32hexnp_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { - return (base32_tobuffer(lexer, base32hex, ISC_FALSE, target, length)); + return (base32_tobuffer(lexer, base32hex, target, length)); } static isc_result_t -base32_decodestring(const char *cstr, const char base[], isc_boolean_t pad, - isc_buffer_t *target) -{ +base32_decodestring(const char *cstr, const char base[], isc_buffer_t *target) { base32_decode_ctx_t ctx; - base32_decode_init(&ctx, -1, base, pad, target); + base32_decode_init(&ctx, -1, base, target); for (;;) { int c = *cstr++; if (c == '\0') @@ -350,26 +312,19 @@ base32_decodestring(const char *cstr, const char base[], isc_boolean_t pad, isc_result_t isc_base32_decodestring(const char *cstr, isc_buffer_t *target) { - return (base32_decodestring(cstr, base32, ISC_TRUE, target)); + return (base32_decodestring(cstr, base32, target)); } isc_result_t isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target) { - return (base32_decodestring(cstr, base32hex, ISC_TRUE, target)); -} - -isc_result_t -isc_base32hexnp_decodestring(const char *cstr, isc_buffer_t *target) { - return (base32_decodestring(cstr, base32hex, ISC_FALSE, target)); + return (base32_decodestring(cstr, base32hex, target)); } static isc_result_t -base32_decoderegion(isc_region_t *source, const char base[], - isc_boolean_t pad, isc_buffer_t *target) -{ +base32_decoderegion(isc_region_t *source, const char base[], isc_buffer_t *target) { base32_decode_ctx_t ctx; - base32_decode_init(&ctx, -1, base, pad, target); + base32_decode_init(&ctx, -1, base, target); while (source->length != 0) { int c = *source->base; RETERR(base32_decode_char(&ctx, c)); @@ -381,17 +336,12 @@ base32_decoderegion(isc_region_t *source, const char base[], isc_result_t isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target) { - return (base32_decoderegion(source, base32, ISC_TRUE, target)); + return (base32_decoderegion(source, base32, target)); } isc_result_t isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target) { - return (base32_decoderegion(source, base32hex, ISC_TRUE, target)); -} - -isc_result_t -isc_base32hexnp_decoderegion(isc_region_t *source, isc_buffer_t *target) { - return (base32_decoderegion(source, base32hex, ISC_FALSE, target)); + return (base32_decoderegion(source, base32hex, target)); } static isc_result_t diff --git a/lib/isc/event.c b/lib/isc/event.c index 895e3d82fe8..8ab75240dca 100644 --- a/lib/isc/event.c +++ b/lib/isc/event.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -41,26 +41,7 @@ destroy(isc_event_t *event) { isc_event_t * isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type, - isc_taskaction_t action, void *arg, size_t size) -{ - isc_event_t *event; - - REQUIRE(size >= sizeof(struct isc_event)); - REQUIRE(action != NULL); - - event = isc_mem_get(mctx, size); - if (event == NULL) - return (NULL); - - ISC_EVENT_INIT(event, size, 0, NULL, type, action, arg, - sender, destroy, mctx); - - return (event); -} - -isc_event_t * -isc_event_constallocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type, - isc_taskaction_t action, const void *arg, size_t size) + isc_taskaction_t action, const void *arg, size_t size) { isc_event_t *event; void *deconst_arg; diff --git a/lib/isc/include/isc/base32.h b/lib/isc/include/isc/base32.h index 347b8ed40a0..978a8db463a 100644 --- a/lib/isc/include/isc/base32.h +++ b/lib/isc/include/isc/base32.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2014 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,6 +14,8 @@ * PERFORMANCE OF THIS SOFTWARE. */ +/* $Id: base32.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */ + #ifndef ISC_BASE32_H #define ISC_BASE32_H 1 @@ -25,8 +27,6 @@ * * Base 32 hex preserves the sort order of data when it is encoded / * decoded. - * - * Base 32 hex "np" is base 32 hex but no padding is produced or accepted. */ #include @@ -44,9 +44,6 @@ isc_base32_totext(isc_region_t *source, int wordlength, isc_result_t isc_base32hex_totext(isc_region_t *source, int wordlength, const char *wordbreak, isc_buffer_t *target); -isc_result_t -isc_base32hexnp_totext(isc_region_t *source, int wordlength, - const char *wordbreak, isc_buffer_t *target); /*!< * \brief Convert data into base32 encoded text. * @@ -72,11 +69,8 @@ isc_result_t isc_base32_decodestring(const char *cstr, isc_buffer_t *target); isc_result_t isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target); -isc_result_t -isc_base32hexnp_decodestring(const char *cstr, isc_buffer_t *target); /*!< - * \brief Decode a null-terminated string in base32, base32hex, or - * base32hex non-padded. + * \brief Decode a null-terminated base32 string. * * Requires: *\li 'cstr' is non-null. @@ -97,11 +91,8 @@ isc_result_t isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); isc_result_t isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); -isc_result_t -isc_base32hexnp_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); /*!< - * \brief Convert text encoded in base32, base32hex, or base32hex - * non-padded from a lexer context into data. + * \brief Convert base32 encoded text from a lexer context into data. * * Requires: *\li 'lex' is a valid lexer context @@ -119,11 +110,8 @@ isc_result_t isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target); isc_result_t isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target); -isc_result_t -isc_base32hexnp_decoderegion(isc_region_t *source, isc_buffer_t *target); /*!< - * \brief Decode a packed (no white space permitted) region in - * base32, base32hex or base32hex non-padded. + * \brief Decode a packed (no white space permitted) base32 region. * * Requires: *\li 'source' is a valid region. diff --git a/lib/isc/include/isc/event.h b/lib/isc/include/isc/event.h index 38206f53b9c..68fabb2fcc3 100644 --- a/lib/isc/include/isc/event.h +++ b/lib/isc/include/isc/event.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007, 2014 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -90,12 +90,9 @@ ISC_LANG_BEGINDECLS isc_event_t * isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type, - isc_taskaction_t action, void *arg, size_t size); -isc_event_t * -isc_event_constallocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type, - isc_taskaction_t action, const void *arg, size_t size); + isc_taskaction_t action, const void *arg, size_t size); /*%< - * Allocate an event structure. + * Allocate an event structure. * * Allocate and initialize in a structure with initial elements * defined by: @@ -106,7 +103,7 @@ isc_event_constallocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type, * ... * }; * \endcode - * + * * Requires: *\li 'size' >= sizeof(struct isc_event) *\li 'action' to be non NULL diff --git a/lib/isc/include/isc/socket.h b/lib/isc/include/isc/socket.h index 2d2285b7c86..9f2916ceb80 100644 --- a/lib/isc/include/isc/socket.h +++ b/lib/isc/include/isc/socket.h @@ -347,7 +347,7 @@ typedef struct isc_socketmethods { unsigned int options); isc_result_t (*sendto)(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_taskaction_t action, - void *arg, isc_sockaddr_t *address, + const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); isc_result_t (*sendto2)(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_sockaddr_t *address, @@ -356,10 +356,10 @@ typedef struct isc_socketmethods { unsigned int flags); isc_result_t (*connect)(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task, isc_taskaction_t action, - void *arg); + const void *arg); isc_result_t (*recv)(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg); + isc_taskaction_t action, const void *arg); isc_result_t (*recv2)(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_socketevent_t *event, unsigned int flags); @@ -742,7 +742,7 @@ isc_socket_listen(isc_socket_t *sock, unsigned int backlog); isc_result_t isc_socket_accept(isc_socket_t *sock, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); /*%< * Queue accept event. When a new connection is received, the task will * get an ISC_SOCKEVENT_NEWCONN event with the sender set to the listen @@ -766,7 +766,7 @@ isc_socket_accept(isc_socket_t *sock, isc_result_t isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addressp, isc_task_t *task, isc_taskaction_t action, - void *arg); + const void *arg); /*%< * Connect 'socket' to peer with address *saddr. When the connection * succeeds, or when an error occurs, a CONNECT event with action 'action' @@ -833,11 +833,11 @@ isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp); isc_result_t isc_socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, unsigned int minimum, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_recv2(isc_socket_t *sock, isc_region_t *region, @@ -920,21 +920,21 @@ isc_socket_recv2(isc_socket_t *sock, isc_region_t *region, /*@{*/ isc_result_t isc_socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); isc_result_t isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); isc_result_t isc_socket_sendtov2(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, unsigned int flags); isc_result_t @@ -1154,7 +1154,7 @@ isc_socket_dscp(isc_socket_t *sock, isc_dscp_t dscp); isc_socketevent_t * isc_socket_socketevent(isc_mem_t *mctx, void *sender, isc_eventtype_t eventtype, isc_taskaction_t action, - void *arg); + const void *arg); /*%< * Get a isc_socketevent_t to be used with isc_socket_sendto2(), etc. */ diff --git a/lib/isc/include/isc/task.h b/lib/isc/include/isc/task.h index 1127547b844..2293237b287 100644 --- a/lib/isc/include/isc/task.h +++ b/lib/isc/include/isc/task.h @@ -129,7 +129,7 @@ typedef struct isc_taskmethods { unsigned int (*unsend)(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag, isc_eventlist_t *events); isc_result_t (*onshutdown)(isc_task_t *task, isc_taskaction_t action, - void *arg); + const void *arg); void (*shutdown)(isc_task_t *task); void (*setname)(isc_task_t *task, const char *name, void *tag); unsigned int (*purgeevents)(isc_task_t *task, void *sender, @@ -442,7 +442,7 @@ isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, isc_result_t isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, - void *arg); + const void *arg); /*%< * Send a shutdown event with action 'action' and argument 'arg' when * 'task' is shutdown. diff --git a/lib/isc/include/isc/timer.h b/lib/isc/include/isc/timer.h index 361e3d12359..f3c74a77cc3 100644 --- a/lib/isc/include/isc/timer.h +++ b/lib/isc/include/isc/timer.h @@ -113,7 +113,7 @@ typedef struct { const isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, - void *arg, + const void *arg, isc_timer_t **timerp); } isc_timermgrmethods_t; @@ -174,7 +174,7 @@ isc_timer_create(isc_timermgr_t *manager, const isc_interval_t *interval, isc_task_t *task, isc_taskaction_t action, - void *arg, + const void *arg, isc_timer_t **timerp); /*%< * Create a new 'type' timer managed by 'manager'. The timers parameters diff --git a/lib/isc/socket_api.c b/lib/isc/socket_api.c index 6691f2211a6..546937560cc 100644 --- a/lib/isc/socket_api.c +++ b/lib/isc/socket_api.c @@ -149,7 +149,7 @@ isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr, isc_result_t isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, - isc_taskaction_t action, void *arg, + isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { REQUIRE(ISCAPI_SOCKET_VALID(sock)); @@ -164,7 +164,7 @@ isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_task_t *task, isc_result_t isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task, - isc_taskaction_t action, void *arg) + isc_taskaction_t action, const void *arg) { REQUIRE(ISCAPI_SOCKET_VALID(sock)); @@ -176,7 +176,7 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task, isc_result_t isc_socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { REQUIRE(ISCAPI_SOCKET_VALID(sock)); @@ -312,7 +312,7 @@ isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp, isc_result_t isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg) + isc_taskaction_t action, const void *arg) { return (isc__socket_recvv(sock, buflist, minimum, task, action, arg)); } @@ -327,21 +327,21 @@ isc_socket_recv2(isc_socket_t *sock, isc_region_t *region, isc_result_t isc_socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { return (isc__socket_send(sock, region, task, action, arg)); } isc_result_t isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { return (isc__socket_sendv(sock, buflist, task, action, arg)); } isc_result_t isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { return (isc__socket_sendtov(sock, buflist, task, action, arg, @@ -350,7 +350,7 @@ isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_result_t isc_socket_sendtov2(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, unsigned int flags) { @@ -392,7 +392,7 @@ isc_socket_listen(isc_socket_t *sock, unsigned int backlog) { isc_result_t isc_socket_accept(isc_socket_t *sock, isc_task_t *task, - isc_taskaction_t action, void *arg) + isc_taskaction_t action, const void *arg) { return (isc__socket_accept(sock, task, action, arg)); } diff --git a/lib/isc/task.c b/lib/isc/task.c index fff6b884eaf..0a4e80a4f02 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -207,7 +207,7 @@ isc__task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag, isc_eventlist_t *events); isc_result_t isc__task_onshutdown(isc_task_t *task0, isc_taskaction_t action, - void *arg); + const void *arg); void isc__task_shutdown(isc_task_t *task0); void @@ -798,7 +798,7 @@ isc__task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, isc_result_t isc__task_onshutdown(isc_task_t *task0, isc_taskaction_t action, - void *arg) + const void *arg) { isc__task_t *task = (isc__task_t *)task0; isc_boolean_t disallowed = ISC_FALSE; @@ -2163,7 +2163,7 @@ isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type, } isc_result_t -isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, void *arg) +isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, const void *arg) { REQUIRE(ISCAPI_TASK_VALID(task)); diff --git a/lib/isc/timer.c b/lib/isc/timer.c index 729be1c58d7..c28851565b4 100644 --- a/lib/isc/timer.c +++ b/lib/isc/timer.c @@ -126,7 +126,7 @@ struct isc__timermgr { isc_result_t isc__timer_create(isc_timermgr_t *manager, isc_timertype_t type, const isc_time_t *expires, const isc_interval_t *interval, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp); isc_result_t isc__timer_reset(isc_timer_t *timer, isc_timertype_t type, @@ -378,7 +378,7 @@ destroy(isc__timer_t *timer) { isc_result_t isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type, const isc_time_t *expires, const isc_interval_t *interval, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp) { isc__timermgr_t *manager = (isc__timermgr_t *)manager0; @@ -1130,7 +1130,7 @@ isc_timermgr_destroy(isc_timermgr_t **managerp) { isc_result_t isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type, const isc_time_t *expires, const isc_interval_t *interval, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_timer_t **timerp) { REQUIRE(ISCAPI_TIMERMGR_VALID(manager)); diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 0dd5bbce5e8..e111c74a051 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -503,32 +503,32 @@ isc__socket_detach(isc_socket_t **socketp); isc_result_t isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg); + isc_taskaction_t action, const void *arg); isc_result_t isc__socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg); + isc_taskaction_t action, const void *arg); isc_result_t isc__socket_recv2(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, isc_socketevent_t *event, unsigned int flags); isc_result_t isc__socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc__socket_sendto(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); isc_result_t isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo); isc_result_t isc__socket_sendtov2(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, unsigned int flags); isc_result_t @@ -539,7 +539,7 @@ isc__socket_sendto2(isc_socket_t *sock, isc_region_t *region, isc_socketevent_t * isc_socket_socketevent(isc_mem_t *mctx, void *sender, isc_eventtype_t eventtype, isc_taskaction_t action, - void *arg); + const void *arg); void isc__socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active); @@ -555,11 +555,11 @@ isc_result_t isc__socket_listen(isc_socket_t *sock, unsigned int backlog); isc_result_t isc__socket_accept(isc_socket_t *sock, - isc_task_t *task, isc_taskaction_t action, void *arg); + isc_task_t *task, isc_taskaction_t action, const void *arg); isc_result_t isc__socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task, isc_taskaction_t action, - void *arg); + const void *arg); isc_result_t isc__socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp); isc_result_t @@ -1770,7 +1770,7 @@ destroy_socketevent(isc_event_t *event) { static isc_socketevent_t * allocate_socketevent(isc_mem_t *mctx, void *sender, isc_eventtype_t eventtype, isc_taskaction_t action, - void *arg) + const void *arg) { isc_socketevent_t *ev; @@ -4829,7 +4829,7 @@ socket_recv(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, isc_result_t isc__socket_recvv(isc_socket_t *sock0, isc_bufferlist_t *buflist, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg) + isc_taskaction_t action, const void *arg) { isc__socket_t *sock = (isc__socket_t *)sock0; isc_socketevent_t *dev; @@ -4884,7 +4884,7 @@ isc__socket_recvv(isc_socket_t *sock0, isc_bufferlist_t *buflist, isc_result_t isc__socket_recv(isc_socket_t *sock0, isc_region_t *region, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg) + isc_taskaction_t action, const void *arg) { isc__socket_t *sock = (isc__socket_t *)sock0; isc_socketevent_t *dev; @@ -5030,7 +5030,7 @@ socket_send(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, isc_result_t isc__socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { /* * REQUIRE() checking is performed in isc_socket_sendto(). @@ -5041,7 +5041,7 @@ isc__socket_send(isc_socket_t *sock, isc_region_t *region, isc_result_t isc__socket_sendto(isc_socket_t *sock0, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { isc__socket_t *sock = (isc__socket_t *)sock0; @@ -5070,7 +5070,7 @@ isc__socket_sendto(isc_socket_t *sock0, isc_region_t *region, isc_result_t isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { return (isc__socket_sendtov2(sock, buflist, task, action, arg, NULL, NULL, 0)); @@ -5078,7 +5078,7 @@ isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_result_t isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { return (isc__socket_sendtov2(sock, buflist, task, action, arg, address, @@ -5087,7 +5087,7 @@ isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_result_t isc__socket_sendtov2(isc_socket_t *sock0, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, unsigned int flags) { @@ -5487,7 +5487,7 @@ isc__socket_listen(isc_socket_t *sock0, unsigned int backlog) { */ isc_result_t isc__socket_accept(isc_socket_t *sock0, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { isc__socket_t *sock = (isc__socket_t *)sock0; isc_socket_newconnev_t *dev; @@ -5562,7 +5562,7 @@ isc__socket_accept(isc_socket_t *sock0, isc_result_t isc__socket_connect(isc_socket_t *sock0, isc_sockaddr_t *addr, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { isc__socket_t *sock = (isc__socket_t *)sock0; isc_socket_connev_t *dev; @@ -6131,7 +6131,7 @@ isc__socket_dscp(isc_socket_t *sock0, isc_dscp_t dscp) { isc_socketevent_t * isc_socket_socketevent(isc_mem_t *mctx, void *sender, isc_eventtype_t eventtype, isc_taskaction_t action, - void *arg) + const void *arg) { return (allocate_socketevent(mctx, sender, eventtype, action, arg)); } diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index 0c694b2b08b..aa347bba792 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -1071,7 +1071,7 @@ destroy_socketevent(isc_event_t *event) { static isc_socketevent_t * allocate_socketevent(isc_mem_t *mctx, isc_socket_t *sock, isc_eventtype_t eventtype, isc_taskaction_t action, - void *arg) + const void *arg) { isc_socketevent_t *ev; @@ -2833,7 +2833,7 @@ socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, isc_result_t isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg) + isc_taskaction_t action, const void *arg) { isc_socketevent_t *dev; isc_socketmgr_t *manager; @@ -2904,7 +2904,7 @@ isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_result_t isc__socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum, isc_task_t *task, - isc_taskaction_t action, void *arg) + isc_taskaction_t action, const void *arg) { isc_socketevent_t *dev; isc_socketmgr_t *manager; @@ -3053,7 +3053,7 @@ socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task, isc_result_t isc__socket_send(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { /* * REQUIRE() checking is performed in isc_socket_sendto(). @@ -3064,7 +3064,7 @@ isc__socket_send(isc_socket_t *sock, isc_region_t *region, isc_result_t isc__socket_sendto(isc_socket_t *sock, isc_region_t *region, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { isc_socketevent_t *dev; @@ -3108,7 +3108,7 @@ isc__socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_result_t isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { return (isc_socket_sendtov2(sock, buflist, task, action, arg, NULL, NULL, 0)); @@ -3116,7 +3116,7 @@ isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_result_t isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo) { return (isc_socket_sendtov2(sock, buflist, task, action, arg, address, @@ -3125,7 +3125,7 @@ isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist, isc_result_t isc__socket_sendtov2(isc_socket_t *sock, isc_bufferlist_t *buflist, - isc_task_t *task, isc_taskaction_t action, void *arg, + isc_task_t *task, isc_taskaction_t action, const void *arg, isc_sockaddr_t *address, struct in6_pktinfo *pktinfo, unsigned int flags) { @@ -3348,7 +3348,7 @@ isc__socket_listen(isc_socket_t *sock, unsigned int backlog) { */ isc_result_t isc__socket_accept(isc_socket_t *sock, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { isc_socket_newconnev_t *adev; isc_socketmgr_t *manager; @@ -3466,7 +3466,7 @@ isc__socket_accept(isc_socket_t *sock, isc_result_t isc__socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, - isc_task_t *task, isc_taskaction_t action, void *arg) + isc_task_t *task, isc_taskaction_t action, const void *arg) { char strbuf[ISC_STRERRORSIZE]; isc_socket_connev_t *cdev; @@ -3936,7 +3936,7 @@ isc___socketmgr_maxudp(isc_socketmgr_t *manager, int maxudp) { isc_socketevent_t * isc_socket_socketevent(isc_mem_t *mctx, void *sender, isc_eventtype_t eventtype, isc_taskaction_t action, - void *arg) + const void *arg) { return (allocate_socketevent(mctx, sender, eventtype, action, arg)); } diff --git a/util/copyrights b/util/copyrights index 1c04481f345..aba9b617b8e 100644 --- a/util/copyrights +++ b/util/copyrights @@ -928,11 +928,8 @@ ./bin/tests/system/checkzone/clean.sh SH 2011,2012,2013,2014 ./bin/tests/system/checkzone/setup.sh SH 2014 ./bin/tests/system/checkzone/tests.sh SH 2011,2012,2013,2014 -./bin/tests/system/checkzone/zones/bad-nsec3-padded.db ZONE 2014 -./bin/tests/system/checkzone/zones/bad-nsec3owner-padded.db ZONE 2014 ./bin/tests/system/checkzone/zones/bad1.db ZONE 2013 ./bin/tests/system/checkzone/zones/bad2.db ZONE 2014 -./bin/tests/system/checkzone/zones/good-nsec3-nopadhash.db ZONE 2014 ./bin/tests/system/checkzone/zones/good1.db ZONE 2011 ./bin/tests/system/checkzone/zones/spf.db ZONE 2013 ./bin/tests/system/checkzone/zones/test1.db ZONE 2013 @@ -3103,7 +3100,7 @@ ./lib/dns/rdata/generic/nid_104.h C 2013 ./lib/dns/rdata/generic/ns_2.c C 1998,1999,2000,2001,2004,2007,2009 ./lib/dns/rdata/generic/ns_2.h C 1998,1999,2000,2001,2004,2005,2007 -./lib/dns/rdata/generic/nsec3_50.c C 2008,2009,2011,2012,2014 +./lib/dns/rdata/generic/nsec3_50.c C 2008,2009,2011,2012 ./lib/dns/rdata/generic/nsec3_50.h C 2008,2011,2012 ./lib/dns/rdata/generic/nsec3param_51.c C 2008,2009 ./lib/dns/rdata/generic/nsec3param_51.h C 2008 @@ -3329,7 +3326,7 @@ ./lib/isc/crc64.c C 2013 ./lib/isc/entropy.c C 2000,2001,2002,2003,2004,2005,2006,2007,2009,2010,2014 ./lib/isc/error.c C 1998,1999,2000,2001,2004,2005,2007 -./lib/isc/event.c C 1998,1999,2000,2001,2004,2005,2007,2014 +./lib/isc/event.c C 1998,1999,2000,2001,2004,2005,2007 ./lib/isc/fsaccess.c C 2000,2001,2004,2005,2007 ./lib/isc/hash.c C 2003,2004,2005,2006,2007,2009,2013,2014 ./lib/isc/heap.c C 1997,1998,1999,2000,2001,2004,2005,2006,2007,2010,2011,2012,2013,2014 @@ -3347,7 +3344,7 @@ ./lib/isc/include/isc/app.h C 1999,2000,2001,2004,2005,2006,2007,2009,2013,2014 ./lib/isc/include/isc/assertions.h C 1997,1998,1999,2000,2001,2004,2005,2006,2007,2008,2009 ./lib/isc/include/isc/backtrace.h C 2009 -./lib/isc/include/isc/base32.h C 2008,2014 +./lib/isc/include/isc/base32.h C 2008 ./lib/isc/include/isc/base64.h C 1999,2000,2001,2004,2005,2006,2007 ./lib/isc/include/isc/bind9.h C 2009,2013 ./lib/isc/include/isc/boolean.h C 1998,1999,2000,2001,2004,2005,2006,2007 @@ -3357,7 +3354,7 @@ ./lib/isc/include/isc/crc64.h C 2013 ./lib/isc/include/isc/entropy.h C 2000,2001,2004,2005,2006,2007,2009 ./lib/isc/include/isc/error.h C 1998,1999,2000,2001,2004,2005,2006,2007,2009 -./lib/isc/include/isc/event.h C 1998,1999,2000,2001,2002,2004,2005,2006,2007,2014 +./lib/isc/include/isc/event.h C 1998,1999,2000,2001,2002,2004,2005,2006,2007 ./lib/isc/include/isc/eventclass.h C 1998,1999,2000,2001,2004,2005,2007 ./lib/isc/include/isc/file.h C 2000,2001,2004,2005,2006,2007,2009,2011,2012 ./lib/isc/include/isc/formatcheck.h C 2000,2001,2004,2005,2006,2007