X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=d4705bde819e1887c189951593d1a1e299e62fcd;hb=3bf3d7d3e7d51034bda873861c52578f3abe6b5d;hp=aee5736af6db5e5ecbceedaf64c2469e29677023;hpb=edc1efed3c0cf5aebb1c765066c0413757229a31;p=tinc diff --git a/src/protocol_auth.c b/src/protocol_auth.c index aee5736a..d4705bde 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -436,6 +436,8 @@ bool send_metakey(connection_t *c) { if(!c) return false; + c->outbudget = cipher_budget(c->outcipher); + if(!(c->outdigest = digest_open_by_name("sha256", -1))) return false; @@ -548,6 +550,8 @@ bool metakey_h(connection_t *c, const char *request) { c->incipher = NULL; } + c->inbudget = cipher_budget(c->incipher); + if(digest) { if(!(c->indigest = digest_open_by_nid(digest, -1))) { logger(DEBUG_ALWAYS, LOG_ERR, "Error during initialisation of digest from %s (%s)", c->name, c->hostname); @@ -884,8 +888,10 @@ bool ack_h(connection_t *c, const char *request) { socklen_t local_salen = sizeof local_sa; if (getsockname(c->socket, &local_sa.sa, &local_salen) < 0) logger(DEBUG_ALWAYS, LOG_WARNING, "Could not get local socket address for connection with %s", c->name); - else + else { sockaddr_setport(&local_sa, myport); + c->edge->local_address = local_sa; + } c->edge->weight = (weight + c->estimated_weight) / 2; c->edge->connection = c; c->edge->options = c->options;