X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=ba5db2ea2e743f28d904ab480b6e41f8615dd691;hb=4c30004cb6dc23616d7295b0ce631f066e7f1f82;hp=21cfc52ed7f7aa170464e8c16261d52ebba7b8f9;hpb=0b8b23e0dd7219344543f135ca0aeba8a4a42d48;p=tinc diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 21cfc52e..ba5db2ea 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -139,7 +139,7 @@ bool send_id(connection_t *c) { minor = myself->connection->protocol_minor; } - if(proxytype) + if(proxytype && c->outgoing) if(!send_proxyrequest(c)) return false; @@ -160,10 +160,10 @@ bool id_h(connection_t *c, const char *request) { if(name[0] == '^' && !strcmp(name + 1, controlcookie)) { c->status.control = true; c->allow_request = CONTROL; - c->last_ping_time = time(NULL) + 3600; + c->last_ping_time = now.tv_sec + 3600; - free(c->name); - c->name = xstrdup(""); + free(c->name); + c->name = xstrdup(""); return send_request(c, "%d %d %d", ACK, TINC_CTL_VERSION_CURRENT, getpid()); } @@ -248,7 +248,7 @@ bool send_metakey(connection_t *c) { if(!cipher_open_blowfish_ofb(&c->outcipher)) return false; - + if(!digest_open_sha1(&c->outdigest, -1)) return false; @@ -302,7 +302,7 @@ bool send_metakey(connection_t *c) { cipher_get_nid(&c->outcipher), digest_get_nid(&c->outdigest), c->outmaclength, c->outcompression, hexkey); - + c->status.encryptout = true; return result; }