Require ExperimentalProtocol = yes for new features, update documentation.
[tinc] / src / protocol_auth.c
index 70062f3..21a4b7e 100644 (file)
 bool send_id(connection_t *c) {
        gettimeofday(&c->start, NULL);
 
-       int minor = myself->connection->protocol_minor;
-       if(c->config_tree && !read_ecdsa_public_key(c))
-               minor = 1;
+       int minor = 0;
 
-       return send_request(c, "%d %s %d.%d", ID, myself->connection->name,
-                                               myself->connection->protocol_major, minor);
+       if(experimental) {
+               if(c->config_tree && !read_ecdsa_public_key(c))
+                       minor = 1;
+               else
+                       minor = myself->connection->protocol_minor;
+       }
+
+       return send_request(c, "%d %s %d.%d", ID, myself->connection->name, myself->connection->protocol_major, minor);
 }
 
 bool id_h(connection_t *c, char *request) {
@@ -115,7 +119,7 @@ bool id_h(connection_t *c, char *request) {
                        return false;
                }
 
-               if(c->protocol_minor >= 2)
+               if(experimental && c->protocol_minor >= 2)
                        if(!read_ecdsa_public_key(c))
                                return false;
        } else {
@@ -123,6 +127,9 @@ bool id_h(connection_t *c, char *request) {
                        c->protocol_minor = 1;
        }
 
+       if(!experimental)
+               c->protocol_minor = 0;
+
        c->allow_request = METAKEY;
 
        if(c->protocol_minor >= 2)