diff --git a/nimble/host/mesh/src/friend.c b/nimble/host/mesh/src/friend.c index ff34eda9c..b544a7830 100644 --- a/nimble/host/mesh/src/friend.c +++ b/nimble/host/mesh/src/friend.c @@ -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);