blob: c5081b80169dca150d37c5cf286e01a5946d27f8 [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
Brian Carlstrom6e420382010-06-15 20:32:09 -070052 # Run local openssl tests
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080053 (cd android.testssl/ && ./testssl.sh)
Brian Carlstrom6e420382010-06-15 20:32:09 -070054 # Build and sync libcore tests
55 (croot && cd libcore && mm -j16 snod && adb remount && adb sync)
56 # Run libcore tests
57 (croot && ~dalvik-prebuild/vogar/bin/vogar --classpath out/target/common/obj/JAVA_LIBRARIES/core-tests-support_intermediates/classes.jar --classpath out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/classes.jar javax.net.ssl tests.api.javax.net tests.api.java.math.BigIntegerTest org.apache.harmony.math.tests.java.math)
58 # try an https website
Brian Carlstrom925e1a42010-04-26 11:13:10 -070059 adb shell am start https://online.citibank.com # confirm result in browser
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080060
618) Do a full build before checking in:
62
63 m clobber && m -j16
The Android Open Source Project656d9c72009-03-03 19:30:25 -080064
Nagendra Modadugue45f1062009-09-30 11:36:48 -070065Optionally, check whether build flags (located in android-config.mk
66need to be updated. Doing this step will help ensure that the
67compiled library is appropriately optimized for speed and size. To
68update build flags:
The Android Open Source Project656d9c72009-03-03 19:30:25 -080069
Nagendra Modadugue45f1062009-09-30 11:36:48 -070070a) source openssl.config
71b) tar -zxf openssl-*.tar.gz
72c) cd openssl-*/
73d) ./Configure $CONFIGURE_ARGS
74e) examine Makefile and compare with ../android-config.mk
75f) modify ../openssl.config as appropriate and go to step 3) above.
The Android Open Source Project656d9c72009-03-03 19:30:25 -080076
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080077Alternatively, ."/import_openssl.sh import" now prints the
78post-Configure Makefile for review before deleting in on import.