From: Marcel Holtmann <marcel@holtmann.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "'BlueZ Mailing List'" <bluez-devel@lists.sourceforge.net>
Subject: RE: [Bluez-devel] Alignment issue
Date: Fri, 13 Aug 2004 11:05:52 +0200 [thread overview]
Message-ID: <1092387952.28711.217.camel@pegasus> (raw)
In-Reply-To: <1092384465.4186.37.camel@imladris.demon.co.uk>
Hi David,
> > I looked at the patches from the bluez-utils source RPM and actually I
> > can include optional PIE support for you. A simple patch for that is
> > easy and actually I already did that. From what I saw, this is a GCC 3.4
> > only feature and you give -pie at linking time and not at compile time
> > of the sources itself. Is this correct?
>
> You also need -fpic in CFLAGS, I believe.
if this is true, then this makes your patch useless. However after doing
some research in this area it seems that I must use -fPIE and then link
with -pie. This actually only works for programs, because libtool don't
uses these extra flags.
Check out the CVS. The patch for that is already included.
> > What is the best way to detect PIE support in the compiler?
>
> I hate myself for saying it, but possibly just test whether you can
> actually build an executable that way?
I did it this way, but there were reports of Sparc platforms where the
resulting binary should be run-tested.
> > And please don't do this
> >
> > # Authentication and Encryption
> > - #auth enable;
> > - #encrypt enable;
> > + auth enable;
> > + encrypt enable;
> >
> > in the bluez-utils-2.3-conf.patch. If you do that then you are going to
> > set your local device in security mode 3 and this is not what you want.
>
> Hmmm, OK.... /me refers to Google and then
> http://www.niksula.cs.hut.fi/~jiitv/bluesec.html
This is a nice page, I know, but it is too theoretical ;)
> Don't I want that? If I were to leave it out, would that leave it in
> mode 1, and mean I wouldn't be required to exchange a PIN with _every_
> device before I can communicate with it at all?
The point here is that setting "auth enable" sets the device into
security mode 3. It is the same with "hciconfig hci0 auth". And you
can't have encryption without authentication and so leave this both
disabled.
Even if the Bluetooth specification talks about three security modes, we
can only differ between mode 3 and mode 1/2 on the device level. This
means that we are in security mode 1 or in mode 2 if you don't set this
options.
The difference between mode 1 and 2 are that in security mode 1 or
device will never initiate the security mechanism, but it will respond
to it if the other device asks. For example a mobile phone.
In security mode 2 the mechanism will be triggerd before the service is
usable. In general these are done by the daemons that implement the
profile. Look at pand and dund for example. This is why it is called
service level security.
The reason behind security mode 1/2 and mode 3 are that in mode 1 and 2
you can request SDP information without authentication, but in security
mode 3 the authentication is enforced right after the link creation on
the HCI level and you must even authenticate for SDP information.
And some device don't really like connections from hosts with security
mode 3. It will work in some way, but it causes more troubles than it is
good for.
> The gnome-bluetooth program has been known to register its OBEX file
> receive service and then just dump stuff into the user's home directory
> -- even files with names like .rhosts :) If I make the requested change,
> would that mean that _anyone_ can exploit this, rather than only devices
> with which we're already paired?
If this is possible, then this is a misdesign in the program. You can't
rely on the Bluetooth security mechanism for everything. Look at the
reports about hacking into a mobile phone. I wrote one of that papers ;)
> Or am I getting confused? Can we do security mode 2?
You can enforce authentication with the correct option to dund and pand
for example. Otherwise we go with security mode 1, but this does not
mean that we never have to authenticate.
> I have a _vague_ recollection that there were devices I couldn't
> communicate with unless I enabled those -- but it was a long time ago
> and perhaps it was just that I thought authentication and encryption
> sounded like good things so I should probably enable them :)
You will be always able to communicate to all devices if you are in
security mode 1/2, but there are some that expect something and you
don't get any feedback. The best example is the Apple keyboard. If
connect to it the first time it expects that you input a PIN on the
numeric keys. If you don't do this in time the connectio is terminated
and you don't see why. Even hcidump don't gives you any clues. You must
know how these devices work. The stupid thing behind this is that Apple
uses security mode 3 for the mouse and the keyboard. And how would you
input a PIN with a mouse. The only other security mode 3 device is the
old Nokia 6210 and that is it. Every other device I have seen so far is
using service based security.
And I never checked this, but I think the CSR based mice don't have a
default PIN or something like that and so you won't be able to connect
these devices (every mice except the Apple one) to a host in security
mode 3. Investigate this before your think about enabling this again.
Regards
Marcel
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2004-08-13 9:05 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-10 18:38 [Bluez-devel] Alignment issue Daryl Van Vorst
2004-08-10 23:12 ` Marcel Holtmann
2004-08-11 9:20 ` Stephen Crane
2004-08-11 11:08 ` David Woodhouse
2004-08-11 19:33 ` Marcel Holtmann
2004-08-11 7:13 ` Marcel Holtmann
2004-08-11 16:44 ` Daryl Van Vorst
2004-08-11 19:31 ` Marcel Holtmann
2004-08-12 8:34 ` David Woodhouse
2004-08-12 9:27 ` Marcel Holtmann
2004-08-12 10:01 ` David Woodhouse
2004-08-12 10:22 ` Marcel Holtmann
2004-08-12 10:35 ` David Woodhouse
2004-08-12 11:00 ` Marcel Holtmann
2004-08-12 11:33 ` David Woodhouse
2004-08-12 11:49 ` Marcel Holtmann
2004-08-12 12:02 ` David Woodhouse
2004-08-12 12:29 ` Marcel Holtmann
2004-08-12 13:36 ` Marcel Holtmann
2004-08-13 8:07 ` David Woodhouse
2004-08-13 9:05 ` Marcel Holtmann [this message]
2004-08-13 9:14 ` David Woodhouse
2004-08-13 11:52 ` David Woodhouse
2004-08-13 12:40 ` Marcel Holtmann
2004-08-12 12:53 ` David Woodhouse
2004-08-13 9:58 ` Marcel Holtmann
2004-08-13 10:56 ` David Woodhouse
2004-08-12 10:10 ` Stephen Crane
2004-08-12 10:25 ` Marcel Holtmann
2005-01-20 14:30 ` David Woodhouse
2005-01-20 14:45 ` Marcel Holtmann
2005-01-20 14:59 ` David Woodhouse
2005-01-20 18:14 ` Marcel Holtmann
2005-01-21 8:26 ` David Woodhouse
2005-01-23 8:12 ` Marcel Holtmann
2005-01-23 11:39 ` Marcel Holtmann
2005-01-23 12:29 ` David Woodhouse
2005-01-23 14:40 ` Marcel Holtmann
2005-01-23 15:11 ` David Woodhouse
2005-01-23 15:22 ` Marcel Holtmann
2005-01-23 23:16 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2004-08-16 9:48 john smith
2004-08-16 10:15 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1092387952.28711.217.camel@pegasus \
--to=marcel@holtmann.org \
--cc=bluez-devel@lists.sourceforge.net \
--cc=dwmw2@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox