1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-22 05:25:03 -05:00

Use '\012' as the end of the SSH banner line, not '\n'.

Mac compilers default to making '\n' == '\015'.

[originally from svn r2493]
This commit is contained in:
Ben Harris 2003-01-07 23:05:12 +00:00
parent bdd6633970
commit 40493b20ea

6
ssh.c
View File

@ -1844,7 +1844,7 @@ static int do_ssh_init(Ssh ssh, unsigned char c)
s->i = -1; s->i = -1;
} else if (s->i < sizeof(s->version) - 1) } else if (s->i < sizeof(s->version) - 1)
s->version[s->i++] = c; s->version[s->i++] = c;
} else if (c == '\n') } else if (c == '\012')
break; break;
} }
@ -1894,7 +1894,7 @@ static int do_ssh_init(Ssh ssh, unsigned char c)
sha_string(&ssh->exhashbase, s->vstring, strcspn(s->vstring, "\r\n")); sha_string(&ssh->exhashbase, s->vstring, strcspn(s->vstring, "\r\n"));
sprintf(vlog, "We claim version: %s", verstring); sprintf(vlog, "We claim version: %s", verstring);
logevent(vlog); logevent(vlog);
strcat(verstring, "\n"); strcat(verstring, "\012");
logevent("Using SSH protocol version 2"); logevent("Using SSH protocol version 2");
sk_write(ssh->s, verstring, strlen(verstring)); sk_write(ssh->s, verstring, strlen(verstring));
ssh->protocol = ssh2_protocol; ssh->protocol = ssh2_protocol;
@ -1910,7 +1910,7 @@ static int do_ssh_init(Ssh ssh, unsigned char c)
sshver); sshver);
sprintf(vlog, "We claim version: %s", verstring); sprintf(vlog, "We claim version: %s", verstring);
logevent(vlog); logevent(vlog);
strcat(verstring, "\n"); strcat(verstring, "\012");
logevent("Using SSH protocol version 1"); logevent("Using SSH protocol version 1");
sk_write(ssh->s, verstring, strlen(verstring)); sk_write(ssh->s, verstring, strlen(verstring));