From 6785e06f2b062616d190b043a18fd40826b21043 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 25 Apr 2014 03:39:56 +0200 Subject: handshake: simplify fastd_handshake_new_reply This will hopefully lead to an async verify implementation... --- src/protocols/ec25519_fhmqvc/handshake.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/protocols/ec25519_fhmqvc') diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c index 7e893c8..37c753f 100644 --- a/src/protocols/ec25519_fhmqvc/handshake.c +++ b/src/protocols/ec25519_fhmqvc/handshake.c @@ -268,13 +268,13 @@ static void clear_shared_handshake_key(const fastd_peer_t *peer) { } static void respond_handshake(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, - const handshake_key_t *handshake_key, const aligned_int256_t *peer_handshake_key, const fastd_handshake_t *handshake, const fastd_method_info_t *method) { + const handshake_key_t *handshake_key, const aligned_int256_t *peer_handshake_key, const fastd_method_info_t *method) { pr_debug("responding handshake with %P[%I]...", peer, remote_addr); if (!update_shared_handshake_key(peer, handshake_key, peer_handshake_key)) return; - fastd_buffer_t buffer = fastd_handshake_new_reply(handshake, method, true, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES)); + fastd_buffer_t buffer = fastd_handshake_new_reply(2, method, true, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES)); fastd_handshake_add(&buffer, RECORD_SENDER_KEY, PUBLICKEYBYTES, &conf.protocol_config->key.public); fastd_handshake_add(&buffer, RECORD_RECEIPIENT_KEY, PUBLICKEYBYTES, &peer->protocol_config->public_key); @@ -334,7 +334,7 @@ static void finish_handshake(fastd_socket_t *sock, const fastd_peer_address_t *l &peer->protocol_config->public_key, &sigma, compat ? NULL : shared_handshake_key.w, handshake_key->serial)) return; - fastd_buffer_t buffer = fastd_handshake_new_reply(handshake, method, false, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES)); + fastd_buffer_t buffer = fastd_handshake_new_reply(3, method, false, 4*(4+PUBLICKEYBYTES) + 2*(4+HASHBYTES)); fastd_handshake_add(&buffer, RECORD_SENDER_KEY, PUBLICKEYBYTES, &conf.protocol_config->key.public); fastd_handshake_add(&buffer, RECORD_RECEIPIENT_KEY, PUBLICKEYBYTES, &peer->protocol_config->public_key); @@ -599,7 +599,7 @@ void fastd_protocol_ec25519_fhmqvc_handshake_handle(fastd_socket_t *sock, const peer->last_handshake_response_timeout = fastd_in_seconds(conf.min_handshake_interval); peer->last_handshake_response_address = *remote_addr; - respond_handshake(sock, local_addr, remote_addr, peer, &ctx.protocol_state->handshake_key, &peer_handshake_key, handshake, method); + respond_handshake(sock, local_addr, remote_addr, peer, &ctx.protocol_state->handshake_key, &peer_handshake_key, method); return; } -- cgit v1.2.3