* [PATCH 1/2] Bluetooth: Fix security level for peripheral role
@ 2013-07-31 19:25 Andre Guedes
2013-07-31 19:25 ` [PATCH 2/2] Bluetooth: Fix encryption key size " Andre Guedes
2013-08-20 12:14 ` [PATCH 1/2] Bluetooth: Fix security level " Andre Guedes
0 siblings, 2 replies; 4+ messages in thread
From: Andre Guedes @ 2013-07-31 19:25 UTC (permalink / raw)
To: linux-bluetooth
While playing the peripheral role, the host gets a LE Long Term Key
Request Event from the controller when a connection is established
with a bonded device. The host then informs the LTK which should be
used for the connection. Once the link is encrypted, the host gets
an Encryption Change Event.
Therefore we should set conn->pending_sec_level instead of conn->
sec_level in hci_le_ltk_request_evt. This way, conn->sec_level is
properly updated in hci_encrypt_change_evt.
Moreover, since we have a LTK associated to the device, we have at
least BT_SECURITY_MEDIUM security level.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
net/bluetooth/hci_event.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 50e39f4..ea993ab 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3556,7 +3556,9 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
cp.handle = cpu_to_le16(conn->handle);
if (ltk->authenticated)
- conn->sec_level = BT_SECURITY_HIGH;
+ conn->pending_sec_level = BT_SECURITY_HIGH;
+ else
+ conn->pending_sec_level = BT_SECURITY_MEDIUM;
hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
--
1.8.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] Bluetooth: Fix encryption key size for peripheral role
2013-07-31 19:25 [PATCH 1/2] Bluetooth: Fix security level for peripheral role Andre Guedes
@ 2013-07-31 19:25 ` Andre Guedes
2013-09-01 17:09 ` Gustavo Padovan
2013-08-20 12:14 ` [PATCH 1/2] Bluetooth: Fix security level " Andre Guedes
1 sibling, 1 reply; 4+ messages in thread
From: Andre Guedes @ 2013-07-31 19:25 UTC (permalink / raw)
To: linux-bluetooth
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>
---
net/bluetooth/hci_event.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ea993ab..bc56245 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3560,6 +3560,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) {
--
1.8.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] Bluetooth: Fix security level for peripheral role
2013-07-31 19:25 [PATCH 1/2] Bluetooth: Fix security level for peripheral role Andre Guedes
2013-07-31 19:25 ` [PATCH 2/2] Bluetooth: Fix encryption key size " Andre Guedes
@ 2013-08-20 12:14 ` Andre Guedes
1 sibling, 0 replies; 4+ messages in thread
From: Andre Guedes @ 2013-08-20 12:14 UTC (permalink / raw)
To: linux-bluetooth
Ping.
On Wed, Jul 31, 2013 at 4:25 PM, Andre Guedes
<andre.guedes@openbossa.org> wrote:
> While playing the peripheral role, the host gets a LE Long Term Key
> Request Event from the controller when a connection is established
> with a bonded device. The host then informs the LTK which should be
> used for the connection. Once the link is encrypted, the host gets
> an Encryption Change Event.
>
> Therefore we should set conn->pending_sec_level instead of conn->
> sec_level in hci_le_ltk_request_evt. This way, conn->sec_level is
> properly updated in hci_encrypt_change_evt.
>
> Moreover, since we have a LTK associated to the device, we have at
> least BT_SECURITY_MEDIUM security level.
>
> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
> ---
> net/bluetooth/hci_event.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 50e39f4..ea993ab 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -3556,7 +3556,9 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
> cp.handle = cpu_to_le16(conn->handle);
>
> if (ltk->authenticated)
> - conn->sec_level = BT_SECURITY_HIGH;
> + conn->pending_sec_level = BT_SECURITY_HIGH;
> + else
> + conn->pending_sec_level = BT_SECURITY_MEDIUM;
>
> hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
>
> --
> 1.8.3.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Bluetooth: Fix encryption key size for peripheral role
2013-07-31 19:25 ` [PATCH 2/2] Bluetooth: Fix encryption key size " Andre Guedes
@ 2013-09-01 17:09 ` Gustavo Padovan
0 siblings, 0 replies; 4+ messages in thread
From: Gustavo Padovan @ 2013-09-01 17:09 UTC (permalink / raw)
To: Andre Guedes; +Cc: linux-bluetooth
Hi Andre,
2013-07-31 Andre Guedes <andre.guedes@openbossa.org>:
> 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>
> ---
> net/bluetooth/hci_event.c | 2 ++
> 1 file changed, 2 insertions(+)
Patches have been applied to bluetooth.git. Thanks.
Gustavo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-01 17:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-31 19:25 [PATCH 1/2] Bluetooth: Fix security level for peripheral role Andre Guedes
2013-07-31 19:25 ` [PATCH 2/2] Bluetooth: Fix encryption key size " Andre Guedes
2013-09-01 17:09 ` Gustavo Padovan
2013-08-20 12:14 ` [PATCH 1/2] Bluetooth: Fix security level " Andre Guedes
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.