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.
This commit is contained in:
quamrulmina 2015-12-14 16:45:55 -06:00
parent 750b52e4d4
commit f8f10e1911
4 changed files with 13 additions and 6 deletions

View File

@ -385,7 +385,7 @@ _ssh_send_banner(struct ssh *ssh, char **bannerp)
#ifndef WIN32_FIXME
snprintf(buf, sizeof buf, "SSH-2.0-%.100s\r\n", SSH_VERSION);
#else
snprintf(buf, sizeof buf, "SSH-2.0-%.100sp1 Microsoft Win32 port %s\r\n", SSH_VERSION, __DATE__ );
snprintf(buf, sizeof buf, "SSH-2.0-%.100sp1 Microsoft_Win32_port %s\r\n", SSH_VERSION, __DATE__ );
#endif
if ((r = sshbuf_put(ssh_packet_get_output(ssh), buf, strlen(buf))) != 0)
return r;

View File

@ -682,10 +682,10 @@ send_client_banner(int connection_out, int minor1)
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION);
#else
#ifdef WIN32_VS
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft Win32 port with VS %s\r\n",
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft_Win32_port_with_VS %s\r\n",
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION, __DATE__ );
#else
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft Win32 port %s\r\n",
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft_Win32_port %s\r\n",
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION, __DATE__ );
#endif
#endif

9
sshd.c
View File

@ -739,10 +739,17 @@ sshd_exchange_identification(int sock_in, int sock_out)
minor = PROTOCOL_MINOR_1;
}
#ifndef WIN32_FIXME
xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
major, minor, SSH_VERSION,
major, minor, SSH_VERSION,
*options.version_addendum == '\0' ? "" : " ",
options.version_addendum, newline);
#else
xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
major, minor, SSH_RELEASE,
*options.version_addendum == '\0' ? "" : " ",
options.version_addendum, newline);
#endif
/* Send our protocol version identification. */
if (roaming_atomicio(vwrite, sock_out, server_version_string,

View File

@ -6,9 +6,9 @@
#define SSH_PORTABLE "p1"
#else
#ifdef WIN32_VS
#define SSH_PORTABLE "p1 Microsoft Win32 port with VS"
#define SSH_PORTABLE "p1 Microsoft_Win32_port_with_VS"
#else
#define SSH_PORTABLE "p1 Microsoft Win32 port"
#define SSH_PORTABLE "p1 Microsoft_Win32_port"
#endif
#endif
#define SSH_RELEASE SSH_VERSION SSH_PORTABLE