|
YAACC - UPNP Client and Server
|
The Noise handshake KKpsk2 (Noise Protocol Framework, revision 34) that every Sendspin connection uses:
More...

Public Member Functions | |
| byte[] | writeMessage1 (byte[] payload, SecureRandom random) throws NoiseException |
Message 1, written by the initiator: e, es, ss and the payload. | |
| byte[] | readMessage1 (byte[] message) throws NoiseException |
| Message 1, read by the responder;. | |
| byte[] | writeMessage2 (byte[] payload, byte[] psk, SecureRandom random) throws NoiseException |
Message 2, written by the responder: e, ee, se, psk and the payload. | |
| byte[] | readMessage2 (byte[] message, byte[] psk) throws NoiseException |
| Message 2, read by the initiator;. | |
| int | readMessage2Any (byte[] message, byte[]... psks) throws NoiseException |
| Message 2 against several PSKs in order, from the state after message 1: the first that verifies wins. | |
| byte[] | lastPayload () |
The payload of the message 2 that readMessage2Any(byte[], byte[]...) read. | |
| byte[] | handshakeHash () |
The handshake hash h: the prologue of a re-handshake in transport mode. | |
| NoiseTransport | split () |
| Ends the handshake: the two transport ciphers; the handshake state is zeroed. | |
| void | destroy () |
Static Public Member Functions | |
| static NoiseKkPsk2 | initiator (NoiseSuite suite, byte[] prologue, X25519Keys.KeyPair staticKey, byte[] remoteStatic) |
| The server's side. | |
| static NoiseKkPsk2 | responder (NoiseSuite suite, byte[] prologue, X25519Keys.KeyPair staticKey, byte[] remoteStatic) |
| The client's side. | |
The Noise handshake KKpsk2 (Noise Protocol Framework, revision 34) that every Sendspin connection uses:
-> s (pre-message: the static key of the initiator, the server) <- s (pre-message: the static key of the responder, the client) ... -> e, es, ss <- e, ee, se, psk
With a psk token in the pattern every e token also mixes the public ephemeral key into the chaining key (section 9.2 of the Noise specification). The PSK is mixed in by the second message, which is why the first message can be read before the responder has chosen the PSK. The hash is SHA-256, the suites are NoiseSuite.
The initiator writes message 1 and reads message 2, the responder reads message 1 and writes message 2; afterwards split() gives the transport. An instance is used by one thread, for one handshake. The secrets of the handshake are zeroed by destroy(), which split() calls; the static key is the caller's and stays.
| byte[] de.yaacc.sendspin.secure.NoiseKkPsk2.handshakeHash | ( | ) |
The handshake hash h: the prologue of a re-handshake in transport mode.
Valid after message 2 was written or read.
|
static |
The server's side.
| prologue | the exact bytes of client/init followed by those of server/init |
| byte[] de.yaacc.sendspin.secure.NoiseKkPsk2.readMessage1 | ( | byte[] | message | ) | throws NoiseException |
Message 1, read by the responder;.
Referenced by de.yaacc.sendspin.session.ClientHandshake.perform(), and de.yaacc.sendspin.session.ClientHandshake.rehandshake().

| byte[] de.yaacc.sendspin.secure.NoiseKkPsk2.readMessage2 | ( | byte[] | message, |
| byte[] | psk ) throws NoiseException |
Message 2, read by the initiator;.
readMessage2Any(byte[], byte[]...). Referenced by de.yaacc.sendspin.secure.NoiseKkPsk2.readMessage2Any().

| int de.yaacc.sendspin.secure.NoiseKkPsk2.readMessage2Any | ( | byte[] | message, |
| byte...[] | psks ) throws NoiseException |
Message 2 against several PSKs in order, from the state after message 1: the first that verifies wins.
The server uses it to try the PSK its first message referenced and then the Sentinel PSK (credential mismatch).
lastPayload() | NoiseException | if none verifies; this object is then unusable |
Referenced by de.yaacc.sendspin.session.ServerHandshake.perform().

