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

legacy: initialized field in Features is true only if mnemonic is stored #971

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

tsusanka
Copy link
Contributor

Older firmware supported direct mnemonic load or xprv import. This support was removed from the latest firmware. If someone used this feature and upgraded to the latest fw node deriving does not work anymore and we also incorrectly state that the device as initialized (features.initialized).

This PR modifies this field to isInitialized() && hasMnemonic() as @prusnak suggested to declare the device as initialized only if it has a mnemonic stored. Because of that I have added storage_has (maybe storage_key_exists is better?) to only check if mnemonic is present instead of fetching it.

I also had to modify the wipedevice test, which now fails on TT, but that will be fixed by the changes in #958. So I suggest to merge this after the soft lock.

Closes #965

@tsusanka tsusanka added this to the 2020-06 milestone Apr 30, 2020
@tsusanka tsusanka added the blocked Blocked by external force. Third party inputs required. label Apr 30, 2020
legacy/firmware/fsm_msg_common.h Outdated Show resolved Hide resolved
@matejcik
Copy link
Contributor

please remove the wipedevice test from this, it will lead to conflict with #958 where the test is also modified. I think the version from #958 will succeed here as well.

@tsusanka tsusanka removed the blocked Blocked by external force. Third party inputs required. label Apr 30, 2020
@tsusanka
Copy link
Contributor Author

tsusanka commented Apr 30, 2020

The deferred label of course needs to stay, because now legacy test suite is not passing. Waits for #958.

@tsusanka tsusanka added the blocked Blocked by external force. Third party inputs required. label Apr 30, 2020
@tsusanka tsusanka modified the milestones: 2020-06, 2020-07 May 19, 2020
@tsusanka tsusanka removed the blocked Blocked by external force. Third party inputs required. label Jun 5, 2020
@tsusanka tsusanka merged commit 41966c6 into master Jun 5, 2020
@tsusanka tsusanka deleted the tsusanka/965-initialized branch June 5, 2020 09:07
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.

Device claims to be initialized when it was imported using XPRV which can't be used anymore
4 participants