Page MenuHomePhabricator

[electrum] fix hardware wallet decryption
ClosedPublic

Authored by PiRK on Oct 18 2023, 05:06.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCe55bc67e6e7c: [electrum] fix hardware wallet decryption
Summary

Wallets are encrypted with a key derived from a password. Hardware wallets use a hex-encoded public key generated by the device on a special derivation path as the password.

With the recent refactorings, Xpub.get_pubkey_from_xpub now returns bytes, so we need to explicitely convert it to a hex string before passing it to storage.decrypt.

Note that this was already fixed in HardwareKeyStore.get_password_for_storage_encryption which is called when the wallet is first created, so any wallet created by Electrum ABC 5.2.8 will be correctly encrypted. The bug affect the decryption when the user tries to reopen the wallet later.

Test Plan

Open an encrypted hardware wallet. Tested with a Ledger Nano S and a Satochip card.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_hw_wallet_decryption
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25366
Build 50313: Build Diffelectrum-tests
Build 50312: arc lint + arc unit