Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmetcalf committed Nov 29, 2016
1 parent aec5180 commit be99732
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions browser/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var curves = require('./curves.json')
function sign (hash, key, hashType, signType, tag) {
var priv = parseKeys(key)
if (priv.curve) {
// rsa keys can be interpreted as ecdsa ones in openssl
if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
return ecSign(hash, priv)
} else if (priv.type === 'dsa') {
Expand Down
1 change: 1 addition & 0 deletions browser/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var curves = require('./curves.json')
function verify (sig, hash, key, signType, tag) {
var pub = parseKeys(key)
if (pub.type === 'ec') {
// rsa keys can be interpreted as ecdsa ones in openssl
if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
return ecVerify(sig, hash, pub)
} else if (pub.type === 'dsa') {
Expand Down
2 changes: 0 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ fixtures.valid.ec.forEach(function (f) {
}

test(f.message, function (t) {
console.log(f.scheme)
var nSign = nCrypto.createSign(f.scheme)
var bSign = bCrypto.createSign(f.scheme)

Expand All @@ -83,7 +82,6 @@ fixtures.valid.ec.forEach(function (f) {
if (f.scheme !== 'DSA' && f.scheme.toLowerCase().indexOf('dsa') === -1) {
test(f.message + ' named rsa through', function (t) {
var scheme = 'RSA-' + f.scheme.toUpperCase()
console.log(scheme)
var nSign = nCrypto.createSign(scheme)
var bSign = bCrypto.createSign(scheme)

Expand Down

0 comments on commit be99732

Please sign in to comment.