xref: /netbsd-src/external/bsd/unbound/dist/testdata/autotrust_init_ds.rpl (revision c38e7cc395b1472a774ff828e46123de44c628e9)
1; config options
2server:
3	target-fetch-policy: "0 0 0 0 0"
4	log-time-ascii: yes
5	fake-sha1: yes
6	trust-anchor-signaling: no
7stub-zone:
8	name: "."
9	stub-addr: 193.0.14.129         # K.ROOT-SERVERS.NET.
10; initial content (say from dig example.com DS > example.com.key)
11AUTOTRUST_FILE example.com
12example.com.	10800	IN	DS	55582 5 1 66e829ebd8145e6f030b840ae63b77273c9575e1 ; xiniv-mopov-rakoc-galuk-zibeb-ricob-penuf-rutad-lyzan-hetuv-caxox
13AUTOTRUST_END
14CONFIG_END
15
16SCENARIO_BEGIN Test autotrust with initial trust anchor from DS
17
18; K-ROOT
19RANGE_BEGIN 0 100
20	ADDRESS 193.0.14.129
21ENTRY_BEGIN
22MATCH opcode qname qtype
23ADJUST copy_id copy_query
24REPLY QR AA
25SECTION QUESTION
26. IN NS
27SECTION ANSWER
28. IN NS k.root-servers.net.
29SECTION ADDITIONAL
30k.root-servers.net IN A 193.0.14.129
31ENTRY_END
32
33ENTRY_BEGIN
34MATCH opcode subdomain
35ADJUST copy_id copy_query
36REPLY QR
37SECTION QUESTION
38com. IN NS
39SECTION AUTHORITY
40com. IN NS a.gtld-servers.net.
41SECTION ADDITIONAL
42a.gtld-servers.net. IN A 192.5.6.30
43ENTRY_END
44RANGE_END
45
46; a.gtld-servers.net.
47RANGE_BEGIN 0 100
48	ADDRESS 192.5.6.30
49ENTRY_BEGIN
50MATCH opcode subdomain
51ADJUST copy_id copy_query
52REPLY QR
53SECTION QUESTION
54example.com. IN NS
55SECTION AUTHORITY
56example.com. IN NS ns.example.com.
57SECTION ADDITIONAL
58ns.example.com. IN A 1.2.3.4
59ENTRY_END
60RANGE_END
61
62; ns.example.com.
63RANGE_BEGIN 0 100
64	ADDRESS 1.2.3.4
65ENTRY_BEGIN
66MATCH opcode qname qtype
67ADJUST copy_id
68REPLY QR AA
69SECTION QUESTION
70www.example.com. IN A
71SECTION ANSWER
72www.example.com.	3600	IN	A	10.20.30.40
73www.example.com.	3600	IN	RRSIG	A 5 3 3600 20090924111500 20090821111500 30899 example.com. pYGxVLsWUvOp1wSf0iwPap+JnECfC5GAm1lRqy3YEqecNGld7U7x/5Imo3CerbdZrVptUQs2oH0lcjwYJXMnsw== ;{id = 30899}
74SECTION AUTHORITY
75example.com.	3600	IN	NS	ns.example.com.
76example.com.	3600	IN	RRSIG	NS 5 2 3600 20090924111500 20090821111500 30899 example.com. J5wxRq0jgwQL6yy530kvo9cHqNAUHV8IF4dvaYZL0bNraO2Oe6dVXqlJl4+cxNHI2TMsstwFPr2Zz8tv6Az2mQ== ;{id = 30899}
77SECTION ADDITIONAL
78ns.example.com.	3600	IN	A	1.2.3.4
79ns.example.com.	3600	IN	RRSIG	A 5 3 3600 20090924111500 20090821111500 30899 example.com. JsXbS18oyc0zkVaOWGSFdIQuOsZKflT0GraT9afDPoWLCgH4ApF7jNgfJV7Pqy1sTBRajME5IUAhpANwGBuW4A== ;{id = 30899}
80ENTRY_END
81
82ENTRY_BEGIN
83MATCH opcode qname qtype
84ADJUST copy_id
85REPLY QR AA
86SECTION QUESTION
87example.com. IN DNSKEY
88SECTION ANSWER
89; KSK 1
90example.com.	10800	IN	DNSKEY	257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b}
91; ZSK 1
92example.com.	10800	IN	DNSKEY	256 3 5 AQPQ41chR9DEHt/aIzIFAqanbDlRflJoRs5yz1jFsoRIT7dWf0r+PeDuewdxkszNH6wnU4QL8pfKFRh5PIYVBLK3 ;{id = 30899 (ksk), size = 512b}
93; signatures
94example.com.	10800	IN	RRSIG	DNSKEY 5 2 10800 20090924111500 20090821111500 30899 example.com. b/HK231jIQLX8IhlZfup3r0yhpXaasbPE6LzxoEVVvWaTZWcLmeV8jDIcn0qO7Yvs7bIJN20lwVAV0GcHH3hWQ== ;{id = 30899}
95example.com.	10800	IN	RRSIG	DNSKEY 5 2 10800 20090924111500 20090821111500 55582 example.com. PCHme1QLoULxqjhg5tMlpR0qJlBfstEUVq18TtNoKQe9le1YhJ9caheXcTWoK+boLhXxg9u6Yyvq8FboQh0OjA== ;{id = 55582}
96
97ENTRY_END
98RANGE_END
99
100; set date/time to Aug 24 07:46:40  (2009).
101STEP 5 TIME_PASSES ELAPSE 1251100000
102STEP 6 ASSIGN t0 = ${time}
103; get probe time and check it. 4800 is about 10% less than 5400. And more than
104; the 3600 that a failure timeout would have.
105STEP 7 ASSIGN probe = ${range 4800 ${timeout} 5400}
106
107
108; the auto probing should have been done now.
109STEP 8 CHECK_AUTOTRUST example.com
110FILE_BEGIN
111; autotrust trust anchor file
112;;id: example.com. 1
113;;last_queried: 1251100000 ;;Mon Aug 24 07:46:40 2009
114;;last_success: 1251100000 ;;Mon Aug 24 07:46:40 2009
115;;next_probe_time: ${$t0 + $probe} ;;${ctime $t0 + $probe}
116;;query_failed: 0
117;;query_interval: 5400
118;;retry_time: 3600
119example.com.	10800	IN	DNSKEY	257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b} ;;state=2 [  VALID  ] ;;count=0 ;;lastchange=1251100000 ;;Mon Aug 24 07:46:40 2009
120FILE_END
121
122
123STEP 10 QUERY
124ENTRY_BEGIN
125REPLY RD DO
126SECTION QUESTION
127www.example.com. IN A
128ENTRY_END
129
130STEP 20 CHECK_ANSWER
131ENTRY_BEGIN
132MATCH all
133REPLY QR RD RA AD DO NOERROR
134SECTION QUESTION
135www.example.com. IN A
136SECTION ANSWER
137www.example.com.	3600	IN	A	10.20.30.40
138www.example.com.	3600	IN	RRSIG	A 5 3 3600 20090924111500 20090821111500 30899 example.com. pYGxVLsWUvOp1wSf0iwPap+JnECfC5GAm1lRqy3YEqecNGld7U7x/5Imo3CerbdZrVptUQs2oH0lcjwYJXMnsw== ;{id = 30899}
139SECTION AUTHORITY
140example.com.	3600	IN	NS	ns.example.com.
141example.com.	3600	IN	RRSIG	NS 5 2 3600 20090924111500 20090821111500 30899 example.com. J5wxRq0jgwQL6yy530kvo9cHqNAUHV8IF4dvaYZL0bNraO2Oe6dVXqlJl4+cxNHI2TMsstwFPr2Zz8tv6Az2mQ== ;{id = 30899}
142SECTION ADDITIONAL
143ns.example.com.	3600	IN	A	1.2.3.4
144ns.example.com.	3600	IN	RRSIG	A 5 3 3600 20090924111500 20090821111500 30899 example.com. JsXbS18oyc0zkVaOWGSFdIQuOsZKflT0GraT9afDPoWLCgH4ApF7jNgfJV7Pqy1sTBRajME5IUAhpANwGBuW4A== ;{id = 30899}
145ENTRY_END
146
147; The autotrust anchor was probed due to the query.
148
149STEP 30 CHECK_AUTOTRUST example.com
150FILE_BEGIN
151; autotrust trust anchor file
152;;id: example.com. 1
153;;last_queried: 1251100000 ;;Mon Aug 24 07:46:40 2009
154;;last_success: 1251100000 ;;Mon Aug 24 07:46:40 2009
155;;next_probe_time: ${$t0 + $probe} ;;${ctime $t0 + $probe}
156;;query_failed: 0
157;;query_interval: 5400
158;;retry_time: 3600
159example.com.	10800	IN	DNSKEY	257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b} ;;state=2 [  VALID  ] ;;count=0 ;;lastchange=1251100000 ;;Mon Aug 24 07:46:40 2009
160FILE_END
161
162; wait and see if autotrust probes (the unchanged) domain again.
163STEP 40 TIME_PASSES EVAL ${$probe}
164
165STEP 50 TRAFFIC
166
167STEP 65 ASSIGN probe2 = ${range 4800 ${timeout} 5400}
168
169STEP 70 CHECK_AUTOTRUST example.com
170FILE_BEGIN
171; autotrust trust anchor file
172;;id: example.com. 1
173;;last_queried: ${time} ;;${ctime ${time}}
174;;last_success: ${time} ;;${ctime ${time}}
175;;next_probe_time: ${$t0 + $probe + $probe2} ;;${ctime $t0 + $probe + $probe2}
176;;query_failed: 0
177;;query_interval: 5400
178;;retry_time: 3600
179example.com.	10800	IN	DNSKEY	257 3 5 AwEAAc3Z5DQDJpH4oPdNtC4BUQHk50XMD+dHr4r8psHmivIa83hxR5CRgCtd9sENCW9Ae8OIO19xw9t/RPaEAqQa+OE= ;{id = 55582 (ksk), size = 512b} ;;state=2 [  VALID  ] ;;count=0 ;;lastchange=1251100000 ;;Mon Aug 24 07:46:40 2009
180FILE_END
181
182SCENARIO_END
183