Commit b59bc363 authored by Lyle Zhu's avatar Lyle Zhu Committed by Benjamin Cabé
Browse files

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: default avatarLyle Zhu <lyle.zhu@nxp.com>
parent 58f6ca80
Loading
Loading
Loading
Loading
+6 −0
Changes for subsys/bluetooth/host/smp.c: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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");
}