Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Added
- CI runs flake8, pylint and the dependency license check on Python 3.14
- Dependabot opens update pull requests for the GitHub Actions every week and for the Python dependencies every month; minor and patch updates come grouped in one pull request per ecosystem, major updates one by one, and a release is proposed once it is seven days old
- ``NOTICES.md`` and the license texts of code from other projects are included in the package; the Windows installer installs them together with the licenses of the bundled Python packages
- ``seed recover`` explains, before the passphrase prompt, how to enter the passphrase of a wallet set up on Windows with version 1.0.5 or earlier; the documentation has the details

Changed
^^^^^^^
Expand Down
13 changes: 12 additions & 1 deletion cryptnox_cli/command/helper/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _verify_input(card: cryptnox_sdk_py.Card, method, text, verify_text,
return value


def get_bip39_passphrase(confirm_required: bool = True) -> str:
def get_bip39_passphrase(confirm_required: bool = True, recovery: bool = False) -> str:
print()
print_warning("BIP39 PASSPHRASE FEATURE")
print("A BIP39 passphrase is an optional extra password that provides additional security.")
Expand All @@ -220,6 +220,17 @@ def get_bip39_passphrase(confirm_required: bool = True) -> str:
print(" • Press ENTER to skip passphrase (standard BIP39 with empty passphrase)")
print()

if recovery:
print_warning("WALLET SET UP ON WINDOWS WITH VERSION 1.0.5 OR EARLIER?")
print("The passphrase prompt of those versions did not keep characters outside ASCII")
print("(accented letters, symbols, emoji). To open such a wallet:")
print(" • Set up with 1.0.4 or 1.0.5: enter the passphrase without those characters")
print(" • Pasted with Ctrl+V into the classic console: no passphrase was stored, answer No")
print(" • Set up with 1.0.3 or earlier: the characters were stored changed; contact support")
print("Then move the funds to a wallet created with this version.")
print("Details: https://docs.cryptnox.com/cryptnox-cli/cli.html#windows-passphrase")
print()

use_passphrase = confirm("Do you want to use a BIP39 passphrase?")

passphrase = ""
Expand Down
2 changes: 1 addition & 1 deletion cryptnox_cli/command/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _recover(card: cryptnox_sdk_py.Card) -> int:
mnemonic = ui.input_with_exit("> ")

try:
passphrase = ui.get_bip39_passphrase(confirm_required=True)
passphrase = ui.get_bip39_passphrase(confirm_required=True, recovery=True)
except ui.ExitException as error:
print(error)
return -1
Expand Down
18 changes: 18 additions & 0 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,24 @@ If your wallet was created with a passphrase, you **must** provide the same pass
- ✅ Same mnemonic + different passphrase = completely different wallet
- ✅ Passphrase can be any UTF-8 string (including spaces and special characters)

.. _windows-passphrase:

Wallets set up on Windows with version 1.0.5 or earlier
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Up to version 1.0.5 the passphrase prompt on Windows did not keep characters outside ASCII, such as accented letters, Cyrillic or CJK characters, symbols and emoji. The card works, but the passphrase as written down restores a different wallet. ``seed recover`` points to this section before it asks for the passphrase. Linux and macOS are not affected.

Versions 1.0.4 and 1.0.5 dropped every such character that the console's code page contains, so the passphrase that opens the wallet is the one with those characters removed. Exceptions:

- A character the code page does not contain became a question mark or a similar plain character, such as ``o`` for ``ő``, and that character is part of the stored passphrase.
- On a Chinese, Japanese or Korean console a character could leave one ASCII character behind, such as a backslash.
- Pasted into the classic console with right-click, symbols and emoji arrived as nothing; pasted into Windows Terminal, an emoji became two question marks.
- Pasted into the classic console with Ctrl+V, nothing arrived: the wallet was set up without a passphrase. Answer ``No`` when ``seed recover`` asks whether to use one.

Version 1.0.3 and earlier stored a character the code page contains as a different character, so such a wallet opens neither with the passphrase as written nor with those characters removed. Contact Cryptnox support.

Once the wallet is open, move the funds to a wallet created with the current version, so that the written-down passphrase is the one that restores it.

Exit Codes
----------

Expand Down
Loading