Skip to content

fix: error when passphrase provided but passphrase protection disabled#2

Open
BitHighlander wants to merge 2 commits into
masterfrom
bugfix/keepkey-passphrase-ignored
Open

fix: error when passphrase provided but passphrase protection disabled#2
BitHighlander wants to merge 2 commits into
masterfrom
bugfix/keepkey-passphrase-ignored

Conversation

@BitHighlander
Copy link
Copy Markdown
Owner

Summary

  • When a BIP39 passphrase is provided but passphrase_protection is disabled on the device, HWI silently ignores the passphrase and returns the default (no-passphrase) wallet
  • This causes wallet apps (Sparrow, Specter) to derive wrong addresses with no indication of the problem
  • Now raises BadArgumentError in _check_unlocked() with a clear message to enable passphrase protection via togglepassphrase
  • Adds warnings in enumerate() output for both KeepKey and Trezor devices

Verified

  • Empty passphrase xpub: xpub6D6UctxqkwVv1s...
  • Passphrase "test" xpub: xpub6DArWrRe4wygCG... (different wallet, confirmed working)
  • Without passphrase protection enabled: clear error instead of silent wrong wallet

Test plan

  • enumerate() without passphrase works normally
  • enumerate(password='test') with protection off returns warning
  • getmasterxpub with passphrase but protection off raises BadArgumentError
  • After enabling passphrase protection, different passphrase produces different xpub

…bled

Previously, if a BIP39 passphrase was provided but passphrase_protection
was not enabled on the device, HWI silently ignored the passphrase and
returned the default (no-passphrase) wallet. This could cause wallet apps
like Sparrow and Specter to derive the wrong addresses without any
indication of the problem.

Now raises BadArgumentError in _check_unlocked() and adds warnings in
enumerate() output for both KeepKey and Trezor devices.
Previously, if a BIP39 passphrase was provided but passphrase_protection
was not enabled on the device, HWI silently ignored the passphrase and
returned the default (no-passphrase) wallet. This could cause wallet apps
like Sparrow and Specter to derive the wrong addresses without any
indication of the problem.

Now prints a warning to stderr in _check_unlocked() and adds warnings
in enumerate() output for both KeepKey and Trezor devices. Non-breaking:
existing integrations continue to work, they just see the warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant