Search code examples
androidopensslfipsandroid-ndk

Android, how to use fipsld in "ndk-build" for openssl


In order to use fips-capable openssl library (libcrypto.a in my case) on android, I need to link the built libcrypto.a in my.so (JNI code). According to openssl fips 2.0 user manual, fipsld should be used to verify and generate hmac signature. I am currently using "ndk-build" to link in libcrypto.a and generate my.so, my question is, how can I integrate fipsld in my Android.mk?

If it's tough to use Android.mk / ndk-build, I will switch to use arm-eabi-gcc to link libcrypto.a and create my.so. The gcc way to use fipsld is documented in openssl fips user manual. Can anyone provide me a link to a sample set (config / Makefile) of building .so linking .a for android.

Thanks


Solution

  • No need to use fipsld, build fips openssl shared lib using

    make fips shared --with-fipsdir=xxxxx
    

    and use ndk-build to link in the libcrypto.so.1.0.0 through symbolic link libcrypto.so.