public static String getAuthCommandName(int cmd) { switch(cmd) { case SshConstants.SSH_MSG_USERAUTH_REQUEST: return "SSH_MSG_USERAUTH_REQUEST"; case SshConstants.SSH_MSG_USERAUTH_INFO_REQUEST: return "SSH_MSG_USERAUTH_INFO_REQUEST"; default: return SshConstants.getCommandMessageName(cmd); } } }
public static String getAuthCommandName(int cmd) { switch(cmd) { case SshConstants.SSH_MSG_USERAUTH_REQUEST: return "SSH_MSG_USERAUTH_REQUEST"; case SshConstants.SSH_MSG_USERAUTH_INFO_REQUEST: return "SSH_MSG_USERAUTH_INFO_REQUEST"; default: return SshConstants.getCommandMessageName(cmd); } } }
public ChannelAsyncOutputStream(Channel channel, byte cmd) { this.channelInstance = Objects.requireNonNull(channel, "No channel"); this.packetWriter = channelInstance.resolveChannelStreamPacketWriter(channel, cmd); this.cmd = cmd; this.packetWriteId = channel.toString() + "[" + SshConstants.getCommandMessageName(cmd) + "]"; }
static String getGroupKexOpcodeName(int cmd) { String name = GROUP_KEX_OPCODES_MAP.get(cmd); if (GenericUtils.isEmpty(name)) { return SshConstants.getCommandMessageName(cmd); } else { return name; } }
@Override public String toString() { return getClass().getSimpleName() + "[" + getChannel() + "] " + SshConstants.getCommandMessageName(cmd & 0xFF); } }
protected void validateKexState(int cmd, KexState expected) { KexState actual = kexState.get(); if (!expected.equals(actual)) { throw new IllegalStateException("Received KEX command=" + SshConstants.getCommandMessageName(cmd) + " while in state=" + actual + " instead of " + expected); } }
static String getSimpleKexOpcodeName(int cmd) { String name = SIMPLE_KEX_OPCODES_MAP.get(cmd); if (GenericUtils.isEmpty(name)) { return SshConstants.getCommandMessageName(cmd); } else { return name; } } }
@Override public String toString() { return getClass().getSimpleName() + "[" + getChannel() + "] cmd=" + SshConstants.getCommandMessageName(cmd & 0xFF); } }
@Override protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception { int cmd = buffer.getUByte(); throw new IllegalStateException("processAuthDataRequest(" + session + ")[" + service + "]" + " received unknown packet: cmd=" + SshConstants.getCommandMessageName(cmd)); }
@Override public String toString() { return getClass().getSimpleName() + "[" + getChannel() + "] cmd=" + SshConstants.getCommandMessageName(cmd & 0xFF); } }
static String getSimpleKexOpcodeName(int cmd) { String name = SIMPLE_KEX_OPCODES_MAP.get(cmd); if (GenericUtils.isEmpty(name)) { return SshConstants.getCommandMessageName(cmd); } else { return name; } } }
@Override protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception { int cmd = buffer.getUByte(); throw new IllegalStateException("processAuthDataRequest(" + session + ")[" + service + "]" + " received unknown packet: cmd=" + SshConstants.getCommandMessageName(cmd)); }
@Override public String toString() { return getClass().getSimpleName() + "[" + getChannel() + "] " + SshConstants.getCommandMessageName(cmd & 0xFF); } }
public ChannelAsyncOutputStream(Channel channel, byte cmd) { this.channelInstance = Objects.requireNonNull(channel, "No channel"); this.packetWriter = channelInstance.resolveChannelStreamPacketWriter(channel, cmd); this.cmd = cmd; this.packetWriteId = channel.toString() + "[" + SshConstants.getCommandMessageName(cmd) + "]"; }
static String getGroupKexOpcodeName(int cmd) { String name = GROUP_KEX_OPCODES_MAP.get(cmd); if (GenericUtils.isEmpty(name)) { return SshConstants.getCommandMessageName(cmd); } else { return name; } }
protected void handleAuthenticationInProgress(int cmd, Buffer buffer) throws Exception { String username = (currentAuth == null) ? null : currentAuth.getUsername(); if (log.isDebugEnabled()) { log.debug("handleAuthenticationInProgress({}@{}) {}", username, getServerSession(), SshConstants.getCommandMessageName(cmd)); } }
protected void handleAuthenticationInProgress(int cmd, Buffer buffer) throws Exception { String username = (currentAuth == null) ? null : currentAuth.getUsername(); if (log.isDebugEnabled()) { log.debug("handleAuthenticationInProgress({}@{}) {}", username, getServerSession(), SshConstants.getCommandMessageName(cmd)); } }
protected void handleAuthenticationInProgress(int cmd, Buffer buffer) throws Exception { String username = (currentAuth == null) ? null : currentAuth.getUsername(); if (log.isDebugEnabled()) { log.debug("handleAuthenticationInProgress({}@{}) {}", username, getServerSession(), SshConstants.getCommandMessageName(cmd)); } }
protected IoWriteFuture sendFailureResponse(ConnectionService service, byte cmd, int channelId) throws IOException { Session session = service.getSession(); // Use DEBUG level to avoid log overflow due to invalid messages flood if (log.isDebugEnabled()) { log.debug("sendFailureResponse({}) send SSH_MSG_CHANNEL_FAILURE for {} command on unknown channel: {}", session, SshConstants.getCommandMessageName(cmd), channelId); } Buffer rsp = session.createBuffer(SshConstants.SSH_MSG_CHANNEL_FAILURE, Integer.BYTES); rsp.putInt(channelId); return session.writePacket(rsp); } }
protected IoWriteFuture sendFailureResponse(ConnectionService service, byte cmd, int channelId) throws IOException { Session session = service.getSession(); // Use DEBUG level to avoid log overflow due to invalid messages flood if (log.isDebugEnabled()) { log.debug("sendFailureResponse({}) send SSH_MSG_CHANNEL_FAILURE for {} command on unknown channel: {}", session, SshConstants.getCommandMessageName(cmd), channelId); } Buffer rsp = session.createBuffer(SshConstants.SSH_MSG_CHANNEL_FAILURE, Integer.BYTES); rsp.putInt(channelId); return session.writePacket(rsp); } }