From 4cf36cb549eca28a2bdf5cde837c056fd0878953 Mon Sep 17 00:00:00 2001 From: Brian Gix Date: Mon, 8 Jun 2020 16:07:45 -0700 Subject: [PATCH] mesh: Fix clean-up introduced bug Before the clean-up we were making a useless check of an otherwise unused boolean (net->provisioner) to determine if we should decode with device keys (which was incorrect). This was replaced by a check the node type (node->provisioner). However, the check was incorrect in the first place, and prevents provisioner nodes from decrypting non device key messages. --- mesh/model.c | 2 +- mesh/net.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mesh/model.c b/mesh/model.c index f2dfb2644..5ed95afac 100644 --- a/mesh/model.c +++ b/mesh/model.c @@ -907,7 +907,7 @@ bool mesh_model_rx(struct mesh_node *node, bool szmict, uint32_t seq0, * The packet needs to be decoded by the correct key which * is hinted by key_aid, but is not necessarily definitive */ - if (key_aid == APP_AID_DEV || node_is_provisioner(node)) + if (key_aid == APP_AID_DEV) decrypt_idx = dev_packet_decrypt(node, data, size, szmict, src, dst, key_aid, seq0, iv_index, clear_text); diff --git a/mesh/net.c b/mesh/net.c index c12dd6541..7dbe45f7d 100644 --- a/mesh/net.c +++ b/mesh/net.c @@ -108,7 +108,6 @@ struct mesh_net { bool friend_enable; bool beacon_enable; bool proxy_enable; - bool provisioner; bool friend_seq; struct l_timeout *iv_update_timeout; enum _iv_upd_state iv_upd_state; -- 2.47.3