Monday, November 16, 2009

Adventures in the Nokia 770

Here is a quick write-up of what I just did.
Pulled a WPA-PSK hex hash off of a wirelessly connected computer via WZCOOK (from the aircrack-ng program suite)
Converted said hash to an ascii key in order to use on the Nokia 770.
--Source, nice batch converter
Used gconf-editor to manually set the key on the Nokia 770
Source below--Take note, bug mentioned  at the very end doesnt exist on the Nokia 770, so don't do the strange thing he reccommends unless you really enjoy putting in all those numbers twice.
"
from
----
HOWTO: WPA-PSK when you only have the 64-hexit PSK, no passphrase
From Internet Tablet Talk

HOWTO for connecting an N810 via WPA-PSK when you know the 64-hexit key but not the passphrase
Some background from WikiPedia: ([1])
" Security in pre-shared key mode
Pre-shared key mode (PSK, also known as personal mode) is designed for home and small office networks that don't require the complexity of an 802.1X authentication server. Each user must enter a passphrase to access the network. The passphrase may be from 8 to 63 printable ASCII characters or 64 hexadecimal digits (256 bits).[2] If you choose to use the ASCII characters, a hash function reduces it from 504 bits (63 characters * 8 bits/character) to 256 bits (using also the SSID). The passphrase may be stored on the user's computer at their discretion under most operating systems to avoid re-entry. The passphrase must remain stored in the wireless access point."

Some chipset/Driver/UserInterface combinations understand that when one enters a string of 64 hexits (the PSK that is derived from an 8 to 63 ASCII character passphrase) it is not an ASCII string, and those drivers just put the 64 hexits into the PSK field without applying the PBKDF2(passphrase, SSID, 4096, 256) (more info here: [2]) .

However, many other chipset/driver combos, such as Linksys, the Nokia, the HP iPaq210, don't try to tell if the entry one makes when the dialog box asks "enter your pre-shared key" is the 8 to 63 character passphrase or the actual 64 hexit PSK; they expect only a passphrase, and will not accept anything longer than 63 characters. This is not so much a "bug" as it is an oversight on the part of the coders. Furthermore, they confuse the user by prompting them for a "pre-shared key", when what they really expect is the passphrase; the 8-63 character ASCII string that will be hashed into the 64-hexit PSK via PBKDF2.

If you have the 64-hexit PSK for an access point that is configured for WPA-PSK, you can use the gconf-editor tool to poke in those values. BTW, don't waste your time trying to "go backwards" from the PSK to the passphrase. This is complex. More information here: ( [3])
You might wonder " Why did he go to all this trouble? Just re-do the AP with a new passphrase and this time don't lose it?" . Good question - sadly, we already have over a thousand APs configured with this SSID and PSK, and until we roll out WCS/WiSM later this year, and then 802.1x, we are stuck with our current world. Our PSK was manually selected and was not generated with PBKDF2, so we never had a passphrase to begin with.
I was able to convert our 64-hexit PSK to 32, 8-bit decimal integers, and poke them into my n810 with gconf-editor. I did the conversion by hand with the Windows calculator, but you can probably find on-line converters for this. I first tried to use gconftool-2 to write the values, but it would not work, and kept giving errors I could not figure out. However, gconftool-2 is great for reading and printing out the various "registry" entries. The section of interest can be seen by running:

gconftool-2 -R /system/osso/connectivity/IAP

As I learned more about the tool, I realized that EAP_wpa_preshared_key was a 'value'. So, I tried this:

gconftool-2 --get /system/osso/connectivity/IAP/theParticularNetwork/EAP_wpa_preshared_key

and it printed out just the PSK value; the format looks like this:

[123,123,123, ... 123]

gconf-editor is available via the Nokia Application Manager - "browse all" available applications and pick it from the list. Seemed to install OK, no problems with dependencies. I'm running: OS2008 Version: 2.2007.51-3
The hardest part of editing EAP_wpa_preshared_key was struggling with the maddening bug in gconf-editor. The editor will allow you to see each of the 32 integer values; there is an "edit" button that when clicked, will pop-up the value in a dialog box that has little up/down buttons to change the value. But, after changing it, and hitting OK, and then OK again, it would revert to the unchanged value! Arrgh!

I finally figured out that instead of hitting the second "OK" after editing one of the integers, if I clicked on the "title bar" at the top of the editing window, and then clicked "Cancel", it would accept the edited value without reverting to the unedited integer. It does not matter if the editor is launched in user mode or with root privilege - same maddening problem.
"
--------------------------------------------------

Wednesday, November 4, 2009

Segmentation Fault

Iceweasel reported a segmentation fault after a hard reboot, wouldn't come back up even with --safemode. I do believe it had to do with enabling "allow websites to choose their own fonts" mixed with Google Reader. Not really sure, but I do know it had to do with fonts as I ran iceweasel in the terminal right after the computer rebooted and got some type of debugging related to font directories. Eventually I installed a new browser and found a forum post mentioning installing msttcorefonts to no avail, but for me, worked like a charm.

sudo apt-get install msttcorefonts

ftw. No problems so far.

Direction Change

This won't be like my other blogs, this one will actually help other people. ;) Just kidding, this will be the "Tech" section. Whenever I run into a problem and/or find a solution, I'll put it up here so that if I find the answer it will be easier to find for others with the same issue. Here we go.