bip70: throw on bad curve.

This commit is contained in:
Christopher Jeffrey 2016-07-29 13:24:02 -07:00
parent 41cc642a32
commit 7d8da2d377
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -182,7 +182,7 @@ pk._verify = function verify(hash, msg, sig, key) {
return rsa.verify(hash, msg, sig, key.data);
case 'ecdsa':
if (!key.curve)
return false;
throw new Error('No curve present.');
return ecdsa.verify(key.curve, hash, msg, sig, key.data);
default:
throw new Error('Unsupported algorithm.');
@ -211,7 +211,7 @@ pk.sign = function sign(hash, msg, key) {
return rsa.sign(hash, msg, key.data);
case 'ecdsa':
if (!key.curve)
return false;
throw new Error('No curve present.');
return ecdsa.sign(key.curve, hash, msg, key.data);
default:
throw new Error('Unsupported algorithm.');