Skip to content

bluetooth: smp: CTKD issue when cross br and ble connections and security #90574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarkWangChinese
Copy link
Collaborator

The peer uses the RPA address.
A BR connection is created firstly, a subsequent BLE connection is created secondly, the BR SMP CTKD occur thirdly (The BLE LTK is derived from BR and the BR SMP distribute peer's IRK and identity address here), but the BLE LTK is saved to key pool that is not matched with the previous BLE connection because the derived LTK is saved with identity address and BLE connection uses RPA. Fix it by: Resolve the BLE connections' RPA with the derived IRK to find the previous BLE connections and match the connections with derived LTK key.

@github-actions github-actions bot added area: Bluetooth area: Bluetooth Host Bluetooth Host (excluding BR/EDR) labels May 26, 2025
@Thalley Thalley removed their request for review May 26, 2025 10:53
@alwa-nordic alwa-nordic added the area: Bluetooth Classic Bluetooth Classic (BR/EDR) label May 27, 2025
@alwa-nordic alwa-nordic requested review from lylezhu2012 and removed request for alwa-nordic May 27, 2025 13:58
@MarkWangChinese MarkWangChinese force-pushed the feature/cross_br_ble_conns_security_ctkd_issue branch from c0cf761 to 5d6b8f1 Compare May 28, 2025 01:45
{
struct bt_keys *keys = data;

if (!bt_addr_le_is_identity(&conn->le.dst) &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!bt_addr_le_is_identity(&conn->le.dst) &&
if (!bt_addr_le_is_rpa(&conn->le.dst)) {
return;
}
if (

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

…rity

The peer uses the RPA address.
A BR connection is created firstly, a subsequent BLE connection is
created secondly, the BR SMP CTKD occur thirdly (The BLE LTK is
derived from BR and the BR SMP distribute peer's IRK and identity address
here), but the BLE LTK is saved to key pool that is not
matched with the previous BLE connection because the derived LTK is saved
with identity address and BLE connection uses RPA. Fix it by: Resolve the
BLE connections' RPA with the derived IRK to find the previous BLE
connections and match the connections with derived LTK key.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
@MarkWangChinese MarkWangChinese force-pushed the feature/cross_br_ble_conns_security_ctkd_issue branch from 5d6b8f1 to 3da815d Compare May 28, 2025 13:47
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Classic Bluetooth Classic (BR/EDR) area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants