From febf3e72928c293e81f307ad91a7dcf5e70d7a56 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 8 Feb 2021 18:14:38 +0100 Subject: [PATCH] Add missing config file update on receiving a proactive REQ_KEY request. A REQ_KEY request from a node that wants our key can contain their key as well. The node status was not set to dirty in this case, which could prevent their key from being written to disk with the default settings, but this actually always forgot to write the key to disk with storage policy set to KEYS_ONLY. --- src/protocol_key.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/protocol_key.c b/src/protocol_key.c index 693b96db..6a2946eb 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -146,6 +146,13 @@ static bool req_key_ext_h(meshlink_handle_t *mesh, connection_t *c, const char * logger(mesh, MESHLINK_ERROR, "Got bad %s from %s: %s", "REQ_PUBKEY", from->name, "invalid pubkey"); return true; } + + logger(mesh, MESHLINK_INFO, "Learned ECDSA public key from %s", from->name); + from->status.dirty = true; + + if(!node_write_config(mesh, from, true)) { + // ignore + } } } -- 2.39.5