blob: 7110d3d64635c2b2cc49094650049c0d34954e27 [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 Carlstrom98d58bb2010-03-09 09:56:55 -080054
558) Do a full build before checking in:
56
57 m clobber && m -j16
The Android Open Source Project656d9c72009-03-03 19:30:25 -080058
Nagendra Modadugue45f1062009-09-30 11:36:48 -070059Optionally, check whether build flags (located in android-config.mk
60need to be updated. Doing this step will help ensure that the
61compiled library is appropriately optimized for speed and size. To
62update build flags:
The Android Open Source Project656d9c72009-03-03 19:30:25 -080063
Nagendra Modadugue45f1062009-09-30 11:36:48 -070064a) source openssl.config
65b) tar -zxf openssl-*.tar.gz
66c) cd openssl-*/
67d) ./Configure $CONFIGURE_ARGS
68e) examine Makefile and compare with ../android-config.mk
69f) modify ../openssl.config as appropriate and go to step 3) above.
The Android Open Source Project656d9c72009-03-03 19:30:25 -080070
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080071Alternatively, ."/import_openssl.sh import" now prints the
72post-Configure Makefile for review before deleting in on import.