blob: 6232aa1cea190482389047027e037ab80e98cbdb [file] [log] [blame]
Nagendra Modadugue45f1062009-09-30 11:36:48 -07001OpenSSL on the Android platform.
The Android Open Source Project656d9c72009-03-03 19:30:25 -08002---
3
Nagendra Modadugue45f1062009-09-30 11:36:48 -07004The code in this directory is based on $OPENSSL_VERSION in the file
5openssl.config, and some backported OpenSSL code in crypto/0.9.9-dev.
Brian Carlstromf2ee5ff2010-03-30 09:41:16 -07006See patches/README for more information on how the code differs from
7$OPENSSL_VERSION.
The Android Open Source Project656d9c72009-03-03 19:30:25 -08008
Nagendra Modadugue45f1062009-09-30 11:36:48 -07009Porting New Versions of OpenSSL.
10--
The Android Open Source Project656d9c72009-03-03 19:30:25 -080011
12The following steps are recommended for porting new OpenSSL versions.
13
Nagendra Modadugue45f1062009-09-30 11:36:48 -0700141) Retrieve the appropriate version of the OpenSSL source from
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080015 www.openssl.org/source (in openssl-*.tar.gz file). Check the PGP
16 signature (found in matching openssl-*.tar.gz.asc file) with:
The Android Open Source Project656d9c72009-03-03 19:30:25 -080017
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080018 gpg openssl-*.tar.gz
The Android Open Source Project656d9c72009-03-03 19:30:25 -080019
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080020 If the public key is not found, import the the one with the
21 matching RSA key ID from http://www.openssl.org/about/, using:
22
23 gpg --import # paste PGP public key block on stdin
24
252) Update the variables in openssl.config and openssl.version as appropriate.
26 At the very least you will need to update the openssl.version.
27
283) Run:
29
30 ./import_openssl.sh import openssl-*.tar.gz
Nagendra Modadugue45f1062009-09-30 11:36:48 -070031
324) If there are any errors, then modify openssl.config, openssl.version
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080033 and patches in patches/ as appropriate. You might want to use:
Nagendra Modadugue45f1062009-09-30 11:36:48 -070034
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080035 ./import_openssl.sh regenerate patches/*.patch
36
37 Repeat step 3.
38
395) Cleanup before building with:
40
Brian Carlstromad880032010-05-14 11:42:48 -070041 m -j16 clean-libcrypto clean-libssl clean-openssl clean-ssltest
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080042
436) Build openssl from the external/openssl directory with:
44
Brian Carlstromad880032010-05-14 11:42:48 -070045 mm -j16 snod && adb sync system
Nagendra Modadugue45f1062009-09-30 11:36:48 -070046
47 If there are build errors, then patches/*.mk, openssl.config, or
48 android-config.mk may need updating.
The Android Open Source Project656d9c72009-03-03 19:30:25 -080049
Brian Carlstrom98d58bb2010-03-09 09:56:55 -0800507) Run tests to make sure things are working:
51
52 (cd android.testssl/ && ./testssl.sh)
Brian Carlstrom7f9d8bc2010-04-13 15:51:25 -070053 adb shell run-core-tests tests.xnet.AllTests
Brian Carlstrome296ea52010-04-23 15:24:16 -070054 adb shell run-core-tests javax.net.ssl.AllTests
Brian Carlstrom674ff292010-04-15 14:22:36 -070055 adb shell run-core-tests org.apache.harmony.math.tests.java.math.AllTests
56 adb shell run-core-tests tests.api.java.math.BigIntegerTest
Brian Carlstrom925e1a42010-04-26 11:13:10 -070057 adb shell am start https://online.citibank.com # confirm result in browser
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080058
598) Do a full build before checking in:
60
61 m clobber && m -j16
The Android Open Source Project656d9c72009-03-03 19:30:25 -080062
Nagendra Modadugue45f1062009-09-30 11:36:48 -070063Optionally, check whether build flags (located in android-config.mk
64need to be updated. Doing this step will help ensure that the
65compiled library is appropriately optimized for speed and size. To
66update build flags:
The Android Open Source Project656d9c72009-03-03 19:30:25 -080067
Nagendra Modadugue45f1062009-09-30 11:36:48 -070068a) source openssl.config
69b) tar -zxf openssl-*.tar.gz
70c) cd openssl-*/
71d) ./Configure $CONFIGURE_ARGS
72e) examine Makefile and compare with ../android-config.mk
73f) modify ../openssl.config as appropriate and go to step 3) above.
The Android Open Source Project656d9c72009-03-03 19:30:25 -080074
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080075Alternatively, ."/import_openssl.sh import" now prints the
76post-Configure Makefile for review before deleting in on import.