From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 31 19:25:28 2008 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1D6106566B for ; Mon, 31 Mar 2008 19:25:28 +0000 (UTC) (envelope-from gamato@users.sf.net) Received: from slimak.dkm.cz (smtp.dkm.cz [62.24.64.34]) by mx1.freebsd.org (Postfix) with SMTP id 6C1B68FC16 for ; Mon, 31 Mar 2008 19:25:27 +0000 (UTC) (envelope-from gamato@users.sf.net) Received: (qmail 24609 invoked by uid 0); 31 Mar 2008 19:19:58 -0000 Received: from r5j117.net.upc.cz (HELO ?86.49.9.117?) (86.49.9.117) by smtp.dkm.cz with SMTP; 31 Mar 2008 19:19:58 -0000 Message-ID: <47F1395D.5090003@users.sf.net> Date: Mon, 31 Mar 2008 21:19:57 +0200 From: mato User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.12) Gecko/20080305 SeaMonkey/1.1.8 MIME-Version: 1.0 To: Iain Hibbert References: <47DBE7A4.3060006@users.sf.net> <47EF6AA5.60403@users.sf.net> <1206902625.989759.1963.nullmailer@galant.ukfsn.org> In-Reply-To: <1206902625.989759.1963.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@freebsd.org Subject: Re: BT issues X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2008 19:25:28 -0000 Hi Iain, Iain Hibbert wrote: > On Sun, 30 Mar 2008, mato wrote: > > >> 2) What am I trying to do ? Well, I set up internet sharing on my home laptop >> via BT and I can use it from my other laptop. Now, it works when my other >> (work) laptop runs FreeBSD. When I boot the other laptop in to Windows it >> asks me for PIN and then it works OK. But when I boot in to FreeBSD again I >> cannot connect and I have to reinitialise as explained in my original email. >> So to me it seems connecting from Windows somehow changes stored key which is >> unusable for subsequent FreeBSD uses. >> > > the pairing is between the Bluetooth controllers (the actual dongle) but > the Link Key is generally held in the OS so dual booting can be > troublesome. In FreeBSD it is stored and supplied by hcsecd and you can > edit it, but naturally Windows does not know about that so it makes a new > link key and then FreeBSD does not know what it is. > > Yeah, and imho that's quite useful feature of Windows in this case -- it first tries its stored link key and if it doesn't work it'll ask for PIN and will generate a new link key. Even if FreeBSD has no facility or desire to interactively ask for PIN, I can imagine it could at least try and regenerate link key from PIN which would help in this case. > There are some ways around this, in order of bestness: > > - make no authentication necessary (ie no pairing) (dangerous) > > No. > - set the PIN to be a fixed PIN so that a new link key will be generated > each time (I don't know if Windows can do this either) (its not a great > solution) > > I'm not aware of this possibility. How can I make FreeBSD regenerate link key each time ? It's not an issue with Windows as it asks for PIN when pairing fails. > - hack into Windows and find the link key, store this in your hcsecd file > and all should be well. (I think there is a way to do this with Windows > but I didn't find it) > > I've no idea how to do this. And it wouldn't help in the following scenario -- I've got a guest who would like to connect to the internet via my BT sharing and once doing it she would make my FreeBSD regenerate the link key and I'm in the same situation as now (except that I cannot possibly hack link keys in Windows of my visitors). > - store the link key in the device, so that the OS does not need to know > about it. > > I've no idea how to do it and if it is possible at all. > I wrote a program that does this last for NetBSD called btkey(1) - > although it will not work directly on FreeBSD (the config file we use is > different) it should not be difficult to port it, at least enough to store > a link key into the device. > > (see cvsweb.netbsd.org .. src/usr.bin/btkey) > > regards, > iain > Cheers, Martin