Lines Matching refs:nsec3

246 	dns_rdata_nsec3_t *nsec3 = source;
251 REQUIRE(nsec3->common.rdtype == type);
252 REQUIRE(nsec3->common.rdclass == rdclass);
253 REQUIRE(nsec3->typebits != NULL || nsec3->len == 0);
254 REQUIRE(nsec3->hash == dns_hash_sha1);
259 RETERR(uint8_tobuffer(nsec3->hash, target));
260 RETERR(uint8_tobuffer(nsec3->flags, target));
261 RETERR(uint16_tobuffer(nsec3->iterations, target));
262 RETERR(uint8_tobuffer(nsec3->salt_length, target));
263 RETERR(mem_tobuffer(target, nsec3->salt, nsec3->salt_length));
264 RETERR(uint8_tobuffer(nsec3->next_length, target));
265 RETERR(mem_tobuffer(target, nsec3->next, nsec3->next_length));
267 region.base = nsec3->typebits;
268 region.length = nsec3->len;
270 return (mem_tobuffer(target, nsec3->typebits, nsec3->len));
276 dns_rdata_nsec3_t *nsec3 = target;
282 nsec3->common.rdclass = rdata->rdclass;
283 nsec3->common.rdtype = rdata->type;
284 ISC_LINK_INIT(&nsec3->common, link);
288 nsec3->hash = uint8_consume_fromregion(&region);
289 nsec3->flags = uint8_consume_fromregion(&region);
290 nsec3->iterations = uint16_consume_fromregion(&region);
292 nsec3->salt_length = uint8_consume_fromregion(&region);
293 nsec3->salt = mem_maybedup(mctx, region.base, nsec3->salt_length);
294 if (nsec3->salt == NULL)
296 isc_region_consume(&region, nsec3->salt_length);
298 nsec3->next_length = uint8_consume_fromregion(&region);
299 nsec3->next = mem_maybedup(mctx, region.base, nsec3->next_length);
300 if (nsec3->next == NULL)
302 isc_region_consume(&region, nsec3->next_length);
304 nsec3->len = region.length;
305 nsec3->typebits = mem_maybedup(mctx, region.base, region.length);
306 if (nsec3->typebits == NULL)
309 nsec3->mctx = mctx;
313 if (nsec3->next != NULL)
314 isc_mem_free(mctx, nsec3->next);
315 isc_mem_free(mctx, nsec3->salt);
321 dns_rdata_nsec3_t *nsec3 = source;
324 REQUIRE(nsec3->common.rdtype == dns_rdatatype_nsec3);
326 if (nsec3->mctx == NULL)
329 if (nsec3->salt != NULL)
330 isc_mem_free(nsec3->mctx, nsec3->salt);
331 if (nsec3->next != NULL)
332 isc_mem_free(nsec3->mctx, nsec3->next);
333 if (nsec3->typebits != NULL)
334 isc_mem_free(nsec3->mctx, nsec3->typebits);
335 nsec3->mctx = NULL;