blob: 10368381a7056b8178bb6eb848499b9bf9f0d91e [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
41 m -j16 clean-openssl clean-libcrypto clean-libssl
42
436) Build openssl from the external/openssl directory with:
44
45 mm -j16
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 Carlstrom674ff292010-04-15 14:22:36 -070054 adb shell run-core-tests org.apache.harmony.math.tests.java.math.AllTests
55 adb shell run-core-tests tests.api.java.math.BigIntegerTest
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080056
578) Do a full build before checking in:
58
59 m clobber && m -j16
The Android Open Source Project656d9c72009-03-03 19:30:25 -080060
Nagendra Modadugue45f1062009-09-30 11:36:48 -070061Optionally, check whether build flags (located in android-config.mk
62need to be updated. Doing this step will help ensure that the
63compiled library is appropriately optimized for speed and size. To
64update build flags:
The Android Open Source Project656d9c72009-03-03 19:30:25 -080065
Nagendra Modadugue45f1062009-09-30 11:36:48 -070066a) source openssl.config
67b) tar -zxf openssl-*.tar.gz
68c) cd openssl-*/
69d) ./Configure $CONFIGURE_ARGS
70e) examine Makefile and compare with ../android-config.mk
71f) modify ../openssl.config as appropriate and go to step 3) above.
The Android Open Source Project656d9c72009-03-03 19:30:25 -080072
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080073Alternatively, ."/import_openssl.sh import" now prints the
74post-Configure Makefile for review before deleting in on import.