nsec3_50.c revision 3398334b3acda24b086957286288ca9852662b12
/*
* Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
*
* 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: nsec3_50.c,v 1.4 2008/09/25 04:02:39 tbox Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
*
* 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 NOMINET 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.
*/
/* RFC 5155 */
#ifndef RDATA_GENERIC_NSEC3_50_C
#define RDATA_GENERIC_NSEC3_50_C
#include <isc/iterated_hash.h>
static inline isc_result_t
int octet;
int window;
unsigned int flags;
unsigned char hashalg;
isc_buffer_t b;
/* Hash. */
ISC_FALSE));
/* Flags. */
ISC_FALSE));
if (flags > 255U)
/* Iterations. */
ISC_FALSE));
/* salt */
ISC_FALSE));
} else {
}
/*
* Next hash a single base32hex word.
*/
ISC_FALSE));
if (isc_buffer_usedlength(&b) > 0xffU)
do {
break;
} while (1);
/*
* Find if we have a type in this window.
*/
break;
if (octet < 0)
continue;
}
return (ISC_R_SUCCESS);
}
static inline isc_result_t
unsigned int i, j, k;
unsigned char hash;
unsigned char flags;
char buf[sizeof("65535 ")];
j = uint8_fromregion(&sr);
if (j != 0) {
} else
j = uint8_fromregion(&sr);
i += 2;
for (j = 0; j < len; j++) {
continue;
for (k = 0; k < 8; k++) {
continue;
if (dns_rdatatype_isknown(t)) {
} else {
char buf[sizeof("TYPE65535")];
}
}
}
}
return (ISC_R_SUCCESS);
}
static inline isc_result_t
unsigned int window, lastwindow = 0;
unsigned int len;
unsigned int i;
/* hash(1), flags(1), interation(2), saltlen(1) */
/*
* Check for overflow.
*/
i += 2;
/*
* Check that bitmap windows are in the correct order.
*/
/*
* Check for legal lengths.
*/
/*
* Check for overflow.
*/
/*
* The last octet of the bitmap must be non zero.
*/
lastwindow = window;
}
return (DNS_R_EXTRADATA);
return (ISC_R_SUCCESS);
}
static inline isc_result_t
}
static inline int
}
static inline isc_result_t
/*
* Perform sanity check.
*/
i += 2;
lastwindow = window;
}
}
static inline isc_result_t
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
}
static inline void
return;
}
static inline isc_result_t
return (ISC_R_SUCCESS);
}
static inline isc_result_t
isc_region_t r;
dns_rdata_toregion(rdata, &r);
}
static inline isc_boolean_t
return (ISC_TRUE);
}
static inline isc_boolean_t
return (ISC_TRUE);
}
#endif /* RDATA_GENERIC_NSEC3_50_C */