X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_key.c;h=d4a0b17401b3e31743170870291dfb96c520518d;hp=ee292b65448dcee3e043ffd4a71cec0ad2cf96a2;hb=b8495a806b083bdd63a5ed3ef35e5badb415c7f4;hpb=3fae14fae5a347823679ef694ab630b4991a201d diff --git a/src/protocol_key.c b/src/protocol_key.c index ee292b65..d4a0b174 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -131,6 +131,12 @@ bool req_key_h(connection_t *c) { /* Check if this key request is for us */ if(to == myself) { /* Yes, send our own key back */ + if(!from->status.reachable) { + logger(LOG_WARNING, "Got %s from %s (%s) origin %s which is not reachable", + "REQ_KEY", c->name, c->hostname, from_name); + return true; + } + if(!send_ans_key(from)) { return false; } @@ -286,6 +292,11 @@ bool ans_key_h(connection_t *c) { return true; } } else { + if(from->outkeylength != 1) { + logger(LOG_ERR, "Node %s (%s) uses wrong keylength!", from->name, from->hostname); + return true; + } + from->outcipher = NULL; }