Bluetooth: Fix encryption key size for peripheral role
authorAndre Guedes <andre.guedes@openbossa.org>
Wed, 31 Jul 2013 19:25:29 +0000 (16:25 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Oct 2013 23:08:32 +0000 (16:08 -0700)
commit 89cbb4da0abee2f39d75f67f9fd57f7410c8b65c upstream.

This patch fixes the connection encryption key size information when
the host is playing the peripheral role. We should set conn->enc_key_
size in hci_le_ltk_request_evt, otherwise it is left uninitialized.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/hci_event.c

index 1a9fa7f60bd4747884a2f75ce35d9d0e390c9ddb..dcaa6dbbab2cfc505d069f1dc416cac94ff89117 100644 (file)
@@ -3615,6 +3615,8 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
        else
                conn->pending_sec_level = BT_SECURITY_MEDIUM;
 
+       conn->enc_key_size = ltk->enc_size;
+
        hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
 
        if (ltk->type & HCI_SMP_STK) {