]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
SVCB: rename echconfig to ech (per draft -05)
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 30 Apr 2021 08:34:02 +0000 (10:34 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 30 Apr 2021 08:34:02 +0000 (10:34 +0200)
pdns/dnsparser.cc
pdns/dnswriter.cc
pdns/rcpgenerator.cc
pdns/svc-records.cc
pdns/svc-records.hh
pdns/test-dnsrecords_cc.cc
pdns/test-dnswriter_cc.cc
pdns/test-rcpgenerator_cc.cc
pdns/test-svc_records_cc.cc
regression-tests.api/test_Zones.py

index ccdcddfd0757a7aa08d6d2f76931b7bb6b055b37..10327144841f60ab6ce926a9a8b70acfba6bc57f 100644 (file)
@@ -649,7 +649,7 @@ void PacketReader::xfrSvcParamKeyVals(set<SvcParam> &kvs) {
       kvs.insert(SvcParam(key, std::move(addresses)));
       break;
     }
-    case SvcParam::echconfig: {
+    case SvcParam::ech: {
       std::string blob;
       blob.reserve(len);
       xfrBlobNoSpaces(blob, len);
index 1255dbea73a7e8c78285acb4d2fecb68116a19b6..5bf32a182e8af3788180fe9424857e87af5675ec 100644 (file)
@@ -437,9 +437,9 @@ template <typename Container> void GenericDNSPacketWriter<Container>::xfrSvcPara
         xfrCAWithoutPort(param.getKey(), a);
       }
       break;
-    case SvcParam::echconfig:
-      xfr16BitInt(param.getEchConfig().size()); // size
-      xfrBlobNoSpaces(param.getEchConfig());
+    case SvcParam::ech:
+      xfr16BitInt(param.getECH().size()); // size
+      xfrBlobNoSpaces(param.getECH());
       break;
     default:
       xfr16BitInt(param.getValue().size());
index 3b5ce6f1ade2e08debd26313d313511091c0dec9..ddda75c9eb0df1cc7a72263ed6eaf7be33078cf4 100644 (file)
@@ -413,7 +413,7 @@ void RecordTextReader::xfrSvcParamKeyVals(set<SvcParam>& val)
       val.insert(SvcParam(key, port));
       break;
     }
-    case SvcParam::echconfig: {
+    case SvcParam::ech: {
       bool haveQuote = d_string.at(d_pos) == '"';
       if (haveQuote) {
         d_pos++;
@@ -422,7 +422,7 @@ void RecordTextReader::xfrSvcParamKeyVals(set<SvcParam>& val)
       xfrBlobNoSpaces(value);
       if (haveQuote) {
         if (d_string.at(d_pos) != '"') {
-          throw RecordTextException("echconfig value starts, but does not end with a '\"' symbol");
+          throw RecordTextException("ech value starts, but does not end with a '\"' symbol");
         }
         d_pos++;
       }
@@ -865,10 +865,10 @@ void RecordTextWriter::xfrSvcParamKeyVals(const set<SvcParam>& val) {
       d_string = str + d_string;
       break;
     }
-    case SvcParam::echconfig: {
+    case SvcParam::ech: {
       auto str = d_string;
       d_string.clear();
-      xfrBlobNoSpaces(param.getEchConfig());
+      xfrBlobNoSpaces(param.getECH());
       d_string = str + '"' + d_string + '"';
       break;
     }
index 0b04f31e057da95878bf280f1df095d5f227e790..90d1e77a982900f0499e1b95a0ba989cb0805d6f 100644 (file)
@@ -29,7 +29,7 @@ const std::map<std::string, SvcParam::SvcParamKey> SvcParam::SvcParams = {
   {"no-default-alpn", SvcParam::SvcParamKey::no_default_alpn},
   {"port", SvcParam::SvcParamKey::port},
   {"ipv4hint", SvcParam::SvcParamKey::ipv4hint},
-  {"echconfig", SvcParam::SvcParamKey::echconfig},
+  {"ech", SvcParam::SvcParamKey::ech},
   {"ipv6hint", SvcParam::SvcParamKey::ipv6hint}
 };
 
@@ -67,13 +67,13 @@ SvcParam::SvcParam(const SvcParamKey &key) {
 
 SvcParam::SvcParam(const SvcParamKey &key, const std::string &value) {
   d_key = key;
-  if (d_key != SvcParamKey::echconfig && d_key < 7) {
+  if (d_key != SvcParamKey::ech && d_key < 7) {
     throw std::invalid_argument("can not create SvcParam for " + keyToString(key) + " with a string value");
   }
-  if (d_key == SvcParamKey::echconfig) {
+  if (d_key == SvcParamKey::ech) {
     std::string d;
     // TODO check Base64 decode
-    d_echconfig = value;
+    d_ech = value;
     return;
   }
   d_value = value;
@@ -166,11 +166,11 @@ const std::set<SvcParam::SvcParamKey>& SvcParam::getMandatory() const {
   return d_mandatory;
 }
 
-const std::string& SvcParam::getEchConfig() const {
-  if (d_key != SvcParam::echconfig) {
-    throw std::invalid_argument("getEchConfig called for non-echconfig key '" + keyToString(d_key) + "'");
+const std::string& SvcParam::getECH() const {
+  if (d_key != SvcParam::ech) {
+    throw std::invalid_argument("getECH called for non-ech key '" + keyToString(d_key) + "'");
   }
-  return d_echconfig;
+  return d_ech;
 }
 
 const std::string& SvcParam::getValue() const {
index 1ac4eedb43abb673f7d6838a35025e0424b09c68..5f154c99f8fb1d01ecd3cc58d805d51c71b77121 100644 (file)
@@ -37,7 +37,7 @@ class SvcParam {
       no_default_alpn = 2,
       port = 3,
       ipv4hint = 4,
-      echconfig = 5,
+      ech = 5,
       ipv6hint = 6
     };
 
@@ -47,7 +47,7 @@ class SvcParam {
   //! To create a value-less SvcParam (like no-default-alpn)
   SvcParam(const SvcParamKey &key);
 
-  //! To create a "generic" SvcParam (for keyNNNNN and echconfig)
+  //! To create a "generic" SvcParam (for keyNNNNN and ech)
   SvcParam(const SvcParamKey &key, const std::string &value);
 
   //! To create a multi-value SvcParam (like mandatory)
@@ -81,7 +81,7 @@ class SvcParam {
   const std::vector<ComboAddress>& getIPHints() const;
   const std::vector<std::string>& getALPN() const;
   const std::set<SvcParamKey>& getMandatory() const;
-  const std::string& getEchConfig() const;
+  const std::string& getECH() const;
   const std::string& getValue() const;
 
   bool getAutoHint() const { return d_autohint; };
@@ -94,7 +94,7 @@ class SvcParam {
     std::vector<std::string> d_alpn; // For ALPN
     std::set<SvcParamKey> d_mandatory; // For mandatory
     std::vector<ComboAddress> d_ipHints; // For ipv{6,4}hints
-    std::string d_echconfig; // For echconfig
+    std::string d_ech; // For Encrypted Client Hello
     uint16_t d_port{0}; // For port
 
     // Set to true if we encountered an "auto" field in hints
index 0f7161d0db4e0b5775b1e94e92abca84da862f9b..06d1661d1b4230fc207bf8e0ae2f90e9b9631d94 100644 (file)
@@ -217,8 +217,8 @@ BOOST_AUTO_TEST_CASE(test_record_types) {
      (CASE_S(QType::SVCB, "1 foo.powerdns.org. alpn=h3,h2", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x01\x00\x06\x02h3\x02h2"))
      (CASE_S(QType::SVCB, "1 foo.powerdns.org. port=53", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x03\x00\x02\x00\x35"))
      (CASE_S(QType::SVCB, "1 foo.powerdns.org. ipv4hint=192.0.2.53,192.0.2.2", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x04\x00\x08\xc0\x00\x02\x35\xc0\x00\x02\x02"))
-     (CASE_S(QType::SVCB, "1 foo.powerdns.org. echconfig=\"aGVsbG8=\"", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x05\x00\x05hello"))
-     (CASE_L(QType::SVCB, "1 foo.powerdns.org. echconfig=aGVsbG8=", "1 foo.powerdns.org. echconfig=\"aGVsbG8=\"", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x05\x00\x05hello"))
+     (CASE_S(QType::SVCB, "1 foo.powerdns.org. ech=\"aGVsbG8=\"", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x05\x00\x05hello"))
+     (CASE_L(QType::SVCB, "1 foo.powerdns.org. ech=aGVsbG8=", "1 foo.powerdns.org. ech=\"aGVsbG8=\"", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x05\x00\x05hello"))
      (CASE_S(QType::SVCB, "1 foo.powerdns.org. ipv6hint=2001:db8::1,2001:db8::53:1", "\0\x01\3foo\x08powerdns\x03org\x00\x00\x06\x00\x20\x20\x01\x0d\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x20\x01\x0d\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\x00\x01"))
 
      (CASE_S(QType::SVCB, "1 foo.powerdns.org. key666=\"hello\"", "\0\x01\3foo\x08powerdns\x03org\x00\x02\x9a\x00\x005hello"))
index dd939c0c1915c072c27f5513d9be2b78e619a138..bef0a81c61465175cc75a3b55ed978c2105d066c 100644 (file)
@@ -195,13 +195,13 @@ BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_ipv4hint) {
   BOOST_CHECK(c == vector<uint8_t>({0,4,0,8,192,0,2,1,192,0,2,2}));
 }
 
-BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_echconfig) {
+BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_ech) {
   DNSName name("powerdns.com.");
   vector<uint8_t> packet;
   DNSPacketWriter pwR(packet, name, QType::SVCB, QClass::IN, 0);
   pwR.getHeader()->qr = 1;
 
-  set<SvcParam> params({SvcParam(SvcParam::echconfig, "a very bogus echconfig value")});
+  set<SvcParam> params({SvcParam(SvcParam::ech, "a very bogus echconfig value")});
 
   pwR.startRecord(name, QType::SVCB);
   pwR.commit();
index e2fd947d83e896b84972158d4a4739714f8ce22c..c2ea8ea4f4f00403ee7b43386749612cc5fd7caa 100644 (file)
@@ -326,7 +326,7 @@ BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_generic) {
 }
 
 BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_multiple) {
-        RecordTextReader rtr("key666=foobar echconfig=\"dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU=\" ipv6hint=2001:db8::1 alpn=h2,h3 mandatory=alpn ipv4hint=192.0.2.1,192.0.2.2"); // out of order, resulting set should be in-order
+        RecordTextReader rtr("key666=foobar ech=\"dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU=\" ipv6hint=2001:db8::1 alpn=h2,h3 mandatory=alpn ipv4hint=192.0.2.1,192.0.2.2"); // out of order, resulting set should be in-order
         set<SvcParam> v;
         rtr.xfrSvcParamKeyVals(v);
         BOOST_CHECK_EQUAL(v.size(), 6U);
@@ -344,7 +344,7 @@ BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_multiple) {
                         BOOST_CHECK(vit->getKey() == SvcParam::ipv4hint);
                 }
                 if (i == 3) {
-                        BOOST_CHECK(vit->getKey() == SvcParam::echconfig);
+                        BOOST_CHECK(vit->getKey() == SvcParam::ech);
                 }
                 if (i == 4) {
                         BOOST_CHECK(vit->getKey() == SvcParam::ipv6hint);
@@ -359,18 +359,18 @@ BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_multiple) {
         string target;
         RecordTextWriter rtw(target);
         rtw.xfrSvcParamKeyVals(v);
-        BOOST_CHECK_EQUAL(target, "mandatory=alpn alpn=h2,h3 ipv4hint=192.0.2.1,192.0.2.2 echconfig=\"dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU=\" ipv6hint=2001:db8::1 key666=\"foobar\"");
+        BOOST_CHECK_EQUAL(target, "mandatory=alpn alpn=h2,h3 ipv4hint=192.0.2.1,192.0.2.2 ech=\"dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU=\" ipv6hint=2001:db8::1 key666=\"foobar\"");
 }
 
-BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_echconfig) {
-        string source("echconfig=\"dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU=\"");
+BOOST_AUTO_TEST_CASE(test_xfrSvcParamKeyVals_ech) {
+        string source("ech=\"dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU=\"");
         RecordTextReader rtr(source);
         set<SvcParam> v;
         rtr.xfrSvcParamKeyVals(v);
         BOOST_CHECK_EQUAL(v.size(), 1U);
         auto k = v.begin()->getKey();
-        BOOST_CHECK(k == SvcParam::echconfig);
-        auto val = v.begin()->getEchConfig();
+        BOOST_CHECK(k == SvcParam::ech);
+        auto val = v.begin()->getECH();
         BOOST_CHECK_EQUAL(val, "totally bogus echconfig value"); // decoded!
 
         // Check the writer
index 9571b63b983a753465864e253153fd97607a6a90..a096cc68c1ab69028edb4c931f618aa46e7bd79e 100644 (file)
@@ -34,9 +34,9 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_keyFromString) {
     BOOST_CHECK(k == 4);
     BOOST_CHECK(k == SvcParam::ipv4hint);
 
-    k = SvcParam::keyFromString("echconfig");
+    k = SvcParam::keyFromString("ech");
     BOOST_CHECK(k == 5);
-    BOOST_CHECK(k == SvcParam::echconfig);
+    BOOST_CHECK(k == SvcParam::ech);
 
     k = SvcParam::keyFromString("ipv6hint");
     BOOST_CHECK(k == 6);
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_keyToString) {
     BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::no_default_alpn), "no-default-alpn");
     BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::port), "port");
     BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::ipv4hint), "ipv4hint");
-    BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::echconfig), "echconfig");
+    BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::ech), "ech");
     BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::ipv6hint), "ipv6hint");
     BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::SvcParamKey(7)), "key7");
     BOOST_CHECK_EQUAL(SvcParam::keyToString(SvcParam::SvcParamKey(666)), "key666");
@@ -82,8 +82,8 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_value) {
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv4hint, val), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv6hint, val), std::invalid_argument);
 
-    BOOST_CHECK_NO_THROW(param = SvcParam(SvcParam::echconfig, base64val));
-    BOOST_CHECK_EQUAL(param.getEchConfig(), base64val);
+    BOOST_CHECK_NO_THROW(param = SvcParam(SvcParam::ech, base64val));
+    BOOST_CHECK_EQUAL(param.getECH(), base64val);
     BOOST_CHECK_THROW(param.getValue(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getALPN(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getIPHints(), std::invalid_argument);
@@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_value) {
     BOOST_CHECK_THROW(param.getPort(), std::invalid_argument);
 
     // TODO test bad base64 value
-    // BOOST_CHECK_THROW(SvcParam(SvcParam::echconfig, val), std::invalid_argument);
+    // BOOST_CHECK_THROW(SvcParam(SvcParam::ech, val), std::invalid_argument);
 
     // Any string is allowed.....
     BOOST_CHECK_NO_THROW(param = SvcParam(SvcParam::keyFromString("key666"), base64val));
@@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_value) {
     BOOST_CHECK_EQUAL(param.getValue(), val);
 
     BOOST_CHECK_THROW(param.getALPN(), std::invalid_argument);
-    BOOST_CHECK_THROW(param.getEchConfig(), std::invalid_argument);
+    BOOST_CHECK_THROW(param.getECH(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getIPHints(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getMandatory(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getPort(), std::invalid_argument);
@@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_set_string_value) {
     BOOST_CHECK_THROW(SvcParam(SvcParam::no_default_alpn, std::move(val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::port, std::move(val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv4hint, std::move(val)), std::invalid_argument);
-    BOOST_CHECK_THROW(SvcParam(SvcParam::echconfig, std::move(val)), std::invalid_argument);
+    BOOST_CHECK_THROW(SvcParam(SvcParam::ech, std::move(val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv6hint, std::move(val)), std::invalid_argument);
 
     set<string> mandatoryVal = {"alpn", "key666"};
@@ -124,7 +124,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_set_string_value) {
     auto retval = param.getMandatory();
     BOOST_CHECK(retval == mandatoryExpected);
     BOOST_CHECK_THROW(param.getALPN(), std::invalid_argument);
-    BOOST_CHECK_THROW(param.getEchConfig(), std::invalid_argument);
+    BOOST_CHECK_THROW(param.getECH(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getIPHints(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getPort(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getValue(), std::invalid_argument);
@@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_vector_string_value) {
     BOOST_CHECK_THROW(SvcParam(SvcParam::no_default_alpn, std::move(val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::port, std::move(val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv4hint, std::move(val)), std::invalid_argument);
-    BOOST_CHECK_THROW(SvcParam(SvcParam::echconfig, std::move(val)), std::invalid_argument);
+    BOOST_CHECK_THROW(SvcParam(SvcParam::ech, std::move(val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv6hint, std::move(val)), std::invalid_argument);
 
     SvcParam param;
@@ -147,7 +147,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_vector_string_value) {
 
     BOOST_CHECK_EQUAL_COLLECTIONS(alpns.begin(), alpns.end(), checkVal.begin(), checkVal.end());
     BOOST_CHECK_THROW(param.getMandatory(), std::invalid_argument);
-    BOOST_CHECK_THROW(param.getEchConfig(), std::invalid_argument);
+    BOOST_CHECK_THROW(param.getECH(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getIPHints(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getPort(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getValue(), std::invalid_argument);
@@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_set_comboaddress_value) {
     BOOST_CHECK_THROW(SvcParam(SvcParam::alpn, std::move(v4Val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::no_default_alpn, std::move(v4Val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::port, std::move(v4Val)), std::invalid_argument);
-    BOOST_CHECK_THROW(SvcParam(SvcParam::echconfig, std::move(v4Val)), std::invalid_argument);
+    BOOST_CHECK_THROW(SvcParam(SvcParam::ech, std::move(v4Val)), std::invalid_argument);
 
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv6hint, std::move(v4Val)), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv4hint, std::move(v6Val)), std::invalid_argument);
@@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_set_comboaddress_value) {
     BOOST_CHECK(retval == v4CheckVal);
     BOOST_CHECK_THROW(param.getMandatory(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getALPN(), std::invalid_argument);
-    BOOST_CHECK_THROW(param.getEchConfig(), std::invalid_argument);
+    BOOST_CHECK_THROW(param.getECH(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getPort(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getValue(), std::invalid_argument);
 
@@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_set_comboaddress_value) {
     BOOST_CHECK(retval == v6CheckVal);
     BOOST_CHECK_THROW(param.getMandatory(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getALPN(), std::invalid_argument);
-    BOOST_CHECK_THROW(param.getEchConfig(), std::invalid_argument);
+    BOOST_CHECK_THROW(param.getECH(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getPort(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getValue(), std::invalid_argument);
 }
@@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_uint16_value) {
     BOOST_CHECK_THROW(SvcParam(SvcParam::alpn, port), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::no_default_alpn, port), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv4hint, port), std::invalid_argument);
-    BOOST_CHECK_THROW(SvcParam(SvcParam::echconfig, port), std::invalid_argument);
+    BOOST_CHECK_THROW(SvcParam(SvcParam::ech, port), std::invalid_argument);
     BOOST_CHECK_THROW(SvcParam(SvcParam::ipv6hint, port), std::invalid_argument);
 
     SvcParam param;
@@ -213,7 +213,7 @@ BOOST_AUTO_TEST_CASE(test_SvcParam_ctor_uint16_value) {
     BOOST_CHECK_EQUAL(param.getPort(), port);
     BOOST_CHECK_THROW(param.getMandatory(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getALPN(), std::invalid_argument);
-    BOOST_CHECK_THROW(param.getEchConfig(), std::invalid_argument);
+    BOOST_CHECK_THROW(param.getECH(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getIPHints(), std::invalid_argument);
     BOOST_CHECK_THROW(param.getValue(), std::invalid_argument);
 }
index 1c1688c517c9317e16395600f828a10eaaed3902..eb7ad5693c2fb261c3d462c35bafd1a40b93713c 100644 (file)
@@ -1477,7 +1477,7 @@ $ORIGIN %NAME%
             'ttl': 3600,
             'records': [
                 {
-                    "content": '40 . mandatory=alpn alpn=h2,h3 ipv4hint=192.0.2.1,192.0.2.2 echconfig="dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU="',
+                    "content": '40 . mandatory=alpn alpn=h2,h3 ipv4hint=192.0.2.1,192.0.2.2 ech="dG90YWxseSBib2d1cyBlY2hjb25maWcgdmFsdWU="',
                     "disabled": False
                 },
             ]