From: Michael Tokarev Date: Sun, 24 May 2009 18:32:24 +0000 (+0400) Subject: Fix ans_key exchange in recent changes X-Git-Tag: release-1.0.10~64 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=ca5b67111e4d797d15623c2163f67fe489dc3bf2;hp=7034338bc36d9ea96d152091b9d58c2afc3f0c20 Fix ans_key exchange in recent changes send_ans_key() was using the wrong in vs. outkeylength to terminate the key being sent, so it was always empty. --- diff --git a/src/protocol_key.c b/src/protocol_key.c index d9719ca4..64225fd2 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -172,7 +172,7 @@ bool send_ans_key(node_t *to) // Convert to hexadecimal and send key = alloca(2 * to->inkeylength + 1); bin2hex(to->inkey, key, to->inkeylength); - key[to->outkeylength * 2] = '\0'; + key[to->inkeylength * 2] = '\0'; return send_request(to->nexthop->connection, "%d %s %s %s %d %d %d %d", ANS_KEY, myself->name, to->name, key,