Identify ssh client version with more info and sshd server shows it by an env var
MS Win32 port & build date added in text part of version id ssh client send to the remote sshd. sshd also shows this string via environment variable "SSH_CLIENT_ID" . All these are allowed and encouraged by the SSH RFC and improves usability and assists users to know what ssh versions and vendor build they are running.
This commit is contained in:
parent
6c4fc9c4c5
commit
484bab654b
|
@ -382,7 +382,11 @@ _ssh_send_banner(struct ssh *ssh, char **bannerp)
|
|||
char buf[256];
|
||||
int r;
|
||||
|
||||
#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__ );
|
||||
#endif
|
||||
if ((r = sshbuf_put(ssh_packet_get_output(ssh), buf, strlen(buf))) != 0)
|
||||
return r;
|
||||
chop(buf);
|
||||
|
|
|
@ -677,8 +677,13 @@ send_client_banner(int connection_out, int minor1)
|
|||
{
|
||||
/* Send our own protocol version identification. */
|
||||
if (compat20) {
|
||||
#ifndef WIN32_FIXME
|
||||
xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n",
|
||||
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION);
|
||||
#else
|
||||
xasprintf(&client_version_string, "SSH-%d.%d-%.100sp1 Microsoft Win32 port %s\r\n",
|
||||
PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION, __DATE__ );
|
||||
#endif
|
||||
} else {
|
||||
xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n",
|
||||
PROTOCOL_MAJOR_1, minor1, SSH_VERSION);
|
||||
|
|
4
sshd.c
4
sshd.c
|
@ -795,6 +795,10 @@ sshd_exchange_identification(int sock_in, int sock_out)
|
|||
debug("Client protocol version %d.%d; client software version %.100s",
|
||||
remote_major, remote_minor, remote_version);
|
||||
|
||||
#ifdef WIN32_FIXME
|
||||
SetEnvironmentVariable("SSH_CLIENT_ID", remote_version);
|
||||
#endif
|
||||
|
||||
active_state->compat = compat_datafellows(remote_version);
|
||||
|
||||
if ((datafellows & SSH_BUG_PROBE) != 0) {
|
||||
|
|
Loading…
Reference in New Issue