diff options
author | Mukund Sivaraman <muks@isc.org> | 2012-07-23 07:33:57 +0200 |
---|---|---|
committer | Mukund Sivaraman <muks@isc.org> | 2012-07-23 07:39:32 +0200 |
commit | d0d70f211833ccd8071704d3fec8858e79f4304d (patch) | |
tree | b0c05921e35f72cab70b3f1a6d91a94260926ef2 /src/lib/dns/tests/rdata_sshfp_unittest.cc | |
parent | [2124] Indent code according to our coding style (diff) | |
download | kea-d0d70f211833ccd8071704d3fec8858e79f4304d.tar.xz kea-d0d70f211833ccd8071704d3fec8858e79f4304d.zip |
[2124] Check that algorithm and fingerprint are in the range [1,255]
Diffstat (limited to 'src/lib/dns/tests/rdata_sshfp_unittest.cc')
-rw-r--r-- | src/lib/dns/tests/rdata_sshfp_unittest.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/dns/tests/rdata_sshfp_unittest.cc b/src/lib/dns/tests/rdata_sshfp_unittest.cc index 0e5b8653ce..6c66c3565e 100644 --- a/src/lib/dns/tests/rdata_sshfp_unittest.cc +++ b/src/lib/dns/tests/rdata_sshfp_unittest.cc @@ -60,7 +60,6 @@ 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("0 1 123456789abcdef67890123456789abcdef67890")); EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 1 123456789abcdef67890123456789abcdef67890")); EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("2 1 123456789abcdef67890123456789abcdef67890")); EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("3 1 123456789abcdef67890123456789abcdef67890")); @@ -71,6 +70,12 @@ TEST_F(Rdata_SSHFP_Test, algorithmTypes) { EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 3 123456789abcdef67890123456789abcdef67890")); EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 128 123456789abcdef67890123456789abcdef67890")); EXPECT_NO_THROW(const generic::SSHFP rdata_sshfp("1 255 123456789abcdef67890123456789abcdef67890")); + + // 0 is still reserved. + EXPECT_THROW(const generic::SSHFP rdata_sshfp("0 1 123456789abcdef67890123456789abcdef67890"), + InvalidRdataText); + EXPECT_THROW(const generic::SSHFP rdata_sshfp("1 0 123456789abcdef67890123456789abcdef67890"), + InvalidRdataText); } TEST_F(Rdata_SSHFP_Test, badText) { |