Skip to content

Commit

Permalink
Bluetooth: Don't distribute keys in case of Encryption Failure
Browse files Browse the repository at this point in the history
SMP Keys should only be distributeed when encryption is successful.

Signed-off-by: Hemant Gupta <hemant.gupta@stericsson.com>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
  • Loading branch information
Hemant Gupta authored and Gustavo Padovan committed May 9, 2012
1 parent f4001d2 commit 35d4adc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4813,7 +4813,8 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
BT_DBG("conn %p", conn);

if (hcon->type == LE_LINK) {
smp_distribute_keys(conn, 0);
if (!status && encrypt)
smp_distribute_keys(conn, 0);
cancel_delayed_work(&conn->security_timer);
}

Expand Down

0 comments on commit 35d4adc

Please sign in to comment.