summaryrefslogtreecommitdiffstats
path: root/src/protocol_ec25519_fhmqvc.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-20 02:37:04 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-20 02:37:04 +0200
commit8cbd59792e7f03de927593994fb85466b7432d39 (patch)
tree491580d96b29cbf1d95e958548b2f4454bbbd878 /src/protocol_ec25519_fhmqvc.c
parente4afa048704f2db3ff1e0e5e3a5fe27b334fcdd5 (diff)
downloadfastd-8cbd59792e7f03de927593994fb85466b7432d39.tar
fastd-8cbd59792e7f03de927593994fb85466b7432d39.zip
Refactor handshake code, prevent downgrade attacks
Diffstat (limited to 'src/protocol_ec25519_fhmqvc.c')
-rw-r--r--src/protocol_ec25519_fhmqvc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol_ec25519_fhmqvc.c b/src/protocol_ec25519_fhmqvc.c
index 40ec7f7..ce429dc 100644
--- a/src/protocol_ec25519_fhmqvc.c
+++ b/src/protocol_ec25519_fhmqvc.c
@@ -370,7 +370,7 @@ static void respond_handshake(fastd_context_t *ctx, const fastd_socket_t *sock,
if (!update_shared_handshake_key(ctx, peer, handshake_key, peer_handshake_key))
return;
- fastd_buffer_t buffer = fastd_handshake_new_reply(ctx, handshake, method, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES));
+ fastd_buffer_t buffer = fastd_handshake_new_reply(ctx, handshake, method, true, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES));
fastd_handshake_add(ctx, &buffer, RECORD_SENDER_KEY, PUBLICKEYBYTES, ctx->conf->protocol_config->key.public.p);
fastd_handshake_add(ctx, &buffer, RECORD_RECEIPIENT_KEY, PUBLICKEYBYTES, peer->protocol_config->public_key.p);
@@ -532,7 +532,7 @@ static void finish_handshake(fastd_context_t *ctx, fastd_socket_t *sock, const f
&peer->protocol_config->public_key, &sigma, handshake_key->serial))
return;
- fastd_buffer_t buffer = fastd_handshake_new_reply(ctx, handshake, method, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES));
+ fastd_buffer_t buffer = fastd_handshake_new_reply(ctx, handshake, method, false, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES));
fastd_handshake_add(ctx, &buffer, RECORD_SENDER_KEY, PUBLICKEYBYTES, ctx->conf->protocol_config->key.public.p);
fastd_handshake_add(ctx, &buffer, RECORD_RECEIPIENT_KEY, PUBLICKEYBYTES, peer->protocol_config->public_key.p);