mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 16:43:14 +00:00
validate bip129 header on import, and fix importing unencrypted bsms files with open wallet
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user