Mobile Multimedia Lab



P2PWNC: Peer-to-peer Wireless Network Confederation RI - Documentation




In this section, the process of porting the latest OpenSSL version to the Linksys WRT54GS router platform is described. In order to provide support for Elliptic Curve Cryptography, version 0.9.8 is needed.

For the following, we assume that the user has downloaded the latest version of the source distribution of the Linksys WRT54GS firmware from Linksys FTP site and extracted it to srcpath

The process of porting OpenSSL 0.9.8 to the router's firmware is summarized in the following steps:

  • Download the latest OpenSSL version (currently 0.9.8) from http://www.openssl.org.

  • Replace the [srcpath]/release/src/router/openssl directory with the OpenSSL 0.9.8 version. Note that the name of the directory should be openssl.

  • Go to [srcpath]/release/src/router/openssl and configure so that eventually, the Makefile will have the following values for CC, LD and CFLAG:

    CC= mipsel-uclibc-gcc
    LD=mipsel-uclibc-ld
    CFLAG= -DOPENSSL_THREADS -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -mcpu=r6000 -mips2


    A simple way to achieve this is to configure OpenSSL with the following command:

    ./Configure linux-mipsel:mipsel-linux-gcc shared


    and then hand-edit the appropriate values inside the Makefile

    Also, after configuring, add the following target at the end of the Makefile, so that it will build shared libraries (libssl and libcrypto):

    shared-library:
    $(LD) -shared -o libcrypto.so $(shell find crypto -iname "*.o") $(shell find engines -iname "*.o")
    $(LD) -shared -o libssl.so $(shell find ssl -iname "*.o")

    This is necessary in order for the shared libs (libssl.so, libcrypto.so) to be built. Also, since a new target has been added, it should also be placed next to the "make all" target:

    all: Makefile.ssl build_all openssl.pc shared-library