BIND 10 master, updated. 49e6644811a7ad09e1326f20dd73ab43116dfd21 Merge branch 'master' into trac2124

BIND 10 source code commits bind10-changes at lists.isc.org
Sun Jul 29 21:41:59 UTC 2012


The branch, master has been updated
       via  49e6644811a7ad09e1326f20dd73ab43116dfd21 (commit)
       via  2c8689536e71f5258ecf01b7fdc5c00644e1feeb (commit)
       via  9b88b6be9672b0f0c683cf51fe9a23c5332d0300 (commit)
       via  5a7c29f6d80ca982c4c48357af6833381268b590 (commit)
       via  d2355e5f5b2bfc9dc85f0670bf28fc7d47433b1d (commit)
       via  a09cb3f049e97d207fed3345a97af0458f23a345 (commit)
       via  40175938620af9a6c5116ef93418874bc53c3b1e (commit)
       via  d71f7e9f7c16bbe923a2d3e473b1118e762f73ef (commit)
       via  73080d999ec47baa78877697fadccc2cb5e99c51 (commit)
       via  595b447c655af350fdb1f93528f4f05af3f5aa9f (commit)
       via  26401e4e861462c03f689c32f97f49d582a64a5b (commit)
       via  31477bf85002788f773532657e00cdf8e11a1995 (commit)
       via  3b82a4fda312a144d2883de96da76386ec199eea (commit)
       via  16cd39d09fbdf9c2121b9aa0cbe124355f42f134 (commit)
       via  d75a744fcd766bdedc2e7c49890c80c3606e3550 (commit)
       via  6efceeee9d4af8525513e9701d975a9f1bf57eb0 (commit)
       via  67872ac4ab32dd0bf8dcc02d724b84f8aab87413 (commit)
       via  5e7af00c87fdb082fcaf024727de244a822513c5 (commit)
       via  25e34715a248f5ef26648093be23a391438a84f4 (commit)
       via  63c345f54424efeabf4e6e40ff9f62eee9f8b59e (commit)
       via  2d714adfc87c6f8d5e20d408eec1a521605c127f (commit)
       via  d0d70f211833ccd8071704d3fec8858e79f4304d (commit)
       via  045ede28af3d51c72a5333bd8069d90c3e91a46f (commit)
       via  d448a7e8c847e7842e5cb3c92e8ea673fba9544d (commit)
       via  50d012ed556335386d1340f21c1acaeecb2dd357 (commit)
      from  8fa723bfd4e41dca1c398dfc1350b419d50facea (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 49e6644811a7ad09e1326f20dd73ab43116dfd21
Merge: 2c86895 8fa723b
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Jul 30 02:36:47 2012 +0530

    Merge branch 'master' into trac2124

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/rdata/generic/sshfp_44.cc              |  105 +++++++-----
 src/lib/dns/rdata/generic/sshfp_44.h               |    5 +-
 src/lib/dns/tests/rdata_sshfp_unittest.cc          |  167 +++++++++++++++++++-
 src/lib/dns/tests/testdata/.gitignore              |    6 +
 src/lib/dns/tests/testdata/Makefile.am             |    8 +
 src/lib/dns/tests/testdata/rdata_sshfp_fromWire10  |    6 +
 src/lib/dns/tests/testdata/rdata_sshfp_fromWire11  |    4 +
 src/lib/dns/tests/testdata/rdata_sshfp_fromWire12  |    4 +
 .../dns/tests/testdata/rdata_sshfp_fromWire3.spec  |    8 +
 .../dns/tests/testdata/rdata_sshfp_fromWire4.spec  |    8 +
 .../dns/tests/testdata/rdata_sshfp_fromWire5.spec  |    8 +
 .../dns/tests/testdata/rdata_sshfp_fromWire6.spec  |    8 +
 .../dns/tests/testdata/rdata_sshfp_fromWire7.spec  |    8 +
 .../dns/tests/testdata/rdata_sshfp_fromWire8.spec  |    9 ++
 ...{rdata_sshfp_fromWire => rdata_sshfp_fromWire9} |    6 +-
 15 files changed, 308 insertions(+), 52 deletions(-)
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire10
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire11
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire12
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire3.spec
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire4.spec
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire5.spec
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire6.spec
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire7.spec
 create mode 100644 src/lib/dns/tests/testdata/rdata_sshfp_fromWire8.spec
 copy src/lib/dns/tests/testdata/{rdata_sshfp_fromWire => rdata_sshfp_fromWire9} (56%)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/sshfp_44.cc b/src/lib/dns/rdata/generic/sshfp_44.cc
index f4bbb53..64b3cc1 100644
--- a/src/lib/dns/rdata/generic/sshfp_44.cc
+++ b/src/lib/dns/rdata/generic/sshfp_44.cc
@@ -35,88 +35,95 @@ using namespace isc::util::encode;
 // BEGIN_ISC_NAMESPACE
 // BEGIN_RDATA_NAMESPACE
 
-SSHFP::SSHFP(InputBuffer& buffer, size_t rdata_len)
-{
+SSHFP::SSHFP(InputBuffer& buffer, size_t rdata_len) {
     if (rdata_len < 2) {
-      isc_throw(InvalidRdataLength, "SSHFP record too short");
+        isc_throw(InvalidRdataLength, "SSHFP record too short");
     }
 
     algorithm_ = buffer.readUint8();
     fingerprint_type_ = buffer.readUint8();
 
     rdata_len -= 2;
-    fingerprint_.resize(rdata_len);
-    buffer.readData(&fingerprint_[0], rdata_len);
+    if (rdata_len > 0) {
+        fingerprint_.resize(rdata_len);
+        buffer.readData(&fingerprint_[0], rdata_len);
+    }
 }
 
-SSHFP::SSHFP(const std::string& sshfp_str)
-{
+SSHFP::SSHFP(const std::string& sshfp_str) {
     std::istringstream iss(sshfp_str);
-    // peekc should be of iss's char_type for isspace to work
-    std::istringstream::char_type peekc;
     std::stringbuf fingerprintbuf;
     uint32_t algorithm, fingerprint_type;
 
     iss >> algorithm >> fingerprint_type;
     if (iss.bad() || iss.fail()) {
-      isc_throw(InvalidRdataText, "Invalid SSHFP text");
+        isc_throw(InvalidRdataText, "Invalid SSHFP text");
     }
-    if ((algorithm < 1) || (algorithm > 2)) {
-      isc_throw(InvalidRdataText, "SSHFP algorithm number out of range");
-    }
-    if (fingerprint_type != 1) {
-      isc_throw(InvalidRdataText, "SSHFP fingerprint type out of range");
+
+    if (algorithm > 255) {
+        isc_throw(InvalidRdataText, "SSHFP algorithm number out of range");
     }
 
-    iss.read(&peekc, 1);
-    if (!iss.good() || !isspace(peekc, iss.getloc())) {
-      isc_throw(InvalidRdataText, "SSHFP presentation format error");
+    if (fingerprint_type > 255) {
+        isc_throw(InvalidRdataText, "SSHFP fingerprint type out of range");
     }
 
     iss >> &fingerprintbuf;
+    try {
+        decodeHex(fingerprintbuf.str(), fingerprint_);
+    } catch (const isc::BadValue& e) {
+        isc_throw(InvalidRdataText,
+                  "Bad SSHFP fingerprint: " << e.what());
+    }
 
     algorithm_ = algorithm;
     fingerprint_type_ = fingerprint_type;
-    decodeHex(fingerprintbuf.str(), fingerprint_);
 }
 
-SSHFP::SSHFP(uint8_t algorithm, uint8_t fingerprint_type, const std::string& fingerprint)
+SSHFP::SSHFP(uint8_t algorithm, uint8_t fingerprint_type,
+             const std::string& fingerprint)
 {
-    if ((algorithm < 1) || (algorithm > 2)) {
-      isc_throw(InvalidRdataText, "SSHFP algorithm number out of range");
-    }
-    if (fingerprint_type != 1) {
-      isc_throw(InvalidRdataText, "SSHFP fingerprint type out of range");
-    }
-
     algorithm_ = algorithm;
     fingerprint_type_ = fingerprint_type;
-    decodeHex(fingerprint, fingerprint_);
+
+    try {
+        decodeHex(fingerprint, fingerprint_);
+    } catch (const isc::BadValue& e) {
+        isc_throw(InvalidRdataText, "Bad SSHFP fingerprint: " << e.what());
+    }
 }
 
 SSHFP::SSHFP(const SSHFP& other) :
-  Rdata(), algorithm_(other.algorithm_), fingerprint_type_(other.fingerprint_type_), fingerprint_(other.fingerprint_)
+  Rdata(), algorithm_(other.algorithm_),
+  fingerprint_type_(other.fingerprint_type_),
+  fingerprint_(other.fingerprint_)
 {}
 
 void
 SSHFP::toWire(OutputBuffer& buffer) const {
     buffer.writeUint8(algorithm_);
     buffer.writeUint8(fingerprint_type_);
-    buffer.writeData(&fingerprint_[0], fingerprint_.size());
+
+    if (!fingerprint_.empty()) {
+        buffer.writeData(&fingerprint_[0], fingerprint_.size());
+    }
 }
 
 void
 SSHFP::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint8(algorithm_);
     renderer.writeUint8(fingerprint_type_);
-    renderer.writeData(&fingerprint_[0], fingerprint_.size());
+
+    if (!fingerprint_.empty()) {
+        renderer.writeData(&fingerprint_[0], fingerprint_.size());
+    }
 }
 
 string
 SSHFP::toText() const {
     return (lexical_cast<string>(static_cast<int>(algorithm_)) +
             " " + lexical_cast<string>(static_cast<int>(fingerprint_type_)) +
-            " " + encodeHex(fingerprint_));
+            (fingerprint_.empty() ? "" : " " + encodeHex(fingerprint_)));
 }
 
 int
@@ -138,27 +145,41 @@ SSHFP::compare(const Rdata& other) const {
         return (1);
     }
 
-    size_t this_len = fingerprint_.size();
-    size_t other_len = other_sshfp.fingerprint_.size();
-    size_t cmplen = min(this_len, other_len);
-    int cmp = memcmp(&fingerprint_[0], &other_sshfp.fingerprint_[0], cmplen);
-    if (cmp != 0) {
-      return (cmp);
+    const size_t this_len = fingerprint_.size();
+    const size_t other_len = other_sshfp.fingerprint_.size();
+    const size_t cmplen = min(this_len, other_len);
+
+    if (cmplen > 0) {
+        const int cmp = memcmp(&fingerprint_[0], &other_sshfp.fingerprint_[0],
+                               cmplen);
+        if (cmp != 0) {
+            return (cmp);
+        }
+    }
+
+    if (this_len == other_len) {
+        return (0);
+    } else if (this_len < other_len) {
+        return (-1);
     } else {
-      return ((this_len == other_len)
-	      ? 0 : (this_len < other_len) ? -1 : 1);
+        return (1);
     }
 }
 
 uint8_t
-SSHFP::getSSHFPAlgorithmNumber() const {
+SSHFP::getAlgorithmNumber() const {
     return (algorithm_);
 }
 
 uint8_t
-SSHFP::getSSHFPFingerprintType() const {
+SSHFP::getFingerprintType() const {
     return (fingerprint_type_);
 }
 
+size_t
+SSHFP::getFingerprintLen() const {
+    return (fingerprint_.size());
+}
+
 // END_RDATA_NAMESPACE
 // END_ISC_NAMESPACE
diff --git a/src/lib/dns/rdata/generic/sshfp_44.h b/src/lib/dns/rdata/generic/sshfp_44.h
index c3ba944..d9ebea4 100644
--- a/src/lib/dns/rdata/generic/sshfp_44.h
+++ b/src/lib/dns/rdata/generic/sshfp_44.h
@@ -38,8 +38,9 @@ public:
     ///
     /// Specialized methods
     ///
-    uint8_t getSSHFPAlgorithmNumber() const;
-    uint8_t getSSHFPFingerprintType() const;
+    uint8_t getAlgorithmNumber() const;
+    uint8_t getFingerprintType() const;
+    size_t getFingerprintLen() const;
 
 private:
     /// Note: this is a prototype version; we may reconsider
diff --git a/src/lib/dns/tests/rdata_sshfp_unittest.cc b/src/lib/dns/tests/rdata_sshfp_unittest.cc
index dd133ce..dccd8b1 100644
--- a/src/lib/dns/tests/rdata_sshfp_unittest.cc
+++ b/src/lib/dns/tests/rdata_sshfp_unittest.cc
@@ -41,6 +41,18 @@ class Rdata_SSHFP_Test : public RdataTest {
 
 const string sshfp_txt("2 1 123456789abcdef67890123456789abcdef67890");
 const generic::SSHFP rdata_sshfp(2, 1, "123456789abcdef67890123456789abcdef67890");
+const uint8_t rdata_sshfp_wiredata[] = {
+    // algorithm
+    0x02,
+    // fingerprint type
+    0x01,
+    // fingerprint
+    0x12, 0x34, 0x56, 0x78,
+    0x9a, 0xbc, 0xde, 0xf6,
+    0x78, 0x90, 0x12, 0x34,
+    0x56, 0x78, 0x9a, 0xbc,
+    0xde, 0xf6, 0x78, 0x90
+};
 
 TEST_F(Rdata_SSHFP_Test, createFromText) {
     // Basic test
@@ -56,9 +68,34 @@ TEST_F(Rdata_SSHFP_Test, createFromText) {
     EXPECT_EQ(0, rdata_sshfp4.compare(rdata_sshfp));
 }
 
+TEST_F(Rdata_SSHFP_Test, algorithmTypes) {
+    // Some of these may not be RFC conformant, but we relax the check
+    // in our code to work with algorithm and fingerprint types that may
+    // show up in the future.
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 1 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("2 1 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("3 1 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("128 1 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("255 1 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 1 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 2 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 3 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 128 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 255 12ab"));
+
+    // 0 is reserved, but we allow that too
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("0 1 12ab"));
+    EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 0 12ab"));
+
+    // > 255 would be broken
+    EXPECT_THROW(const generic::SSHFP rdata_sshfp("256 1 12ab"),
+                 InvalidRdataText);
+    EXPECT_THROW(const generic::SSHFP rdata_sshfp("2 256 12ab"),
+                 InvalidRdataText);
+}
+
 TEST_F(Rdata_SSHFP_Test, badText) {
     EXPECT_THROW(const generic::SSHFP rdata_sshfp("1"), InvalidRdataText);
-    EXPECT_THROW(const generic::SSHFP rdata_sshfp("1 2"), InvalidRdataText);
     EXPECT_THROW(const generic::SSHFP rdata_sshfp("BUCKLE MY SHOES"), InvalidRdataText);
     EXPECT_THROW(const generic::SSHFP rdata_sshfp("1 2 foo bar"), InvalidRdataText);
 }
@@ -77,18 +114,136 @@ TEST_F(Rdata_SSHFP_Test, createFromWire) {
     EXPECT_EQ(0, rdata_sshfp.compare(
                   *rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
                                         "rdata_sshfp_fromWire2")));
-    // TBD: more tests
+    // algorithm=1, fingerprint=1
+    EXPECT_NO_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                         "rdata_sshfp_fromWire3.wire"));
+
+    // algorithm=255, fingerprint=1
+    EXPECT_NO_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                         "rdata_sshfp_fromWire4.wire"));
+
+    // algorithm=0, fingerprint=1
+    EXPECT_NO_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                         "rdata_sshfp_fromWire5.wire"));
+
+    // algorithm=5, fingerprint=0
+    EXPECT_NO_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                         "rdata_sshfp_fromWire6.wire"));
+
+    // algorithm=255, fingerprint=255
+    EXPECT_NO_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                         "rdata_sshfp_fromWire7.wire"));
+
+    // short fingerprint data
+    EXPECT_NO_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                         "rdata_sshfp_fromWire8.wire"));
+
+    // fingerprint is shorter than rdata len
+    EXPECT_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                      "rdata_sshfp_fromWire9"),
+                 InvalidBufferPosition);
+
+    // fingerprint is missing
+    EXPECT_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                      "rdata_sshfp_fromWire10"),
+                 InvalidBufferPosition);
+
+    // all rdata is missing
+    EXPECT_THROW(rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                                      "rdata_sshfp_fromWire11"),
+                 InvalidBufferPosition);
 }
 
 TEST_F(Rdata_SSHFP_Test, toText) {
     EXPECT_TRUE(boost::iequals(sshfp_txt, rdata_sshfp.toText()));
+
+    const string sshfp_txt2("2 1");
+    const generic::SSHFP rdata_sshfp2(sshfp_txt2);
+    EXPECT_TRUE(boost::iequals(sshfp_txt2, rdata_sshfp2.toText()));
+
+    const generic::SSHFP rdata_sshfp3("2 1 ");
+    EXPECT_TRUE(boost::iequals(sshfp_txt2, rdata_sshfp3.toText()));
+}
+
+TEST_F(Rdata_SSHFP_Test, toWire) {
+    this->obuffer.clear();
+    rdata_sshfp.toWire(this->obuffer);
+
+    EXPECT_EQ(22, this->obuffer.getLength());
+
+    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
+                        this->obuffer.getData(),
+                        this->obuffer.getLength(),
+                        rdata_sshfp_wiredata, sizeof(rdata_sshfp_wiredata));
+}
+
+TEST_F(Rdata_SSHFP_Test, compare) {
+    const generic::SSHFP rdata_sshfp2("2 1");
+    EXPECT_EQ(-1, rdata_sshfp2.compare(rdata_sshfp));
+    EXPECT_EQ(1, rdata_sshfp.compare(rdata_sshfp2));
+}
+
+TEST_F(Rdata_SSHFP_Test, getAlgorithmNumber) {
+    EXPECT_EQ(2, rdata_sshfp.getAlgorithmNumber());
 }
 
-TEST_F(Rdata_SSHFP_Test, getSSHFPAlgorithmNumber) {
-    EXPECT_EQ(2, rdata_sshfp.getSSHFPAlgorithmNumber());
+TEST_F(Rdata_SSHFP_Test, getFingerprintType) {
+    EXPECT_EQ(1, rdata_sshfp.getFingerprintType());
 }
 
-TEST_F(Rdata_SSHFP_Test, getSSHFPFingerprintType) {
-    EXPECT_EQ(1, rdata_sshfp.getSSHFPFingerprintType());
+TEST_F(Rdata_SSHFP_Test, getFingerprintLen) {
+    EXPECT_EQ(20, rdata_sshfp.getFingerprintLen());
+}
+
+TEST_F(Rdata_SSHFP_Test, emptyFingerprintFromWire) {
+    const uint8_t rdf_wiredata[] = {
+        // algorithm
+        0x04,
+        // fingerprint type
+        0x09
+    };
+
+    const generic::SSHFP rdf =
+        dynamic_cast<const generic::SSHFP&>
+        (*rdataFactoryFromFile(RRType("SSHFP"), RRClass("IN"),
+                               "rdata_sshfp_fromWire12"));
+
+    EXPECT_EQ(4, rdf.getAlgorithmNumber());
+    EXPECT_EQ(9, rdf.getFingerprintType());
+    EXPECT_EQ(0, rdf.getFingerprintLen());
+
+    this->obuffer.clear();
+    rdf.toWire(this->obuffer);
+
+    EXPECT_EQ(2, this->obuffer.getLength());
+
+    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
+                        this->obuffer.getData(),
+                        this->obuffer.getLength(),
+                        rdf_wiredata, sizeof(rdf_wiredata));
+}
+
+TEST_F(Rdata_SSHFP_Test, emptyFingerprintFromString) {
+    const generic::SSHFP rdata_sshfp2("5 6");
+    const uint8_t rdata_sshfp2_wiredata[] = {
+        // algorithm
+        0x05,
+        // fingerprint type
+        0x06
+    };
+
+    EXPECT_EQ(5, rdata_sshfp2.getAlgorithmNumber());
+    EXPECT_EQ(6, rdata_sshfp2.getFingerprintType());
+    EXPECT_EQ(0, rdata_sshfp2.getFingerprintLen());
+
+    this->obuffer.clear();
+    rdata_sshfp2.toWire(this->obuffer);
+
+    EXPECT_EQ(2, this->obuffer.getLength());
+
+    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
+                        this->obuffer.getData(),
+                        this->obuffer.getLength(),
+                        rdata_sshfp2_wiredata, sizeof(rdata_sshfp2_wiredata));
 }
 }
diff --git a/src/lib/dns/tests/testdata/.gitignore b/src/lib/dns/tests/testdata/.gitignore
index e56355b..e8879e1 100644
--- a/src/lib/dns/tests/testdata/.gitignore
+++ b/src/lib/dns/tests/testdata/.gitignore
@@ -79,6 +79,12 @@
 /rdata_soa_toWireUncompressed.wire
 /rdata_sshfp_fromWire1.wire
 /rdata_sshfp_fromWire2.wire
+/rdata_sshfp_fromWire3.wire
+/rdata_sshfp_fromWire4.wire
+/rdata_sshfp_fromWire5.wire
+/rdata_sshfp_fromWire6.wire
+/rdata_sshfp_fromWire7.wire
+/rdata_sshfp_fromWire8.wire
 /rdata_tsig_fromWire1.wire
 /rdata_tsig_fromWire2.wire
 /rdata_tsig_fromWire3.wire
diff --git a/src/lib/dns/tests/testdata/Makefile.am b/src/lib/dns/tests/testdata/Makefile.am
index 043ea55..9352833 100644
--- a/src/lib/dns/tests/testdata/Makefile.am
+++ b/src/lib/dns/tests/testdata/Makefile.am
@@ -45,6 +45,9 @@ BUILT_SOURCES += rdata_rp_fromWire3.wire rdata_rp_fromWire4.wire
 BUILT_SOURCES += rdata_rp_fromWire5.wire rdata_rp_fromWire6.wire
 BUILT_SOURCES += rdata_rp_toWire1.wire rdata_rp_toWire2.wire
 BUILT_SOURCES += rdata_sshfp_fromWire1.wire rdata_sshfp_fromWire2.wire
+BUILT_SOURCES += rdata_sshfp_fromWire3.wire rdata_sshfp_fromWire4.wire
+BUILT_SOURCES += rdata_sshfp_fromWire5.wire rdata_sshfp_fromWire6.wire
+BUILT_SOURCES += rdata_sshfp_fromWire7.wire rdata_sshfp_fromWire8.wire
 BUILT_SOURCES += rdata_afsdb_fromWire1.wire rdata_afsdb_fromWire2.wire
 BUILT_SOURCES += rdata_afsdb_fromWire3.wire rdata_afsdb_fromWire4.wire
 BUILT_SOURCES += rdata_afsdb_fromWire5.wire
@@ -129,6 +132,11 @@ EXTRA_DIST += rdata_rp_fromWire5.spec rdata_rp_fromWire6.spec
 EXTRA_DIST += rdata_rp_toWire1.spec rdata_rp_toWire2.spec
 EXTRA_DIST += rdata_sshfp_fromWire rdata_sshfp_fromWire2
 EXTRA_DIST += rdata_sshfp_fromWire1.spec rdata_sshfp_fromWire2.spec
+EXTRA_DIST += rdata_sshfp_fromWire3.spec rdata_sshfp_fromWire4.spec
+EXTRA_DIST += rdata_sshfp_fromWire5.spec rdata_sshfp_fromWire6.spec
+EXTRA_DIST += rdata_sshfp_fromWire7.spec rdata_sshfp_fromWire8.spec
+EXTRA_DIST += rdata_sshfp_fromWire9 rdata_sshfp_fromWire10
+EXTRA_DIST += rdata_sshfp_fromWire11 rdata_sshfp_fromWire12
 EXTRA_DIST += rdata_afsdb_fromWire1.spec rdata_afsdb_fromWire2.spec
 EXTRA_DIST += rdata_afsdb_fromWire3.spec rdata_afsdb_fromWire4.spec
 EXTRA_DIST += rdata_afsdb_fromWire5.spec
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire10 b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire10
new file mode 100644
index 0000000..220e570
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire10
@@ -0,0 +1,6 @@
+# Test where fingerprint is missing
+
+# SSHFP RDATA, RDLEN=32
+0020
+# ALGORITHM=2 FINGERPRINT_TYPE=1 FINGERPRINT=(none)
+02 01
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire11 b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire11
new file mode 100644
index 0000000..a2f8636
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire11
@@ -0,0 +1,4 @@
+# Test where RDATA is completely missing
+
+# SSHFP RDATA, RDLEN=32
+0020
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire12 b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire12
new file mode 100644
index 0000000..eabd06b
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire12
@@ -0,0 +1,4 @@
+# SSHFP RDATA, RDLEN=02
+0002
+# ALGORITHM=4 FINGERPRINT_TYPE=9
+04 09
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire3.spec b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire3.spec
new file mode 100644
index 0000000..d111afd
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire3.spec
@@ -0,0 +1,8 @@
+#
+# SSHFP RDATA
+#
+[custom]
+sections: sshfp
+[sshfp]
+algorithm: 1
+fingerprint_type: 1
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire4.spec b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire4.spec
new file mode 100644
index 0000000..b9b2658
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire4.spec
@@ -0,0 +1,8 @@
+#
+# SSHFP RDATA
+#
+[custom]
+sections: sshfp
+[sshfp]
+algorithm: 255
+fingerprint_type: 1
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire5.spec b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire5.spec
new file mode 100644
index 0000000..b3a19fa
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire5.spec
@@ -0,0 +1,8 @@
+#
+# SSHFP RDATA
+#
+[custom]
+sections: sshfp
+[sshfp]
+algorithm: 0
+fingerprint_type: 1
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire6.spec b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire6.spec
new file mode 100644
index 0000000..437e282
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire6.spec
@@ -0,0 +1,8 @@
+#
+# SSHFP RDATA
+#
+[custom]
+sections: sshfp
+[sshfp]
+algorithm: 5
+fingerprint_type: 0
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire7.spec b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire7.spec
new file mode 100644
index 0000000..8e21d11
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire7.spec
@@ -0,0 +1,8 @@
+#
+# SSHFP RDATA
+#
+[custom]
+sections: sshfp
+[sshfp]
+algorithm: 255
+fingerprint_type: 255
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire8.spec b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire8.spec
new file mode 100644
index 0000000..98aa00f
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire8.spec
@@ -0,0 +1,9 @@
+#
+# SSHFP RDATA
+#
+[custom]
+sections: sshfp
+[sshfp]
+fingerprint: 082359342fd9
+algorithm: 255
+fingerprint_type: 255
diff --git a/src/lib/dns/tests/testdata/rdata_sshfp_fromWire9 b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire9
new file mode 100644
index 0000000..05fc806
--- /dev/null
+++ b/src/lib/dns/tests/testdata/rdata_sshfp_fromWire9
@@ -0,0 +1,6 @@
+# Test where fingerprint length is smaller than what RDATA len indicates
+
+# SSHFP RDATA, RDLEN=32
+0020
+# ALGORITHM=2 FINGERPRINT_TYPE=1 FINGERPRINT=123456789abcdef67890123456789abcdef67890
+02 01 123456789abcdef67890123456789abcdef67890



More information about the bind10-changes mailing list