]> tinc-vpn.org Git - tinc/blobdiff - src/protocol_auth.c
Log an error message with the node's name when receiving bad SPTPS packets.
[tinc] / src / protocol_auth.c
index 73a591edb1e976e75bca7d09c58f43012ad7a725..be90d92bfe5a619ddcb01a915bfc72101cf0d55f 100644 (file)
@@ -730,6 +730,12 @@ static bool upgrade_h(connection_t *c, const char *request) {
                return false;
        }
 
+       c->ecdsa = ecdsa_set_base64_public_key(pubkey);
+       if(!c->ecdsa) {
+               logger(DEBUG_ALWAYS, LOG_INFO, "Got bad Ed25519 public key from %s (%s), not upgrading.", c->name, c->hostname);
+               return false;
+       }
+
        logger(DEBUG_ALWAYS, LOG_INFO, "Got Ed25519 public key from %s (%s), upgrading!", c->name, c->hostname);
        append_config_file(c->name, "Ed25519PublicKey", pubkey);
        c->allow_request = TERMREQ;