forked from LittleChest/dns-packet
Remove accidental or in typebitmap.encodingLength (#41)
This commit is contained in:
parent
f4c95d6dda
commit
8a6764b2b3
2
index.js
2
index.js
@ -944,7 +944,7 @@ typebitmap.encodingLength = function (typelist) {
|
||||
var extents = []
|
||||
for (var i = 0; i < typelist.length; 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
|
||||
|
||||
20
test.js
20
test.js
@ -404,6 +404,26 @@ tape('nsec', function (t) {
|
||||
nextDomain: 'foo.com',
|
||||
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
|
||||
var sampleNSEC = Buffer.from('003704686f7374076578616d706c6503636f6d00' +
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user