-
Notifications
You must be signed in to change notification settings - Fork 2
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
pairing timeout and stale sessions #10
Comments
An important detail here is that the stale mechanism detailed in the RFC is for sessions i.e., the Noise cryptographic session instantiated on completion of a Noise handshake. The problem you describe affects instead handshakes, that happen before a session is instantiated. The successful completion of an handshake is implicit by sending and subsequently receiving a message after the handshake, because for decryption to succeed the recovered keys have to match. Since Alice is already sending a message to Bob in In general, handshakes were designed to be performed async thanks to store nodes, so probably in the general case the timeout counter could be removed, since I don't see a real need for that. In case of pairings, a timeout makes sense instead. However the pairing is designed so that is Alice that mainly transfers some data to Bob. Hence Bob will implicitly receive an ack that the pairing was successful as soon as he decrypts received data. |
Roadmap:
In terms of UX, this is very similar to the Status Chat contact request:
TODO: create/link issues for the roadmap |
While testing the example app, I ran into the following problem: In Alice's webapp (the initiator), she confirmed the authcode too close to the timeout. Alice gets a handshake completed message in that webpage, but in Bob's webapp, the final handshake message did not arrive on time, so a "Pairing Timeout" error was shown.
The timeout I implemented is not exactly what is described in https://rfc.vac.dev/spec/37/#session-states but it is something temporary while we implement stale session support. In any case, once stale sessions are implemented, the scenario described above could still happen, with Bob (the receiver), assuming that a session is stale because it did not receive the last message on time.
So, besides implementing the functionality to mark a session as stale, should we also implement a way to notify that the handshake was successful? i.e: in this pattern, Alice should wait until Bob confirms that it received the message generated in the
d
step, to assume that the handshake pairing was completed? this confirmation message could be sent/received with the cipherstate objects obtained from finalizing the handshake.I'm thinking this is more of an application concern, because as far as 35/WAKU2-NOISE concerns, the handshake was done according to specs, it's just that the timeout mechanism stops the process from being completed successfully.
Or perhaps we should remove this timeout and not implement stale session functionality at all? In the meantime I increased the timeout to 2m.
cc: @fryorcraken @s1fr0 @weboko
The text was updated successfully, but these errors were encountered: