From 2ecd49b655c6e4dcc66be6bbf9e056a9352d55de Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 14 Mar 2018 08:47:44 -0700 Subject: [PATCH] dns: cleanup. --- lib/dns/server.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/dns/server.js b/lib/dns/server.js index 4f9d6d1c5..45984b80d 100644 --- a/lib/dns/server.js +++ b/lib/dns/server.js @@ -90,7 +90,7 @@ class RootServer extends DNSServer { const name = util.label(qs.name, labels, -1); // Lookup the name data. - const data = await this.hsk.getDataByName(name, -1); + const data = await this.hsk.getDataByName(name.toLowerCase(), -1); // Non-existent domain. if (!data) { @@ -105,25 +105,25 @@ class RootServer extends DNSServer { // We should also be giving an NSEC proof // here, but I don't think it's possible // with the current construction. - if (ds) { + if (ds) dnssec.signMessage(res, '.', key.pub, key.priv); - dnssec.signMessage(res, tld, key.pub, key.priv); - } return res; } // Our resolution. - const rec = Resource.fromRaw(data); - const res = rec.toDNS(qs.name, qs.type, ds); + const resource = Resource.fromRaw(data); + const res = resource.toDNS(qs.name, qs.type, ds); if (res.answer.length === 0 && res.authority.length === 0) { res.authority.push(this.toSOA()); } - if (ds) + if (ds) { dnssec.signMessage(res, tld, key.pub, key.priv); + dnssec.signMessage(res, '.', key.pub, key.priv); + } return res; }