aboutsummaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-06-28 17:52:58 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-06-29 14:41:14 +0200
commit206f3ff895d3d822ac4f23426136537129f9f062 (patch)
tree59728e18437ec9308d14a50082ef831b5b158612 /src/misc.c
parent81b4320318966e83678641a06717c301b071971b (diff)
downloadlibssh-206f3ff895d3d822ac4f23426136537129f9f062.tar.gz
libssh-206f3ff895d3d822ac4f23426136537129f9f062.tar.xz
libssh-206f3ff895d3d822ac4f23426136537129f9f062.zip
Rest in Peace SSHv1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/misc.c b/src/misc.c
index 628218d1..76d96217 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -821,14 +821,13 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) {
*
* @param session The session to analyze the banner from.
* @param server 0 means we are a client, 1 a server.
- * @param ssh1 The variable which is set if it is a SSHv1 server.
- * @param ssh2 The variable which is set if it is a SSHv2 server.
*
* @return 0 on success, < 0 on error.
*
* @see ssh_get_issue_banner()
*/
-int ssh_analyze_banner(ssh_session session, int server, int *ssh1, int *ssh2) {
+int ssh_analyze_banner(ssh_session session, int server)
+{
const char *banner;
const char *openssh;
@@ -861,20 +860,15 @@ int ssh_analyze_banner(ssh_session session, int server, int *ssh1, int *ssh2) {
SSH_LOG(SSH_LOG_RARE, "Analyzing banner: %s", banner);
switch (banner[4]) {
+ case '2':
+ break;
case '1':
- *ssh1 = 1;
if (strlen(banner) > 6) {
if (banner[6] == '9') {
- *ssh2 = 1;
- } else {
- *ssh2 = 0;
+ break;
}
}
- break;
- case '2':
- *ssh1 = 0;
- *ssh2 = 1;
- break;
+ FALL_THROUGH;
default:
ssh_set_error(session, SSH_FATAL, "Protocol mismatch: %s", banner);
return -1;