17/03/2013

OpenSSH key, Amazon EC2 RSA, Android and dropbear (from Terminal IDE)

Here is the thing: I have quite complicated SSH key (uses AES-128-CBC) and while there are posts about converting the openssh key to dropbear format, they fail to mention that the openssh key needs to be in some PEM (or more streamline) format. That might seam easy, but when you try to convert using the common example, you might end up getting an error like this:
/usr/lib/dropbear/dropbearconvert openssh dropbear ~/.ssh/id_rsa /tmp/id_rsa.db
Error: Ciphers other than DES-EDE3-CBC not supported
Error reading key from '~/.ssh/id_rsa'
That happens especially if you have keys generate by the Amazon Web Services, or EC2. Those generally look like this:
head -3 ~/.ssh/id_rsa_amazon_ec2
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,1234567890ABCSFTDHIJKLMNOPQRSTUV

Now, that sucks! And google-ing didn't get me very far. So, if you have no idea what to make from that error, well, fear not, as there is a simple solution, coming from openssl. You will need to convert your key to PEM and then, use the dropbearconvert tool like this:
openssl rsa -in ~/.ssh/id_rsa -outform pem > ~/.ssh/id_rsa.pem
You will need to enter your pass phrase if using one:
Enter pass phrase for id_rsa:
writing RSA key

At this point, technically, that key is the same but you have removed the passphrase (you could do the same by using ssh-keygen -p -f ~/.ssh/id_rsa, but then, you will have to put it back).

And now, using the converter on the PEM:
/usr/lib/dropbear/dropbearconvert openssh dropbear ~/.ssh/id_rsa.pem ~/.ssh/id_rsa.db

And you will get your key:
Key is a RSA key
Wrote key to '~/.ssh/id_rsa.db'

Hope this helps someone like me that uses the Amazon generated SSH keys and needs them in the Android side (by the way, I needed it for use with Terminal IDE ssh, which I love)... NOTE: You should remove that file from your system as it is password-less. This could allow someone to use it without knowing your pass phrase!

30/04/2012

N9 and N950: Harmattan way, or how to get your deb package out of the store.nokia.com...

Well, if you had problems like I did with installing some applications from the https://store.nokia.com, here is the very simple recipe how to get around the problem.

But first, a brief introduction into the whys. I wanted to install an application that I saw demonstrated by a friend. When I tried installing it from the Store, it failed with an error about not being able to download. I was puzzled for a long time, filled a bug, waited some time until I thought to give it a try and install it in the old fashion way: manually. So, I fired up a console, find out a way to get the debian packge and then install it.

This entry is how to get the debian package file out. For that, you need the console (terminal) and hence you need the device to have the developer mode enabled.

In the console, you just need to do this:
/usr/bin/osa --get packagename > packagename_versioin_armel.deb

Hope this helps some folks out there searching for answers, and those that still don't have one, go buy it while you can!

30/12/2011

MOSLO, a short story of how is it cooked

Well, MOSLO has been OUT for some time now, and I was thinking it might be time for me to explain more about it!

First, for those not knowing it yet, it is available here: http://wiki.meego.com/ARM/N950. The MOSLO was done to support multiple OS loading on the N9/N950 devices from Nokia.

The basic "architecture" or flow is this:
  1. Bootloader launches the kernel
  2. The kernel boots from rootfs
  3. Rootfs contains the scripts to either:
    1. export USB to the Host PC so that the developer can put another kernel (in the boot/bzImage) and rootfs or
    2. load the boot/bzImage from the "exported USB" image if there is such kernel
Another thing about MOSLO is how to install it. Here we need to understand a bit about the role of the Harmattan flashing architecture. The design is to load into the device the right software that will do the work of flashing MOSLO. For that, we can use any Harmattan image (or "fiasco.bin") that is released with the One Click Flasher (or OCF).

Once we have the right image loaded, we can send the MOSLO to be flashed. As such, MOSLO comes packaged for N950 or N9.