Skip to content

Commit f46465b

Browse files
committed
Add mnemonic validation on migration
1 parent 1c412e3 commit f46465b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Bitkit/Services/MigrationsService.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ extension MigrationsService {
448448
throw AppError(message: "Invalid mnemonic: \(words.count) words", debugMessage: nil)
449449
}
450450

451+
guard BitkitCore.validateMnemonic(mnemonic) else {
452+
throw AppError(message: "Invalid BIP39 mnemonic", debugMessage: nil)
453+
}
454+
451455
try Keychain.saveString(key: .bip39Mnemonic(index: walletIndex), str: mnemonic)
452456
}
453457

0 commit comments

Comments
 (0)