Commit d19d98f2 authored by Niels Möller's avatar Niels Möller
Browse files

* src/connection.h (connection): Replaced the client_version and

server_version fields with an array.

Rev: src/client.c:1.54
Rev: src/connection.c:1.26
Rev: src/connection.h:1.24
Rev: src/server.c:1.46
parent 941a140d
......@@ -84,14 +84,14 @@ static int client_initiate(struct fd_callback **c,
make_client_close_handler()),
closure->random);
connection->client_version
connection->versions[CONNECTION_CLIENT]
= ssh_format("SSH-%lz-%lz %lz",
CLIENT_PROTOCOL_VERSION,
SOFTWARE_CLIENT_VERSION,
closure->id_comment);
res = A_WRITE(connection->raw,
ssh_format("%lS\r\n", connection->client_version));
ssh_format("%lS\r\n", connection->versions[CONNECTION_CLIENT]));
if (LSH_CLOSEDP(res))
return res;
......@@ -132,15 +132,15 @@ static int do_line(struct line_handler **h,
closure->connection
);
closure->connection->server_version
closure->connection->versions[CONNECTION_SERVER]
= ssh_format("%ls", length, line);
verbose("Client version: %ps\n"
"Server version: %ps\n",
closure->connection->client_version->length,
closure->connection->client_version->data,
closure->connection->server_version->length,
closure->connection->server_version->data);
closure->connection->versions[CONNECTION_CLIENT]->length,
closure->connection->versions[CONNECTION_CLIENT]->data,
closure->connection->versions[CONNECTION_SERVER]->length,
closure->connection->versions[CONNECTION_SERVER]->data);
/* FIXME: Cleanup properly. */
KILL(closure);
......
......@@ -161,8 +161,8 @@ struct ssh_connection *make_ssh_connection(struct packet_handler *kex_handler)
connection->super.write = handle_connection;
/* Initialize instance variables */
connection->client_version
= connection->server_version
connection->versions[CONNECTION_SERVER]
= connection->versions[CONNECTION_CLIENT]
= connection->session_id = NULL;
connection->resources = empty_resource_list();
......
......@@ -60,8 +60,9 @@ struct ssh_connection;
(super abstract_write)
(vars
; Sent and received version strings
(client_version string)
(server_version string)
;;(client_version string)
;;(server_version string)
(versions array (string) 2)
(session_id string)
; Cleanup
......
......@@ -49,11 +49,11 @@
#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_UTMP_H
#if HAVE_UTMP_H
#include <utmp.h>
#endif
#ifdef HAVE_UTMPX_H
#if HAVE_UTMPX_H
#include <utmpx.h>
#endif
......@@ -167,7 +167,7 @@ static int server_initiate(struct fd_callback **c,
closure->random);
connection->server_version
connection->versions[CONNECTION_SERVER]
= ssh_format("SSH-%lz-%lz %lz",
#if WITH_SSH1_FALLBACK
(closure->fallback
......@@ -188,12 +188,12 @@ static int server_initiate(struct fd_callback **c,
{
connection->kexinits[CONNECTION_SERVER] = MAKE_KEXINIT(closure->init);
return A_WRITE(connection->raw,
ssh_format("%lS\n", connection->server_version));
ssh_format("%lS\n", connection->versions[CONNECTION_SERVER]));
}
#endif /* WITH_SSH1_FALLBACK */
res = A_WRITE(connection->raw,
ssh_format("%lS\r\n", connection->server_version));
ssh_format("%lS\r\n", connection->versions[CONNECTION_SERVER]));
if (LSH_CLOSEDP(res))
return res;
......@@ -262,11 +262,11 @@ static int do_line(struct line_handler **h,
closure->connection
);
closure->connection->client_version
closure->connection->versions[CONNECTION_CLIENT]
= ssh_format("%ls", length, line);
verbose("Client version: %pS\n",
closure->connection->client_version);
closure->connection->versions[CONNECTION_CLIENT]);
/* FIXME: Cleanup properly. */
KILL(closure);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment