Bluetooth: Mesh: Update seqnum when re-encrypting for friend
Sets the sequence number when re-encrypting messages from the friend to the lpn. This is a regression from #28511. Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This commit is contained in:
parent
48526b6925
commit
512444d863
1 changed files with 4 additions and 1 deletions
|
@ -432,7 +432,8 @@ static int unseg_app_sdu_prepare(struct bt_mesh_friend *frnd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
BT_DBG("Re-encrypting friend pdu");
|
||||
BT_DBG("Re-encrypting friend pdu (SeqNum %06x -> %06x)",
|
||||
meta.crypto.seq_num, bt_mesh.seq);
|
||||
|
||||
err = unseg_app_sdu_decrypt(frnd, buf, &meta);
|
||||
if (err) {
|
||||
|
@ -440,6 +441,8 @@ static int unseg_app_sdu_prepare(struct bt_mesh_friend *frnd,
|
|||
return err;
|
||||
}
|
||||
|
||||
meta.crypto.seq_num = bt_mesh.seq;
|
||||
|
||||
err = unseg_app_sdu_encrypt(frnd, buf, &meta);
|
||||
if (err) {
|
||||
BT_WARN("Re-encryption failed! %d", err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue