2012-04-18 05:18:59

by Hemant Gupta

[permalink] [raw]
Subject: [PATCH] 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 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 20dbebb..42d3e97 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4812,7 +4812,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)

BT_DBG("conn %p", conn);

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



2012-04-18 09:16:08

by Hemant Gupta

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

Please ignore this patch, will send new patch shortly.

On Wed, Apr 18, 2012 at 10:48 AM, Hemant Gupta
<[email protected]> wrote:
> SMP Keys should only be distributeed when encryption is successful.
>
> Signed-off-by: Hemant Gupta <[email protected]>
> ---
> ?net/bluetooth/l2cap_core.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 20dbebb..42d3e97 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -4812,7 +4812,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
>
> ? ? ? ?BT_DBG("conn %p", conn);
>
> - ? ? ? if (hcon->type == LE_LINK) {
> + ? ? ? if (hcon->type == LE_LINK && !status && encrypt) {
> ? ? ? ? ? ? ? ?smp_distribute_keys(conn, 0);
> ? ? ? ? ? ? ? ?cancel_delayed_work(&conn->security_timer);
> ? ? ? ?}
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html



--
Best Regards
Hemant Gupta
ST-Ericsson India