cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt/*
6fb9b25791778f69002eb72be6235e20d98ec452Tinderbox User * Copyright (C) 2009, 2011-2013, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt *
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt#ifndef GENERIC_KEYDATA_65533_C
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt#define GENERIC_KEYDATA_65533_C 1
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt#include <isc/time.h>
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt#include <isc/stdtime.h>
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt#include <dst/dst.h>
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
d6f99498d624d5c5c8ee45067df02e6a6b35a1a3Mark Andrews#define RRTYPE_KEYDATA_ATTRIBUTES (0)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntfromtext_keydata(ARGS_FROMTEXT) {
5f630b9417a01321f73662202e63922eccea5900Evan Hunt isc_result_t result;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_token_t token;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_secalg_t alg;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_secproto_t proto;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_keyflags_t flags;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_uint32_t refresh, addhd, removehd;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(type);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(rdclass);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(origin);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(options);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(callbacks);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* refresh timer */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt ISC_FALSE));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &refresh));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint32_tobuffer(refresh, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* add hold-down */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt ISC_FALSE));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &addhd));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint32_tobuffer(addhd, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* remove hold-down */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt ISC_FALSE));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &removehd));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint32_tobuffer(removehd, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* flags */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt ISC_FALSE));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETTOK(dns_keyflags_fromtext(&flags, &token.value.as_textregion));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint16_tobuffer(flags, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* protocol */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt ISC_FALSE));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETTOK(dns_secproto_fromtext(&proto, &token.value.as_textregion));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(mem_tobuffer(target, &proto, 1));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* algorithm */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt ISC_FALSE));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETTOK(dns_secalg_fromtext(&alg, &token.value.as_textregion));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(mem_tobuffer(target, &alg, 1));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* No Key? */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if ((flags & 0xc000) == 0xc000)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_SUCCESS);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
5f630b9417a01321f73662202e63922eccea5900Evan Hunt result = isc_base64_tobuffer(lexer, target, -1);
5f630b9417a01321f73662202e63922eccea5900Evan Hunt if (result != ISC_R_SUCCESS)
5f630b9417a01321f73662202e63922eccea5900Evan Hunt return (result);
5f630b9417a01321f73662202e63922eccea5900Evan Hunt
5f630b9417a01321f73662202e63922eccea5900Evan Hunt /* Ensure there's at least enough data to compute a key ID for MD5 */
5f630b9417a01321f73662202e63922eccea5900Evan Hunt if (alg == DST_ALG_RSAMD5 && isc_buffer_usedlength(target) < 19)
5f630b9417a01321f73662202e63922eccea5900Evan Hunt return (ISC_R_UNEXPECTEDEND);
5f630b9417a01321f73662202e63922eccea5900Evan Hunt
5f630b9417a01321f73662202e63922eccea5900Evan Hunt return (ISC_R_SUCCESS);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunttotext_keydata(ARGS_TOTEXT) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t sr;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt char buf[sizeof("64000")];
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt unsigned int flags;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt unsigned char algorithm;
bfde61d5194a534d800f3b90008d1f52261922c5Mark Andrews unsigned long refresh, add, deltime;
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt char algbuf[DNS_NAME_FORMATSIZE];
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt const char *keyinfo;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata->type == dns_rdatatype_keydata);
d6f99498d624d5c5c8ee45067df02e6a6b35a1a3Mark Andrews
d6f99498d624d5c5c8ee45067df02e6a6b35a1a3Mark Andrews if ((tctx->flags & DNS_STYLEFLAG_KEYDATA) == 0 || rdata->length < 16)
d6f99498d624d5c5c8ee45067df02e6a6b35a1a3Mark Andrews return (unknown_totext(rdata, tctx, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_toregion(rdata, &sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* refresh timer */
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt refresh = uint32_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 4);
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(dns_time32_totext(refresh, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(" ", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* add hold-down */
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt add = uint32_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 4);
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(dns_time32_totext(add, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(" ", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* remove hold-down */
bfde61d5194a534d800f3b90008d1f52261922c5Mark Andrews deltime = uint32_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 4);
bfde61d5194a534d800f3b90008d1f52261922c5Mark Andrews RETERR(dns_time32_totext(deltime, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(" ", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* flags */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt flags = uint16_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 2);
ad1317338af79edad878c9c3e4361798503310baMark Andrews snprintf(buf, sizeof(buf), "%u", flags);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(buf, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(" ", target));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt if ((flags & DNS_KEYFLAG_KSK) != 0) {
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt if (flags & DNS_KEYFLAG_REVOKE)
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt keyinfo = "revoked KSK";
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt else
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt keyinfo = "KSK";
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt } else
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt keyinfo = "ZSK";
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* protocol */
ad1317338af79edad878c9c3e4361798503310baMark Andrews snprintf(buf, sizeof(buf), "%u", sr.base[0]);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 1);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(buf, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(" ", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* algorithm */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt algorithm = sr.base[0];
ad1317338af79edad878c9c3e4361798503310baMark Andrews snprintf(buf, sizeof(buf), "%u", algorithm);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 1);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(buf, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* No Key? */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if ((flags & 0xc000) == 0xc000)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_SUCCESS);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* key */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(" (", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(tctx->linebreak, target));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt if (tctx->width == 0) /* No splitting */
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt RETERR(isc_base64_totext(&sr, 60, "", target));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt else
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt RETERR(isc_base64_totext(&sr, tctx->width - 2,
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt tctx->linebreak, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(tctx->linebreak, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(" ", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(")", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t tmpr;
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt char rbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt char abuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt char dbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_time_t t;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt RETERR(str_totext(" ; ", target));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt RETERR(str_totext(keyinfo, target));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt dns_secalg_format((dns_secalg_t) algorithm, algbuf,
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt sizeof(algbuf));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt RETERR(str_totext("; alg = ", target));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt RETERR(str_totext(algbuf, target));
9a859983d7059a6eb9c877c1d2ac6a3a5b7170f7Evan Hunt RETERR(str_totext("; key id = ", target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_toregion(rdata, &tmpr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Skip over refresh, addhd, and removehd */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&tmpr, 12);
ad1317338af79edad878c9c3e4361798503310baMark Andrews snprintf(buf, sizeof(buf), "%u",
ad1317338af79edad878c9c3e4361798503310baMark Andrews dst_region_computeid(&tmpr, algorithm));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(str_totext(buf, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_stdtime_t now;
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_stdtime_get(&now);
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt
29756974c585f616bb6e8233218cc385df9aeddbTinderbox User RETERR(str_totext(tctx->linebreak, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext("; next refresh: ", target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_time_set(&t, refresh, 0);
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_time_formathttptimestamp(&t, rbuf, sizeof(rbuf));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext(rbuf, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt
072ce62d236a377b6ef442bd43948ceda1220026Mark Andrews if (add == 0U) {
29756974c585f616bb6e8233218cc385df9aeddbTinderbox User RETERR(str_totext(tctx->linebreak, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext("; no trust", target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt } else {
29756974c585f616bb6e8233218cc385df9aeddbTinderbox User RETERR(str_totext(tctx->linebreak, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt if (add < now) {
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext("; trusted since: ",
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt } else {
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext("; trust pending: ",
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt }
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_time_set(&t, add, 0);
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_time_formathttptimestamp(&t, abuf,
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt sizeof(abuf));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext(abuf, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt }
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt
bfde61d5194a534d800f3b90008d1f52261922c5Mark Andrews if (deltime != 0U) {
29756974c585f616bb6e8233218cc385df9aeddbTinderbox User RETERR(str_totext(tctx->linebreak, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext("; removal pending: ",
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt target));
bfde61d5194a534d800f3b90008d1f52261922c5Mark Andrews isc_time_set(&t, deltime, 0);
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt isc_time_formathttptimestamp(&t, dbuf,
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt sizeof(dbuf));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt RETERR(str_totext(dbuf, target));
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt }
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt }
591389c7d44e5ca20c357627dd179772cfefaaccEvan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt }
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_SUCCESS);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntfromwire_keydata(ARGS_FROMWIRE) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t sr;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(type);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(rdclass);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(dctx);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(options);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_buffer_activeregion(source, &sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_buffer_forward(source, sr.length);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (mem_tobuffer(target, sr.base, sr.length));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunttowire_keydata(ARGS_TOWIRE) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t sr;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata->type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(cctx);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_toregion(rdata, &sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (mem_tobuffer(target, sr.base, sr.length));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline int
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntcompare_keydata(ARGS_COMPARE) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t r1;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t r2;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt REQUIRE(rdata1->type == rdata2->type);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt REQUIRE(rdata1->rdclass == rdata2->rdclass);
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata1->type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_toregion(rdata1, &r1);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_toregion(rdata2, &r2);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (isc_region_compare(&r1, &r2));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntfromstruct_keydata(ARGS_FROMSTRUCT) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_keydata_t *keydata = source;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt REQUIRE(source != NULL);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt REQUIRE(keydata->common.rdtype == type);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt REQUIRE(keydata->common.rdclass == rdclass);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(type);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(rdclass);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Refresh timer */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint32_tobuffer(keydata->refresh, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Add hold-down */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint32_tobuffer(keydata->addhd, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Remove hold-down */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint32_tobuffer(keydata->removehd, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Flags */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint16_tobuffer(keydata->flags, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Protocol */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint8_tobuffer(keydata->protocol, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Algorithm */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt RETERR(uint8_tobuffer(keydata->algorithm, target));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Data */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (mem_tobuffer(target, keydata->data, keydata->datalen));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunttostruct_keydata(ARGS_TOSTRUCT) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_keydata_t *keydata = target;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t sr;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata->type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt REQUIRE(target != NULL);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->common.rdclass = rdata->rdclass;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->common.rdtype = rdata->type;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt ISC_LINK_INIT(&keydata->common, link);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_toregion(rdata, &sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Refresh timer */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (sr.length < 4)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_UNEXPECTEDEND);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->refresh = uint32_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 4);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Add hold-down */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (sr.length < 4)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_UNEXPECTEDEND);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->addhd = uint32_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 4);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Remove hold-down */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (sr.length < 4)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_UNEXPECTEDEND);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->removehd = uint32_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 4);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Flags */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (sr.length < 2)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_UNEXPECTEDEND);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->flags = uint16_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 2);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Protocol */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (sr.length < 1)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_UNEXPECTEDEND);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->protocol = uint8_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 1);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Algorithm */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (sr.length < 1)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_UNEXPECTEDEND);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->algorithm = uint8_fromregion(&sr);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_consume(&sr, 1);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt /* Data */
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->datalen = sr.length;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->data = mem_maybedup(mctx, sr.base, keydata->datalen);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (keydata->data == NULL)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_NOMEMORY);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->mctx = mctx;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_SUCCESS);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline void
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntfreestruct_keydata(ARGS_FREESTRUCT) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_keydata_t *keydata = (dns_rdata_keydata_t *) source;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt REQUIRE(source != NULL);
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(keydata->common.rdtype == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (keydata->mctx == NULL)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt if (keydata->data != NULL)
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_mem_free(keydata->mctx, keydata->data);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt keydata->mctx = NULL;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntadditionaldata_keydata(ARGS_ADDLDATA) {
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata->type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(rdata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(add);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(arg);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_R_SUCCESS);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_result_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntdigest_keydata(ARGS_DIGEST) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt isc_region_t r;
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata->type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt dns_rdata_toregion(rdata, &r);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return ((digest)(arg, &r));
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_boolean_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntcheckowner_keydata(ARGS_CHECKOWNER) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(name);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(type);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(rdclass);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(wildcard);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_TRUE);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntstatic inline isc_boolean_t
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Huntchecknames_keydata(ARGS_CHECKNAMES) {
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata->type == dns_rdatatype_keydata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(rdata);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(owner);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt UNUSED(bad);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt return (ISC_TRUE);
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt}
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsstatic inline int
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewscasecompare_keydata(ARGS_COMPARE) {
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews return (compare_keydata(rdata1, rdata2));
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews}
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews
cfb1587eb9a6dc6d1d36ea0344e1b20068b81e88Evan Hunt#endif /* GENERIC_KEYDATA_65533_C */