Remove accidental or in typebitmap.encodingLength (#41)

This commit is contained in:
Nick Johnson 2018-09-05 17:52:59 +01:00 committed by silverwind
parent f4c95d6dda
commit 8a6764b2b3
2 changed files with 21 additions and 1 deletions

View File

@ -944,7 +944,7 @@ typebitmap.encodingLength = function (typelist) {
var extents = [] var extents = []
for (var i = 0; i < typelist.length; i++) { for (var i = 0; i < typelist.length; i++) {
var typeid = types.toType(typelist[i]) var typeid = types.toType(typelist[i])
extents[typeid >> 8] |= Math.max(extents[typeid >> 8] || 0, typeid & 0xFF) extents[typeid >> 8] = Math.max(extents[typeid >> 8] || 0, typeid & 0xFF)
} }
var len = 0 var len = 0

20
test.js
View File

@ -404,6 +404,26 @@ tape('nsec', function (t) {
nextDomain: 'foo.com', nextDomain: 'foo.com',
rrtypes: ['A', 'DNSKEY', 'CAA', 'DLV'] rrtypes: ['A', 'DNSKEY', 'CAA', 'DLV']
}) })
testEncoder(t, packet.nsec, {
nextDomain: 'foo.com',
rrtypes: ['TXT'] // 16
})
testEncoder(t, packet.nsec, {
nextDomain: 'foo.com',
rrtypes: ['TKEY'] // 249
})
testEncoder(t, packet.nsec, {
nextDomain: 'foo.com',
rrtypes: ['RRSIG', 'NSEC']
})
testEncoder(t, packet.nsec, {
nextDomain: 'foo.com',
rrtypes: ['TXT', 'RRSIG']
})
testEncoder(t, packet.nsec, {
nextDomain: 'foo.com',
rrtypes: ['TXT', 'NSEC']
})
// Test with the sample NSEC from https://tools.ietf.org/html/rfc4034#section-4.3 // Test with the sample NSEC from https://tools.ietf.org/html/rfc4034#section-4.3
var sampleNSEC = Buffer.from('003704686f7374076578616d706c6503636f6d00' + var sampleNSEC = Buffer.from('003704686f7374076578616d706c6503636f6d00' +