Skip to content

Commit

Permalink
dns/resource: NS DNSSEC
Browse files Browse the repository at this point in the history
Sign the additional fields for a NS query.
  • Loading branch information
Mark Tyneway committed Oct 9, 2019
1 parent 8bbd817 commit d6888a1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/dns/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -1228,13 +1228,27 @@ class Resource extends Struct {
key.signZSK(res.additional, types.A);
key.signZSK(res.additional, types.AAAA);
break;
case types.NS:
case types.NS: {
res.authority = this.toNS(name);
res.additional = this.toNSIP(name);
for (const rr of this.toGlue(types.NS))
res.additional.push(rr);
key.signZSK(res.authority, types.NS);

const names = new Set();
for (const rr of res.additional)
names.add(rr.name);

const additional = res.additional;
for (const name of names) {
for (const type of [types.A, types.AAAA]) {
const rrset = util.extractSet(additional, name, type);
const sig = key.signZSK(rrset, type);
additional.push(...sig);
}
}
break;
}
case types.MX:
res.answer = this.toMX(name);
res.additional = this.toMXIP(name);
Expand Down

0 comments on commit d6888a1

Please sign in to comment.