Lines Matching refs:nsec3

330 	dns_rdata_nsec3_t *nsec3 = source;
336 REQUIRE(nsec3->common.rdtype == type);
337 REQUIRE(nsec3->common.rdclass == rdclass);
338 REQUIRE(nsec3->typebits != NULL || nsec3->len == 0);
339 REQUIRE(nsec3->hash == dns_hash_sha1);
344 RETERR(uint8_tobuffer(nsec3->hash, target));
345 RETERR(uint8_tobuffer(nsec3->flags, target));
346 RETERR(uint16_tobuffer(nsec3->iterations, target));
347 RETERR(uint8_tobuffer(nsec3->salt_length, target));
348 RETERR(mem_tobuffer(target, nsec3->salt, nsec3->salt_length));
349 RETERR(uint8_tobuffer(nsec3->next_length, target));
350 RETERR(mem_tobuffer(target, nsec3->next, nsec3->next_length));
355 for (i = 0; i < nsec3->len ; i += len) {
356 INSIST(i + 2 <= nsec3->len);
357 window = nsec3->typebits[i];
358 len = nsec3->typebits[i+1];
362 INSIST(i + len <= nsec3->len);
363 INSIST(nsec3->typebits[i + len - 1] != 0);
367 return (mem_tobuffer(target, nsec3->typebits, nsec3->len));
373 dns_rdata_nsec3_t *nsec3 = target;
379 nsec3->common.rdclass = rdata->rdclass;
380 nsec3->common.rdtype = rdata->type;
381 ISC_LINK_INIT(&nsec3->common, link);
385 nsec3->hash = uint8_consume_fromregion(&region);
386 nsec3->flags = uint8_consume_fromregion(&region);
387 nsec3->iterations = uint16_consume_fromregion(&region);
389 nsec3->salt_length = uint8_consume_fromregion(&region);
390 nsec3->salt = mem_maybedup(mctx, region.base, nsec3->salt_length);
391 if (nsec3->salt == NULL)
393 isc_region_consume(&region, nsec3->salt_length);
395 nsec3->next_length = uint8_consume_fromregion(&region);
396 nsec3->next = mem_maybedup(mctx, region.base, nsec3->next_length);
397 if (nsec3->next == NULL)
399 isc_region_consume(&region, nsec3->next_length);
401 nsec3->len = region.length;
402 nsec3->typebits = mem_maybedup(mctx, region.base, region.length);
403 if (nsec3->typebits == NULL)
406 nsec3->mctx = mctx;
410 if (nsec3->next != NULL)
411 isc_mem_free(mctx, nsec3->next);
412 isc_mem_free(mctx, nsec3->salt);
418 dns_rdata_nsec3_t *nsec3 = source;
421 REQUIRE(nsec3->common.rdtype == 50);
423 if (nsec3->mctx == NULL)
426 if (nsec3->salt != NULL)
427 isc_mem_free(nsec3->mctx, nsec3->salt);
428 if (nsec3->next != NULL)
429 isc_mem_free(nsec3->mctx, nsec3->next);
430 if (nsec3->typebits != NULL)
431 isc_mem_free(nsec3->mctx, nsec3->typebits);
432 nsec3->mctx = NULL;