View | Details | Raw Unified | Return to bug 1443
Collapse All | Expand All

(-)sshd.c (-2 / +4 lines)
Lines 379-385 sshd_exchange_identification(int sock_in Link Here
379
	int mismatch;
379
	int mismatch;
380
	int remote_major, remote_minor;
380
	int remote_major, remote_minor;
381
	int major, minor;
381
	int major, minor;
382
	char *s;
382
	char *s, *newline = "\n";
383
	char buf[256];			/* Must not be larger than remote_version. */
383
	char buf[256];			/* Must not be larger than remote_version. */
384
	char remote_version[256];	/* Must be at least as big as buf. */
384
	char remote_version[256];	/* Must be at least as big as buf. */
385
385
Lines 390-400 sshd_exchange_identification(int sock_in Link Here
390
	} else if (options.protocol & SSH_PROTO_2) {
390
	} else if (options.protocol & SSH_PROTO_2) {
391
		major = PROTOCOL_MAJOR_2;
391
		major = PROTOCOL_MAJOR_2;
392
		minor = PROTOCOL_MINOR_2;
392
		minor = PROTOCOL_MINOR_2;
393
		newline = "\r\n";
393
	} else {
394
	} else {
394
		major = PROTOCOL_MAJOR_1;
395
		major = PROTOCOL_MAJOR_1;
395
		minor = PROTOCOL_MINOR_1;
396
		minor = PROTOCOL_MINOR_1;
396
	}
397
	}
397
	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION);
398
	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor,
399
	    SSH_VERSION, newline);
398
	server_version_string = xstrdup(buf);
400
	server_version_string = xstrdup(buf);
399
401
400
	/* Send our protocol version identification. */
402
	/* Send our protocol version identification. */
(-)sshconnect.c (-2 / +2 lines)
Lines 524-533 ssh_exchange_identification(int timeout_ Link Here
524
		    (options.protocol & SSH_PROTO_2) ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
524
		    (options.protocol & SSH_PROTO_2) ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
525
		    remote_major);
525
		    remote_major);
526
	/* Send our own protocol version identification. */
526
	/* Send our own protocol version identification. */
527
	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n",
527
	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s",
528
	    compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
528
	    compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
529
	    compat20 ? PROTOCOL_MINOR_2 : minor1,
529
	    compat20 ? PROTOCOL_MINOR_2 : minor1,
530
	    SSH_VERSION);
530
	    SSH_VERSION, compat20 ? "\r\n" : "\n");
531
	if (atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf))
531
	if (atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf))
532
		fatal("write: %.100s", strerror(errno));
532
		fatal("write: %.100s", strerror(errno));
533
	client_version_string = xstrdup(buf);
533
	client_version_string = xstrdup(buf);

Return to bug 1443