Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browserify-sign

Package Overview
Dependencies
Maintainers
5
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-sign - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc