Skip to content

Commit

Permalink
passphrase: always reset to 'no-passphrase' during wallet setup
Browse files Browse the repository at this point in the history
If desired, the user can later enable a bip39 passphrase explicitly in
the Options 'BIP39 Passphrase' menu.
  • Loading branch information
JamieDriver committed Jun 17, 2024
1 parent 67bccc0 commit 42efa85
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions main/process/mnemonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1424,17 +1424,13 @@ void initialise_with_mnemonic(const bool temporary_restore, const bool force_qr_
#endif // CONFIG_HAS_CAMERA

// When using 'temporary restore' we respect the existing passphrase settings.
// If using 'advanced mode' to setup the persistent wallet, we ask the user and save the settings.
// In basic/standard mode automatically set 'no passphrase'.
// NOTE: we don't offer the 'once' option at setup time (only in the options/setting prefs menu).
keychain_set_confirm_export_blinding_key(advanced_mode);
// Otherwise reset to 'passphrase not in use' by default during new wallet setup.
// NOTE: the user can enable it explicitly in the options/setting prefs menu if desired.
if (!temporary_restore) {
const char* question[] = { " Add BIP39 passphrase?", "You will need this", "to access your funds." };
const bool use_passphrase
= advanced_mode && await_yesno_activity("BIP39 Passphrase", question, 3, false, "blkstrm.com/passphrase");
keychain_set_passphrase_frequency(use_passphrase ? PASSPHRASE_ALWAYS : PASSPHRASE_NEVER);
keychain_set_passphrase_frequency(PASSPHRASE_NEVER);
keychain_persist_key_flags();
}
keychain_set_confirm_export_blinding_key(advanced_mode);

if (!derive_keychain(temporary_restore, mnemonic)) {
// Error making wallet...
Expand Down

0 comments on commit 42efa85

Please sign in to comment.