From: Guus Sliepen Date: Tue, 5 Nov 2019 18:27:11 +0000 (+0100) Subject: Handle host config files without a public key. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=91501d27480bf37881b6872cf63462c50de197f3;p=meshlink Handle host config files without a public key. Commit fa05f996c5500c056a36c1d43e33a407f876643c broke reading config files for hosts for which no public key is known. --- diff --git a/src/net_setup.c b/src/net_setup.c index 1a123cf5..e1db743a 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -170,12 +170,14 @@ bool node_read_from_config(meshlink_handle_t *mesh, node_t *n, const config_t *c const void *key; uint32_t len = packmsg_get_bin_raw(&in, &key); - if(len != 32) { - return false; - } + if(len) { + if(len != 32) { + return false; + } - if(!ecdsa_active(n->ecdsa)) { - n->ecdsa = ecdsa_set_public_key(key); + if(!ecdsa_active(n->ecdsa)) { + n->ecdsa = ecdsa_set_public_key(key); + } } n->canonical_address = packmsg_get_str_dup(&in);