Login without decrypting the whole tree #615
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
The
loginTree
is a pretty heavyweight structure that has everything decrypted. We want to get rid of this thing, so we just decrypt what we need, when we need it.Unfortunately, the loginTree is a fundamental core data structure, so getting rid of it is a huge project. This PR just removes the loginTree decryption from the early login stages. This is a change where everything depends on everything else, so there is no way to do it except for a making a single giant commit.
With this change in place, the early login process relies more heavily on the
stashTree
data structure, which has the same shape as the login tree, but with everything encrypted instead of decrypted. We also add a newSessionKey
, which consists a decryption key along with the loginId the key goes with.We still have a loginTree stored in redux, but this is derived from the stashTree, and only exists once login is complete. Getting rid of this will be another project, but that one will be easier to break into small pieces. Since we derive the loginTree from the stashTree now, we never need to modify the loginTree in memory, which means we can also get rid of the
LoginKit.login
diff.