Skip to content

Commit

Permalink
Merge pull request #12 from crypto-browserify/errors
Browse files Browse the repository at this point in the history
correct error message
  • Loading branch information
dcousens committed Apr 13, 2015
2 parents 7846def + 06b80c9 commit a013ec1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ function sign (hash, key, hashType, signType) {
var priv = parseKeys(key)
if (priv.curve) {
if (signType !== 'ecdsa') {
throw new Error('wrong public key type')
throw new Error('wrong private key type')
}
return ecSign(hash, priv)
} else if (priv.type === 'dsa') {
return dsaSign(hash, priv, hashType)
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')
}
}
var len = priv.modulus.byteLength()
Expand Down

0 comments on commit a013ec1

Please sign in to comment.