2012-04-18 09:16:26

by Hemant Gupta

[permalink] [raw]
Subject: [PATCH v1] 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 <[email protected]>
---
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 20dbebb..c33d714 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)
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);
}

--
1.7.0.4



2012-04-19 14:16:48

by Gustavo Padovan

[permalink] [raw]
Subject: Re: [PATCH v1] Bluetooth: Don't distribute keys in case of Encryption Failure

Hi Hemant,

* Hemant Gupta <[email protected]> [2012-04-18 14:46:26 +0530]:

> SMP Keys should only be distributeed when encryption is successful.
>
> Signed-off-by: Hemant Gupta <[email protected]>
> ---
> net/bluetooth/l2cap_core.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)

Patch has been applied to bluetooth-next. Thanks.

Gustavo