If a user tries to configure publication of a model with an appkey that
is not bound to that model, an error should be returned.
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
if (!mod->pub_enabled || (mod->cbs && !(mod->cbs->pub)))
return MESH_STATUS_INVALID_PUB_PARAM;
- if (!appkey_have_key(node_get_net(node), idx))
+ if (!appkey_have_key(node_get_net(node), idx) ||
+ !has_binding(mod->bindings, idx))
return MESH_STATUS_INVALID_APPKEY;
/*