Today I needed to use MD5 in a C program on my BBB (running Angstrom) therefore I looked into openssl.
All seemed straight forward until I realised that my cross compiler tool chain did not include an arm version of the libssl library.
Note: Among other great tutorials, installing an ARM cross compiler chain is covered by Derek Molloy (see here).
After lots of searching, it seemed the only solution was to get hold of the openssl source and cross compile it myself.
Here’s how to do it:
tar xvxf openssl-1.0.0d.tar.gz
make CC=”arm-linux-gnueabi-gcc” AR=”arm-linux-gnueabi-ar r”
now you should have two new files called
Copy these to /usr/arm-linux/gnueabi/lib
now in Eclipse, view the project properties and under “GCC C++ Linker” section, click on “Libraries” and then in the “Libraries” display area, click on the add icon and type crypto. Once that is saved, compile the main program and all should go well.
If you want an MD5 test program, here is one:
You can run that on the bone to see the MD5 result which should be 54b0c58c7ce9f2a8b551351102ee0938
If you want to check it is right, you can do so in an ssh terminal using:
echo -n “this is a test” | md5sum