X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=858992c846fa30ae209dd917aba53c99ceefc863;hb=53b00f8c1abda0d477c75e4d70a7341301fa1733;hp=0085598e743f0f3259ae743b3d0f3f2c94ff64d0;hpb=06943e828c45d8f4f1da6dc51907499f92957a39;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index 0085598e..858992c8 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -86,10 +86,8 @@ bool node_read_ecdsa_public_key(node_t *n) { fp = fopen(pubname, "r"); - if(!fp) { - logger(DEBUG_ALWAYS, LOG_ERR, "Error reading ECDSA public key file `%s': %s", pubname, strerror(errno)); + if(!fp) goto exit; - } n->ecdsa = ecdsa_read_pem_public_key(fp); fclose(fp); @@ -673,10 +671,14 @@ static bool setup_myself(void) { myself->options |= PROT_MINOR << 24; - get_config_bool(lookup_config(config_tree, "ExperimentalProtocol"), &experimental); - - if(experimental && !read_ecdsa_private_key()) - return false; + if(!get_config_bool(lookup_config(config_tree, "ExperimentalProtocol"), &experimental)) { + experimental = read_ecdsa_private_key(); + if(!experimental) + logger(DEBUG_ALWAYS, LOG_WARNING, "Support for SPTPS disabled."); + } else { + if(experimental && !read_ecdsa_private_key()) + return false; + } if(!read_rsa_private_key()) return false;