提交 7d5843b7 编写于 作者: J Johan Hedberg 提交者: Marcel Holtmann

Bluetooth: Remove unnecessary SMP STK define

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: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 c29d2444
...@@ -349,7 +349,6 @@ enum { ...@@ -349,7 +349,6 @@ enum {
#define HCI_LK_AUTH_COMBINATION_P256 0x08 #define HCI_LK_AUTH_COMBINATION_P256 0x08
/* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */ /* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
#define HCI_SMP_STK 0x80 #define HCI_SMP_STK 0x80
#define HCI_SMP_STK_SLAVE 0x81
#define HCI_SMP_LTK 0x82 #define HCI_SMP_LTK 0x82
#define HCI_SMP_LTK_SLAVE 0x83 #define HCI_SMP_LTK_SLAVE 0x83
......
...@@ -4241,7 +4241,7 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -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 * distribute the keys. Later, security can be re-established
* using a distributed LTK. * using a distributed LTK.
*/ */
if (ltk->type == HCI_SMP_STK_SLAVE) { if (ltk->type == HCI_SMP_STK) {
list_del(&ltk->list); list_del(&ltk->list);
kfree(ltk); kfree(ltk);
} }
......
...@@ -568,8 +568,12 @@ static u8 smp_random(struct smp_chan *smp) ...@@ -568,8 +568,12 @@ static u8 smp_random(struct smp_chan *smp)
else else
auth = 0; 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_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); ediv, rand);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册