]> tinc-vpn.org Git - tinc/blobdiff - src/net_setup.c
connection_t: allocate legacy context on first use
[tinc] / src / net_setup.c
index a829e8228388d7d9d3401b752122d98c8762e968..f2534a477af5e2a4717095ab7de6791a7b65e737 100644 (file)
@@ -788,9 +788,11 @@ static bool setup_myself(void) {
                }
        }
 
-       myself->connection->rsa = read_rsa_private_key(&config_tree, NULL);
+       rsa_t *rsa = read_rsa_private_key(&config_tree, NULL);
 
-       if(!myself->connection->rsa) {
+       if(rsa) {
+               myself->connection->legacy = new_legacy_ctx(rsa);
+       } else {
                if(experimental) {
                        logger(DEBUG_ALWAYS, LOG_WARNING, "Support for legacy protocol disabled.");
                } else {