]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #10074 from pieterlexis/SVCB-improvements
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 1 Apr 2021 09:36:21 +0000 (11:36 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Apr 2021 09:36:21 +0000 (11:36 +0200)
SVCB improvements

1  2 
docs/settings.rst
pdns/common_startup.cc
pdns/dnsrecords.cc
pdns/dnsrecords.hh
pdns/misc.hh
pdns/rcpgenerator.cc
pdns/rcpgenerator.hh
pdns/tcpreceiver.cc
pdns/test-dnsrecords_cc.cc

Simple merge
Simple merge
Simple merge
Simple merge
diff --cc pdns/misc.hh
index fd377cfc4a667fcb34be05f7b169ba8d131dfd0f,ee04ebb72b306c5b0b31b9e0cde16b6da974fdd5..b76601e33646e369a24522eb31724f51a7ca53e0
@@@ -624,8 -624,7 +624,10 @@@ DNSName reverseNameFromIP(const ComboAd
  
  std::string getCarbonHostName();
  size_t parseRFC1035CharString(const std::string &in, std::string &val); // from ragel
+ size_t parseSVCBValueListFromParsedRFC1035CharString(const std::string &in, vector<std::string> &val); // from ragel
+ size_t parseSVCBValueList(const std::string &in, vector<std::string> &val);
  
  std::string makeLuaString(const std::string& in);
 +
 +// Used in NID and L64 records
 +typedef uint8_t NodeOrLocatorID[8];
Simple merge
Simple merge
Simple merge
index bf521f197084b67fe0c27d6e4e2e7197b595d292,ca9522b81efaa2ce65ecb8af0fb0544695f7de0f..2cf75da507a494466b21c5e84b7e445ca5c6d63b
@@@ -229,14 -229,15 +229,22 @@@ BOOST_AUTO_TEST_CASE(test_record_types
       (CASE_S(QType::SVCB, "16 foo.powerdns.org. mandatory=alpn alpn=h2,h3 ipv4hint=192.0.2.1", "\0\x10\3foo\x08powerdns\x03org\x00\x00\x00\x00\x02\x00\x01\x00\x01\x00\x06\x02h2\x02h3\x00\x04\x00\x04\xc0\x00\x02\x01"))
       (CASE_L(QType::SVCB, "16 foo.powerdns.org. alpn=h2,h3 mandatory=alpn ipv4hint=192.0.2.1", "16 foo.powerdns.org. mandatory=alpn alpn=h2,h3 ipv4hint=192.0.2.1", "\0\x10\3foo\x08powerdns\x03org\x00\x00\x00\x00\x02\x00\x01\x00\x01\x00\x06\x02h2\x02h3\x00\x04\x00\x04\xc0\x00\x02\x01"))
  
+      // IPv4hint is quoted
+      (CASE_L(QType::SVCB, "16 foo.powerdns.org. alpn=h2,h3 mandatory=alpn ipv4hint=\"192.0.2.1\"", "16 foo.powerdns.org. mandatory=alpn alpn=h2,h3 ipv4hint=192.0.2.1", "\0\x10\3foo\x08powerdns\x03org\x00\x00\x00\x00\x02\x00\x01\x00\x01\x00\x06\x02h2\x02h3\x00\x04\x00\x04\xc0\x00\x02\x01"))
+      // Escaped ALPN value
+      (CASE_S(QType::SVCB, R"FOO(1 foo.powerdns.org. alpn=h3\\,cool,h2)FOO", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x01\x00\x0b\x07h3,cool\x02h2"))
+      (CASE_S(QType::SVCB, R"FOO(1 foo.powerdns.org. alpn=h\\\\3\\,cool,h2)FOO", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x01\x00\x0c\x08h\\3,cool\x02h2"))
+      // Escaped _and_ spaced ALPN value
+      (CASE_S(QType::SVCB, R"FOO(1 foo.powerdns.org. alpn="h3\\,co ol,h2")FOO", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x01\x00\x0c\x08h3,co ol\x02h2"))
       (CASE_S(QType::SPF, "\"v=spf1 a:mail.rec.test ~all\"", "\x1bv=spf1 a:mail.rec.test ~all"))
 +
 +     (CASE_S(QType::NID, "15 0123:4567:89AB:CDEF", "\x00\x0F\x01\x23\x45\x67\x89\xab\xcd\xef"))
 +     (CASE_S(QType::NID, "15 2001:0DB8:1234:ABCD", "\x00\x0F\x20\x01\x0d\xb8\x12\x34\xab\xcd"))
 +     (CASE_S(QType::L32, "513 192.0.2.1", "\x02\x01\xc0\x00\x02\x01"))
 +     (CASE_S(QType::L64, "255 2001:0DB8:1234:ABCD", "\x00\xFF\x20\x01\x0d\xb8\x12\x34\xab\xcd"))
 +     (CASE_S(QType::LP, "512 foo.powerdns.org.", "\x02\x00\3foo\x08powerdns\x03org\x00"))
 +
       (CASE_S(QType::EUI48, "00-11-22-33-44-55", "\x00\x11\x22\x33\x44\x55"))
       (CASE_S(QType::EUI64, "00-11-22-33-44-55-66-77", "\x00\x11\x22\x33\x44\x55\x66\x77"))
       (CASE_S(QType::TKEY, "gss-tsig. 12345 12345 3 21 4 dGVzdA== 4 dGVzdA==", "\x08gss-tsig\x00\x00\x00\x30\x39\x00\x00\x30\x39\x00\x03\x00\x15\x00\x04test\x00\x04test"))