validate bip129 header on import, and fix importing unencrypted bsms files with open wallet

This commit is contained in:
Craig Raw
2026-03-12 12:33:56 +02:00
parent 32a35ed2c0
commit 186eacc245
2 changed files with 5 additions and 0 deletions
@@ -1287,6 +1287,7 @@ public class AppController implements Initializable {
private boolean attemptImportWallet(File file, SecureString password) {
List<WalletImport> walletImporters = List.of(new ColdcardSinglesig(), new ColdcardMultisig(),
new Bip129(),
new Electrum(),
new SpecterDesktop(),
new Descriptor(),
@@ -235,6 +235,10 @@ public class Bip129 implements KeystoreFileExport, KeystoreFileImport, WalletExp
}
String header = reader.readLine();
if(header == null || !header.startsWith("BSMS")) {
throw new ImportException("Not a BSMS file");
}
String descriptor = reader.readLine();
String paths = reader.readLine();
String address = reader.readLine();