Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Optional for passphrase #644

Merged
merged 4 commits into from
Dec 8, 2022

Conversation

achow101
Copy link
Member

We should be distinguishing from the empty passphrase and no passphrase provided, so instead of defaulting to the empty passphrase, change passphrase (aka password) to an Optional. This way, if it is not provided, it is None and empty passphrases can be handled correctly.

Fixes #639

We need to distinguish between passphrase not set, and empty passphrase.
So use an Optional instead of checking for the empty string.
@achow101
Copy link
Member Author

Updated to unify Trezor's enumerate and other commands behavior. Both will require a passphrase to be provided if passphrase protection is on.

If the passphrase is not provided and passphrase protection is enabled,
default to the empty string.
@achow101
Copy link
Member Author

#639 (comment) recommends that we default to the empty string passphrase if no passphrase is provided, so I've updated this to do that. TrezorClient will use "" if no passphrase is given, and enumerate will now only emit a warning if no passphrase is provided rather than an error.

@achow101 achow101 merged commit e7af45d into bitcoin-core:master Dec 8, 2022
@moneymanolis
Copy link

Just fyi: Works fine with Specter now.

@moneymanolis
Copy link

@achow101 just checking in, when are you planning a new release with that PR included? The last release was in May, so might perhaps be about time anyway?

@achow101
Copy link
Member Author

@moneymanolis I plan on making a release at the beginning of the new year.

@moneymanolis
Copy link

Great, thanks!

achow101 added a commit to achow101/hardware-wallet-interface that referenced this pull request Jan 11, 2023
Since bitcoin-core#644, not providing a passphrase to a trezor that has passphrases
enabled will only result in a warning rather than setting
`needs_passphrase_set` to false.
achow101 added a commit that referenced this pull request Jan 12, 2023
… passphrase changes

b8a379c test, trezor: Properly pass empty string passphrase (Andrew Chow)
c3f490f test, trezor: Check for warnings rather than needs_passphrase_sent (Andrew Chow)
203c844 trezor: Add missing NoPasswordError import (Andrew Chow)

Pull request description:

  Fixes a couple things were missed following #644 which are causing CI failures in Trezor tests.

Top commit has no ACKs.

Tree-SHA512: 508c6c9cdbc18833360a146296293500480938723843927e980e124ab24cb17f035418623e7fcb3e1a196e3e6bb7754bdd3bd2903d5d9064918ad875124efd1a
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.

Trezor: it should be possible to use an empty passphrase
2 participants