* [PATCH] Bluetooth: Simplify hci_conn_accept_secure check
@ 2011-06-02 12:24 Waldemar Rymarkiewicz
2011-06-06 17:23 ` Gustavo F. Padovan
0 siblings, 1 reply; 2+ messages in thread
From: Waldemar Rymarkiewicz @ 2011-06-02 12:24 UTC (permalink / raw)
To: linux-bluetooth; +Cc: padovan, Waldemar Rymarkiewicz
If the link key is secure (authenticated or combination 16 digit)
the sec_level will be always BT_SECURITY_HIGH. Therefore, instead
of checking the link key type simply check the sec_level on the link.
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
---
net/bluetooth/hci_conn.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 0408a93..37f5a17 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -643,9 +643,7 @@ int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level)
if (sec_level != BT_SECURITY_HIGH)
return 1; /* Accept if non-secure is required */
- if (conn->key_type == HCI_LK_AUTH_COMBINATION ||
- (conn->key_type == HCI_LK_COMBINATION &&
- conn->pin_length == 16))
+ if (conn->sec_level == BT_SECURITY_HIGH)
return 1;
return 0; /* Reject not secure link */
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: Simplify hci_conn_accept_secure check
2011-06-02 12:24 [PATCH] Bluetooth: Simplify hci_conn_accept_secure check Waldemar Rymarkiewicz
@ 2011-06-06 17:23 ` Gustavo F. Padovan
0 siblings, 0 replies; 2+ messages in thread
From: Gustavo F. Padovan @ 2011-06-06 17:23 UTC (permalink / raw)
To: Waldemar Rymarkiewicz; +Cc: linux-bluetooth
Hi Waldemar,
* Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> [2011-06-02 14:24:52 +0200]:
> If the link key is secure (authenticated or combination 16 digit)
> the sec_level will be always BT_SECURITY_HIGH. Therefore, instead
> of checking the link key type simply check the sec_level on the link.
>
> Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
> ---
> net/bluetooth/hci_conn.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
Applied, thanks.
Gustavo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-06 17:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-02 12:24 [PATCH] Bluetooth: Simplify hci_conn_accept_secure check Waldemar Rymarkiewicz
2011-06-06 17:23 ` Gustavo F. Padovan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).