]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
Bluetooth: Remove unnecessary SMP STK define
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 16 Jun 2014 16:25:15 +0000 (19:25 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:42 +0000 (17:42 +0200)
We never store the "master" type of STKs since we request encryption
directly with them so we only need one STK type (the one that's
looked-up on the slave side). Simply remove the unnecessary define and
rename the _SLAVE one to the shorter form.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci.h
net/bluetooth/hci_event.c
net/bluetooth/smp.c

index 16587dcd6a9181b74814f1a4d0865332aa1bd81d..98f7520d2f57e53005f647f426f687c7c27aa366 100644 (file)
@@ -349,7 +349,6 @@ enum {
 #define HCI_LK_AUTH_COMBINATION_P256   0x08
 /* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
 #define HCI_SMP_STK                    0x80
-#define HCI_SMP_STK_SLAVE              0x81
 #define HCI_SMP_LTK                    0x82
 #define HCI_SMP_LTK_SLAVE              0x83
 
index 3d52be1d695db5c9cca8e7642376800ea4c76525..8dde40430b5fe7e0b37736f84e001c701c4cc0de 100644 (file)
@@ -4241,7 +4241,7 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
         * distribute the keys. Later, security can be re-established
         * using a distributed LTK.
         */
-       if (ltk->type == HCI_SMP_STK_SLAVE) {
+       if (ltk->type == HCI_SMP_STK) {
                list_del(&ltk->list);
                kfree(ltk);
        }
index 1f4ed1e78e10cb11a8bcfb98a78acf1216d5d73d..b9cac1deb19fcc0dcf01fefced71dc0ef70134b8 100644 (file)
@@ -568,8 +568,12 @@ static u8 smp_random(struct smp_chan *smp)
                else
                        auth = 0;
 
+               /* Even though there's no _SLAVE suffix this is the
+                * slave STK we're adding for later lookup (the master
+                * STK never needs to be stored).
+                */
                hci_add_ltk(hcon->hdev, &hcon->dst, hcon->dst_type,
-                           HCI_SMP_STK_SLAVE, auth, stk, smp->enc_key_size,
+                           HCI_SMP_STK, auth, stk, smp->enc_key_size,
                            ediv, rand);
        }