X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=b0b876083ee929ba1a0bc171a7c9d01891d3213d;hb=efca41606d4083eade90047d57cb963eb3b7e731;hp=a829e8228388d7d9d3401b752122d98c8762e968;hpb=0289162552cd85375605044c696e2a3294e7aa9a;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index a829e822..b0b87608 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -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 { @@ -946,7 +948,11 @@ static bool setup_myself(void) { #endif /* Compression */ - if(get_config_int(lookup_config(&config_tree, "Compression"), &myself->incompression)) { + int incompression = 0; + + if(get_config_int(lookup_config(&config_tree, "Compression"), &incompression)) { + myself->incompression = incompression; + switch(myself->incompression) { case COMPRESS_LZ4: #ifdef HAVE_LZ4 @@ -996,8 +1002,6 @@ static bool setup_myself(void) { myself->incompression = COMPRESS_NONE; } - myself->connection->outcompression = COMPRESS_NONE; - /* Done */ myself->nexthop = myself;