allow zero length paths when parsing psbt key derivations

This commit is contained in:
Craig Raw 2021-11-10 15:43:11 +02:00
parent 6c03c4106a
commit f46d627755

View file

@ -64,7 +64,7 @@ public class PSBTEntry {
throw new PSBTParseException("Invalid master fingerprint specified: " + masterFingerprint);
}
if(data.length < 8) {
throw new PSBTParseException("Invalid key derivation specified: not enough bytes");
return new KeyDerivation(masterFingerprint, "m");
}
List<ChildNumber> bip32pathList = readBIP32Derivation(Arrays.copyOfRange(data, 4, data.length));
String bip32path = KeyDerivation.writePath(bip32pathList);