blob: cc43cac50b2be6e5eedfb86151a8243df22f046c [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.
The Android Open Source Project656d9c72009-03-03 19:30:25 -08006
Nagendra Modadugue45f1062009-09-30 11:36:48 -07007Porting New Versions of OpenSSL.
8--
The Android Open Source Project656d9c72009-03-03 19:30:25 -08009
10The following steps are recommended for porting new OpenSSL versions.
11
Nagendra Modadugue45f1062009-09-30 11:36:48 -0700121) Retrieve the appropriate version of the OpenSSL source from
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080013 www.openssl.org/source (in openssl-*.tar.gz file). Check the PGP
14 signature (found in matching openssl-*.tar.gz.asc file) with:
The Android Open Source Project656d9c72009-03-03 19:30:25 -080015
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080016 gpg openssl-*.tar.gz
The Android Open Source Project656d9c72009-03-03 19:30:25 -080017
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080018 If the public key is not found, import the the one with the
19 matching RSA key ID from http://www.openssl.org/about/, using:
20
21 gpg --import # paste PGP public key block on stdin
22
232) Update the variables in openssl.config and openssl.version as appropriate.
24 At the very least you will need to update the openssl.version.
25
263) Run:
27
28 ./import_openssl.sh import openssl-*.tar.gz
Nagendra Modadugue45f1062009-09-30 11:36:48 -070029
304) If there are any errors, then modify openssl.config, openssl.version
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080031 and patches in patches/ as appropriate. You might want to use:
Nagendra Modadugue45f1062009-09-30 11:36:48 -070032
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080033 ./import_openssl.sh regenerate patches/*.patch
34
35 Repeat step 3.
36
375) Cleanup before building with:
38
39 m -j16 clean-openssl clean-libcrypto clean-libssl
40
416) Build openssl from the external/openssl directory with:
42
43 mm -j16
Nagendra Modadugue45f1062009-09-30 11:36:48 -070044
45 If there are build errors, then patches/*.mk, openssl.config, or
46 android-config.mk may need updating.
The Android Open Source Project656d9c72009-03-03 19:30:25 -080047
Brian Carlstrom98d58bb2010-03-09 09:56:55 -0800487) Run tests to make sure things are working:
49
50 (cd android.testssl/ && ./testssl.sh)
51
528) Do a full build before checking in:
53
54 m clobber && m -j16
The Android Open Source Project656d9c72009-03-03 19:30:25 -080055
Nagendra Modadugue45f1062009-09-30 11:36:48 -070056Optionally, check whether build flags (located in android-config.mk
57need to be updated. Doing this step will help ensure that the
58compiled library is appropriately optimized for speed and size. To
59update build flags:
The Android Open Source Project656d9c72009-03-03 19:30:25 -080060
Nagendra Modadugue45f1062009-09-30 11:36:48 -070061a) source openssl.config
62b) tar -zxf openssl-*.tar.gz
63c) cd openssl-*/
64d) ./Configure $CONFIGURE_ARGS
65e) examine Makefile and compare with ../android-config.mk
66f) modify ../openssl.config as appropriate and go to step 3) above.
The Android Open Source Project656d9c72009-03-03 19:30:25 -080067
Brian Carlstrom98d58bb2010-03-09 09:56:55 -080068Alternatively, ."/import_openssl.sh import" now prints the
69post-Configure Makefile for review before deleting in on import.