The Android Open Source Project | 656d9c7 | 2009-03-03 19:30:25 -0800 | [diff] [blame^] | 1 | Version Information |
| 2 | --- |
| 3 | |
| 4 | The code in this directory is based on 0.9.8h with patches from |
| 5 | http://openssl.org/news/secadv_20090107.txt. |
| 6 | |
| 7 | |
| 8 | Porting New Versions of OpenSSL |
| 9 | --- |
| 10 | |
| 11 | The following steps are recommended for porting new OpenSSL versions. |
| 12 | |
| 13 | |
| 14 | a) Run "./Configure linux-generic32 no-idea no-bf no-cast no-seed -DL_ENDIAN" |
| 15 | in the openssl distribution directory. |
| 16 | |
| 17 | (Ignore when the Configure scripts asks you to run "make depend".) |
| 18 | |
| 19 | |
| 20 | b) Create an updated android-config.mk file by looking at CFLAG and DEPFLAG in |
| 21 | the Makefile resulting from step a. Make sure to add all the -D flags to |
| 22 | LOCAL_CFLAGS, except -DTERMIO; include -DOPENSSL_NO_HW in addition to these. |
| 23 | |
| 24 | (New OpenSSL releases may include additional code meant to be disabled by |
| 25 | default, so it's important not to miss any -DOPENSSL_NO_foo. |
| 26 | Usually these should be replicated in crypto/opensslconf.h, but let's not |
| 27 | take a chance.) |
| 28 | |
| 29 | |
| 30 | c) Copy the new LICENSE file from OpenSSL distribution as NOTICE. |
| 31 | Create an empty MODULE_LICENSE_BSD_LIKE file. |
| 32 | |
| 33 | |
| 34 | d) You may delete the following directories along with their contents, |
| 35 | since we won't use these (any more): |
| 36 | |
| 37 | MacOS Netware VMS apps/demoCA apps/set bugs certs crypto/bf crypto/cast \ |
| 38 | crypto/cms crypto/idea crypto/rc5 crypto/seed demos doc engines ms os2 \ |
| 39 | perl shlib test times tools util |
| 40 | |
| 41 | Also you may delete the following files: |
| 42 | |
| 43 | CHANGES CHANGES.SSLeay ChangeLog.0_9_7-stable_not-in-head \ |
| 44 | ChangeLog.0_9_7-stable_not-in-head_FIPS Configure FAQ INSTALL \ |
| 45 | INSTALL.DJGPP INSTALL.MacOS INSTALL.NW INSTALL.OS2 INSTALL.VMS \ |
| 46 | INSTALL.W32 INSTALL.W64 INSTALL.WCE LICENSE Makefile Makefile.bak \ |
| 47 | Makefile.org Makefile.shared NEWS PROBLEMS README README.ASN1 \ |
| 48 | README.ENGINE apps/CA.pl.bak config crypto/opensslconf.h.bak \ |
| 49 | install.com makevms.com openssl.doxy openssl.spec |
| 50 | |
| 51 | |
| 52 | e) Go to include/openssl. There's a bunch of symlinks here. Since symlinks |
| 53 | can be a special case for version control, replace them by regular files: |
| 54 | |
| 55 | for l in *.h; do cp $l copy_$l; rm $l; mv copy_$l $l; done |
| 56 | |
| 57 | Some symlinks will remain, pointing to files that don't exit |
| 58 | (you deleted those in step d). Delete the symlinks. |
| 59 | |
| 60 | |
| 61 | f) Create Android.mk files based on those you find in the previous OpenSSL port: |
| 62 | |
| 63 | Android.mk |
| 64 | |
| 65 | apps/Android.mk |
| 66 | crypto/Android.mk |
| 67 | ssl/Android.mk |
| 68 | |
| 69 | For the latter three, merge in any substantial changes between the |
| 70 | corresponding Makefiles in the OpenSSL distribution (apps/Makefile, |
| 71 | crypto/Makefile, crypto/*/Makefile, ssl/Makefile). |
| 72 | Don't forget to update the directory name for OpenSSL in these files |
| 73 | and whereever else it is used. |
| 74 | |
| 75 | |
| 76 | g) Apply the patch found at the end of this file. |
| 77 | |
| 78 | |
| 79 | h) Finally, create an updated version of this file (README.android)! |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | Patch for apps directory: |
| 85 | |
| 86 | --- openssl-0.9.8h-ORIG/apps/progs.h |
| 87 | +++ openssl-0.9.8h/apps/progs.h |
| 88 | @@ -22,7 +22,9 @@ |
| 89 | extern int x509_main(int argc,char *argv[]); |
| 90 | extern int genrsa_main(int argc,char *argv[]); |
| 91 | extern int gendsa_main(int argc,char *argv[]); |
| 92 | +#if 0 /* ANDROID */ |
| 93 | extern int s_server_main(int argc,char *argv[]); |
| 94 | +#endif |
| 95 | extern int s_client_main(int argc,char *argv[]); |
| 96 | extern int speed_main(int argc,char *argv[]); |
| 97 | extern int s_time_main(int argc,char *argv[]); |
| 98 | @@ -97,7 +99,9 @@ |
| 99 | {FUNC_TYPE_GENERAL,"gendsa",gendsa_main}, |
| 100 | #endif |
| 101 | #if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) |
| 102 | - {FUNC_TYPE_GENERAL,"s_server",s_server_main}, |
| 103 | +#if 0 /* ANDROID */ |
| 104 | + {FUNC_TYPE_GENERAL,"s_server",s_server_main}, |
| 105 | +#endif |
| 106 | #endif |
| 107 | #if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) |
| 108 | {FUNC_TYPE_GENERAL,"s_client",s_client_main}, |
| 109 | diff -ur openssl-0.9.8h-ORIG/apps/speed.c openssl-0.9.8h/apps/speed.c |
| 110 | --- openssl-0.9.8h-ORIG/apps/speed.c |
| 111 | +++ openssl-0.9.8h/apps/speed.c |
| 112 | @@ -108,12 +108,12 @@ |
| 113 | #include <signal.h> |
| 114 | #endif |
| 115 | |
| 116 | -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX) |
| 117 | +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX) || defined(HAVE_ANDROID_OS) |
| 118 | # define USE_TOD |
| 119 | #elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) |
| 120 | # define TIMES |
| 121 | #endif |
| 122 | -#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) /* FIXME */ |
| 123 | +#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) && !defined(HAVE_ANDROID_OS) /* FIXME */ |
| 124 | # define TIMEB |
| 125 | #endif |
| 126 | |
| 127 | @@ -1836,6 +1836,7 @@ |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | +#if 0 /* ANDROID */ |
| 132 | if (doit[D_IGE_128_AES]) |
| 133 | { |
| 134 | for (j=0; j<SIZE_NUM; j++) |
| 135 | @@ -1879,6 +1880,7 @@ |
| 136 | } |
| 137 | } |
| 138 | #endif |
| 139 | +#endif |
| 140 | #ifndef OPENSSL_NO_CAMELLIA |
| 141 | if (doit[D_CBC_128_CML]) |
| 142 | { |