From: Otto Date: Fri, 10 Dec 2021 10:40:58 +0000 (+0100) Subject: Add ZONEMD record type (from Habbie) X-Git-Tag: auth-4.7.0-alpha1~67^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f01f7fa4b86ef4c12c890774e52ad47356f2c74a;p=thirdparty%2Fpdns.git Add ZONEMD record type (from Habbie) --- diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index d3f5741ecf..eac821493c 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -305,6 +305,13 @@ boilerplate_conv(KEY, conv.xfrBlob(d_certificate); ); +boilerplate_conv(ZONEMD, + conv.xfr32BitInt(d_serial); + conv.xfr8BitInt(d_scheme); + conv.xfr8BitInt(d_hashalgo); + conv.xfrHexBlob(d_digest, true); // keep reading across spaces + ); + boilerplate_conv(CERT, conv.xfr16BitInt(d_type); if (d_type == 0) throw MOADNSException("CERT type 0 is reserved"); @@ -963,6 +970,7 @@ void reportOtherTypes() L32RecordContent::report(); L64RecordContent::report(); LPRecordContent::report(); + ZONEMDRecordContent::report(); } void reportAllTypes() diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 7f0a057437..ef312c1dc5 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -586,6 +586,19 @@ public: struct soatimes d_st; }; +class ZONEMDRecordContent : public DNSRecordContent +{ +public: + includeboilerplate(ZONEMD) + //ZONEMDRecordContent(uint32_t serial, uint8_t scheme, uint8_t hashalgo, string digest); + +private: + uint32_t d_serial; + uint8_t d_scheme; + uint8_t d_hashalgo; + string d_digest; +}; + class NSECBitmap { public: diff --git a/pdns/qtype.cc b/pdns/qtype.cc index 8f4302bcd5..3a6a7fa86e 100644 --- a/pdns/qtype.cc +++ b/pdns/qtype.cc @@ -73,6 +73,7 @@ const map QType::names = { {"CDNSKEY", 60}, {"OPENPGPKEY", 61}, {"CSYNC", 62}, + {"ZONEMD", 63}, {"SVCB", 64}, {"HTTPS", 65}, {"SPF", 99}, diff --git a/pdns/qtype.hh b/pdns/qtype.hh index d76ccfcbe3..f1d4baa3b6 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -102,6 +102,7 @@ public: CDNSKEY = 60, OPENPGPKEY = 61, CSYNC = 62, + ZONEMD = 63, SVCB = 64, HTTPS = 65, SPF = 99,