mirror of
https://github.com/ok2/coinbin.git
synced 2026-04-24 11:44:02 +02:00
add extra validation to prevent invalid public keys being used. (as per issue 39)
This commit is contained in:
parent
c276998687
commit
27c9bff17e
@ -278,6 +278,7 @@
|
||||
|
||||
/* decompress an compressed public key */
|
||||
coinjs.pubkeydecompress = function(pubkey) {
|
||||
if((typeof(pubkey) == 'string') && pubkey.match(/^[a-f0-9]+$/i)){
|
||||
var curve = EllipticCurve.getSECCurveByName("secp256k1");
|
||||
try {
|
||||
var pt = curve.curve.decodePointHex(pubkey);
|
||||
@ -293,6 +294,8 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
coinjs.testdeterministicK = function() {
|
||||
// https://github.com/bitpay/bitcore/blob/9a5193d8e94b0bd5b8e7f00038e7c0b935405a03/test/crypto/ecdsa.js
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user