Add optional HMAC challenge-response for wallet encryption#1967
Add optional HMAC challenge-response for wallet encryption#1967kwsantiago wants to merge 16 commits intosparrowwallet:masterfrom
Conversation
592817f to
e7b6fdc
Compare
|
I build a custom version Probably a missing dependency within Gradle-Setup? Could you fix that or did I do something wrong on my side? Also I noticed that the password set dialog changes unintentionally between "Set yubikey" and "set password" if you first checkbox "Require yubikey for unlock" and then enter a password afterwards. |
|
@nzb-tuxxx Thank you for testing and reporting! The crash was a missing |
|
Thanks, I got it working and successfully managed a YubiKey encrypt / decrypt for a testing wallet. What I noticed:
|
|
@nzb-tuxxx Thank you for the thorough testing! All three are fixed:
Please let me know if you still see these or other issues. |
|
Thanks, 1 and 2 looking good. But 3 is still unchanged. Need to restart sparrow to be able to use yubikey again after 15 seconds timeout. I'll test this on real hardware, just to be sure. Edit: Also happens on real hardware |
|
Thanks for this. I think this would be a good addition to Sparrow in principle, but there are significant code changes which need careful review - I haven't attempted this yet. There is however a problem which needs addressing. Currently, there is a UI change to add a checkbox with the text A further question: what value is |
Agree, besides the mentioned hardware wallets, there is also OnlyKey which supports the same protocol: https://docs.onlykey.io/usersguide.html#using-onlykey-with-a-software-password-manager - Maybe just name it |
|
@craigraw Agreed and addressed, all user-facing strings now say "challenge-response" / "security key" instead of "YubiKey". @nzb-tuxxx on issue 3, this should be fixed now. The poll loop wasn't detecting the YubiKey's internal ~15s timeout, so it held the USB interface locked. Now detects it immediately and cleans up. Should be retryable without restart. Can you try it again? Agreed regarding OnlyKey, they use the same HMAC-SHA1 protocol, and the |
|
With 5accef3 every touch responses with |
|
@nzb-tuxxx Bug in the timeout detection. After a successful touch, |
|
Timeout is working now as expected, thanks for your effort @kwsantiago |
Summary
Adds optional HMAC-SHA1 challenge-response as a second factor for wallet encryption, solving #1896.
SHA256(argon2DerivedKey || HMAC_SHA1(argon2Salt))SPRW2wallet header with flags byte to indicate challenge-response is enabledSPRW2walletsDependencies
Changes
Persistence —
SPRW2header format with 1-byte flags field (FLAG_CHALLENGE_RESPONSE),DbPersistencereads/writes CR flag, wraps key deriver when provider is set. The flag is needed so Sparrow knows at load time to set up the provider and allow empty passwords.UI — "Require challenge-response for unlock" checkbox on password set/change dialogs, "Touch your security key" prompt during authentication
Call sites — All wallet unlock/decrypt dialogs detect CR-enabled wallets and set the provider
Test plan