From 004ae15c55b58996d3f4baf0ca14a1c41ab6ce57 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 20 Oct 2013 20:18:26 +0200 Subject: Don't print fastd version from handshake requests when secure handshakes are set, instead print it on handshake finish --- src/protocol_ec25519_fhmqvc.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/protocol_ec25519_fhmqvc.c') diff --git a/src/protocol_ec25519_fhmqvc.c b/src/protocol_ec25519_fhmqvc.c index ce429dc..b7b5162 100644 --- a/src/protocol_ec25519_fhmqvc.c +++ b/src/protocol_ec25519_fhmqvc.c @@ -670,7 +670,6 @@ static inline keypair_t* get_handshake_keypair(handshake_key_t *handshake_key, u } static void protocol_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, const fastd_handshake_t *handshake, const fastd_method_t *method) { - char *peer_version_name = NULL; bool temporary_added = false; maintenance(ctx); @@ -740,11 +739,7 @@ static void protocol_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock return; } - if (handshake->records[RECORD_VERSION_NAME].data) - peer_version_name = strndup((const char*)handshake->records[RECORD_VERSION_NAME].data, handshake->records[RECORD_VERSION_NAME].length); - - pr_verbose(ctx, "received handshake from %P[%I] using fastd %s", peer, remote_addr, peer_version_name); - free(peer_version_name); + pr_verbose(ctx, "received handshake from %P[%I]%s%s", peer, remote_addr, handshake->peer_version ? " using fastd " : "", handshake->peer_version ?: ""); peer->last_handshake_response = ctx->now; peer->last_handshake_response_address = *remote_addr; @@ -785,17 +780,13 @@ static void protocol_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock switch (handshake->type) { case 2: - if (handshake->records[RECORD_VERSION_NAME].data) - peer_version_name = strndup((const char*)handshake->records[RECORD_VERSION_NAME].data, handshake->records[RECORD_VERSION_NAME].length); - - pr_verbose(ctx, "received handshake response from %P[%I] using fastd %s", peer, remote_addr, peer_version_name); - free(peer_version_name); + pr_verbose(ctx, "received handshake response from %P[%I]%s%s", peer, remote_addr, handshake->peer_version ? " using fastd " : "", handshake->peer_version ?: ""); finish_handshake(ctx, sock, local_addr, remote_addr, peer, handshake_key, &peer_handshake_key, handshake, method); break; case 3: - pr_debug(ctx, "received handshake finish from %P[%I]", peer, remote_addr); + pr_debug(ctx, "received handshake finish from %P[%I]%s%s", peer, remote_addr, handshake->peer_version ? " using fastd " : "", handshake->peer_version ?: ""); handle_finish_handshake(ctx, sock, local_addr, remote_addr, peer, handshake_key, &peer_handshake_key, handshake, method); break; -- cgit v1.2.3