X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=34d8980e55a771acd13d2472eacca699e8d0c879;hb=3c163a3796c984deb874fb1cca1ed9a85fc1d087;hp=a9947aad1a9eca0205afc82b4b910db0657eb457;hpb=9b9230a0a79c670b86f54fadd2807b864ff9d91f;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index a9947aad..34d8980e 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -110,6 +110,12 @@ bool read_ecdsa_public_key(connection_t *c) { char *fname; char *p; + if(!c->config_tree) { + init_configuration(&c->config_tree); + if(!read_host_config(c->config_tree, c->name)) + return false; + } + /* First, check for simple ECDSAPublicKey statement */ if(get_config_string(lookup_config(c->config_tree, "ECDSAPublicKey"), &p)) { @@ -192,6 +198,8 @@ static bool read_ecdsa_private_key(void) { if(!fp) { logger(DEBUG_ALWAYS, LOG_ERR, "Error reading ECDSA private key file `%s': %s", fname, strerror(errno)); + if(errno == ENOENT) + logger(DEBUG_ALWAYS, LOG_INFO, "Create an ECDSA keypair with `tinc -n %s generate-ecdsa-keys'.", netname ?: "."); free(fname); return false; }