]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_auth.c
Stop using global variable mesh in net.c.
[meshlink] / src / protocol_auth.c
index c810877f9b863b24724af501f0fb3fc2a50c3b4a..8fad8cc0a1577659f671055150eb1bec80b965a8 100644 (file)
@@ -314,22 +314,15 @@ bool id_h(connection_t *c, const char *request) {
                return false;
        }
 
-       if(mesh->bypass_security) {
-               if(!c->config_tree)
-                       init_configuration(&c->config_tree);
-               c->allow_request = ACK;
-               return send_ack(c);
-       }
-
        if(!c->config_tree) {
                init_configuration(&c->config_tree);
 
-               if(!read_host_config(c->config_tree, c->name)) {
+               if(!read_host_config(mesh, c->config_tree, c->name)) {
                        logger(DEBUG_ALWAYS, LOG_ERR, "Peer %s had unknown identity (%s)", c->hostname, c->name);
                        return false;
                }
 
-               read_ecdsa_public_key(c);
+               read_ecdsa_public_key(mesh, c);
        } else {
                if(c->protocol_minor && !ecdsa_active(c->ecdsa))
                        c->protocol_minor = 1;
@@ -419,7 +412,7 @@ bool ack_h(connection_t *c, const char *request) {
                                n->connection->outgoing = NULL;
                        }
 
-                       terminate_connection(n->connection, false);
+                       terminate_connection(mesh, n->connection, false);
                        /* Run graph algorithm to keep things in sync */
                        graph();
                }