Comparing version 0.10.0 to 0.10.1
@@ -8,14 +8,2 @@ [ | ||
"data": { | ||
"keyTag": 19036, | ||
"algorithm": 8, | ||
"digestType": 2, | ||
"digest": "49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5" | ||
} | ||
}, | ||
{ | ||
"name": ".", | ||
"ttl": 172800, | ||
"class": "IN", | ||
"type": "DS", | ||
"data": { | ||
"keyTag": 20326, | ||
@@ -22,0 +10,0 @@ "algorithm": 8, |
@@ -359,14 +359,2 @@ [ | ||
"data": { | ||
"keyTag": 19036, | ||
"algorithm": 8, | ||
"digestType": 2, | ||
"digest": "49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5" | ||
} | ||
}, | ||
{ | ||
"name": ".", | ||
"ttl": 172800, | ||
"class": "IN", | ||
"type": "DS", | ||
"data": { | ||
"keyTag": 20326, | ||
@@ -373,0 +361,0 @@ "algorithm": 8, |
@@ -49,4 +49,4 @@ /*! | ||
exports.version = '0.10.0'; | ||
exports.version = '0.10.1'; | ||
exports.unbound = exports.UnboundResolver.version; | ||
exports.native = exports.UnboundResolver.native; |
@@ -24,3 +24,2 @@ /*! | ||
keyFlags, | ||
KSK_2010, | ||
KSK_2017 | ||
@@ -43,3 +42,2 @@ } = constants; | ||
const rootAnchors = [ | ||
Record.fromString(KSK_2010), | ||
Record.fromString(KSK_2017) | ||
@@ -320,27 +318,2 @@ ]; | ||
isKSK(proof, ksk) { | ||
assert(proof instanceof this.Proof); | ||
assert(ksk instanceof Record); | ||
assert(ksk.type === types.DS); | ||
if (proof.zones.length < 2) | ||
return false; | ||
const root = proof.zones[0]; | ||
const sig = getSig(root.keys); | ||
if (!sig) | ||
return false; | ||
return sig.data.keyTag === ksk.data.keyTag; | ||
} | ||
isKSK2010(proof) { | ||
return this.isKSK(proof, rootAnchors[0]); | ||
} | ||
isKSK2017(proof) { | ||
return this.isKSK(proof, rootAnchors[1]); | ||
} | ||
getWindow(proof) { | ||
@@ -658,3 +631,3 @@ assert(proof instanceof this.Proof); | ||
if (!ksk) | ||
return null; | ||
return false; | ||
@@ -876,6 +849,4 @@ const [sig, rrset] = splitSet(zone.keys); | ||
const revSet = toRevSet(answer); | ||
const ksk2017 = rootAnchors[1]; | ||
const now = util.now(); | ||
const rrs = []; | ||
const now = util.now(); | ||
@@ -920,13 +891,2 @@ let sig = null; | ||
if (type === types.DNSKEY) { | ||
// Prefer KSK 2017. | ||
if (sig.name === '.') { | ||
if (rd.keyTag === ksk2017.data.keyTag) { | ||
sig = rr; | ||
continue; | ||
} | ||
if (sd.keyTag === ksk2017.data.keyTag) | ||
continue; | ||
} | ||
// Prefer committed keys no matter what. | ||
@@ -933,0 +893,0 @@ if (!dsSet.has(sd.keyTag) && dsSet.has(rd.keyTag)) { |
@@ -21,3 +21,2 @@ /*! | ||
const util = exports; | ||
const YEAR68 = (1 << 31) >>> 0; | ||
@@ -951,20 +950,19 @@ util.splitName = function splitName(s) { | ||
const sc = unpad(s, 12, 14); | ||
const da = new Date(); | ||
const da = new Date(); | ||
da.setUTCFullYear(y); | ||
da.setUTCMonth(m - 1); | ||
da.setUTCDate(d); | ||
da.setUTCMonth(m - 1, d); | ||
da.setUTCHours(hr); | ||
da.setUTCMinutes(mn); | ||
da.setUTCSeconds(sc); | ||
da.setUTCMilliseconds(0); | ||
const t = Math.floor(da.getTime() / 1000); | ||
const div = util.now() / YEAR68; | ||
const ms = da.getTime(); | ||
let mod = Math.floor(div) - 1; | ||
if (!Number.isSafeInteger(ms)) | ||
throw new RangeError('Invalid time.'); | ||
if (mod < 0) | ||
mod = 0; | ||
assert(ms % 1000 === 0); | ||
return (t - (mod * YEAR68)) >>> 0; | ||
return ms / 1000; | ||
}; | ||
@@ -974,15 +972,10 @@ | ||
assert(Number.isSafeInteger(t) && t >= 0); | ||
assert(Number.isSafeInteger(t * 1000)); | ||
const div = (t - util.now()) / YEAR68; | ||
const da = new Date(t * 1000); | ||
const ms = da.getTime(); | ||
let mod = Math.floor(div) - 1; | ||
if (!Number.isSafeInteger(ms)) | ||
throw new RangeError('Invalid time.'); | ||
if (mod < 0) | ||
mod = 0; | ||
const ti = t - (mod * YEAR68); | ||
const da = new Date(); | ||
da.setTime(ti * 1000); | ||
const y = util.pad(da.getUTCFullYear(), 4); | ||
@@ -989,0 +982,0 @@ const m = util.pad(da.getUTCMonth() + 1, 2); |
{ | ||
"name": "bns", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "DNS bike-shed", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
668083
25621