* Setting a static pin to allow pairing
@ 2017-12-18 10:28 Roy Sigurd Karlsbakk
2017-12-18 11:09 ` Bastien Nocera
2017-12-18 12:37 ` Luiz Augusto von Dentz
0 siblings, 2 replies; 8+ messages in thread
From: Roy Sigurd Karlsbakk @ 2017-12-18 10:28 UTC (permalink / raw)
To: linux-bluetooth
Hi all
I'm trying to setup a raspberry pi as a bluetooth host allowing pairing fro=
m a phone, but with a predefined pincode, and I can't find any docs on how =
to do this. I find some on how to do this interactively, but then, this isn=
't meant to be used like that, more like a "blackbox". I've tried to google=
this quite a bit and reading the docs, but I can't find much. Any idea how=
to do this?
Also, what I'm trying to end up with, is allowing the pi to place a call th=
rough the phone over bluetooth. I haven't managed to find much docs on this=
either. Bluetooth on linux is quite a new experience (although I've used L=
inux for >20 years), so thanks for any help
Vennlig hilsen
roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
Hi=C3=B0 g=C3=B3=C3=B0a skaltu =C3=AD stein h=C3=B6ggva, hi=C3=B0 illa =C3=
=AD snj=C3=B3 rita.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Setting a static pin to allow pairing
2017-12-18 10:28 Setting a static pin to allow pairing Roy Sigurd Karlsbakk
@ 2017-12-18 11:09 ` Bastien Nocera
2017-12-18 16:12 ` Luiz Augusto von Dentz
2017-12-18 12:37 ` Luiz Augusto von Dentz
1 sibling, 1 reply; 8+ messages in thread
From: Bastien Nocera @ 2017-12-18 11:09 UTC (permalink / raw)
To: Roy Sigurd Karlsbakk, linux-bluetooth
On Mon, 2017-12-18 at 11:28 +0100, Roy Sigurd Karlsbakk wrote:
> Hi all
>
> I'm trying to setup a raspberry pi as a bluetooth host allowing
> pairing from a phone, but with a predefined pincode, and I can't find
> any docs on how to do this. I find some on how to do this
> interactively, but then, this isn't meant to be used like that, more
> like a "blackbox". I've tried to google this quite a bit and reading
> the docs, but I can't find much. Any idea how to do this?
You can use bluez-tools:
https://github.com/khvzak/bluez-tools
(it's packaged for Debian as well, make sure you have a new enough
version to avoid crashes)
This is an example use:
https://github.com/hadess/CHIP-bluetooth-speaker/blob/master/setup.sh#L73
Cheers
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Setting a static pin to allow pairing
2017-12-18 10:28 Setting a static pin to allow pairing Roy Sigurd Karlsbakk
2017-12-18 11:09 ` Bastien Nocera
@ 2017-12-18 12:37 ` Luiz Augusto von Dentz
2017-12-18 16:24 ` Roy Sigurd Karlsbakk
1 sibling, 1 reply; 8+ messages in thread
From: Luiz Augusto von Dentz @ 2017-12-18 12:37 UTC (permalink / raw)
To: Roy Sigurd Karlsbakk; +Cc: linux-bluetooth@vger.kernel.org
Hi Roy,
On Mon, Dec 18, 2017 at 8:28 AM, Roy Sigurd Karlsbakk <roy@karlsbakk.net> w=
rote:
> Hi all
>
> I'm trying to setup a raspberry pi as a bluetooth host allowing pairing f=
rom a phone, but with a predefined pincode, and I can't find any docs on ho=
w to do this. I find some on how to do this interactively, but then, this i=
sn't meant to be used like that, more like a "blackbox". I've tried to goog=
le this quite a bit and reading the docs, but I can't find much. Any idea h=
ow to do this?
With SSP, introduced in Bluetooth 2.1, there is no longer a need to
have predefined pincode. In case that you don't have any means to
confirm you should be able to use "NoInputNoOutput", you can check how
this is done in bluetoothctl:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client/main.c#n1049
> Also, what I'm trying to end up with, is allowing the pi to place a call =
through the phone over bluetooth. I haven't managed to find much docs on th=
is either. Bluetooth on linux is quite a new experience (although I've used=
Linux for >20 years), so thanks for any help
You will need a telephony stack such as oFono to do that:
https://github.com/intgr/ofono/blob/master/doc/hfp-overview.txt
In case you are using PulseAudio here is how to setup:
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Blu=
etooth/#index5h2
>
> Vennlig hilsen
>
> roy
> --
> Roy Sigurd Karlsbakk
> (+47) 98013356
> http://blogg.karlsbakk.net/
> GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
> --
> Hi=C3=B0 g=C3=B3=C3=B0a skaltu =C3=AD stein h=C3=B6ggva, hi=C3=B0 illa =
=C3=AD snj=C3=B3 rita.
> --
> 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
--=20
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Setting a static pin to allow pairing
2017-12-18 11:09 ` Bastien Nocera
@ 2017-12-18 16:12 ` Luiz Augusto von Dentz
2017-12-18 16:22 ` Bastien Nocera
0 siblings, 1 reply; 8+ messages in thread
From: Luiz Augusto von Dentz @ 2017-12-18 16:12 UTC (permalink / raw)
To: Bastien Nocera; +Cc: Roy Sigurd Karlsbakk, linux-bluetooth@vger.kernel.org
Hi Bastien,
On Mon, Dec 18, 2017 at 9:09 AM, Bastien Nocera <hadess@hadess.net> wrote:
> On Mon, 2017-12-18 at 11:28 +0100, Roy Sigurd Karlsbakk wrote:
>> Hi all
>>
>> I'm trying to setup a raspberry pi as a bluetooth host allowing
>> pairing from a phone, but with a predefined pincode, and I can't find
>> any docs on how to do this. I find some on how to do this
>> interactively, but then, this isn't meant to be used like that, more
>> like a "blackbox". I've tried to google this quite a bit and reading
>> the docs, but I can't find much. Any idea how to do this?
>
> You can use bluez-tools:
> https://github.com/khvzak/bluez-tools
>
> (it's packaged for Debian as well, make sure you have a new enough
> version to avoid crashes)
>
> This is an example use:
> https://github.com/hadess/CHIP-bluetooth-speaker/blob/master/setup.sh#L73
Thats is rather old, and we did have incorporated a lot of the
features in these tools into bluetoothctl, obexctl, etc.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Setting a static pin to allow pairing
2017-12-18 16:12 ` Luiz Augusto von Dentz
@ 2017-12-18 16:22 ` Bastien Nocera
0 siblings, 0 replies; 8+ messages in thread
From: Bastien Nocera @ 2017-12-18 16:22 UTC (permalink / raw)
To: Luiz Augusto von Dentz
Cc: Roy Sigurd Karlsbakk, linux-bluetooth@vger.kernel.org
On Mon, 2017-12-18 at 14:12 -0200, Luiz Augusto von Dentz wrote:
> Hi Bastien,
>
> On Mon, Dec 18, 2017 at 9:09 AM, Bastien Nocera <hadess@hadess.net>
> wrote:
> > On Mon, 2017-12-18 at 11:28 +0100, Roy Sigurd Karlsbakk wrote:
> > > Hi all
> > >
> > > I'm trying to setup a raspberry pi as a bluetooth host allowing
> > > pairing from a phone, but with a predefined pincode, and I can't
> > > find
> > > any docs on how to do this. I find some on how to do this
> > > interactively, but then, this isn't meant to be used like that,
> > > more
> > > like a "blackbox". I've tried to google this quite a bit and
> > > reading
> > > the docs, but I can't find much. Any idea how to do this?
> >
> > You can use bluez-tools:
> > https://github.com/khvzak/bluez-tools
> >
> > (it's packaged for Debian as well, make sure you have a new enough
> > version to avoid crashes)
> >
> > This is an example use:
> > https://github.com/hadess/CHIP-bluetooth-speaker/blob/master/setup.
> > sh#L73
>
> Thats is rather old,
It's been ported to BlueZ 5, and I did some fixing last year when I
needed the functionality it offers.
> and we did have incorporated a lot of the
> features in these tools into bluetoothctl, obexctl, etc.
Can you actually run bluetoothctl in non-interactive mode, as a
service?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Setting a static pin to allow pairing
2017-12-18 12:37 ` Luiz Augusto von Dentz
@ 2017-12-18 16:24 ` Roy Sigurd Karlsbakk
2017-12-18 16:43 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 8+ messages in thread
From: Roy Sigurd Karlsbakk @ 2017-12-18 16:24 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
>> I'm trying to setup a raspberry pi as a bluetooth host allowing pairing =
from a
>> phone, but with a predefined pincode, and I can't find any docs on how t=
o do
>> this. I find some on how to do this interactively, but then, this isn't =
meant
>> to be used like that, more like a "blackbox". I've tried to google this =
quite a
>> bit and reading the docs, but I can't find much. Any idea how to do this=
?
>=20
> With SSP, introduced in Bluetooth 2.1, there is no longer a need to
> have predefined pincode. In case that you don't have any means to
> confirm you should be able to use "NoInputNoOutput", you can check how
> this is done in bluetoothctl:
Perhaps I'm overseeing something, but I don't quite understand how SSP will=
help. I'm more concerned about unauthorized bluetooth clients pairing with=
this than MITM-attacks. I want pairing to be fairly simple, but I need a w=
ay to identify the client.
Vennlig hilsen
roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
Hi=C3=B0 g=C3=B3=C3=B0a skaltu =C3=AD stein h=C3=B6ggva, hi=C3=B0 illa =C3=
=AD snj=C3=B3 rita.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Setting a static pin to allow pairing
2017-12-18 16:24 ` Roy Sigurd Karlsbakk
@ 2017-12-18 16:43 ` Luiz Augusto von Dentz
2017-12-18 16:53 ` Roy Sigurd Karlsbakk
0 siblings, 1 reply; 8+ messages in thread
From: Luiz Augusto von Dentz @ 2017-12-18 16:43 UTC (permalink / raw)
To: Roy Sigurd Karlsbakk; +Cc: linux-bluetooth
Hi Roy,
On Mon, Dec 18, 2017 at 2:24 PM, Roy Sigurd Karlsbakk <roy@karlsbakk.net> wrote:
>>> I'm trying to setup a raspberry pi as a bluetooth host allowing pairing from a
>>> phone, but with a predefined pincode, and I can't find any docs on how to do
>>> this. I find some on how to do this interactively, but then, this isn't meant
>>> to be used like that, more like a "blackbox". I've tried to google this quite a
>>> bit and reading the docs, but I can't find much. Any idea how to do this?
>>
>> With SSP, introduced in Bluetooth 2.1, there is no longer a need to
>> have predefined pincode. In case that you don't have any means to
>> confirm you should be able to use "NoInputNoOutput", you can check how
>> this is done in bluetoothctl:
>
> Perhaps I'm overseeing something, but I don't quite understand how SSP will help. I'm more concerned about unauthorized bluetooth clients pairing with this than MITM-attacks. I want pairing to be fairly simple, but I need a way to identify the client.
Authorization is a separate concept, usually services will require
certain security level which when not met may cause the pairing
process to kick in, authorization may happen regardless of that if the
device is not trusted. In other words, Paired property tells if the
device if the device has been authenticated and a link-key exists and
Trusted tell if the device can connect without being authorized by the
agent, the 2 properties acts completely independent.
For instance, this is how we handle authorization in bluetoothctl:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client/agent.c#n242
Note that RequestAuthorization is for authorizing a new pairing not a
new connection, which is done by AuthorizeService:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/agent-api.txt#n161
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/agent-api.txt#n174
In both cases the device object is given so you can identify who is
pairing/connecting.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Setting a static pin to allow pairing
2017-12-18 16:43 ` Luiz Augusto von Dentz
@ 2017-12-18 16:53 ` Roy Sigurd Karlsbakk
0 siblings, 0 replies; 8+ messages in thread
From: Roy Sigurd Karlsbakk @ 2017-12-18 16:53 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
>>>> I'm trying to setup a raspberry pi as a bluetooth host allowing pairin=
g from a
>>>> phone, but with a predefined pincode, and I can't find any docs on how=
to do
>>>> this. I find some on how to do this interactively, but then, this isn'=
t meant
>>>> to be used like that, more like a "blackbox". I've tried to google thi=
s quite a
>>>> bit and reading the docs, but I can't find much. Any idea how to do th=
is?
>>>
>>> With SSP, introduced in Bluetooth 2.1, there is no longer a need to
>>> have predefined pincode. In case that you don't have any means to
>>> confirm you should be able to use "NoInputNoOutput", you can check how
>>> this is done in bluetoothctl:
>>
>> Perhaps I'm overseeing something, but I don't quite understand how SSP w=
ill
>> help. I'm more concerned about unauthorized bluetooth clients pairing wi=
th this
>> than MITM-attacks. I want pairing to be fairly simple, but I need a way =
to
>> identify the client.
>=20
> Authorization is a separate concept, usually services will require
> certain security level which when not met may cause the pairing
> process to kick in, authorization may happen regardless of that if the
> device is not trusted. In other words, Paired property tells if the
> device if the device has been authenticated and a link-key exists and
> Trusted tell if the device can connect without being authorized by the
> agent, the 2 properties acts completely independent.
>=20
> For instance, this is how we handle authorization in bluetoothctl:
>=20
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client/agent.c#n2=
42
>=20
> Note that RequestAuthorization is for authorizing a new pairing not a
> new connection, which is done by AuthorizeService:
>=20
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/agent-api.txt=
#n161
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/agent-api.txt=
#n174
>=20
> In both cases the device object is given so you can identify who is
> pairing/connecting.
I see - thanks. This is all pretty new to me. Do you know how I can use blu=
etoothectl or similar tools to script up authorisation with the client with=
out digging deeply into the API?
Vennlig hilsen
roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
Hi=C3=B0 g=C3=B3=C3=B0a skaltu =C3=AD stein h=C3=B6ggva, hi=C3=B0 illa =C3=
=AD snj=C3=B3 rita.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-12-18 16:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-18 10:28 Setting a static pin to allow pairing Roy Sigurd Karlsbakk
2017-12-18 11:09 ` Bastien Nocera
2017-12-18 16:12 ` Luiz Augusto von Dentz
2017-12-18 16:22 ` Bastien Nocera
2017-12-18 12:37 ` Luiz Augusto von Dentz
2017-12-18 16:24 ` Roy Sigurd Karlsbakk
2017-12-18 16:43 ` Luiz Augusto von Dentz
2017-12-18 16:53 ` Roy Sigurd Karlsbakk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox