validator.c revision 1a69a1a78cfaa86f3b68bbc965232b7876d4da2a
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * Copyright (C) 2000 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * Permission to use, copy, modify, and distribute this software for any
9e77d51069a97a21c68184134a0c9847e95490ffMark Andrews * purpose with or without fee is hereby granted, provided that the above
9e77d51069a97a21c68184134a0c9847e95490ffMark Andrews * copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews * We don't use the SIG RR's _tostruct routine because it copies things.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington /* Unlocked. */
9e77d51069a97a21c68184134a0c9847e95490ffMark Andrews /* Locked by lock. */
9e77d51069a97a21c68184134a0c9847e95490ffMark Andrews unsigned int options;
f4cbe536b11da614fe05aeaeff41e324854cda7bMark Andrews#define VALID_VALIDATOR(v) ISC_MAGIC_VALID(v, VALIDATOR_MAGIC)
bb01a40e659564bcb9571eca0319762eb20b7a01Andreas Gustafsson#define SHUTDOWN(v) (((v)->attributes & VALATTR_SHUTDOWN) != 0)
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonstatic void nullkeyvalidated(isc_task_t *task, isc_event_t *event);
c40265eba0c99708887d68e67901924065ba2514Brian Wellingtonstatic inline isc_boolean_t containsnullkey(dns_validator_t *val,
bb01a40e659564bcb9571eca0319762eb20b7a01Andreas Gustafssonstatic inline isc_result_t get_dst_key(dns_validator_t *val,
01b8865b1462ba219c90cf6c00f1bf0fdf780d9bBrian Wellingtonstatic inline isc_result_t validate(dns_validator_t *val, isc_boolean_t resume);
bb01a40e659564bcb9571eca0319762eb20b7a01Andreas Gustafssonstatic inline isc_result_t nxtvalidate(dns_validator_t *val,
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrewsstatic inline isc_result_t proveunsecure(dns_validator_t *val,
53aba5065d2ee3c103912ecfe865418bad6fa576Brian Wellingtonstatic void validator_log(dns_validator_t *val, int level,
47c2e9924ef9f9c20287642e4f0a13a5f2cb2574Mark Andrews const char *fmt, ...);
d03d2dbfe9cebf4dbbd2c8807afe5703862cc721Mark Andrewsrdata_to_siginfo(dns_rdata_t *rdata, dns_siginfo_t *siginfo) {
isc_buffer_t b;
isc_region_t r;
isc_buffer_remainingregion(&b, &r);
goto free_event;
goto free_event;
sizeof(dns_rdataset_t));
val,
sizeof(dns_rdataset_t));
sizeof(dns_rdataset_t));
goto free_event;
goto free_event;
sizeof(dns_rdataset_t));
sizeof(dns_rdataset_t));
static inline isc_boolean_t
isc_buffer_t b;
return (ISC_FALSE);
return (found);
static inline isc_result_t
isc_buffer_t b;
return (result);
return (result);
isc_buffer_putuint8(&b, 0);
return (result);
return (ISC_R_SUCCESS);
return (result);
static inline isc_result_t
int order;
return (ISC_R_SUCCESS);
return (result);
return (ISC_R_SUCCESS);
return (result);
return (DNS_R_CONTINUE);
return (DNS_R_CONTINUE);
sizeof *frdataset);
return (ISC_R_NOMEMORY);
sizeof *fsigrdataset);
sizeof *frdataset);
return (ISC_R_NOMEMORY);
NULL,
val,
return (result);
return (DNS_R_WAIT);
return (ISC_R_NOMEMORY);
sizeof *fsigrdataset);
sizeof *frdataset);
return (ISC_R_NOMEMORY);
val,
return (result);
return (DNS_R_WAIT);
return (result);
static inline isc_result_t
if (resume) {
return (ISC_R_NOMEMORY);
if (!resume) {
return (result);
&rdata);
return (result);
return (result);
static inline isc_result_t
int order;
isc_region_t r;
if (!resume) {
return (DNS_R_FORMERR);
link))
if (order == 0) {
} else if (order > 0) {
if (order >= 0) {
&sigrdata);
return (ISC_R_NOMEMORY);
&nextname))
return (result);
return (ISC_R_SUCCESS);
return (result);
static inline isc_result_t
return (result);
if (!resume)
return (result);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
sizeof *frdataset);
return (ISC_R_NOMEMORY);
sizeof *fsigrdataset);
sizeof *frdataset);
return (ISC_R_NOMEMORY);
sizeof *frdataset);
sizeof *fsigrdataset);
return (ISC_R_NOMEMORY);
sizeof *frdataset);
sizeof *fsigrdataset);
return (ISC_R_NOMEMORY);
NULL,
val,
return (DNS_R_WAIT);
sizeof *frdataset);
return (ISC_R_NOMEMORY);
sizeof *fsigrdataset);
sizeof *frdataset);
return (ISC_R_NOMEMORY);
return (result);
return (DNS_R_WAIT);
return (result);
INSIST(0);
return (ISC_R_NOMEMORY);
sizeof (dns_validatorevent_t));
goto cleanup_val;
goto cleanup_event;
return (ISC_R_SUCCESS);
return (result);
if (want_destroy)
isc_buffer_t b;
isc_region_t r;
!= ISC_R_SUCCESS)
isc_buffer_clear(&b);
isc_buffer_usedregion(&b, &r);