Comparing version 2.0.4 to 2.0.6
11
index.js
@@ -113,2 +113,6 @@ const WebTorrent = require('webtorrent') | ||
if(infoHash !== data.infohash){ | ||
throw new Error('infohash does not match with the given infohash') | ||
} | ||
const signatureBuff = Buffer.from(data.sig, 'hex') | ||
@@ -118,5 +122,6 @@ const encodedSignatureData = this.encodeSigData({ seq: data.sequence, v: { ih: infoHash, ...data.stuff } }) | ||
if (infoHash !== data.infohash || !ed.verify(signatureBuff, encodedSignatureData, addressBuff)) { | ||
if (!ed.verify(signatureBuff, encodedSignatureData, addressBuff)) { | ||
throw new Error('data does not match signature') | ||
} | ||
return data | ||
@@ -271,3 +276,3 @@ } | ||
checkProperty.folder = folderPath | ||
const dataPath = path.join(checkProperty.folder, checkProperty.infoHash) | ||
const dataPath = path.join(checkProperty.folder, checkProperty.infohash) | ||
@@ -397,3 +402,3 @@ // if current option is true, then if the infohash for the address is brand new then empty the directory and download the new infohash | ||
this.checkId.set(id.address, checkTorrent) | ||
return { torrent: checkTorrent, address: id.address, secret: id.secret, infohash: checkTorrent.infohash } | ||
return { torrent: checkTorrent, address: id.address, secret: id.secret, infohash: checkTorrent.infohash, sequence: checkTorrent.sequence } | ||
} else { | ||
@@ -400,0 +405,0 @@ |
{ | ||
"name": "torrentz", | ||
"version": "2.0.4", | ||
"version": "2.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25646
604