browserify-sign
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "browserify-sign", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "", | ||
@@ -17,7 +17,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"bn.js": "^1.0.0", | ||
"bn.js": "^2.0.0", | ||
"browserify-rsa": "^2.0.0", | ||
"create-hash": "^1.1.0", | ||
"create-hmac": "^1.1.2", | ||
"elliptic": "^1.0.0", | ||
"elliptic": "^3.0.0", | ||
"inherits": "^2.0.1", | ||
@@ -24,0 +24,0 @@ "parse-asn1": "^3.0.0" |
@@ -14,3 +14,3 @@ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js | ||
if (signType !== 'ecdsa') { | ||
throw new Error('wrong public key type') | ||
throw new Error('wrong private key type') | ||
} | ||
@@ -21,7 +21,7 @@ return ecSign(hash, priv) | ||
if (signType !== 'dsa') { | ||
throw new Error('wrong public key type') | ||
throw new Error('wrong private key type') | ||
} | ||
} else { | ||
if (signType !== 'rsa') { | ||
throw new Error('wrong public key type') | ||
throw new Error('wrong private key type') | ||
} | ||
@@ -28,0 +28,0 @@ } |
@@ -32,3 +32,3 @@ var asn1 = require('parse-asn1/asn1') | ||
test(f.message, function (t) { | ||
t.plan(5) | ||
t.plan(7) | ||
@@ -42,3 +42,3 @@ var mySign = myCrypto.createSign(f.scheme) | ||
t.equals(mySig.toString('hex'), nodeSig.toString('hex'), 'equal sigs') | ||
t.equals(mySig.toString('hex'), f.signature) | ||
t.equals(mySig.toString('hex'), f.signature, 'compare to known') | ||
@@ -49,2 +49,6 @@ var myVer = myCrypto.createVerify(f.scheme) | ||
t.ok(myVer.update(message).verify(pub, nodeSig), 'me validate node sig') | ||
myVer = myCrypto.createVerify(f.scheme) | ||
nodeVer = nodeCrypto.createVerify(f.scheme) | ||
t.ok(nodeVer.update(message).verify(pub, nodeSig), 'node validate node sig') | ||
t.ok(myVer.update(message).verify(pub, mySig), 'me validate my sig') | ||
}) | ||
@@ -51,0 +55,0 @@ }) |
@@ -68,3 +68,3 @@ 'use strict' | ||
var pubkey = pub.data.subjectPrivateKey.data | ||
return curve.verify(hash.toString('hex'), sig.toString('hex'), pubkey.toString('hex')) | ||
return curve.verify(hash, sig, pubkey) | ||
} | ||
@@ -71,0 +71,0 @@ function dsaVerify (sig, hash, pub) { |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
182987
1641
0
+ Addedelliptic@3.1.0(transitive)
- Removedbn.js@1.3.0(transitive)
- Removedelliptic@1.0.1(transitive)
Updatedbn.js@^2.0.0
Updatedelliptic@^3.0.0