Skip to content

Commit f8f10e1

Browse files
committed
Fixed #49. server identification string unhelpfully generic.
SSH-2.0-OpenSSH_7.1p1 Microsoft_Win32_port_with_VS or SSH-2.0-OpenSSH_7.1p1 Microsoft_Win32_port is transmitted as sshd & ssh version based if Visual Studio or Mingw build compiler is used.
1 parent 750b52e commit f8f10e1

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

ssh_api.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ _ssh_send_banner(struct ssh *ssh, char **bannerp)
385385
#ifndef WIN32_FIXME
386386
snprintf(buf, sizeof buf, "SSH-2.0-%.100s\r\n", SSH_VERSION);
387387
#else
388-
snprintf(buf, sizeof buf, "SSH-2.0-%.100sp1 Microsoft Win32 port %s\r\n", SSH_VERSION, __DATE__ );
388+
snprintf(buf, sizeof buf, "SSH-2.0-%.100sp1 Microsoft_Win32_port %s\r\n", SSH_VERSION, __DATE__ );
389389
#endif
390390
if ((r = sshbuf_put(ssh_packet_get_output(ssh), buf, strlen(buf))) != 0)
391391
return r;

sshconnect.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,10 @@ send_client_banner(int connection_out, int minor1)
682682
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION);
683683
#else
684684
#ifdef WIN32_VS
685-
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft Win32 port with VS %s\r\n",
685+
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft_Win32_port_with_VS %s\r\n",
686686
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION, __DATE__ );
687687
#else
688-
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft Win32 port %s\r\n",
688+
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft_Win32_port %s\r\n",
689689
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION, __DATE__ );
690690
#endif
691691
#endif

sshd.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,17 @@ sshd_exchange_identification(int sock_in, int sock_out)
739739
minor = PROTOCOL_MINOR_1;
740740
}
741741

742+
#ifndef WIN32_FIXME
742743
xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
743-
major, minor, SSH_VERSION,
744+
major, minor, SSH_VERSION,
745+
*options.version_addendum == '\0' ? "" : " ",
746+
options.version_addendum, newline);
747+
#else
748+
xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
749+
major, minor, SSH_RELEASE,
744750
*options.version_addendum == '\0' ? "" : " ",
745751
options.version_addendum, newline);
752+
#endif
746753

747754
/* Send our protocol version identification. */
748755
if (roaming_atomicio(vwrite, sock_out, server_version_string,

version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#define SSH_PORTABLE "p1"
77
#else
88
#ifdef WIN32_VS
9-
#define SSH_PORTABLE "p1 Microsoft Win32 port with VS"
9+
#define SSH_PORTABLE "p1 Microsoft_Win32_port_with_VS"
1010
#else
11-
#define SSH_PORTABLE "p1 Microsoft Win32 port"
11+
#define SSH_PORTABLE "p1 Microsoft_Win32_port"
1212
#endif
1313
#endif
1414
#define SSH_RELEASE SSH_VERSION SSH_PORTABLE

0 commit comments

Comments
 (0)