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: ENCRYPTION_FAILURE during key negotiation after key rotation #135

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

Conversation

michaelkamphausen
Copy link
Contributor

Hi Herb!

I recently encountered an ENCRYPTION_FAILURE when I tried to connect my device with the server.
I realized that the server had encrypted the seed for negotiating a shared key with a newer generation of user keys that my device was not yet aware of. As a result, the device was unable to connect and therefore could not synchronize the team graph to receive the new keys and remained locked out.

So I wrote a test that reproduces the problem. It occurs when a user has at least three devices in the team graph, let's say a laptop, a phone and a tablet. If he uses the laptop to remove the phone, the user keys are rotated, but the tablet won't receive the new keys if it's offline during the removal. Since the laptop and the server have the latest user keys, but the tablet doesn't, it becomes unable to connect to the server because the server uses a newer generation of user keys for key negotiation than the tablet.

I am wondering if the problem could be solved by using device keys for key negotiation as device keys never rotate. I have tried it and it solves the problem, passes all tests and I assume it is equally secure. But I'm uneasy about what I don't know, such as your reasons for favoring user keys for shared key negotiation, or security issues or side effects that I'm unaware of.
What do you think?

…evices of the same user (or one device and the server) try to connect and negotiate a shared key, but one device does not know about a user key rotation yet which happened previously
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