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

* src/keyexchange.c (kex_build_secret): Add length header for

secret key.

Rev: src/keyexchange.c:1.69
parent a0ec71ec
......@@ -727,17 +727,21 @@ install_keys(struct object_list *algorithms,
static struct hash_instance *
kex_build_secret(struct hash_algorithm *H,
struct lsh_string *exchange_hash,
struct lsh_string *secret)
struct lsh_string *K)
/* We include a length field for the key, but not for the exchange
* hash. */
struct hash_instance *hash = MAKE_HASH(H);
struct lsh_string *s = ssh_format("%S%lS", K, exchange_hash);
HASH_UPDATE(hash, secret->length, secret->data);
HASH_UPDATE(hash, s->length, s->data);
HASH_UPDATE(hash, exchange_hash->length, exchange_hash->data);
return hash;
/* NOTE: Consumes both the xchange_hash and K */
keyexchange_finish(struct ssh_connection *connection,
struct object_list *algorithms,
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