Skip to content

Commit 6948de1

Browse files
fix(app): do not use HDNode.fromPrivateKeyBuffer()
There is no plausible use case where we want to instantiate a bip32 node from just the private key buffer (without chaincode). Issue: BG-34381
1 parent aa44234 commit 6948de1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/sign.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,10 @@ const parseKey = co(function *(rawkey, coin, path) {
429429
return xprv;
430430

431431
}
432-
// if it doesn't have commas, we expect it is an xprv or xlmsecret properly formatted
433432
if (path) {
434-
let node = utxolib.HDNode.fromPrivateKeyBuffer(Buffer.from(rawkey, 'hex'));
435-
node = node.derivePath(path);
436-
return node.toBase58();
433+
throw new Error(`cannot derive key with path`)
437434
}
435+
// if it doesn't have commas or a path, return unchanged input
438436
return rawkey;
439437
});
440438

0 commit comments

Comments
 (0)