Rename NoiseStreamHandler to NoiseTransportHandler for consistency with Noise specification terminology

This commit is contained in:
Jon Chambers
2024-03-26 16:52:43 -04:00
committed by Jon Chambers
parent 75bb22f08b
commit 8a587d1d12
8 changed files with 18 additions and 19 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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);