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

*** empty log message ***

Rev: src/client_keyexchange.c:1.4
Rev: src/connection.h:1.12
parent d462a169
......@@ -52,7 +52,10 @@ static void do_handle_dh_reply(struct packet_handler *c,
/* Record session id */
if (!connection->session_id)
connection->session_id = closure->dh.exchange_hash;
{
connection->session_id = closure->dh.exchange_hash;
closure->dh.exchange_hash = NULL; /* For gc */
}
/* A hash instance initialized with the key, to be used for key generation */
......@@ -61,6 +64,7 @@ static void do_handle_dh_reply(struct packet_handler *c,
HASH_UPDATE(hash, s->length, s->data);
lsh_string_free(s);
/* FIXME: Must use some object which knows what algorithms to use */
res = prepare_keys(connection, hash);
lsh_free(hash);
......@@ -101,7 +105,8 @@ int prepare_keys_client(struct hash_instance *secret,
/* FIXME: No IV:s */
struct crypto_instance *crypt_client_to_server
= kex_make_encrypt(secret, KEX_ENCRYPTION_CLIENT_TO_SERVER, connection);
= kex_make_encrypt(secret, /* FIXME: algorithm */,
KEX_ENCRYPTION_CLIENT_TO_SERVER, connection);
struct crypto_instance *crypt_server_to_client
= kex_make_decrypt(secret, KEX_ENCRYPTION_SERVER_TO_CLIENT, connection);
......@@ -112,3 +117,5 @@ int prepare_keys_client(struct hash_instance *secret,
......@@ -46,10 +46,12 @@ struct ssh_connection
struct lsh_string *session_id;
/* Reading */
struct mac_instance *mac;
struct crypto_instance *crypto;
/* Recieveing */
UINT32 rec_max_packet;
struct mac_instance *rec_mac;
struct crypto_instance *rec_crypto;
/* Sending */
struct abstract_write *raw; /* Socket connected to the other end */
struct abstract_write *write; /* Where to send packets through the
......@@ -63,8 +65,6 @@ struct ssh_connection
struct packet_handler *unimplemented;
struct packet_handler *fail;
UINT32 max_packet;
/* Key exchange */
/* int kex_state; */
......@@ -74,9 +74,10 @@ struct ssh_connection
struct newkeys_info *newkeys; /* Negotiated algorithms */
int ignore_one_packet;
#if 0
int provides_privacy;
int provides_integrity;
#endif
};
struct ssh_connection *make_ssh_connection(struct packet_handler *kex_handler);
......
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