Skip to content

Commit 48a995d

Browse files
committed
test: dns test case failures after c-ares update to 1.21.0+
c-ares has made intentional changes to the behavior of TXT records to comply with RFC 7208, which concatenates multiple strings for the same TXT record into a single string. Multiple TXT records are not concatenated. Also, response handling has changed, such that a response which is completely invalid in formatting is thrown away as a malicious forged/spoofed packet rather than returning EBADRESP. This is one step toward RFC 9018 (EDNS COOKIES) which will require the message to at least be structurally valid to validate against spoofed records. Fixes: #50741 Refs: #50444 Fix By: Brad House (@bradh352)
1 parent 2d1bc3d commit 48a995d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/parallel/test-dns-resolveany-bad-ancount.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ server.bind(0, common.mustCall(async () => {
3030
dnsPromises.resolveAny('example.org')
3131
.then(common.mustNotCall())
3232
.catch(common.expectsError({
33-
code: 'EBADRESP',
33+
// May return EBADRESP or ETIMEOUT
34+
// code: 'EBADRESP',
3435
syscall: 'queryAny',
3536
hostname: 'example.org'
3637
}));
3738

3839
dns.resolveAny('example.org', common.mustCall((err) => {
39-
assert.strictEqual(err.code, 'EBADRESP');
40+
assert.notStrictEqual(err.code, 'SUCCESS');
4041
assert.strictEqual(err.syscall, 'queryAny');
4142
assert.strictEqual(err.hostname, 'example.org');
4243
const descriptor = Object.getOwnPropertyDescriptor(err, 'message');

test/parallel/test-dns-resolveany.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const answers = [
1111
{ type: 'AAAA', address: '::42', ttl: 123 },
1212
{ type: 'MX', priority: 42, exchange: 'foobar.com', ttl: 124 },
1313
{ type: 'NS', value: 'foobar.org', ttl: 457 },
14-
{ type: 'TXT', entries: [ 'v=spf1 ~all', 'xyz\0foo' ] },
14+
{ type: 'TXT', entries: [ 'v=spf1 ~all xyz\0foo' ] },
1515
{ type: 'PTR', value: 'baz.org', ttl: 987 },
1616
{
1717
type: 'SOA',

0 commit comments

Comments
 (0)