Skip to contentSkip to conversation

Support for stored link keys

Bluez-devel Marcel Holtmann 6 participants 12 messages Apr 21, 2005 – Apr 29, 2005 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

Hi Folks,

the new support for storing the link keys in an ASCII base format under /var/lib/bluetooth is now part of the bluez-utils-2.16 release and I am now thinking of adding support for stored link keys. This would be very useful for people in multi-boot environments, I think.

However there are some other things first, that should be addressed. The path for /var/lib/bluetooth is hardcoded into hcid/storage.c at the moment and that is a bad think. I actually forgot to think about that problem before I released it.

In the long term there will be config options for the embedded guys to fully override all storage parameters, but that is future talk. What I wanna do now is use ${localstatedir} to define the storage place at compilation time. This means you can add --localstatedir=/var to your configure command. Do you think that is the right way? Another thing is if we should use /var/lib64/bluetooth on 64-bit platforms? What is the deal for the /var directory on these architectures?

Now back to the stored link keys issue. I think about adding a "key" option to hciconfig which allows you to list all link keys and also to move specific ones (specified by a BD_ADDR) for storage on the chip. The question is what should we do with the link key in the linkkeys storage file? Keep it or delete it afterwards?

I also wanna let hcid retrieve all stored link keys when a new device is plugged in or configured. Should we then store these keys in the linkkeys file or cache them only in memory? What we get from link key notify is obvious a valid key, but the stored ones could be wrong. On the other side you can also put invalid keys in the linkkeys file very easy.

Please post your thoughts.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

Hello Marcel,

I use at least 3 dongles and so I implemented profiles for each one, simmilar to alternatives, so each profile has a directory in /etc/bluetooth/profiles and script softlinks files to /etc/bluetooth and this solved my issues, when connecting with different dongles, but it did not solve issues regarding linkkeys in windows.

Your idea is great, would love to see it, and I would store all linkkeys which device ever created, if it is possible to add them later on chip. But I think this would not solve my problem with multiple dongles, as I would still need to use profiles, as each dongle would still need it's own list, right?

Do you have any other sollution to this, or what do you think of inclusion of profiles for each device? Do you know how widcomm stack store linkkeys, in registry? Would it be possible to use same linkkey in both OSes?

take care,
mitja

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

author maintainer
#2 lore raw

Hi Mitja,

Quoted 5 lines

I use at least 3 dongles and so I implemented profiles for each one, simmilar to alternatives, so each profile has a directory in /etc/bluetooth/profiles and script softlinks files to /etc/bluetooth and this solved my issues, when connecting with different dongles, but it did not solve issues regarding linkkeys in windows.

I don't know for what this is needed. The current hcid stores the link keys now under /var/lib/bluetooth and it uses a subdirectory with the text representation of the BD_ADDR to differ between adapters.

However even the previous hcid was able to store link keys for different dongles and you can also use profiling inside the hcid.conf. For example I use something like this to name all my development dongles.

	device 00:02:xx:xx:xx:xx {
	        name "Casira BC4";
	}

	device 00:0B:xx:xx:xx:xx {
	        name "3Com USB dongle";
	}
Quoted 5 lines

Your idea is great, would love to see it, and I would store all linkkeys which device ever created, if it is possible to add them later on chip. But I think this would not solve my problem with multiple dongles, as I would still need to use profiles, as each dongle would still need it's own list, right?

There is no problem or I don't understand what you mean. However the space for stored link keys on the chip is limited. I think that max for CSR based chips is 20.

Quoted 4 lines

Do you have any other sollution to this, or what do you think of inclusion of profiles for each device? Do you know how widcomm stack store linkkeys, in registry? Would it be possible to use same linkkey in both OSes?

The Widcomm stack stores it somewhere in the Registry and actually I like to see a program that can read these keys from the Registry if the Windows root partition is mounted. Anyone?

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw

Hello Marcel,

Quoted 7 lines
	device 00:02:xx:xx:xx:xx {
	        name "Casira BC4";
	}

	device 00:0B:xx:xx:xx:xx {
	        name "3Com USB dongle";
	}

Did not know that. Now I can ditch profiles and use hcid way :) Well only problem I can see now is: for example with first dongle I create connection to access point and store linkkey, and then I do the same with second dongle, wouldn't that overwrite the first linkkey, as target would have the same bdaddr?

Quoted 3 lines

The Widcomm stack stores it somewhere in the Registry and actually I like to see a program that can read these keys from the Registry if the Windows root partition is mounted. Anyone?

This would be cool :)

take care and have a nice day,
mitja

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#9 lore raw
In reply to Marcel Holtmann

Hello again,

Quoted 3 lines

I don't know for what this is needed. The current hcid stores the link keys now under /var/lib/bluetooth and it uses a subdirectory with the text representation of the BD_ADDR to differ between adapters.

Dissregard the previous question :) I will install 2.16 and shut up for now :) I see that each device has its own subdirectory.

thanks and regards,
mitja

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

author maintainer
#4 lore raw
In reply to Mitja Pufic

Hi Mitja,

Quoted 8 lines
Quoted 7 lines
	device 00:02:xx:xx:xx:xx {
	        name "Casira BC4";
	}

	device 00:0B:xx:xx:xx:xx {
	        name "3Com USB dongle";
	}
Quoted 5 lines

Did not know that. Now I can ditch profiles and use hcid way :) Well only problem I can see now is: for example with first dongle I create connection to access point and store linkkey, and then I do the same with second dongle, wouldn't that overwrite the first linkkey, as target would have the same bdaddr?

starting with 2.16 we use sub-directories, but the previous versions stored the link keys with source and destination BD_ADDR.

Quoted 5 lines
Quoted 3 lines

The Widcomm stack stores it somewhere in the Registry and actually I like to see a program that can read these keys from the Registry if the Windows root partition is mounted. Anyone?

This would be cool :)

Exists any tool or library that allows to read the Windows registry directly from Linux if the filesystem is mounted?

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw

Marcel Holtmann <[email protected]> writes:

[...]

Quoted 2 lines

Exists any tool or library that allows to read the Windows registry directly from Linux if the filesystem is mounted?

If anybody has this working, it's the WINE folks. That would be the place to ask.

---ScottG.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw

Moin,

Am Fri, 22 Apr 2005 18:26:48 -0400 schrieb Scott W Gifford:

Quoted 9 lines

Marcel Holtmann <[email protected]> writes:

[...]

Quoted 2 lines

Exists any tool or library that allows to read the Windows registry directly from Linux if the filesystem is mounted?

If anybody has this working, it's the WINE folks. That would be the place to ask.

Actually a quick google turns up two sets of code: editreg from samba for the newer windows systems (as used by kregedit, for example) and a perl hack called readreg95 for windows 95, 98 and millennium edition.

Signature · 4 lines
Henryk Plötz
Grüße aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~
author maintainer
#7 lore raw

Hi Henryk,

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

Exists any tool or library that allows to read the Windows registry directly from Linux if the filesystem is mounted?

If anybody has this working, it's the WINE folks. That would be the place to ask.

Actually a quick google turns up two sets of code: editreg from samba for the newer windows systems (as used by kregedit, for example) and a perl hack called readreg95 for windows 95, 98 and millennium edition.

they write something about a regedit library. It would be cool to have a tool that can read/write link keys from the Widcomm and the XP Bluetooth stack. Anyone volunteering for this job?

Regards

Marcel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#8 lore raw
In reply to Marcel Holtmann
Quoted 8 lines · Marcel Holtmann
Quoted 5 lines
Quoted 3 lines

The Widcomm stack stores it somewhere in the Registry and actually I like to see a program that can read these keys from the Registry if the Windows root partition is mounted. Anyone?

This would be cool :)

Exists any tool or library that allows to read the Windows registry directly from Linux if the filesystem is mounted?

What I tried a while ago was to export BlueZ link keys to reuse them with Microsoft's bluetooth stack. The idea was to write a .inf-file under Linux, which can later be applied under windows to put the link key into the registry. IIRC it was basically working, but I didn't include into the KDE link key manager so far, because I had to change permission of some keys and I didn't know how to do that in an inf file.
The same approach should work for the Widcomm stack, too. It's not fully automatic, but it would be flexible and safe.
It should also be easy to write a small windows tool to extract the contents of the windows bluetooth stack to use it with BlueZ. Extracting it directly under Linux would be more efficient, but I don't think it's worth the effort. It won't hurt much if windows had to be started to transfer link keys. It's meant for Windows/Linux dual boot users anyway.

Fred

Signature · 13 lines
Fred Schaettgen
[email protected]


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
#10 lore raw
In reply to Marcel Holtmann
Quoted 3 lines · Marcel Holtmann

Another thing is if we should use /var/lib64/bluetooth on 64-bit platforms? What is the deal for the /var directory on these architectures?

Only arch-specific binary stuff which is 64-bit should go in lib64. Since none of that should be in /var anyway, I think there is no /var/lib64.

Signature · 14 lines
dwmw2




-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
author maintainer
#11 lore raw

Hi David,

Quoted 7 lines
Quoted 3 lines

Another thing is if we should use /var/lib64/bluetooth on 64-bit platforms? What is the deal for the /var directory on these architectures?

Only arch-specific binary stuff which is 64-bit should go in lib64. Since none of that should be in /var anyway, I think there is no /var/lib64.

so using /var/lib/bluetooth or ${localstatedir}/lib/bluetooth is okay for storing the link keys and other information?

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel