Bugzilla – Attachment 1523 Details for
Bug 1443
Missing terminating CR in identification string (RFC non-compliance)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Send and receive proto banners with CR LF for proto 2
openbsd-ssh-protobanner-newline.patch (text/plain), 1.96 KB, created by
Darren Tucker
on 2008-06-15 04:19:07 AEST
(
hide
)
Description:
Send and receive proto banners with CR LF for proto 2
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2008-06-15 04:19:07 AEST
Size:
1.96 KB
patch
obsolete
>Index: sshd.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshd.c,v >retrieving revision 1.360 >diff -u -p -r1.360 sshd.c >--- sshd.c 12 Jun 2008 20:38:28 -0000 1.360 >+++ sshd.c 14 Jun 2008 01:36:02 -0000 >@@ -379,7 +379,7 @@ sshd_exchange_identification(int sock_in > int mismatch; > int remote_major, remote_minor; > int major, minor; >- char *s; >+ char *s, *newline = "\n"; > char buf[256]; /* Must not be larger than remote_version. */ > char remote_version[256]; /* Must be at least as big as buf. */ > >@@ -390,11 +390,13 @@ sshd_exchange_identification(int sock_in > } else if (options.protocol & SSH_PROTO_2) { > major = PROTOCOL_MAJOR_2; > minor = PROTOCOL_MINOR_2; >+ newline = "\r\n"; > } else { > major = PROTOCOL_MAJOR_1; > minor = PROTOCOL_MINOR_1; > } >- snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION); >+ snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor, >+ SSH_VERSION, newline); > server_version_string = xstrdup(buf); > > /* Send our protocol version identification. */ >Index: sshconnect.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshconnect.c,v >retrieving revision 1.208 >diff -u -p -r1.208 sshconnect.c >--- sshconnect.c 12 Jun 2008 23:24:58 -0000 1.208 >+++ sshconnect.c 14 Jun 2008 01:50:01 -0000 >@@ -524,10 +524,10 @@ ssh_exchange_identification(int timeout_ > (options.protocol & SSH_PROTO_2) ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1, > remote_major); > /* Send our own protocol version identification. */ >- snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", >+ snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", > compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1, > compat20 ? PROTOCOL_MINOR_2 : minor1, >- SSH_VERSION); >+ SSH_VERSION, compat20 ? "\r\n" : "\n"); > if (atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf)) > fatal("write: %.100s", strerror(errno)); > client_version_string = xstrdup(buf);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
djm
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1443
: 1523