The server's side of the opening exchange of every connection (spec, "Communication" and "Encryption"): read the cleartext client/init, answer with server/init and Noise message 1, read Noise message 2, switch to transport mode.
More...
|
| static Result | perform (WsConnection ws, Identity identity, PskResolver psks, SecureRandom random) throws IOException |
| |
| static Result | perform (WsConnection ws, Identity identity, PskResolver psks, SecureRandom random, boolean allowLegacy) throws IOException |
| |
| static void | rehandshake (SecureChannel channel, Identity identity, String clientId, NoiseSuite suite, PskChoice choice, SecureRandom random) throws IOException |
| | The server reruns the Noise handshake inside the open channel (spec, "Re-handshake"): to the Pairing PSK for a pairing, to the long-term PSK after it.
|
| |
The server's side of the opening exchange of every connection (spec, "Communication" and "Encryption"): read the cleartext client/init, answer with server/init and Noise message 1, read Noise message 2, switch to transport mode.
The server is always the Noise initiator, whichever side opened the WebSocket.
A failure that follows from the cleartext client/init alone (version, suite, shape) is answered with server/error and a close; every other failure is silent: the connection is closed without another message. Both end in a HandshakeException.
| static void de.yaacc.sendspin.session.ServerHandshake.rehandshake |
( |
SecureChannel | channel, |
|
|
Identity | identity, |
|
|
String | clientId, |
|
|
NoiseSuite | suite, |
|
|
PskChoice | choice, |
|
|
SecureRandom | random ) throws IOException |
|
static |
The server reruns the Noise handshake inside the open channel (spec, "Re-handshake"): to the Pairing PSK for a pairing, to the long-term PSK after it.
Both messages travel as encrypted noise/handshake messages; message 2 is still under the old keys; the prologue is the hash of the handshake before. No application message is sent from message 1 on (the send lock is held until the new keys are in place); messages of the player under the old keys that arrive meanwhile are kept and delivered by SecureChannel#receive() afterwards. There is no Sentinel fallback here: a message 2 under another PSK fails.
Must be called from the thread that reads the channel.
- Exceptions
-
| HandshakeException | if the player does not answer or does not verify (the caller closes, without a message) |
Referenced by de.yaacc.sendspin.session.ServerHandshake.rehandshake().