aboutsummaryrefslogtreecommitdiff
path: root/lib/dns/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-03-25 14:17:46 +0700
committerShulhan <ms@kilabit.info>2023-03-25 14:17:46 +0700
commitaa8fc4e0a9ff55760c68a5955bbcb93d129ce1ba (patch)
tree4ea0a1d37130965c0648e87ef658526080ff9766 /lib/dns/testdata
parent2726436039c497f21cb483bce0ef8c755fb03d54 (diff)
downloadpakakeh.go-aa8fc4e0a9ff55760c68a5955bbcb93d129ce1ba.tar.xz
lib/dns: allow parsing TXT rdata without quote in zone file
Previously, the zone only parsing TXT record with double quote since most of the example that we found during implementation all use double quote. This changes allow non-double quoted text in zone file with consequence that any spaces will terminated the rdata immediately. Fixes #6
Diffstat (limited to 'lib/dns/testdata')
-rw-r--r--lib/dns/testdata/zone/kilabit_info_test.txt16
-rw-r--r--lib/dns/testdata/zone/windows_test.txt21
2 files changed, 37 insertions, 0 deletions
diff --git a/lib/dns/testdata/zone/kilabit_info_test.txt b/lib/dns/testdata/zone/kilabit_info_test.txt
index 36817017..8a08f35d 100644
--- a/lib/dns/testdata/zone/kilabit_info_test.txt
+++ b/lib/dns/testdata/zone/kilabit_info_test.txt
@@ -17,6 +17,8 @@ origin: kilabit.info.
1.0.b.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. PTR kilabit.info.
+txt_noquote TXT This\032is a text ; Without quote terminated by space.
+
<<< zone_out.txt
$ORIGIN kilabit.info.
@ SOA kilabit.info. admin.kilabit.info. 20180832 3600 60 3600 3600
@@ -25,6 +27,7 @@ $ORIGIN kilabit.info.
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa. 3600 IN PTR kilabit.info.
1.0.b.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 3600 IN PTR kilabit.info.
10.0.0.127.in-addr.arpa. 3600 IN PTR kilabit.info.
+txt_noquote 3600 IN TXT "This is"
<<< message_0.hex
{Name:kilabit.info. Type:SOA}
@@ -117,3 +120,16 @@ $ORIGIN kilabit.info.
0x60| 00 00 0e 10 00 0e 07 6b| . . . . . . . k| 0 0 14 16 0 14 7 107|96
0x68| 69 6c 61 62 69 74 04 69| i l a b i t . i| 105 108 97 98 105 116 4 105|104
0x70| 6e 66 6f 00 | n f o . | 110 102 111 0 |112
+
+<<< message_6.hex
+{Name:txt_noquote.kilabit.info. Type:TXT}
+ | 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7|
+ | 8 9 A B C D E F| 8 9 A B C D E F| 8 9 A B C D E F|
+0x00| 00 00 84 00 00 01 00 01| . . . . . . . .| 0 0 132 0 0 1 0 1|00
+0x08| 00 00 00 00 0b 74 78 74| . . . . . t x t| 0 0 0 0 11 116 120 116|08
+0x10| 5f 6e 6f 71 75 6f 74 65| _ n o q u o t e| 95 110 111 113 117 111 116 101|16
+0x18| 07 6b 69 6c 61 62 69 74| . k i l a b i t| 7 107 105 108 97 98 105 116|24
+0x20| 04 69 6e 66 6f 00 00 10| . i n f o . . .| 4 105 110 102 111 0 0 16|32
+0x28| 00 01 c0 0c 00 10 00 01| . . . . . . . .| 0 1 192 12 0 16 0 1|40
+0x30| 00 00 0e 10 00 08 07 54| . . . . . . . T| 0 0 14 16 0 8 7 84|48
+0x38| 68 69 73 20 69 73 | h i s . i s | 104 105 115 32 105 115 |56
diff --git a/lib/dns/testdata/zone/windows_test.txt b/lib/dns/testdata/zone/windows_test.txt
index 5c6bf896..f6de3956 100644
--- a/lib/dns/testdata/zone/windows_test.txt
+++ b/lib/dns/testdata/zone/windows_test.txt
@@ -17,6 +17,8 @@ $ORIGIN exaple.com.
IN NS ns2.exaple.com.
IN NS ns3.exaple.com.
+_acme-challenge IN TXT 1iG9QDAgheMRmWz69jwupWG2QMbrubnNjZ47IrDb-40
+
<<< zone_out.txt
$ORIGIN exaple.com.
@@ -25,6 +27,7 @@ $ORIGIN exaple.com.
3600 IN NS ns
3600 IN NS ns2
3600 IN NS ns3
+_acme-challenge 3600 IN TXT "1iG9QDAgheMRmWz69jwupWG2QMbrubnNjZ47IrDb-40"
<<< message_0.hex
{Name:exaple.com. Type:SOA}
@@ -67,3 +70,21 @@ $ORIGIN exaple.com.
0x40| 0c 00 02 00 01 00 00 0e| . . . . . . . .| 12 0 2 0 1 0 0 14|64
0x48| 10 00 06 03 6e 73 33 c0| . . . . n s 3 .| 16 0 6 3 110 115 51 192|72
0x50| 0c | . | 12 |80
+
+<<< message_3.hex
+{Name:_acme-challenge.exaple.com. Type:TXT}
+ | 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7|
+ | 8 9 A B C D E F| 8 9 A B C D E F| 8 9 A B C D E F|
+0x00| 00 00 84 00 00 01 00 01| . . . . . . . .| 0 0 132 0 0 1 0 1|00
+0x08| 00 00 00 00 0f 5f 61 63| . . . . . _ a c| 0 0 0 0 15 95 97 99|08
+0x10| 6d 65 2d 63 68 61 6c 6c| m e - c h a l l| 109 101 45 99 104 97 108 108|16
+0x18| 65 6e 67 65 06 65 78 61| e n g e . e x a| 101 110 103 101 6 101 120 97|24
+0x20| 70 6c 65 03 63 6f 6d 00| p l e . c o m .| 112 108 101 3 99 111 109 0|32
+0x28| 00 10 00 01 c0 0c 00 10| . . . . . . . .| 0 16 0 1 192 12 0 16|40
+0x30| 00 01 00 00 0e 10 00 2c| . . . . . . . ,| 0 1 0 0 14 16 0 44|48
+0x38| 2b 31 69 47 39 51 44 41| + 1 i G 9 Q D A| 43 49 105 71 57 81 68 65|56
+0x40| 67 68 65 4d 52 6d 57 7a| g h e M R m W z| 103 104 101 77 82 109 87 122|64
+0x48| 36 39 6a 77 75 70 57 47| 6 9 j w u p W G| 54 57 106 119 117 112 87 71|72
+0x50| 32 51 4d 62 72 75 62 6e| 2 Q M b r u b n| 50 81 77 98 114 117 98 110|80
+0x58| 4e 6a 5a 34 37 49 72 44| N j Z 4 7 I r D| 78 106 90 52 55 73 114 68|88
+0x60| 62 2d 34 30 | b - 4 0 | 98 45 52 48 |96