diff options
Diffstat (limited to 'usr.bin/dig/lib/dns/rdata/generic/ds_43.c')
| -rw-r--r-- | usr.bin/dig/lib/dns/rdata/generic/ds_43.c | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/usr.bin/dig/lib/dns/rdata/generic/ds_43.c b/usr.bin/dig/lib/dns/rdata/generic/ds_43.c index 18bcff348d6..dc2571b5488 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/ds_43.c +++ b/usr.bin/dig/lib/dns/rdata/generic/ds_43.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ds_43.c,v 1.9 2020/02/24 17:45:26 florian Exp $ */ +/* $Id: ds_43.c,v 1.10 2020/02/24 17:47:50 florian Exp $ */ /* RFC3658 */ @@ -153,68 +153,4 @@ towire_ds(ARGS_TOWIRE) { return (mem_tobuffer(target, sr.base, sr.length)); } - -static inline isc_result_t -generic_fromstruct_ds(ARGS_FROMSTRUCT) { - dns_rdata_ds_t *ds = source; - - REQUIRE(source != NULL); - REQUIRE(ds->common.rdtype == type); - REQUIRE(ds->common.rdclass == rdclass); - - UNUSED(type); - UNUSED(rdclass); - - switch (ds->digest_type) { - case DNS_DSDIGEST_SHA1: - REQUIRE(ds->length == ISC_SHA1_DIGESTLENGTH); - break; - case DNS_DSDIGEST_SHA256: - REQUIRE(ds->length == ISC_SHA256_DIGESTLENGTH); - break; - case DNS_DSDIGEST_SHA384: - REQUIRE(ds->length == ISC_SHA384_DIGESTLENGTH); - break; - } - - RETERR(uint16_tobuffer(ds->key_tag, target)); - RETERR(uint8_tobuffer(ds->algorithm, target)); - RETERR(uint8_tobuffer(ds->digest_type, target)); - - return (mem_tobuffer(target, ds->digest, ds->length)); -} - - -static inline isc_result_t -generic_tostruct_ds(ARGS_TOSTRUCT) { - dns_rdata_ds_t *ds = target; - isc_region_t region; - - REQUIRE(target != NULL); - REQUIRE(rdata->length != 0); - REQUIRE(ds->common.rdtype == rdata->type); - REQUIRE(ds->common.rdclass == rdata->rdclass); - REQUIRE(!ISC_LINK_LINKED(&ds->common, link)); - - dns_rdata_toregion(rdata, ®ion); - - ds->key_tag = uint16_fromregion(®ion); - isc_region_consume(®ion, 2); - ds->algorithm = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - ds->digest_type = uint8_fromregion(®ion); - isc_region_consume(®ion, 1); - ds->length = region.length; - - ds->digest = mem_maybedup(region.base, region.length); - if (ds->digest == NULL) - return (ISC_R_NOMEMORY); - - return (ISC_R_SUCCESS); -} - - - - - #endif /* RDATA_GENERIC_DS_43_C */ |
