diff options
author | Hemant Gupta <hemant.gupta@stericsson.com> | 2012-04-18 05:16:26 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo@padovan.org> | 2012-05-09 00:40:36 -0400 |
commit | 35d4adcca1707c551f4598f68fe83118dd82cd60 (patch) | |
tree | 6dc676a5fcc755d78ca9252e398067bc3cffc8da /net/bluetooth/l2cap_core.c | |
parent | f4001d28464d92db5cae7702d65cf18162043a12 (diff) |
Bluetooth: Don't distribute keys in case of Encryption Failure
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>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 913cec3e52d..ce93dcf0c2d 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -4813,7 +4813,8 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
4813 | BT_DBG("conn %p", conn); | 4813 | BT_DBG("conn %p", conn); |
4814 | 4814 | ||
4815 | if (hcon->type == LE_LINK) { | 4815 | if (hcon->type == LE_LINK) { |
4816 | smp_distribute_keys(conn, 0); | 4816 | if (!status && encrypt) |
4817 | smp_distribute_keys(conn, 0); | ||
4817 | cancel_delayed_work(&conn->security_timer); | 4818 | cancel_delayed_work(&conn->security_timer); |
4818 | } | 4819 | } |
4819 | 4820 | ||