mesh: Fix clean-up introduced bug
authorBrian Gix <brian.gix@intel.com>
Mon, 8 Jun 2020 23:07:45 +0000 (16:07 -0700)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Fri, 18 Dec 2020 05:40:30 +0000 (11:10 +0530)
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.

Change-Id: Ia6c8a52afbfe03599884a29d71003a60231f71cb
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
mesh/model.c
mesh/net.c

index f2dfb26..5ed95af 100644 (file)
@@ -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);
index aeb8b84..2b11e52 100644 (file)
@@ -106,7 +106,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;