|
@@ -13,9 +13,8 @@ const SUFFIX = 'test.servnest.test.';
|
|
|
|
|
|
const TOR_PROXY = 'socks5h://127.0.0.1:9050';
|
|
|
|
|
|
-exescape([CONF['dns']['kdig_path'], 'torproject.org', 'AAAA'], $output, $return_code);
|
|
|
-if (preg_match('/^;; Flags: qr rd ra ad;/Dm', implode("\n", $output)) !== 1)
|
|
|
- exit('Unable to do a DNSSEC-validated DNS query.' . LF);
|
|
|
+if (kdig(name: 'nlnet.nl', type: 'AAAA')['AD'] !== 1)
|
|
|
+ exit('DNS queries don\'t seem to be DNSSEC-validated.' . LF);
|
|
|
|
|
|
define('COOKIE_FILE', sys_get_temp_dir() . '/cookie-' . bin2hex(random_bytes(16)) . '.txt');
|
|
|
|
|
@@ -108,13 +107,8 @@ function testReg(): string {
|
|
|
'domain' => $domain,
|
|
|
'ns' => 'ns1.servnest.invalid.',
|
|
|
]);
|
|
|
- exescape([
|
|
|
- CONF['dns']['kdig_path'],
|
|
|
- '@' . CONF['reg']['address'],
|
|
|
- $domain,
|
|
|
- 'NS',
|
|
|
- ], $output);
|
|
|
- if (preg_match('/[ \t]+ns1\.servnest\.invalid\.$/Dm', implode(LF, $output)) !== 1)
|
|
|
+ $results = kdig(name: $domain, type: 'NS', server: CONF['reg']['address']);
|
|
|
+ if ($results['authorityRRs'][0]['rdataNS'] !== 'ns1.servnest.invalid.')
|
|
|
exit('Error: /reg/ns: NS record not set' . LF);
|
|
|
|
|
|
curlTest('/reg/ns', [
|
|
@@ -194,13 +188,10 @@ function testNs(string $domain): void {
|
|
|
'tag' => 'issue',
|
|
|
'value' => 'letsencrypt.org',
|
|
|
]);
|
|
|
- exescape([
|
|
|
- CONF['dns']['kdig_path'],
|
|
|
- '@' . CONF['reg']['address'],
|
|
|
- $domain,
|
|
|
- 'CAA',
|
|
|
- ], $output);
|
|
|
- if (preg_match('/^' . preg_quote($domain, '/') . '[ \t]+7200[ \t]+IN[ \t]+CAA[ \t]+0[ \t]+issue[ \t]+"letsencrypt\.org"$/Dm', implode(LF, $output)) !== 1)
|
|
|
+ $results = kdig(name: $domain, type: 'CAA', server: CONF['reg']['address']);
|
|
|
+ if ($results['answerRRs'][0]['TTL'] !== 7200)
|
|
|
+ exit('Error: /ns/caa: wrong TTL' . LF);
|
|
|
+ if ($results['answerRRs'][0]['rdataCAA'] !== '0 issue "letsencrypt.org" ')
|
|
|
exit('Error: /ns/caa: CAA record not set' . LF);
|
|
|
|
|
|
curlTest('/ns/edit', [
|
|
@@ -208,13 +199,8 @@ function testNs(string $domain): void {
|
|
|
'records' => 'aaaa.' . $domain . ' 3600 AAAA ' . CONF['ht']['ipv6_address'] . "\r\n"
|
|
|
. '@ 86400 NS ' . CONF['ns']['servers'][0] . "\r\n",
|
|
|
]);
|
|
|
- exescape([
|
|
|
- CONF['dns']['kdig_path'],
|
|
|
- '@' . CONF['reg']['address'],
|
|
|
- 'aaaa.' . $domain,
|
|
|
- 'AAAA',
|
|
|
- ], $output);
|
|
|
- if (preg_match('/[ \t]+' . preg_quote(CONF['ht']['ipv6_address'], '/') . '$/Dm', implode(LF, $output)) !== 1)
|
|
|
+ $results = kdig(name: 'aaaa.' . $domain, type: 'AAAA', server: CONF['reg']['address']);
|
|
|
+ if ($results['answerRRs'][0]['rdataAAAA'] !== CONF['ht']['ipv6_address'])
|
|
|
exit('Error: /ns/edit: AAAA record not set' . LF);
|
|
|
}
|
|
|
|