validator.c revision 116e6b4257e3efceca3e82af1e695579129af93d
/*
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and 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.
*/
/* $Id: validator.c,v 1.130 2005/06/07 00:39:05 marka Exp $ */
/*! \file */
#include <config.h>
#include <dns/keytable.h>
#include <dns/rdatastruct.h>
#include <dns/rdataset.h>
#include <dns/rdatatype.h>
#include <dns/resolver.h>
#include <dns/validator.h>
#define VALATTR_SHUTDOWN 0x0001
#define VALATTR_FOUNDNONEXISTENCE 0x0002
#define VALATTR_TRIEDVERIFY 0x0004
#define VALATTR_NEGATIVE 0x0008
#define VALATTR_INSECURITY 0x0010
#define VALATTR_DLV 0x0020
#define VALATTR_DLVTRIED 0x0040
#define VALATTR_DLVSEPTRIED 0x0080
#define VALATTR_NEEDNOQNAME 0x0100
#define VALATTR_NEEDNOWILDCARD 0x0200
#define VALATTR_NEEDNODATA 0x0400
#define VALATTR_FOUNDNOQNAME 0x1000
#define VALATTR_FOUNDNOWILDCARD 0x2000
#define VALATTR_FOUNDNODATA 0x4000
static void
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static void
ISC_FORMAT_PRINTF(5, 0);
static void
static void
static isc_result_t
static isc_result_t
static void
return;
/*
* Caller must be holding the lock.
*/
}
static inline isc_boolean_t
/*
* Caller must be holding the lock.
*/
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_TRUE);
}
static void
result == ISC_R_SUCCESS;
{
{
}
}
}
static isc_boolean_t
{
if (dbresult == DNS_R_NXRRSET)
else {
if (result != ISC_R_SUCCESS)
return (ISC_FALSE);
}
if (result == ISC_R_SUCCESS) {
}
return (found);
}
static void
if (eresult == ISC_R_SUCCESS) {
/*
* Only extract the dst key if the keyset is secure.
*/
if (result == ISC_R_SUCCESS)
}
if (result != DNS_R_WAIT)
} else {
"fetch_callback_validator: got %s",
if (eresult == ISC_R_CANCELED)
else
}
if (want_destroy)
}
static void
if (eresult == ISC_R_SUCCESS) {
if (result != DNS_R_WAIT)
(eresult == DNS_R_NXRRSET ||
eresult == DNS_R_NCACHENXRRSET) &&
{
"no DS record: looking for DLV");
if (result != DNS_R_WAIT)
} else if (eresult == DNS_R_NXRRSET ||
{
"falling back to insecurity proof");
if (result != DNS_R_WAIT)
} else {
"dsfetched: got %s",
if (eresult == ISC_R_CANCELED)
else
}
if (want_destroy)
}
/*
* XXX there's too much duplicated code here.
*/
static void
/*
* There is no DS. If this is a delegation, we're done.
*/
if (val->mustbesecure) {
"must be secure failure");
} else {
}
} else {
if (result != DNS_R_WAIT)
}
} else if (eresult == ISC_R_SUCCESS ||
eresult == DNS_R_NXDOMAIN ||
{
/*
* Either there is a DS or this is not a zone cut. Continue.
*/
if (result != DNS_R_WAIT)
} else {
if (eresult == ISC_R_CANCELED)
else
}
if (want_destroy)
}
static void
if (eresult == ISC_R_SUCCESS) {
/*
* Only extract the dst key if the keyset is secure.
*/
if (result != DNS_R_WAIT)
} else {
"keyvalidated: got %s",
}
if (want_destroy)
}
static void
if (eresult == ISC_R_SUCCESS) {
else
if (result != DNS_R_WAIT)
} else {
"dsvalidated: got %s",
}
if (want_destroy)
}
/*
* Return ISC_R_SUCCESS if we can determine that the name doesn't exist
* or we can determine whether there is data or not at the name.
* If the name does not exist return the wildcard name.
*/
static isc_result_t
{
int order;
if (result != ISC_R_SUCCESS) {
"failure processing NSEC set");
return (result);
}
if (order < 0) {
/*
* The name is not within the NSEC range.
*/
"NSEC does not cover name, before NSEC");
return (ISC_R_IGNORE);
}
if (order == 0) {
/*
* The names are the same.
*/
{
if (!atparent) {
/*
* This NSEC record is from somewhere higher in
* the DNS, and at the parent of a delegation.
* It can not be legitimately used here.
*/
"ignoring parent nsec");
return (ISC_R_IGNORE);
}
} else if (atparent) {
/*
* This NSEC record is from the child.
* It can not be legitimately used here.
*/
"ignoring child nsec");
return (ISC_R_IGNORE);
}
"nsec proves name exists (owner) data=%d",
*data);
return (ISC_R_SUCCESS);
}
if (relation == dns_namereln_subdomain &&
{
/*
* This NSEC record is from somewhere higher in
* the DNS, and at the parent of a delegation.
* It can not be legitimately used here.
*/
return (ISC_R_IGNORE);
}
if (result != ISC_R_SUCCESS)
return (result);
if (order == 0) {
"ignoring nsec matches next name");
return (ISC_R_IGNORE);
}
/*
* The name is not within the NSEC range.
*/
"ignoring nsec because name is past end of range");
return (ISC_R_IGNORE);
}
"nsec proves name exist (empty)");
return (ISC_R_SUCCESS);
}
} else {
}
if (result != ISC_R_SUCCESS) {
"failure generating wilcard name");
return (result);
}
}
return (ISC_R_SUCCESS);
}
static void
if (result != ISC_R_SUCCESS) {
"authvalidated: got %s",
if (result == ISC_R_CANCELED)
else {
if (result != DNS_R_WAIT)
}
} else {
== ISC_R_SUCCESS)
{
if (NEEDNODATA(val))
}
if (!exists) {
if (NEEDNOQNAME(val))
}
}
if (result != DNS_R_WAIT)
}
if (want_destroy)
/*
* Free stuff from the event.
*/
}
static void
if (eresult == ISC_R_SUCCESS) {
"nonexistence proof found");
} else {
"negauthvalidated: got %s",
}
if (want_destroy)
}
static inline isc_result_t
unsigned int options;
char buf1[DNS_NAME_FORMATSIZE];
char buf2[DNS_NAME_FORMATSIZE];
char buf3[DNS_NAME_FORMATSIZE];
return (ISC_R_CANCELED);
if (type == dns_rdatatype_dlv)
if (result == DNS_R_NXDOMAIN) {
} else if (result == DNS_R_COVERINGNSEC) {
/*
* Check if the returned NSEC covers the name.
*/
"covering nsec: trust %u",
goto notfound;
}
if (result != ISC_R_SUCCESS)
goto notfound;
/* Parent NSEC record. */
"covering nsec: for parent");
goto notfound;
}
}
if (result != ISC_R_SUCCESS)
goto notfound;
/* End of zone chain. */
/*
* XXXMPA We could look for a parent NSEC
* at nsec.next and if found retest with
* this NSEC.
*/
"covering nsec: not in zone");
goto notfound;
}
/*
* XXXMPA We could check if this NSEC is at a zone
* apex and if the qname is not below it and look for
* a parent NSEC with the same name. This requires
* that we can cache both NSEC records which we
* currently don't support.
*/
"covering nsec: not in range");
goto notfound;
}
"covering nsec found: '%s' '%s' '%s'",
}
} else if (result != ISC_R_SUCCESS &&
result != DNS_R_GLUE &&
result != DNS_R_HINT &&
result != DNS_R_NCACHENXDOMAIN &&
result != DNS_R_NCACHENXRRSET &&
result != DNS_R_NXRRSET &&
result != DNS_R_HINTNXRRSET &&
result != ISC_R_NOTFOUND) {
goto notfound;
}
return (result);
return (ISC_R_NOTFOUND);
}
static inline isc_boolean_t
{
"continuing validation would lead to "
"deadlock: aborting validation");
return (ISC_TRUE);
}
}
return (ISC_FALSE);
}
static inline isc_result_t
{
return (DNS_R_NOVALIDSIG);
&val->fsigrdataset,
}
static inline isc_result_t
{
return (DNS_R_NOVALIDSIG);
&val->subvalidator);
if (result == ISC_R_SUCCESS)
return (result);
}
/*
* Try to find a key that could have signed 'siginfo' among those
* in 'rdataset'. If found, build a dst_key_t for it and point
* val->key at it.
*
* If val->key is non-NULL, this returns the next matching key.
*/
static isc_result_t
{
isc_buffer_t b;
else {
}
if (result != ISC_R_SUCCESS)
goto failure;
do {
if (result != ISC_R_SUCCESS)
goto failure;
{
if (foundold)
/*
* This is the key we're looking for.
*/
return (ISC_R_SUCCESS);
{
}
}
} while (result == ISC_R_SUCCESS);
if (result == ISC_R_NOMORE)
return (result);
}
static isc_result_t
unsigned int nlabels;
int order;
/*
* Is the signer name appropriate for this signature?
*
* The signer name must be at the same level as the owner name
* or closer to the the DNS root.
*/
if (namereln != dns_namereln_subdomain &&
return (DNS_R_CONTINUE);
if (namereln == dns_namereln_equal) {
/*
* If this is a self-signed keyset, it must not be a zone key
* (since get_key is not called from validatezonekey).
*/
return (DNS_R_CONTINUE);
/*
* Records appearing in the parent zone at delegation
* points cannot be self-signed.
*/
return (DNS_R_CONTINUE);
}
/*
* Do we know about this key?
*/
if (result == ISC_R_SUCCESS) {
/*
* We have an rrset for the given keyname.
*/
{
/*
* We know the key but haven't validated it yet.
*/
&val->fsigrdataset,
"get_key");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
/*
* Having a pending key with no signature means that
* something is broken.
*/
/*
* The key is legitimately insecure. There's no
* point in even attempting verification.
*/
} else {
/*
* See if we've got the key used in the signature.
*/
"keyset with trust %d",
if (result != ISC_R_SUCCESS) {
/*
* Either the key we're looking for is not
* in the rrset, or something bad happened.
* Give up.
*/
}
}
} else if (result == ISC_R_NOTFOUND) {
/*
* We don't know anything about this key.
*/
fetch_callback_validator, "get_key");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
} else if (result == DNS_R_NCACHENXDOMAIN ||
result == DNS_R_NCACHENXRRSET ||
result == DNS_R_NXDOMAIN ||
result == DNS_R_NXRRSET)
{
/*
* This key doesn't exist.
*/
}
return (result);
}
static dns_keytag_t
isc_region_t r;
dns_rdata_toregion(rdata, &r);
}
/*
* Is this keyset self-signed?
*/
static isc_boolean_t
result == ISC_R_SUCCESS;
{
result == ISC_R_SUCCESS;
{
return (ISC_TRUE);
}
}
return (ISC_FALSE);
}
static isc_result_t
"verify rdataset: %s",
if (result == DNS_R_FROMWILDCARD) {
}
return (result);
}
/*
* Attempts positive response validation of a normal RRset.
*
* Returns:
* ISC_R_SUCCESS Validation completed successfully
* DNS_R_WAIT Validation has started but is waiting
* for an event.
* Other return codes are possible and all indicate failure.
*/
static isc_result_t
/*
* Caller must be holding the validator lock.
*/
if (resume) {
/*
* We already have a sigrdataset.
*/
} else {
}
for (;
result == ISC_R_SUCCESS;
{
return (ISC_R_NOMEMORY);
}
if (result != ISC_R_SUCCESS)
return (result);
/*
* At this point we could check that the signature algorithm
* was known and "sufficiently good".
*/
continue;
if (!resume) {
if (result == DNS_R_CONTINUE)
continue; /* Try the next SIG RR. */
if (result != ISC_R_SUCCESS)
return (result);
}
/*
* The key is insecure, so mark the data as insecure also.
*/
if (val->mustbesecure) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
"marking as answer");
return (ISC_R_SUCCESS);
}
do {
if (result == ISC_R_SUCCESS)
break;
&nextnode);
if (result != ISC_R_SUCCESS) {
break;
}
} else {
!= ISC_R_SUCCESS)
break;
}
} while (1);
if (result != ISC_R_SUCCESS)
"failed to verify rdataset");
else {
}
else {
}
}
"no message available for noqname proof");
return (DNS_R_NOVALIDSIG);
}
"looking for noqname proof");
} else if (result == ISC_R_SUCCESS) {
"marking as secure");
return (result);
} else {
"verify failure: %s",
}
}
if (result != ISC_R_NOMORE) {
"failed to iterate signatures: %s",
return (result);
}
return (DNS_R_NOVALIDSIG);
}
static void
if (eresult == ISC_R_SUCCESS) {
else
if (result != DNS_R_WAIT)
} else {
"dlv_validated: got %s",
}
if (want_destroy)
}
static void
if (eresult == ISC_R_SUCCESS) {
if (result != DNS_R_WAIT)
} else if (eresult == DNS_R_NXRRSET ||
{
"falling back to insecurity proof");
if (result != DNS_R_WAIT)
} else {
"dlv_fetched: got %s",
if (eresult == ISC_R_CANCELED)
else
}
if (want_destroy)
}
static isc_result_t
unsigned char dsbuf[DNS_DS_BUFFERSIZE];
unsigned int labels;
if (result != ISC_R_SUCCESS) {
"DLV concatenate failed");
return (DNS_R_NOVALIDSIG);
}
if (result == ISC_R_SUCCESS) {
/*
* We have DLV records.
*/
{
&val->fsigrdataset,
"dlv_validatezonekey");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
/*
* There should never be an unsigned DLV.
*/
"unsigned DLV record");
return (DNS_R_NOVALIDSIG);
} else
} else if (result == ISC_R_NOTFOUND) {
"dlv_validatezonekey");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
} else if (result == DNS_R_NCACHENXDOMAIN ||
result == DNS_R_NCACHENXRRSET ||
result == DNS_R_NXDOMAIN ||
result == DNS_R_NXRRSET)
{
/*
* The DS does not exist.
*/
return (DNS_R_NOVALIDSIG);
}
}
/*
* We have a DLV set.
*/
if (val->mustbesecure) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
return (ISC_R_SUCCESS);
}
/*
* Look through the DLV record and find the keys that can sign the
* key set and the matching signature. For each such key, attempt
* verification.
*/
result == ISC_R_SUCCESS;
{
continue;
continue;
result == ISC_R_SUCCESS;
{
continue;
dsbuf, &newdsrdata);
if (result != ISC_R_SUCCESS)
continue;
/* Covert to DLV */
break;
}
if (result != ISC_R_SUCCESS) {
"no DNSKEY matching DLV");
continue;
}
result == ISC_R_SUCCESS;
{
&sigrdata);
continue;
&keyrdata,
&dstkey);
if (result != ISC_R_SUCCESS)
/*
* This really shouldn't happen, but...
*/
continue;
if (result == ISC_R_SUCCESS)
break;
}
if (result == ISC_R_SUCCESS)
break;
"no RRSIG matching DLV key");
}
if (result == ISC_R_SUCCESS) {
return (result);
if (val->mustbesecure) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
return (ISC_R_SUCCESS);
} else
return (DNS_R_NOVALIDSIG);
}
/*
* Attempts positive response validation of an RRset containing zone keys.
*
* Returns:
* ISC_R_SUCCESS Validation completed successfully
* DNS_R_WAIT Validation has started but is waiting
* for an event.
* Other return codes are possible and all indicate failure.
*/
static isc_result_t
unsigned char dsbuf[DNS_DS_BUFFERSIZE];
/*
* Caller must be holding the validator lock.
*/
/*
* First, see if this key was signed by a trusted key.
*/
result == ISC_R_SUCCESS;
{
&sigrdata);
&keynode);
while (result == ISC_R_SUCCESS) {
if (result == ISC_R_SUCCESS) {
&keynode);
break;
}
&nextnode);
&keynode);
}
if (result == ISC_R_SUCCESS) {
"signed by trusted key; "
"marking as secure");
return (result);
}
}
/*
* If this is the root name and there was no trusted key,
* give up, since there's no DS at the root.
*/
return (DNS_R_NOVALIDSIG);
else
return (DNS_R_NOVALIDDS);
}
/*
* Otherwise, try to find the DS record.
*/
if (result == ISC_R_SUCCESS) {
/*
* We have DS records.
*/
{
&val->fsigrdataset,
"validatezonekey");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
/*
* There should never be an unsigned DS.
*/
"unsigned DS record");
return (DNS_R_NOVALIDSIG);
} else
} else if (result == ISC_R_NOTFOUND) {
/*
* We don't have the DS. Find it.
*/
"validatezonekey");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
(result == DNS_R_NCACHENXRRSET ||
result == DNS_R_NXRRSET) &&
{
"no DS record: looking for DLV");
return (dlv_validatezonekey(val));
} else if (result == DNS_R_NCACHENXDOMAIN ||
result == DNS_R_NCACHENXRRSET ||
result == DNS_R_NXDOMAIN ||
result == DNS_R_NXRRSET)
{
/*
* The DS does not exist.
*/
return (DNS_R_NOVALIDSIG);
}
}
/*
* We have a DS set.
*/
if (val->mustbesecure) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
return (ISC_R_SUCCESS);
}
/*
* Look through the DS record and find the keys that can sign the
* key set and the matching signature. For each such key, attempt
* verification.
*/
result == ISC_R_SUCCESS;
{
continue;
continue;
result == ISC_R_SUCCESS;
{
continue;
dsbuf, &newdsrdata);
if (result != ISC_R_SUCCESS)
continue;
break;
}
if (result != ISC_R_SUCCESS) {
"no DNSKEY matching DS");
continue;
}
result == ISC_R_SUCCESS;
{
&sigrdata);
continue;
&keyrdata,
&dstkey);
if (result != ISC_R_SUCCESS)
/*
* This really shouldn't happen, but...
*/
continue;
if (result == ISC_R_SUCCESS)
break;
}
if (result == ISC_R_SUCCESS)
break;
"no RRSIG matching DS key");
}
if (result == ISC_R_SUCCESS) {
return (result);
{
return (dlv_validatezonekey(val));
if (val->mustbesecure) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
return (ISC_R_SUCCESS);
} else
return (DNS_R_NOVALIDSIG);
}
/*
* Starts a positive response validation.
*
* Returns:
* ISC_R_SUCCESS Validation completed successfully
* DNS_R_WAIT Validation has started but is waiting
* for an event.
* Other return codes are possible and all indicate failure.
*/
static isc_result_t
/*
* If this is not a key, go straight into validate().
*/
return (validatezonekey(val));
}
static isc_result_t
char namebuf[DNS_NAME_FORMATSIZE];
result == ISC_R_SUCCESS;
{
{
continue;
sigrdataset != NULL;
{
break;
}
if (sigrdataset == NULL)
continue;
continue;
== ISC_R_SUCCESS)
{
name;
if (!exists)
val->attributes |=
name;
return (ISC_R_SUCCESS);
}
}
}
if (result == ISC_R_NOMORE)
return (result);
}
static isc_result_t
if (!resume)
else {
}
for (;
result == ISC_R_SUCCESS;
{
if (resume) {
} else
for (;
{
continue;
sigrdataset != NULL;
link))
{
break;
}
if (sigrdataset == NULL)
continue;
/*
* If a signed zone is missing the zone key, bad
* things could happen. A query for data in the zone
* would lead to a query for the zone key, which
* would return a negative answer, which would contain
* an SOA and an NSEC signed by the missing key, which
* would trigger another query for the DNSKEY (since
* the first one is still in progress), and go into an
* infinite loop. Avoid that.
*/
{
continue;
if (result != ISC_R_SUCCESS)
return (result);
if (dns_nsec_typepresent(&nsec,
continue;
}
"nsecvalidate");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
}
}
if (result == ISC_R_NOMORE)
if (result != ISC_R_SUCCESS)
return (result);
/*
* Do we only need to check for NOQNAME?
*/
"noqname proof found");
"marking as secure");
return (ISC_R_SUCCESS);
}
"noqname proof not found");
return (DNS_R_NOVALIDNSEC);
}
/*
* Do we need to check for the wildcard?
*/
if (result != ISC_R_SUCCESS)
return (result);
}
"nsecvalidate");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
}
"nonexistence proof not found");
return (DNS_R_NOVALIDNSEC);
} else {
"nonexistence proof found");
return (ISC_R_SUCCESS);
}
}
static isc_boolean_t
result == ISC_R_SUCCESS;
ds.digest_type) &&
return (ISC_TRUE);
}
}
return (ISC_FALSE);
}
static void
if (eresult == ISC_R_SUCCESS) {
if (result != DNS_R_WAIT)
} else if (eresult == DNS_R_NXRRSET ||
eresult == DNS_R_NXDOMAIN ||
eresult == DNS_R_NCACHENXRRSET ||
eresult == DNS_R_NCACHENXDOMAIN) {
if (result == ISC_R_SUCCESS) {
if (result != DNS_R_WAIT)
} else if (result == ISC_R_NOTFOUND) {
} else if (result != DNS_R_WAIT)
}
if (want_destroy)
}
static isc_result_t
unsigned int labels;
if (!resume) {
} else {
}
while (result == ISC_R_NOSPACE) {
}
if (result != ISC_R_SUCCESS) {
return (DNS_R_NOVALIDSIG);
}
while (dns_name_countlabels(dlvname) >
{
if (result == ISC_R_SUCCESS) {
return (DNS_R_NOVALIDSIG);
return (ISC_R_SUCCESS);
}
if (result == ISC_R_NOTFOUND) {
dlv_fetched2, "finddlvsep");
if (result != ISC_R_SUCCESS)
return (result);
return (DNS_R_WAIT);
}
if (result != DNS_R_NXRRSET &&
result != DNS_R_NXDOMAIN &&
result != DNS_R_NCACHENXRRSET &&
return (result);
/*
* Strip first labels from both dlvsep and dlvname.
*/
}
return (ISC_R_NOTFOUND);
}
static isc_result_t
/*
* If the name is not under a security root look for a dlv record.
*/
if (result == ISC_R_NOTFOUND &&
"finddlvsep returned: %s",
return (tresult);
}
}
/*
* If there is no security root and a dlv record was not found we are
* done. If a dlv record was found use that as the secure entry point,
* if no security root was found.
*/
if (result == ISC_R_NOTFOUND) {
if (!val->havedlvsep) {
"not beneath secure root / DLV");
if (val->mustbesecure) {
"must be secure failure");
goto out;
}
return (ISC_R_SUCCESS);
}
} else if (result != ISC_R_SUCCESS)
return (result);
else if (val->havedlvsep &&
dns_fixedname_name(&secroot))) {
}
if (!resume) {
} else {
if (val->mustbesecure) {
"must be secure failure");
goto out;
}
goto out;
}
}
for (;
{
char namebuf[DNS_NAME_FORMATSIZE];
else
"checking existence of DS at '%s'",
namebuf);
/*
* There is no DS. If this is a delegation,
* we maybe done.
*/
/*
* This shouldn't happen, since the negative
* response should have been validated. Since
* there's no way of validating existing
* negative response blobs, give up.
*/
goto out;
}
/*
* If we havn't looked for a dlvsep look for
* one now. If found restart the proof.
*/
!DLVSEPTRIED(val) &&
if (tresult != ISC_R_NOTFOUND &&
tresult != ISC_R_SUCCESS) {
ISC_LOG_DEBUG(3),
"finddlvsep returned: %s",
return (tresult);
}
}
if (val->mustbesecure) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
return (ISC_R_SUCCESS);
}
continue;
} else if (result == ISC_R_SUCCESS) {
/*
* There is a DS here. Verify that it's secure and
* continue.
*/
if (val->mustbesecure) {
"must be secure failure");
goto out;
}
goto out;
}
continue;
}
{
goto out;
}
&val->fsigrdataset,
"proveunsecure");
if (result != ISC_R_SUCCESS)
goto out;
return (DNS_R_WAIT);
} else if (result == DNS_R_NXDOMAIN ||
{
/*
* This is not a zone cut. Assuming things are
* as expected, continue.
*/
/*
* There should be an NSEC here, since we
* are still in a secure zone.
*/
goto out;
/*
* This shouldn't happen, since the negative
* response should have been validated. Since
* there's no way of validating existing
* negative response blobs, give up.
*/
goto out;
}
continue;
} else if (result == ISC_R_NOTFOUND) {
/*
* We don't know anything about the DS. Find it.
*/
dsfetched2, "proveunsecure");
if (result != ISC_R_SUCCESS)
goto out;
return (DNS_R_WAIT);
}
}
return (DNS_R_NOTINSECURE); /* Couldn't complete insecurity proof */
out:
return (result);
}
static void
/* If the validator has been cancelled, val->event == NULL */
return;
/*
* This looks like a simple validation. We say "looks like"
* because it might end up requiring an insecurity proof.
*/
"attempting positive response validation");
if (result == DNS_R_NOVALIDSIG &&
{
"falling back to insecurity proof");
if (result == DNS_R_NOTINSECURE)
}
/*
* This is either an unsecure subdomain or a response from
* a broken server.
*/
"attempting insecurity proof");
{
/*
* This is a nonexistence validation.
*/
"attempting negative response validation");
} else
} else {
/*
* This shouldn't happen.
*/
INSIST(0);
}
if (result != DNS_R_WAIT) {
}
if (want_destroy)
}
{
return (ISC_R_NOMEMORY);
event = (dns_validatorevent_t *)
sizeof(dns_validatorevent_t));
goto cleanup_val;
}
if (result != ISC_R_SUCCESS)
goto cleanup_event;
val->attributes = 0;
*validatorp = val;
return (ISC_R_SUCCESS);
return (result);
}
void
}
}
static void
}
void
val = *validatorp;
if (want_destroy)
*validatorp = NULL;
}
static void
{
char msgbuf[2048];
char namebuf[DNS_NAME_FORMATSIZE];
char typebuf[DNS_RDATATYPE_FORMATSIZE];
sizeof(typebuf));
msgbuf);
} else {
}
}
static void
return;
}
static void
{
char namestr[DNS_NAME_FORMATSIZE];
char typestr[DNS_RDATATYPE_FORMATSIZE];
}