mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-10 08:17:23 +00:00
host/mesh: Update seqnum when re-encrypting for friend
Sets the sequence number when re-encrypting messages from the friend to the lpn. This is port of 512444d863f0e4de69ea600dda37b11f032e9707
This commit is contained in:
committed by
Krzysztof Kopyściński
parent
94b3c4a9d3
commit
ea75a5e683
@@ -431,6 +431,9 @@ static int unseg_app_sdu_prepare(struct bt_mesh_friend *frnd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
BT_DBG("Re-encrypting friend pdu (SeqNum %06x -> %06x)",
|
||||
meta.crypto.seq_num, bt_mesh.seq);
|
||||
|
||||
err = unseg_app_sdu_unpack(frnd, buf, &meta);
|
||||
if (err) {
|
||||
return err;
|
||||
@@ -446,6 +449,8 @@ static int unseg_app_sdu_prepare(struct bt_mesh_friend *frnd,
|
||||
BT_DBG("Re-encrypting friend pdu (SeqNum %06x -> %06x)",
|
||||
meta.crypto.seq_num, bt_mesh.seq);
|
||||
|
||||
meta.crypto.seq_num = bt_mesh.seq;
|
||||
|
||||
err = unseg_app_sdu_decrypt(frnd, buf, &meta);
|
||||
if (err) {
|
||||
BT_WARN("Decryption failed! %d", err);
|
||||
|
||||
Reference in New Issue
Block a user