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

auth: fixes errors when adding a new device after removing devices #128

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

michaelkamphausen
Copy link

I ran into the error "Can't decrypt link: don't have the correct keyset" while trying to join with a new device after I removed other devices of the same user. I observed that the new device cannot decrypt the whole team graph because it can only unlock the latest generation of team keys using the latest generation of user keys. These were the only user keys that the new device received on joining, while there have been several generations of user and team keys since the key rotations following the device removals.

My proposed solution is to put all generations of user keys in lockboxes when creating a device invitation, so the new device can unlock all generations of team keys.

With these changes, the next thing I had was an ENCRYPTION_FAILURE when the new device started to sync with the server after joining, because the server was still using generation 0 user keys when talking to the new device. It turned out that the user keys in team.state.members and context.user were not updated after the key rotation when removing a device, so I changed that.

…an decrypt all generations of team keys and the complete team graph
…text are updated with the new rotated user keys generation
…s and encrypt them for the new member's user keys to ensure the member can decrypt the complete team graph
@michaelkamphausen
Copy link
Author

When I joined as a new member, I had the same problem with decrypting the links of the team graph after the team keys had previously been rotated. I found that the new user could only unlock the last generation of team keys with his user keys. My suggested solution is to store all generations of team keys in lockboxes encrypted with the new member's user keys.

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.

1 participant