* [PATCH] Bluetooth: Remove device OOB data if it was discovered in band
@ 2012-11-19 14:46 Szymon Janc
2012-11-19 15:05 ` Johan Hedberg
0 siblings, 1 reply; 3+ messages in thread
From: Szymon Janc @ 2012-11-19 14:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
OOB authentication mechanism should be used only if pairing process
has been activated by previous OOB information exchange (Core Spec
4.0 , vol. 1, Part A, 5.1.4.3). Stored OOB data for specific device
should be removed if that device was discovered in band later on.
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
---
This could also be done by userspace but would require calling remove remote
OOB data mgmt command for every device found. Userspace could also track for
which devices OOB data were added but this could be problematic as OOB data
persists userspace restart. Doing it in kernel seems better.
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 9f5c5f2..cda5bac 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1946,6 +1946,8 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb)
for (; num_rsp; num_rsp--, info++) {
bool name_known, ssp;
+ hci_remove_remote_oob_data(hdev, &info->bdaddr);
+
bacpy(&data.bdaddr, &info->bdaddr);
data.pscan_rep_mode = info->pscan_rep_mode;
data.pscan_period_mode = info->pscan_period_mode;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Remove device OOB data if it was discovered in band
2012-11-19 14:46 [PATCH] Bluetooth: Remove device OOB data if it was discovered in band Szymon Janc
@ 2012-11-19 15:05 ` Johan Hedberg
2012-11-19 15:17 ` Szymon Janc
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2012-11-19 15:05 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth
Hi Szymon,
On Mon, Nov 19, 2012, Szymon Janc wrote:
> OOB authentication mechanism should be used only if pairing process
> has been activated by previous OOB information exchange (Core Spec
> 4.0 , vol. 1, Part A, 5.1.4.3). Stored OOB data for specific device
> should be removed if that device was discovered in band later on.
>
> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
>
> This could also be done by userspace but would require calling remove remote
> OOB data mgmt command for every device found. Userspace could also track for
> which devices OOB data were added but this could be problematic as OOB data
> persists userspace restart. Doing it in kernel seems better.
>
>
> 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 9f5c5f2..cda5bac 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -1946,6 +1946,8 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb)
> for (; num_rsp; num_rsp--, info++) {
> bool name_known, ssp;
>
> + hci_remove_remote_oob_data(hdev, &info->bdaddr);
> +
> bacpy(&data.bdaddr, &info->bdaddr);
> data.pscan_rep_mode = info->pscan_rep_mode;
> data.pscan_period_mode = info->pscan_period_mode;
Why would you do this only in hci_inquiry_result_evt? What about
hci_extended_inquiry_result_evt and hci_inquiry_result_with_rssi_evt?
Maybe hci_inquiry_cache_update would be a better function to put this
into.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Remove device OOB data if it was discovered in band
2012-11-19 15:05 ` Johan Hedberg
@ 2012-11-19 15:17 ` Szymon Janc
0 siblings, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2012-11-19 15:17 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth@vger.kernel.org
On Monday 19 of November 2012 17:05:37 Johan Hedberg wrote:
> Hi Szymon,
Hi Johan,
>
> On Mon, Nov 19, 2012, Szymon Janc wrote:
> > OOB authentication mechanism should be used only if pairing process
> > has been activated by previous OOB information exchange (Core Spec
> > 4.0 , vol. 1, Part A, 5.1.4.3). Stored OOB data for specific device
> > should be removed if that device was discovered in band later on.
> >
> > Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> > ---
> >
> > This could also be done by userspace but would require calling remove remote
> > OOB data mgmt command for every device found. Userspace could also track for
> > which devices OOB data were added but this could be problematic as OOB data
> > persists userspace restart. Doing it in kernel seems better.
> >
> >
> > 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 9f5c5f2..cda5bac 100644
> > --- a/net/bluetooth/hci_event.c
> > +++ b/net/bluetooth/hci_event.c
> > @@ -1946,6 +1946,8 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb)
> > for (; num_rsp; num_rsp--, info++) {
> > bool name_known, ssp;
> >
> > + hci_remove_remote_oob_data(hdev, &info->bdaddr);
> > +
> > bacpy(&data.bdaddr, &info->bdaddr);
> > data.pscan_rep_mode = info->pscan_rep_mode;
> > data.pscan_period_mode = info->pscan_period_mode;
>
> Why would you do this only in hci_inquiry_result_evt? What about
> hci_extended_inquiry_result_evt and hci_inquiry_result_with_rssi_evt?
> Maybe hci_inquiry_cache_update would be a better function to put this
> into.
Yes, I guess hci_inquiry_cache_update will be the right place to put this.
Will send V2.
Thx!
> Johan
--
BR
Szymon Janc
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-19 15:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-19 14:46 [PATCH] Bluetooth: Remove device OOB data if it was discovered in band Szymon Janc
2012-11-19 15:05 ` Johan Hedberg
2012-11-19 15:17 ` Szymon Janc
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).