Do openssl-1.0.1g has android platform support?

≯℡__Kan透↙ 提交于 2019-12-12 21:35:48

问题


Because of the heartbleed issue in some versions of OpenSSL, I need to update my OpenSSL version to openssl-1.0.1g. Does it has support for android platform? If yes, can somebody suggest me about the building procedures? I couldn't compile the source for android platform.

Any kind suggestion is highly appreciated.

Note: I will use openssl for android-ndk


回答1:


Do openssl-1.0.1g has android platform support?

Yes.

  1. Go to OpenSSL and Android and fetch setenv-android.sh
  2. Ensure ANDROID_NDK_ROOT is set
  3. Ensure ANDROID_SDK_ROOT is set
  4. Open setenv-android.sh, and ensure _ANDROID_NDK, _ANDROID_EABI and _ANDROID_API suit your taste
  5. Run the following commands (note the leading dot when running setenv-android.sh)

    $ . ./setenv-android.sh

    $ cd openssl-1.0.1g/

    $ perl -pi -e 's/install: all install_docs install_sw/install: install_docs install_sw/g' Makefile.org

    $ ./config shared -no-ssl2 -no-ssl3 -no-comp -no-hw -no-engine --openssldir=/usr/local/ssl/$ANDROID_API

    $ make all

    $ sudo -E make install CC=$ANDROID_TOOLCHAIN/arm-linux-androideabi-gcc RANLIB=$ANDROID_TOOLCHAIN/arm-linux-androideabi-ranlib

After the install, your Android OpenSSL will be located in, for example, /usr/local/ssl/android-18.


Any kind suggestion is highly appreciated.

Note: Android's Zygote is like Linux/Unix init. All processes inherit from it. The problem is, Zygote loads OpenSSL and its probably a down level version. So you will have to create a wrapper shared object that statically links to OpenSSL. Your program will call into your wrapper shared object to avoid the already-mapped-in and down level version of OpenSSL.



来源:https://stackoverflow.com/questions/23098521/do-openssl-1-0-1g-has-android-platform-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!