Compare commits

...

2 Commits

Author SHA1 Message Date
Matthijs Mekking
f089e25217 Add unit test case for issue #4702
Add the found erroneous case to the unit tests.
2024-04-30 17:39:39 +02:00
Matthijs Mekking
1fa199fba2 Add a unit test case for converting \000\009
Sanity checking that this domain converts to the key I am expecting.

Also fix some of the other names that had trailing 0x02 bits.
2024-04-30 17:38:26 +02:00

View File

@@ -56,9 +56,14 @@ ISC_RUN_TEST_IMPL(qpkey_name) {
},
{
.namestr = "\\000",
.key = { 0x03, 0x03, 0x02, 0x02 },
.key = { 0x03, 0x03, 0x02 },
.len = 3,
},
{
.namestr = "\\000\\009",
.key = { 0x03, 0x03, 0x03, 0x0c, 0x02 },
.len = 5,
},
{
.namestr = "com",
.key = { 0x16, 0x22, 0x20, 0x02 },
@@ -72,19 +77,19 @@ ISC_RUN_TEST_IMPL(qpkey_name) {
{
.namestr = "example.com.",
.key = { 0x02, 0x16, 0x22, 0x20, 0x02, 0x18, 0x2b, 0x14,
0x20, 0x23, 0x1f, 0x18, 0x02, 0x02 },
0x20, 0x23, 0x1f, 0x18, 0x02 },
.len = 13,
},
{
.namestr = "example.com",
.key = { 0x16, 0x22, 0x20, 0x02, 0x18, 0x2b, 0x14, 0x20,
0x23, 0x1f, 0x18, 0x02, 0x02 },
0x23, 0x1f, 0x18, 0x02 },
.len = 12,
},
{
.namestr = "EXAMPLE.COM",
.key = { 0x16, 0x22, 0x20, 0x02, 0x18, 0x2b, 0x14, 0x20,
0x23, 0x1f, 0x18, 0x02, 0x02 },
0x23, 0x1f, 0x18, 0x02 },
.len = 12,
},
};
@@ -128,6 +133,9 @@ ISC_RUN_TEST_IMPL(qpkey_sort) {
} testcases[] = {
{ .namestr = "." },
{ .namestr = "\\000." },
{ .namestr = "\\000.\\000." },
{ .namestr = "\\000\\009." },
{ .namestr = "\\007." },
{ .namestr = "example.com." },
{ .namestr = "EXAMPLE.COM." },
{ .namestr = "www.example.com." },
@@ -841,6 +849,27 @@ ISC_RUN_TEST_IMPL(fixiterator) {
check_predecessors(qp, check3);
dns_qp_destroy(&qp);
const char insert4[][64] = { ".", "\\000.", "\\000.\\000.",
"\\000\\009.", "" };
i = 0;
dns_qp_create(mctx, &string_methods, NULL, &qp);
while (insert4[i][0] != '\0') {
insert_str(qp, insert4[i++]);
}
fprintf(stderr, "QP DB 007\n");
qp_test_dumpqp(qp);
fprintf(stderr, "QP TRIE 007\n");
qp_test_dumptrie(qp);
static struct check_predecessors check4[] = { { "\\007.", "\\000\\009.",
DNS_R_PARTIALMATCH, 0 },
{ NULL, NULL, 0, 0 } };
check_predecessors(qp, check4);
dns_qp_destroy(&qp);
}
ISC_TEST_LIST_START