All of lore.kernel.org
 help / color / mirror / Atom feed
* question: auto-trust after pairing
@ 2018-05-16 10:58 Libor Peltan
  2018-05-17  7:55 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Libor Peltan @ 2018-05-16 10:58 UTC (permalink / raw)
  To: linux-bluetooth

Hello everyone,

I'd like to ask about specific configuration of bluetooth daemon.

1. How it works for me:
I'm running BlueZ 5.47 on an ARMv7-powered board with a Qualcomm chip.
When a device (mostly a phone) connects via bluetooth, it is paired automat=
ically without any PIN exchange.
In order to use PAN protocol over bluetooth, the connected device needs to =
be trusted.
To achieve this, I created an external program, that communicates with blue=
toothd via DBus. When a DBus message arrives informing about new paired dev=
ice, the program responds (if some policy conditions are fulfilled) with DB=
us message requesting trusting this device. Overall, this makes an approx 0=
.5 secs delay between pairing and trusting of the device.

2. My problem
When testing an iPhone in the role of the connecting device, after the pair=
ing I can see an error message on the iPhone. After trying to connect again=
, it already works. It's not nice, for the future users, to always receive =
an error message on first attempt - I need to avoid this.
I observed that after pairing, the iPhone immediately (in 10 millis) tries =
to connect to PAN. This is not yet possible, since it's not yet trusted. Th=
is causes the error message.

3. My question
Is there a way to change bluetoothd, so that he automatically trusts a devi=
ce when it pairs?
Is it possible to turn this "auto-trust" mode on and off without restarting=
 bluetoothd?

Thanks much for the answers or any other usefult tips!

Libor Peltan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question: auto-trust after pairing
  2018-05-16 10:58 question: auto-trust after pairing Libor Peltan
@ 2018-05-17  7:55 ` Luiz Augusto von Dentz
  2018-05-17  8:39   ` Szymon Janc
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2018-05-17  7:55 UTC (permalink / raw)
  To: lpeltan; +Cc: linux-bluetooth

Hi Libor,
On Wed, May 16, 2018 at 2:01 PM Libor Peltan <lpeltan@insys-tec.de> wrote:

> Hello everyone,

> I'd like to ask about specific configuration of bluetooth daemon.

> 1. How it works for me:
> I'm running BlueZ 5.47 on an ARMv7-powered board with a Qualcomm chip.
> When a device (mostly a phone) connects via bluetooth, it is paired
automatically without any PIN exchange.
> In order to use PAN protocol over bluetooth, the connected device needs
to be trusted.
> To achieve this, I created an external program, that communicates with
bluetoothd via DBus. When a DBus message arrives informing about new paired
device, the program responds (if some policy conditions are fulfilled) with
DBus message requesting trusting this device. Overall, this makes an approx
0.5 secs delay between pairing and trusting of the device.

> 2. My problem
> When testing an iPhone in the role of the connecting device, after the
pairing I can see an error message on the iPhone. After trying to connect
again, it already works. It's not nice, for the future users, to always
receive an error message on first attempt - I need to avoid this.
> I observed that after pairing, the iPhone immediately (in 10 millis)
tries to connect to PAN. This is not yet possible, since it's not yet
trusted. This causes the error message.

> 3. My question
> Is there a way to change bluetoothd, so that he automatically trusts a
device when it pairs?
> Is it possible to turn this "auto-trust" mode on and off without
restarting bluetoothd?

Even in case of just works pairing there should be a request to the agent
to accept it, trust affects connection authorization perhaps we are not
doing it properly for PAN since there should delay a little bit the
accepting of the L2CAP connection but that is done for all profiles so Id
be surprised that is what is causing the problem.

> Thanks much for the answers or any other usefult tips!

> Libor Peltan

> --
> To unsubscribe from this list: send the line "unsubscribe
linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question: auto-trust after pairing
  2018-05-17  7:55 ` Luiz Augusto von Dentz
@ 2018-05-17  8:39   ` Szymon Janc
  0 siblings, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2018-05-17  8:39 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: lpeltan, linux-bluetooth

Hi,

On Thursday, 17 May 2018 09:55:05 CEST Luiz Augusto von Dentz wrote:
> Hi Libor,
> 
> On Wed, May 16, 2018 at 2:01 PM Libor Peltan <lpeltan@insys-tec.de> wrote:
> > Hello everyone,
> > 
> > I'd like to ask about specific configuration of bluetooth daemon.
> > 
> > 1. How it works for me:
> > I'm running BlueZ 5.47 on an ARMv7-powered board with a Qualcomm chip.
> > When a device (mostly a phone) connects via bluetooth, it is paired
> 
> automatically without any PIN exchange.
> 
> > In order to use PAN protocol over bluetooth, the connected device needs
> 
> to be trusted.
> 
> > To achieve this, I created an external program, that communicates with
> 
> bluetoothd via DBus. When a DBus message arrives informing about new paired
> device, the program responds (if some policy conditions are fulfilled) with
> DBus message requesting trusting this device. Overall, this makes an approx
> 0.5 secs delay between pairing and trusting of the device.
> 
> > 2. My problem
> > When testing an iPhone in the role of the connecting device, after the
> 
> pairing I can see an error message on the iPhone. After trying to connect
> again, it already works. It's not nice, for the future users, to always
> receive an error message on first attempt - I need to avoid this.
> 
> > I observed that after pairing, the iPhone immediately (in 10 millis)
> 
> tries to connect to PAN. This is not yet possible, since it's not yet
> trusted. This causes the error message.
> 
> > 3. My question
> > Is there a way to change bluetoothd, so that he automatically trusts a
> 
> device when it pairs?
> 
> > Is it possible to turn this "auto-trust" mode on and off without
> 
> restarting bluetoothd?
> 
> Even in case of just works pairing there should be a request to the agent
> to accept it, trust affects connection authorization perhaps we are not
> doing it properly for PAN since there should delay a little bit the
> accepting of the L2CAP connection but that is done for all profiles so Id
> be surprised that is what is causing the problem.

My guess would that there is no agent at all, so pairing fallback to JustWorks 
but service autorization fails if there is no agent. I'd suggest to have 
simple agent that will authoriza service connection. Other option would be to 
set device trusted as soon as it gets connected (ie before pairing is 
completed).

-- 
pozdrawiam
Szymon Janc



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-17  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 10:58 question: auto-trust after pairing Libor Peltan
2018-05-17  7:55 ` Luiz Augusto von Dentz
2018-05-17  8:39   ` Szymon Janc

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.