From 66bf33f0900854a3df968e8a93a8dba4bd676c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alperen=20=C5=9Eener?= Date: Thu, 7 Sep 2023 17:46:24 +0200 Subject: [PATCH] Bluetooth: Mesh: Fix Solicitation Mesh crypto API use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pointer of the keys should be send to mesh en/decryption APIs. Signed-off-by: Alperen Şener --- subsys/bluetooth/mesh/solicitation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/mesh/solicitation.c b/subsys/bluetooth/mesh/solicitation.c index 1bf9f9a465a..f6543dcb320 100644 --- a/subsys/bluetooth/mesh/solicitation.c +++ b/subsys/bluetooth/mesh/solicitation.c @@ -304,7 +304,7 @@ static int sol_pdu_create(struct bt_mesh_subnet *sub, struct net_buf_simple *pdu /* DST = 0x0000 */ net_buf_simple_add_le16(pdu, 0x0000); - err = bt_mesh_net_encrypt(sub->keys[SUBNET_KEY_TX_IDX(sub)].msg.enc, + err = bt_mesh_net_encrypt(&sub->keys[SUBNET_KEY_TX_IDX(sub)].msg.enc, pdu, 0, BT_MESH_NONCE_SOLICITATION); if (err) { @@ -313,7 +313,7 @@ static int sol_pdu_create(struct bt_mesh_subnet *sub, struct net_buf_simple *pdu } err = bt_mesh_net_obfuscate(pdu->data, 0, - sub->keys[SUBNET_KEY_TX_IDX(sub)].msg.privacy); + &sub->keys[SUBNET_KEY_TX_IDX(sub)].msg.privacy); if (err) { LOG_ERR("Obfuscation failed, err=%d", err); return err;