nsec.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 1999-2001, 2003-2005, 2007-2009, 2011-2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id$ */
/*! \file */
#include <config.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/rdatastruct.h>
#define RETERR(x) do { \
result = (x); \
if (result != ISC_R_SUCCESS) \
goto failure; \
} while (0)
void
if (bit != 0)
else
}
}
unsigned int
unsigned int max_type)
{
unsigned int window;
int octet;
return (0);
break;
break;
if (octet < 0) {
raw += 32;
continue;
}
/*
* Note: potential overlapping move.
*/
raw += 32;
}
}
{
isc_region_t r;
unsigned int i;
unsigned int max_type;
dns_name_toregion(target, &r);
/*
* Use the end of the space for a raw bitmap leaving enough
* space for the window identifiers and length octets.
*/
if (result != ISC_R_SUCCESS)
return (result);
result == ISC_R_SUCCESS;
{
}
}
/*
* At zone cuts, deny the existence of glue in the parent zone.
*/
for (i = 0; i <= max_type; i++) {
if (dns_nsec_isset(bm, i) &&
dns_nsec_setbit(bm, i, 0);
}
}
if (result != ISC_R_NOMORE)
return (result);
&r);
return (ISC_R_SUCCESS);
}
{
unsigned char data[DNS_NSEC_BUFFERSIZE];
0, NULL);
if (result == DNS_R_UNCHANGED)
return (result);
}
/* This should never fail */
i += 2;
break;
continue;
type % 256));
break;
}
return (present);
}
{
if (result != ISC_R_SUCCESS)
return (result);
if (result == ISC_R_NOTFOUND)
if (result != ISC_R_SUCCESS)
return (result);
result == ISC_R_SUCCESS;
break;
}
if (result == ISC_R_SUCCESS)
if (result == ISC_R_NOMORE) {
}
return (result);
}
/*%
* 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.
*
* Return ISC_R_IGNORE when the NSEC is not the appropriate one.
*/
{
int order;
if (result != ISC_R_SUCCESS) {
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 we are validating "."
* then atparent should not be set as there is no parent.
*/
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);
}
/*
* 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);
}
return (ISC_R_IGNORE);
}
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 wildcard name");
return (result);
}
}
return (ISC_R_SUCCESS);
}