]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add ZONEMD record type (from Habbie)
authorOtto <otto.moerbeek@open-xchange.com>
Fri, 10 Dec 2021 10:40:58 +0000 (11:40 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Mon, 13 Dec 2021 08:54:25 +0000 (09:54 +0100)
pdns/dnsrecords.cc
pdns/dnsrecords.hh
pdns/qtype.cc
pdns/qtype.hh

index d3f5741ecf3e66eda53b00695dbebde876c5d733..eac821493c4d3d04d692eb838915b6ed6b879f28 100644 (file)
@@ -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()
index 7f0a057437a20c644e0fc3f6c687839e6b6c706c..ef312c1dc5fdeb330a8c74bdd8cc6b41de32d5c8 100644 (file)
@@ -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:
index 8f4302bcd5406f38c21d04ba5742a61a955d66ee..3a6a7fa86e1db4714c2bc023db212869a2268589 100644 (file)
@@ -73,6 +73,7 @@ const map<const string, uint16_t> QType::names = {
   {"CDNSKEY", 60},
   {"OPENPGPKEY", 61},
   {"CSYNC", 62},
+  {"ZONEMD", 63},
   {"SVCB", 64},
   {"HTTPS", 65},
   {"SPF", 99},
index d76ccfcbe378513888a27096bd63b4dd97344aa8..f1d4baa3b60dbed47e9ed58abf1e0c2a497e78c9 100644 (file)
@@ -102,6 +102,7 @@ public:
     CDNSKEY = 60,
     OPENPGPKEY = 61,
     CSYNC = 62,
+    ZONEMD = 63,
     SVCB = 64,
     HTTPS = 65,
     SPF = 99,