BIND 10 trac2108_3, updated. 41eff487aee5315bdb63b805d1e3e9efe13118f4 [2108] Check that loading a zone containing NSEC3 names with invalid number of labels throws
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Sep 10 02:01:59 UTC 2012
The branch, trac2108_3 has been updated
via 41eff487aee5315bdb63b805d1e3e9efe13118f4 (commit)
from 2d47ae95847e1088b1458f7d099093d2f5c8d9ef (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 41eff487aee5315bdb63b805d1e3e9efe13118f4
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Sep 10 07:28:37 2012 +0530
[2108] Check that loading a zone containing NSEC3 names with invalid number of labels throws
-----------------------------------------------------------------------
Summary of changes:
.../datasrc/memory/tests/memory_client_unittest.cc | 18 ++++++++++++++++++
src/lib/datasrc/memory/tests/testdata/Makefile.am | 2 ++
.../testdata/example.org-nsec3-fewer-labels.zone | 3 +++
.../testdata/example.org-nsec3-more-labels.zone | 3 +++
4 files changed, 26 insertions(+)
create mode 100644 src/lib/datasrc/memory/tests/testdata/example.org-nsec3-fewer-labels.zone
create mode 100644 src/lib/datasrc/memory/tests/testdata/example.org-nsec3-more-labels.zone
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
index 2bcb3f7..032b965 100644
--- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc
+++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
@@ -317,6 +317,24 @@ TEST_F(MemoryClientTest, loadWildcardNSEC3Throws) {
// Teardown checks for memory segment leaks
}
+TEST_F(MemoryClientTest, loadNSEC3WithFewerLabelsThrows) {
+ // NSEC3 names with labels != (origin_labels + 1) should throw
+ EXPECT_THROW(client_->load(Name("example.org"),
+ TEST_DATA_DIR
+ "/example.org-nsec3-fewer-labels.zone"),
+ InMemoryClient::AddError);
+ // Teardown checks for memory segment leaks
+}
+
+TEST_F(MemoryClientTest, loadNSEC3WithMoreLabelsThrows) {
+ // NSEC3 names with labels != (origin_labels + 1) should throw
+ EXPECT_THROW(client_->load(Name("example.org"),
+ TEST_DATA_DIR
+ "/example.org-nsec3-more-labels.zone"),
+ InMemoryClient::AddError);
+ // Teardown checks for memory segment leaks
+}
+
TEST_F(MemoryClientTest, loadRRSIGFollowsNothing) {
EXPECT_THROW(client_->load(Name("example.org"),
TEST_DATA_DIR
diff --git a/src/lib/datasrc/memory/tests/testdata/Makefile.am b/src/lib/datasrc/memory/tests/testdata/Makefile.am
index 02a23e1..721448a 100644
--- a/src/lib/datasrc/memory/tests/testdata/Makefile.am
+++ b/src/lib/datasrc/memory/tests/testdata/Makefile.am
@@ -21,3 +21,5 @@ EXTRA_DIST += example.org-out-of-zone.zone
EXTRA_DIST += example.org-wildcard-ns.zone
EXTRA_DIST += example.org-wildcard-dname.zone
EXTRA_DIST += example.org-wildcard-nsec3.zone
+EXTRA_DIST += example.org-nsec3-fewer-labels.zone
+EXTRA_DIST += example.org-nsec3-more-labels.zone
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-nsec3-fewer-labels.zone b/src/lib/datasrc/memory/tests/testdata/example.org-nsec3-fewer-labels.zone
new file mode 100644
index 0000000..0221269
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org-nsec3-fewer-labels.zone
@@ -0,0 +1,3 @@
+;; NSEC3 names with labels != (origin_labels + 1)
+example.org. 86400 IN SOA ns.example.org. ns.example.org. 2012091001 7200 3600 2592000 1200
+example.org. 1200 IN NSEC3 1 0 10 AABBCCDD RKOF8QMFRB5F2V9EJHFBVB2JPVSA0DJD A RRSIG
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-nsec3-more-labels.zone b/src/lib/datasrc/memory/tests/testdata/example.org-nsec3-more-labels.zone
new file mode 100644
index 0000000..efebcfb
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org-nsec3-more-labels.zone
@@ -0,0 +1,3 @@
+;; NSEC3 names with labels != (origin_labels + 1)
+example.org. 86400 IN SOA ns.example.org. ns.example.org. 2012091002 7200 3600 2592000 1200
+a.b.example.org. 1200 IN NSEC3 1 0 10 AABBCCDD RKOF8QMFRB5F2V9EJHFBVB2JPVSA0DJD A RRSIG
More information about the bind10-changes
mailing list