Skip to content

Commit 74baf86

Browse files
committed
fix NSEC for asterisk ents and add test
1 parent cd30e94 commit 74baf86

File tree

12 files changed

+46
-4
lines changed

12 files changed

+46
-4
lines changed

modules/tinydnsbackend/data

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20017,7 +20017,7 @@ Cexternal.example.com:somewhere.else.net.:120
2001720017
+host-9998.example.com:192.168.1.14:120
2001820018
+host-9999.example.com:192.168.1.15:120
2001920019
:hwinfo.example.com:13:\003abc\003def:120
20020-
3ipv6.example.com:200106a80000000102104bfffe4b4c61:120
20020+
:ipv6.example.com:28:\040\001\006\250\000\000\000\001\002\020K\377\376KLa:120
2002120021
&italy.example.com::italy-ns1.example.com.:120
2002220022
&italy.example.com::italy-ns2.example.com.:120
2002320023
+italy-ns1.example.com:192.168.5.1:120
@@ -20047,6 +20047,7 @@ Cstart1.example.com:start2.example.com.:120
2004720047
Cstart2.example.com:start3.example.com.:120
2004820048
Cstart3.example.com:start4.example.com.:120
2004920049
+start4.example.com:192.168.2.2:120
20050+
+host.\052.sub.example.com:192.168.6.1:120
2005020051
:text.example.com:16:\025Hi\054\040this\040is\040some\040text:120
2005120052
:text0.example.com:16:\014k\075rsa\073\040p\075one:120
2005220053
:text1.example.com:16:\014k\075rsa\073\040p\075one:120

modules/tinydnsbackend/data.cdb

67 Bytes
Binary file not shown.

pdns/packethandler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void PacketHandler::addNSEC(DNSPacket *p, DNSPacket *r, const string& target, co
671671

672672
if (mode == 2) {
673673
// wildcard NO-DATA
674-
before='.';
674+
before.clear();
675675
sd.db->getBeforeAndAfterNames(sd.domain_id, auth, wildcard, before, after);
676676
emitNSEC(before, after, target, sd, r, mode);
677677
}

regression-tests.nobackend/tinydns-data-check/expected_result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
f1eebfc1577c3dcf26b4390fbc7bb0b2 ../regression-tests/example.com
1+
4bc48a8d9b8d04b553be67639e5656e8 ../regression-tests/example.com
22
a2dd754820cb88fdd3d80b54a212a270 ../regression-tests/test.com
33
21213b4e8cd56e4184696a1bafd987d7 ../regression-tests/wtest.com
44
6e4ac6e3a6cd717df107a7bc2e466ac7 ../regression-tests/dnssec-parent.com

regression-tests/ent-asterisk/command

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
cleandig sub.host.sub.example.com a dnssec
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Check if asterisk empty non-terminal is interpreted as wildcard wihout type
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1 example.com. IN SOA 86400 ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400
2+
2 . IN OPT 32768
3+
Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
4+
Reply to question for qname='sub.host.sub.example.com.', qtype=A
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
1 example.com. IN RRSIG 86400 SOA 8 2 100000 [expiry] [inception] [keytag] example.com. ...
2+
1 example.com. IN SOA 86400 ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400
3+
1 host.*.sub.example.com. IN NSEC 86400 text.example.com. A RRSIG NSEC
4+
1 host.*.sub.example.com. IN RRSIG 86400 NSEC 8 5 86400 [expiry] [inception] [keytag] example.com. ...
5+
1 start4.example.com. IN NSEC 86400 host.*.sub.example.com. A RRSIG NSEC
6+
1 start4.example.com. IN RRSIG 86400 NSEC 8 3 86400 [expiry] [inception] [keytag] example.com. ...
7+
2 . IN OPT 32768
8+
Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
9+
Reply to question for qname='sub.host.sub.example.com.', qtype=A
10+
./ent-asterisk/unbound-host.out:sub.host.sub.example.com has no address (BOGUS (security failure))
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
1 5ui8h56r4776maicvhpdegs6chr19i99.example.com. IN NSEC3 86400 1 [flags] 1 abcd 5UI8H56R4776MAICVHPDEGS6CHR19I9A
2+
1 5ui8h56r4776maicvhpdegs6chr19i99.example.com. IN RRSIG 86400 NSEC3 8 3 86400 [expiry] [inception] [keytag] example.com. ...
3+
1 example.com. IN RRSIG 86400 SOA 8 2 100000 [expiry] [inception] [keytag] example.com. ...
4+
1 example.com. IN SOA 86400 ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400
5+
1 hhrsadparthvtuou67trentjstdodla0.example.com. IN NSEC3 86400 1 [flags] 1 abcd HHRSADPARTHVTUOU67TRENTJSTDODLA1
6+
1 hhrsadparthvtuou67trentjstdodla0.example.com. IN RRSIG 86400 NSEC3 8 3 86400 [expiry] [inception] [keytag] example.com. ...
7+
1 pbl3rtqv3mt7eb29gqp0a17o0h42nj76.example.com. IN NSEC3 86400 1 [flags] 1 abcd PBL3RTQV3MT7EB29GQP0A17O0H42NJ78
8+
1 pbl3rtqv3mt7eb29gqp0a17o0h42nj76.example.com. IN RRSIG 86400 NSEC3 8 3 86400 [expiry] [inception] [keytag] example.com. ...
9+
2 . IN OPT 32768
10+
Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
11+
Reply to question for qname='sub.host.sub.example.com.', qtype=A
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
1 5ui8h56r4776maicvhpdegs6chr19i99.example.com. IN NSEC3 86400 1 [flags] 1 abcd 5UMB87SUFNRRMLILGL48A5GUUHG7RI58
2+
1 5ui8h56r4776maicvhpdegs6chr19i99.example.com. IN RRSIG 86400 NSEC3 8 3 86400 [expiry] [inception] [keytag] example.com. ...
3+
1 example.com. IN RRSIG 86400 SOA 8 2 100000 [expiry] [inception] [keytag] example.com. ...
4+
1 example.com. IN SOA 86400 ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400
5+
1 hhrsadparthvtuou67trentjstdodla0.example.com. IN NSEC3 86400 1 [flags] 1 abcd HHTKKD5HB125SGANBTKMQK84LULH60LH
6+
1 hhrsadparthvtuou67trentjstdodla0.example.com. IN RRSIG 86400 NSEC3 8 3 86400 [expiry] [inception] [keytag] example.com. ...
7+
1 pbkjnd53pnsru5jmaqnk3k936pv2pq5j.example.com. IN NSEC3 86400 1 [flags] 1 abcd PBL4SE96F8T4H4Q24UQMRQ4KS96AHPV3 A RRSIG
8+
1 pbkjnd53pnsru5jmaqnk3k936pv2pq5j.example.com. IN RRSIG 86400 NSEC3 8 3 86400 [expiry] [inception] [keytag] example.com. ...
9+
2 . IN OPT 32768
10+
Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
11+
Reply to question for qname='sub.host.sub.example.com.', qtype=A

0 commit comments

Comments
 (0)