From: Hemant Gupta Date: Wed, 18 Apr 2012 09:16:26 +0000 (+0530) Subject: Bluetooth: Don't distribute keys in case of Encryption Failure X-Git-Tag: v3.5-rc1~101^2~6^2^2^2~55 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=35d4adcca1707c551f4598f68fe83118dd82cd60;p=~emulex%2Finfiniband.git 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 Signed-off-by: Gustavo Padovan --- 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) 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); }