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

*** empty log message ***

Rev: src/keyexchange.c:1.9
Rev: src/keyexchange.h:1.10
Rev: src/read_packet.h:1.6
parent 225d8060
...@@ -195,7 +195,7 @@ static int do_handle_kexinit(struct packet_hander *c, ...@@ -195,7 +195,7 @@ static int do_handle_kexinit(struct packet_hander *c,
return 0; return 0;
/* Save value for later signing */ /* Save value for later signing */
connection->literal_kexinits[connection->type] = packet; connection->literal_kexinits[!connection->type] = packet;
connection->kexinits[!connection->type] = msg; connection->kexinits[!connection->type] = msg;
...@@ -203,9 +203,13 @@ static int do_handle_kexinit(struct packet_hander *c, ...@@ -203,9 +203,13 @@ static int do_handle_kexinit(struct packet_hander *c,
if (!connection->kexinits[connection->type]) if (!connection->kexinits[connection->type])
{ {
int res; int res;
struct lsh_string *packet;
struct kexinit *sent = GENERATE_KEXINIT(closure->init); struct kexinit *sent = GENERATE_KEXINIT(closure->init);
connection->kexinits[connection->type] = sent; connection->kexinits[connection->type] = sent;
res = A_WRITE(connection->write, format_kex(sent)); packet = format_kex(sent);
connection->kexinits[connection->type] = lsh_string_dup(packet);
res = A_WRITE(connection->write, packet);
if (res != WRITE_OK) if (res != WRITE_OK)
return res; return res;
} }
...@@ -242,6 +246,7 @@ static int do_handle_kexinit(struct packet_hander *c, ...@@ -242,6 +246,7 @@ static int do_handle_kexinit(struct packet_hander *c,
hostkey_algorithm hostkey_algorithm
= select_algorithm(connection->kexinits[0]->server_hostkey_algorithms, = select_algorithm(connection->kexinits[0]->server_hostkey_algorithms,
connection->kexinits[1]->server_hostkey_algorithms); connection->kexinits[1]->server_hostkey_algorithms);
for(i = 0; i<KEX_PARAMETERS; i++) for(i = 0; i<KEX_PARAMETERS; i++)
{ {
parameters[i] parameters[i]
...@@ -251,7 +256,7 @@ static int do_handle_kexinit(struct packet_hander *c, ...@@ -251,7 +256,7 @@ static int do_handle_kexinit(struct packet_hander *c,
if (!parameters[i]) if (!parameters[i])
{ {
send_disconnect(connection, ""); send_disconnect(connection, "");
return wRITE_CLOSED; return WRITE_CLOSED;
} }
} }
......
...@@ -42,12 +42,14 @@ ...@@ -42,12 +42,14 @@
struct keyexchange_algorithm struct keyexchange_algorithm
{ {
int (*init)(struct keyexchange_algorithm *closure, int (*init)(struct keyexchange_algorithm *closure,
struct ssh_connection *connection); struct ssh_connection *connection,
struct signature_algorithm *hostkey_algorithm,
void **algorithms);
}; };
#define KEYEXCHANGE_INIT(kex, connection) \ #define KEYEXCHANGE_INIT(kex, connection, ) \
((kex)->init((kex), (connection))) ((kex)->init((kex), (connection)))
struct kexinit struct kexinit
{ {
UINT8 cookie[16]; UINT8 cookie[16];
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "abstract_io.h" #include "abstract_io.h"
#include "abstract_crypto.h" #include "abstract_crypto.h"
#include "newkeys.h"
struct read_packet struct read_packet
{ {
......
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