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

Keep track of resources associated with the connection. Fixed spelling

of "receive".

Rev: src/connection.c:1.19
Rev: src/connection.h:1.20
parent dbe42268
...@@ -46,13 +46,13 @@ static int handle_connection(struct abstract_write *w, ...@@ -46,13 +46,13 @@ static int handle_connection(struct abstract_write *w,
if (!packet->length) if (!packet->length)
{ {
werror("connection.c: Recieved empty packet!\n"); werror("connection.c: Received empty packet!\n");
return LSH_FAIL | LSH_DIE; return LSH_FAIL | LSH_DIE;
} }
msg = packet->data[0]; msg = packet->data[0];
debug("handle_connection: Recieved packet of type %d\n", msg); debug("handle_connection: Received packet of type %d\n", msg);
switch(closure->kex_state) switch(closure->kex_state)
{ {
...@@ -88,7 +88,7 @@ static int handle_connection(struct abstract_write *w, ...@@ -88,7 +88,7 @@ static int handle_connection(struct abstract_write *w,
if ( (msg != SSH_MSG_NEWKEYS) if ( (msg != SSH_MSG_NEWKEYS)
&& (msg != SSH_MSG_DISCONNECT) ) && (msg != SSH_MSG_DISCONNECT) )
{ {
werror("Expected NEWKEYS message, but recieved message %d!\n", werror("Expected NEWKEYS message, but received message %d!\n",
msg); msg);
lsh_string_free(packet); lsh_string_free(packet);
return LSH_FAIL | LSH_DIE; return LSH_FAIL | LSH_DIE;
...@@ -130,7 +130,7 @@ static int do_unimplemented(struct packet_handler *closure, ...@@ -130,7 +130,7 @@ static int do_unimplemented(struct packet_handler *closure,
ssh_format("%c%i", ssh_format("%c%i",
SSH_MSG_UNIMPLEMENTED, SSH_MSG_UNIMPLEMENTED,
packet->sequence_number)); packet->sequence_number));
verbose("Recieved packet of unimplemented type %d.\n", verbose("Received packet of unimplemented type %d.\n",
packet->data[0]); packet->data[0]);
lsh_string_free(packet); lsh_string_free(packet);
...@@ -159,6 +159,8 @@ struct ssh_connection *make_ssh_connection(struct packet_handler *kex_handler) ...@@ -159,6 +159,8 @@ struct ssh_connection *make_ssh_connection(struct packet_handler *kex_handler)
= connection->server_version = connection->server_version
= connection->session_id = NULL; = connection->session_id = NULL;
connection->resources = empty_resource_list();
connection->rec_max_packet = 0x8000; connection->rec_max_packet = 0x8000;
connection->rec_mac = NULL; connection->rec_mac = NULL;
connection->rec_crypto = NULL; connection->rec_crypto = NULL;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#define LSH_CONNECTION_H_INCLUDED #define LSH_CONNECTION_H_INCLUDED
#include "abstract_io.h" #include "abstract_io.h"
#include "resource.h"
#include "randomness.h" #include "randomness.h"
/* Forward declaration */ /* Forward declaration */
...@@ -57,12 +58,15 @@ struct ssh_connection; ...@@ -57,12 +58,15 @@ struct ssh_connection;
(name ssh_connection) (name ssh_connection)
(super abstract_write) (super abstract_write)
(vars (vars
; Sent and recieved version strings ; Sent and received version strings
(client_version string) (client_version string)
(server_version string) (server_version string)
(session_id string) (session_id string)
; Recieveing ; Cleanup
(resources object resource_list)
; Receiving
(rec_max_packet simple UINT32) (rec_max_packet simple UINT32)
(rec_mac object mac_instance) (rec_mac object mac_instance)
(rec_crypto object crypto_instance) (rec_crypto object crypto_instance)
......
Markdown is supported
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