Repository: mina-sshd
Updated Branches:
  refs/heads/master 58209cd3c -> a02a9bf56


[SSHD-840] Return SSH_MSG_UNIMPLEMENTED in AbstractSession#handleMessage if no 
processor found for incoming message


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/a02a9bf5
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/a02a9bf5
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/a02a9bf5

Branch: refs/heads/master
Commit: a02a9bf5661afe959296ce301e20f41416aa0d64
Parents: 4c12a21
Author: Lyor Goldstein <[email protected]>
Authored: Sat Aug 11 10:28:18 2018 +0300
Committer: Lyor Goldstein <[email protected]>
Committed: Sat Aug 11 11:14:21 2018 +0300

----------------------------------------------------------------------
 .../sshd/common/session/helpers/AbstractSession.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/a02a9bf5/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
----------------------------------------------------------------------
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
index b223901..076de1e 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
@@ -627,7 +627,18 @@ public abstract class AbstractSession extends 
AbstractKexFactoryManager implemen
                     currentService.process(cmd, buffer);
                     resetIdleTimeout();
                 } else {
-                    throw new IllegalStateException("Unsupported command " + 
SshConstants.getCommandMessageName(cmd));
+                    /*
+                     * According to 
https://tools.ietf.org/html/rfc4253#section-11.4
+                     *
+                     *      An implementation MUST respond to all unrecognized 
messages
+                     *      with an SSH_MSG_UNIMPLEMENTED message in the order 
in which
+                     *      the messages were received.
+                     */
+                    if (log.isDebugEnabled()) {
+                        log.debug("process({}) Unsupported command: {}",
+                            this, SshConstants.getCommandMessageName(cmd));
+                    }
+                    notImplemented();
                 }
                 break;
         }

Reply via email to