X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=7b4c741f0fe55ce1bd5daefcf39e2d990fa8867e;hb=ddabda536acf33abbfef28bc199d2b3ae7219b46;hp=ed69808d6c1a882229c1299d586305b2bda0db75;hpb=1c475ecb575367a6b3f9328b0f643ad636155341;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index ed69808d..7b4c741f 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -222,7 +222,7 @@ static bool read_ecdsa_private_key(void) { return false; } -#if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN) +#ifndef HAVE_MINGW struct stat s; if(fstat(fileno(fp), &s)) { @@ -314,7 +314,7 @@ static bool read_rsa_private_key(void) { return false; } -#if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN) +#ifndef HAVE_MINGW struct stat s; if(fstat(fileno(fp), &s)) { @@ -341,6 +341,7 @@ static bool read_rsa_private_key(void) { } #endif +#ifndef DISABLE_LEGACY static timeout_t keyexpire_timeout; static void keyexpire_handler(void *data) { @@ -349,6 +350,7 @@ static void keyexpire_handler(void *data) { keylifetime, rand() % 100000 }); } +#endif void regenerate_key(void) { logger(DEBUG_STATUS, LOG_INFO, "Expiring symmetric keys"); @@ -822,7 +824,7 @@ void device_disable(void) { Configure node_t myself and set up the local sockets (listen only) */ static bool setup_myself(void) { - char *name, *hostname, *cipher, *digest, *type; + char *name, *hostname, *type; char *address = NULL; bool port_specified = false; @@ -967,6 +969,8 @@ static bool setup_myself(void) { #ifndef DISABLE_LEGACY /* Generate packet encryption key */ + char *cipher; + if(!get_config_string(lookup_config(config_tree, "Cipher"), &cipher)) { cipher = xstrdup("aes-256-cbc"); } @@ -995,6 +999,8 @@ static bool setup_myself(void) { return false; } + char *digest; + if(!get_config_string(lookup_config(config_tree, "Digest"), &digest)) { digest = xstrdup("sha256"); }