From 91501d27480bf37881b6872cf63462c50de197f3 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 5 Nov 2019 19:27:11 +0100 Subject: [PATCH] Handle host config files without a public key. Commit fa05f996c5500c056a36c1d43e33a407f876643c broke reading config files for hosts for which no public key is known. --- src/net_setup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); -- 2.39.5