|
@@ -58,7 +58,7 @@ TEST_F(TSIGRecordTest, getName) {
|
|
|
}
|
|
|
|
|
|
TEST_F(TSIGRecordTest, getLength) {
|
|
|
- // 85 = 17 + 26 + 16 + 24
|
|
|
+ // 85 = 17 + 26 + 16 + 26
|
|
|
// len(www.example.com) = 17
|
|
|
// len(hmac-md5.sig-alg.reg.int) = 26
|
|
|
// len(MAC) = 16
|
|
@@ -82,10 +82,9 @@ TEST_F(TSIGRecordTest, recordToWire) {
|
|
|
}
|
|
|
|
|
|
TEST_F(TSIGRecordTest, recordToOLongToWire) {
|
|
|
- // Rendering the test record requires a room of 85 bytes (see the
|
|
|
- // getLength test). By setting the limit to 84, it will fail, and
|
|
|
- // the renderer will be marked as "truncated".
|
|
|
- renderer.setLengthLimit(84);
|
|
|
+ // By setting the limit to "record length - 1", it will fail, and the
|
|
|
+ // renderer will be marked as "truncated".
|
|
|
+ renderer.setLengthLimit(test_record.getLength() - 1);
|
|
|
EXPECT_FALSE(renderer.isTruncated()); // not marked before render attempt
|
|
|
EXPECT_EQ(0, test_record.toWire(renderer));
|
|
|
EXPECT_TRUE(renderer.isTruncated());
|