Bluetooth: Classic: SMP: Set secure connection for derived LTK

If the encrypt value of classic connection is
`BT_HCI_ENCRYPTION_ON_BR_AES_CCM`, set the flag `BT_KEYS_SC` for
the derived LTK.

Or, clear the flag `BT_KEYS_SC` for the derived LTK.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit is contained in:
Lyle Zhu 2025-03-25 18:53:12 +08:00 committed by Benjamin Cabé
commit b59bc363ea

View file

@ -1048,6 +1048,12 @@ static void smp_br_derive_ltk(struct bt_smp_br *smp)
keys->flags &= ~BT_KEYS_AUTHENTICATED;
}
if (conn->encrypt == BT_HCI_ENCRYPTION_ON_BR_AES_CCM) {
keys->flags |= BT_KEYS_SC;
} else {
keys->flags &= ~BT_KEYS_SC;
}
LOG_DBG("LTK derived from LinkKey");
}