Rename NoiseStreamHandler to NoiseTransportHandler for consistency with Noise specification terminology

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2024-03-27 17:57:46 -04:00
1 parent 75bb22f08b
commit 8a587d1d12
8 files changed
+18 -19

No files matched your search

@@ -29,7 +29,7 @@ class NoiseNXHandshakeHandler extends AbstractNoiseHandshakeHandler {
// All we need to do is accept the client's ephemeral key and send our own static keys; after that, we can consider
// the handshake complete
context.fireUserEventTriggered(new NoiseHandshakeCompleteEvent(Optional.empty()));
context.pipeline().replace(NoiseNXHandshakeHandler.this, null, new NoiseStreamHandler(getHandshakeState().split()));
context.pipeline().replace(NoiseNXHandshakeHandler.this, null, new NoiseTransportHandler(getHandshakeState().split()));
} else {
// Anything except binary WebSocket frames should have been filtered out of the pipeline by now; treat this as an
// error
@@ -17,15 +17,15 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A Noise stream handler manages a bidirectional Noise session after a handshake has completed.
* A Noise transport handler manages a bidirectional Noise session after a handshake has completed.
*/
class NoiseStreamHandler extends ChannelDuplexHandler {
class NoiseTransportHandler extends ChannelDuplexHandler {
private final CipherStatePair cipherStatePair;
private static final Logger log = LoggerFactory.getLogger(NoiseStreamHandler.class);
private static final Logger log = LoggerFactory.getLogger(NoiseTransportHandler.class);
NoiseStreamHandler(CipherStatePair cipherStatePair) {
NoiseTransportHandler(CipherStatePair cipherStatePair) {
this.cipherStatePair = cipherStatePair;
}
@@ -147,7 +147,7 @@ class NoiseXXHandshakeHandler extends AbstractNoiseHandshakeHandler {
context.fireUserEventTriggered(new NoiseHandshakeCompleteEvent(
Optional.of(new AuthenticatedDevice(accountIdentifier, deviceId))));
context.pipeline().addAfter(context.name(), null, new NoiseStreamHandler(handshakeState.split()));
context.pipeline().addAfter(context.name(), null, new NoiseTransportHandler(handshakeState.split()));
// Flush any buffered reads
pendingInboundFrames.forEach(context::fireChannelRead);