private byte[] handleProtocolMessageWithoutPrepare(ProtocolMessage message, TlsContext context) { ProtocolMessageHandler handler = message.getHandler(context); byte[] protocolMessageBytes = handler.prepareMessage(message, false); return protocolMessageBytes; }
private byte[] handleProtocolMessage(ProtocolMessage message, TlsContext context) { ProtocolMessageHandler handler = message.getHandler(context); byte[] protocolMessageBytes = handler.prepareMessage(message); return protocolMessageBytes; } }
/** * Apply the contents of the messages to the given TLS context. * * @param protocolMessages * @param tlsContext */ private void applyMessages(TlsContext ctx) { for (ProtocolMessage msg : receivedMessages) { LOGGER.debug("Applying " + msg.toCompactString() + " to forward context " + ctx); ProtocolMessageHandler h = msg.getHandler(ctx); h.adjustTLSContext(msg); } }
@Override public void execute(State state) throws WorkflowExecutionException, IOException { TlsContext ctx = state.getTlsContext(connectionAlias); if (isExecuted()) { throw new WorkflowExecutionException("Action already executed!"); } List<ProtocolMessage> messages = ctx.getMessageBuffer(); if (messages.isEmpty()) { LOGGER.debug("Empty buffer, no messages to apply"); } else { for (ProtocolMessage msg : messages) { LOGGER.debug("Applying buffered " + msg.toCompactString() + " to context " + ctx); ProtocolMessageHandler h = msg.getHandler(ctx); h.adjustTLSContext(msg); } } setExecuted(true); }
&& context.getConfig().isFlushOnMessageTypeChange()) { recordPosition = flushBytesToRecords(messageBytesCollector, lastType, records, recordPosition, context); lastMessage.getHandler(context).adjustTlsContextAfterSerialize(lastMessage); lastMessage = null; message.getHandler(context).adjustTlsContextAfterSerialize(message); lastMessage = null; lastMessage.getHandler(context).adjustTlsContextAfterSerialize(lastMessage);