summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2011-02-22 15:12:44 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2011-02-28 13:19:06 +0100
commit1f91451a6735d3e3aa084d8519c2549a812425f0 (patch)
tree4ded930e30d08bfb95608c884ab5ca49b428edbb
parenta47e978e5dfde971331f4ba8716001b5fcf6b99c (diff)
downloadptxdist-1f91451a6735d3e3aa084d8519c2549a812425f0.tar.gz
ptxdist-1f91451a6735d3e3aa084d8519c2549a812425f0.tar.xz
openssl: version bump 0.9.8l -> 1.0.0d
Based on a patch from George McCollister <george.mccollister@gmail.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--patches/openssl-0.9.8l/0001-debian-patches.patch949
-rw-r--r--patches/openssl-0.9.8l/0002-Configure-let-environment-override-RANLIB-and-AR.patch51
-rw-r--r--patches/openssl-0.9.8l/series2
-rw-r--r--patches/openssl-1.0.0d/0001-debian-ca.patch34
-rw-r--r--patches/openssl-1.0.0d/0002-debian-config-hurd.patch29
-rw-r--r--patches/openssl-1.0.0d/0003-debian-debian-targets.patch66
-rw-r--r--patches/openssl-1.0.0d/0004-debian-engines-path.patch95
-rw-r--r--patches/openssl-1.0.0d/0005-debian-kfreebsd-pipe.patch27
-rw-r--r--patches/openssl-1.0.0d/0006-debian-make-targets.patch27
-rw-r--r--patches/openssl-1.0.0d/0007-debian-man-dir.patch27
-rw-r--r--patches/openssl-1.0.0d/0008-debian-man-section.patch46
-rw-r--r--patches/openssl-1.0.0d/0009-debian-no-rpath.patch27
-rw-r--r--patches/openssl-1.0.0d/0010-debian-no-symbolic.patch27
-rw-r--r--patches/openssl-1.0.0d/0011-debian-pic.patch263
-rw-r--r--patches/openssl-1.0.0d/0012-debian-pkg-config.patch48
-rw-r--r--patches/openssl-1.0.0d/0013-debian-valgrind.patch34
-rw-r--r--patches/openssl-1.0.0d/0014-debian-rehash-crt.patch47
-rw-r--r--patches/openssl-1.0.0d/0015-debian-rehash_pod.patch76
-rw-r--r--patches/openssl-1.0.0d/0016-debian-shared-lib-ext.patch28
-rw-r--r--patches/openssl-1.0.0d/0017-debian-stddef.patch26
-rw-r--r--patches/openssl-1.0.0d/0018-debian-version-script.patch53
-rw-r--r--patches/openssl-1.0.0d/0019-debian-gnu_source.patch31
-rw-r--r--patches/openssl-1.0.0d/series19
-rw-r--r--rules/openssl.make2
24 files changed, 1031 insertions, 1003 deletions
diff --git a/patches/openssl-0.9.8l/0001-debian-patches.patch b/patches/openssl-0.9.8l/0001-debian-patches.patch
deleted file mode 100644
index c58b42bb5..000000000
--- a/patches/openssl-0.9.8l/0001-debian-patches.patch
+++ /dev/null
@@ -1,949 +0,0 @@
-From fdcc9b48069aefd58aaefa631450a28e12a201af Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Fri, 3 Jul 2009 21:43:18 +0200
-Subject: [PATCH 1/2] debian patches
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Configure | 52 +++++++++++++++++++++++++++++++++++++--
- Makefile.org | 22 ++++++++++-------
- Makefile.shared | 4 +-
- apps/CA.pl | 2 +
- apps/CA.pl.in | 2 +
- apps/CA.sh | 1 +
- apps/s_time.c | 1 +
- config | 4 +-
- crypto/Makefile | 4 +-
- crypto/aes/Makefile | 2 +-
- crypto/aes/asm/aes-586.pl | 13 +++++++--
- crypto/aes/asm/aes-x86_64.pl | 4 +++
- crypto/des/asm/desboth.pl | 17 ++++++++++--
- crypto/md5/Makefile | 3 +-
- crypto/perlasm/cbc.pl | 24 +++++++++++++++---
- crypto/perlasm/x86_64-xlate.pl | 4 +-
- crypto/perlasm/x86unix.pl | 33 +++++++++++++++++++++++++
- crypto/pkcs7/pk7_mime.c | 2 +-
- crypto/pqueue/pqueue.c | 14 ++++++++++
- crypto/pqueue/pqueue.h | 1 +
- crypto/rand/md_rand.c | 2 +
- crypto/rc4/Makefile | 2 +-
- crypto/rc4/asm/rc4-x86_64.pl | 8 ++++++
- crypto/sha/sha.h | 1 +
- crypto/x86_64cpuid.pl | 4 +++
- engines/Makefile | 6 ++--
- ssl/d1_both.c | 45 +++++++++++++++++++++-------------
- ssl/d1_pkt.c | 4 +++
- ssl/t1_lib.c | 8 ++++++
- tools/c_rehash | 14 +++++++---
- tools/c_rehash.in | 12 +++++++--
- 31 files changed, 254 insertions(+), 61 deletions(-)
-
-diff --git a/Configure b/Configure
-index c6dbfae..0fe11a5 100755
---- a/Configure
-+++ b/Configure
-@@ -128,6 +128,9 @@ my $x86_coff_asm="x86cpuid-cof.o:bn86-cof.o co86-cof.o MAYBE-MO86-cof.o:dx86-cof
- my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o MAYBE-MO86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o rc4_skey.o:rm86-out.o:r586-out.o";
-
- my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o::";
-+# rc4 asm is disabled on amd64 because we configured it with RC4_CHAR while
-+# the assembler only works with int
-+my $x86_64_asm_linux="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::::";
- my $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o::";
-
- my $no_asm="::::::::::";
-@@ -320,6 +323,48 @@ my %table=(
- "osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared:::.so",
- "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared::-msym:.so",
-
-+# Debian GNU/* (various architectures)
-+"debian-alpha","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-alpha-ev4","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev4 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-alpha-ev5","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev5 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-arm","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-armeb","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-armel","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+#"debian-amd64","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-amd64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm_linux}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-avr32", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG_BF_PTR::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+#"debian-freebsd-alpha","gcc:-DTERMIOS -O -Wa,--noexecstack -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC2::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-hppa","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-hurd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mtune=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-ia64","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK RC4_CHAR:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+#"debian-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::dlfcn:linux-shared:-fPIC",
-+"debian-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-i386-i486","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i486 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-i386-i586","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i586 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-i386-i686/cmov","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i686 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-m68k","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-netbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-netbsd-m68k", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-netbsd-sparc", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mv8 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-openbsd-alpha","gcc:-DTERMIOS -O3 -Wa,--noexecstack -g::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-openbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-openbsd-mips","gcc:-O2 -Wa,--noexecstack -g -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:::::::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-powerpc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_UNROLL DES_RISC2 DES_PTR MD2_CHAR RC4_INDEX::linux_ppc32.o::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-ppc64","gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-s390","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-sh3", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-sh4", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-sh3eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-sh4eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-m32r","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-sparc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-sparc-v8","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -mcpu=v8 -g -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-sparc-v9","gcc:-DB_ENDIAN -DTERMIO -O3 -mcpu=v9 -Wa,--noexecstack -Wa,-Av8plus -g -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+
- ####
- #### Variety of LINUX:-)
- ####
-@@ -488,7 +533,7 @@ my %table=(
- # Cygwin
- "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
- "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_coff_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
--"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
-+-"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
-
- # NetWare from David Ward (dsward@novell.com)
- # requires either MetroWerks NLM development tools, or gcc / nlmconv
-@@ -1523,7 +1568,8 @@ while (<IN>)
- elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
- {
- my $sotmp = $1;
-- s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
-+# s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
-+ s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/;
- }
- elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/)
- {
-@@ -1645,7 +1691,7 @@ while (<IN>)
- if (/^#define\s+OPENSSLDIR/)
- { print OUT "#define OPENSSLDIR \"$openssldir\"\n"; }
- elsif (/^#define\s+ENGINESDIR/)
-- { print OUT "#define ENGINESDIR \"$prefix/lib/engines\"\n"; }
-+ { print OUT "#define ENGINESDIR \"$prefix/lib/ssl/engines\"\n"; }
- elsif (/^#((define)|(undef))\s+OPENSSL_EXPORT_VAR_AS_FUNCTION/)
- { printf OUT "#undef OPENSSL_EXPORT_VAR_AS_FUNCTION\n"
- if $export_var_as_fn;
-diff --git a/Makefile.org b/Makefile.org
-index d1b56b2..f84a876 100644
---- a/Makefile.org
-+++ b/Makefile.org
-@@ -131,7 +131,7 @@ FIPSCANLIB=
-
- BASEADDR=
-
--DIRS= crypto fips ssl engines apps test tools
-+DIRS= crypto fips ssl engines apps tools
- SHLIBDIRS= crypto ssl fips
-
- # dirs in crypto to build
-@@ -152,10 +152,11 @@ TESTS = alltests
-
- MAKEFILE= Makefile
-
--MANDIR=$(OPENSSLDIR)/man
-+MANDIR=/usr/share/man
- MAN1=1
- MAN3=3
--MANSUFFIX=
-+MANSUFFIX=ssl
-+MANSECTION=SSL
- SHELL=/bin/sh
-
- TOP= .
-@@ -443,7 +444,8 @@ libcrypto.pc: Makefile
- echo 'Description: OpenSSL cryptography library'; \
- echo 'Version: '$(VERSION); \
- echo 'Requires: '; \
-- echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
-+ echo 'Libs: -L$${libdir} -lcrypto'; \
-+ echo 'Libs.private: $(EX_LIBS)'; \
- echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
-
- libssl.pc: Makefile
-@@ -456,7 +458,8 @@ libssl.pc: Makefile
- echo 'Description: Secure Sockets Layer and cryptography libraries'; \
- echo 'Version: '$(VERSION); \
- echo 'Requires: '; \
-- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
-+ echo 'Libs: -L$${libdir} -lssl'; \
-+ echo 'Libs.private: -lcrypto $(EX_LIBS)'; \
- echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
-
- openssl.pc: Makefile
-@@ -469,7 +472,8 @@ openssl.pc: Makefile
- echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
- echo 'Version: '$(VERSION); \
- echo 'Requires: '; \
-- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
-+ echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
-+ echo 'Libs.private: $(EX_LIBS)'; \
- echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
-
- Makefile: Makefile.org Configure config
-@@ -616,7 +620,7 @@ install: all install_docs install_sw
- install_sw:
- @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
- $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
-- $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \
-+ $(INSTALL_PREFIX)$(INSTALLTOP)/lib/ssl/engines \
- $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
- $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
- $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
-@@ -694,7 +698,7 @@ install_docs:
- echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
- (cd `$(PERL) util/dirname.pl $$i`; \
- sh -c "$$pod2man \
-- --section=$$sec --center=OpenSSL \
-+ --section=$${sec}$(MANSECTION) --center=OpenSSL \
- --release=$(VERSION) `basename $$i`") \
- > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
- $(PERL) util/extract-names.pl < $$i | \
-@@ -711,7 +715,7 @@ install_docs:
- echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
- (cd `$(PERL) util/dirname.pl $$i`; \
- sh -c "$$pod2man \
-- --section=$$sec --center=OpenSSL \
-+ --section=$${sec}$(MANSECTION) --center=OpenSSL \
- --release=$(VERSION) `basename $$i`") \
- > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
- $(PERL) util/extract-names.pl < $$i | \
-diff --git a/Makefile.shared b/Makefile.shared
-index 3183436..48e2710 100644
---- a/Makefile.shared
-+++ b/Makefile.shared
-@@ -149,9 +149,9 @@ DO_GNU_SO=$(CALC_VERSIONS); \
- SHLIB_SUFFIX=; \
- ALLSYMSFLAGS='-Wl,--whole-archive'; \
- NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
-- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
-+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
-
--DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
-+DO_GNU_APP=LDFLAGS="$(CFLAGS)"
-
- #This is rather special. It's a special target with which one can link
- #applications without bothering with any features that have anything to
-diff --git a/apps/CA.pl b/apps/CA.pl
-index a3965ec..afd5c7c 100644
---- a/apps/CA.pl
-+++ b/apps/CA.pl
-@@ -65,6 +65,7 @@ $RET = 0;
- foreach (@ARGV) {
- if ( /^(-\?|-h|-help)$/ ) {
- print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
-+ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
- exit 0;
- } elsif (/^-newcert$/) {
- # create a certificate
-@@ -165,6 +166,7 @@ foreach (@ARGV) {
- } else {
- print STDERR "Unknown arg $_\n";
- print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
-+ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
- exit 1;
- }
- }
-diff --git a/apps/CA.pl.in b/apps/CA.pl.in
-index c783a6e..fa665b7 100644
---- a/apps/CA.pl.in
-+++ b/apps/CA.pl.in
-@@ -65,6 +65,7 @@ $RET = 0;
- foreach (@ARGV) {
- if ( /^(-\?|-h|-help)$/ ) {
- print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
-+ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
- exit 0;
- } elsif (/^-newcert$/) {
- # create a certificate
-@@ -165,6 +166,7 @@ foreach (@ARGV) {
- } else {
- print STDERR "Unknown arg $_\n";
- print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
-+ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
- exit 1;
- }
- }
-diff --git a/apps/CA.sh b/apps/CA.sh
-index a0b20d8..670d2dd 100644
---- a/apps/CA.sh
-+++ b/apps/CA.sh
-@@ -91,6 +91,7 @@ case $i in
- -out ${CATOP}/$CAREQ
- $CA -out ${CATOP}/$CACERT $CADAYS -batch \
- -keyfile ${CATOP}/private/$CAKEY -selfsign \
-+ -extensions v3_ca \
- -infiles ${CATOP}/$CAREQ
- RET=$?
- fi
-diff --git a/apps/s_time.c b/apps/s_time.c
-index 904945e..6fbb822 100644
---- a/apps/s_time.c
-+++ b/apps/s_time.c
-@@ -117,6 +117,7 @@
-
- /* The following if from times(3) man page. It may need to be changed
- */
-+#undef HZ
- #ifndef HZ
- # ifdef _SC_CLK_TCK
- # define HZ ((double)sysconf(_SC_CLK_TCK))
-diff --git a/config b/config
-index 68e7ea1..980c6a9 100755
---- a/config
-+++ b/config
-@@ -162,8 +162,8 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
- echo "${MACHINE}-whatever-linux1"; exit 0
- ;;
-
-- GNU*)
-- echo "hurd-x86"; exit 0;
-+ GNU:*|GNU/*:*)
-+ echo "${MACHINE}-gnuish"; exit 0;
- ;;
-
- LynxOS:*)
-diff --git a/crypto/Makefile b/crypto/Makefile
-index 6557f2b..71ac792 100644
---- a/crypto/Makefile
-+++ b/crypto/Makefile
-@@ -57,7 +57,7 @@ buildinf.h: ../Makefile
- echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
- echo '#endif' ) >buildinf.h
-
--x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
-+x86cpuid-elf.S: x86cpuid.pl perlasm/x86asm.pl
- $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
- x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
- $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
-@@ -70,7 +70,7 @@ uplink.o: ../ms/uplink.c
- uplink-cof.s: ../ms/uplink.pl
- $(PERL) ../ms/uplink.pl coff > $@
-
--x86_64cpuid.s: x86_64cpuid.pl
-+x86_64cpuid.S: x86_64cpuid.pl
- $(PERL) x86_64cpuid.pl $@
- ia64cpuid.s: ia64cpuid.S
- $(CC) $(CFLAGS) -E ia64cpuid.S > $@
-diff --git a/crypto/aes/Makefile b/crypto/aes/Makefile
-index 9d174f4..69ad2f8 100644
---- a/crypto/aes/Makefile
-+++ b/crypto/aes/Makefile
-@@ -57,7 +57,7 @@ ax86-cof.s: asm/aes-586.pl ../perlasm/x86asm.pl
- ax86-out.s: asm/aes-586.pl ../perlasm/x86asm.pl
- (cd asm; $(PERL) aes-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
-
--aes-x86_64.s: asm/aes-x86_64.pl
-+aes-x86_64.S: asm/aes-x86_64.pl
- $(PERL) asm/aes-x86_64.pl $@
-
- files:
-diff --git a/crypto/aes/asm/aes-586.pl b/crypto/aes/asm/aes-586.pl
-index 3bc46a9..52f863c 100755
---- a/crypto/aes/asm/aes-586.pl
-+++ b/crypto/aes/asm/aes-586.pl
-@@ -250,7 +250,7 @@ sub enclast()
- sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
-
- &public_label("AES_Te");
--&function_begin_B("_x86_AES_encrypt");
-+&function_begin_B_static("_x86_AES_encrypt");
- if ($vertical_spin) {
- # I need high parts of volatile registers to be accessible...
- &exch ($s1="edi",$key="ebx");
-@@ -539,7 +539,7 @@ sub declast()
- }
-
- &public_label("AES_Td");
--&function_begin_B("_x86_AES_decrypt");
-+&function_begin_B_static("_x86_AES_decrypt");
- # note that caller is expected to allocate stack frame for me!
- &mov (&DWP(12,"esp"),$key); # save key
-
-@@ -1461,15 +1461,22 @@ sub deckey()
- &public_label("AES_Td");
- &public_label("AES_Te");
- &function_begin_B("AES_set_decrypt_key");
-+ &push ("ebx");
- &mov ("eax",&wparam(0));
- &mov ("ecx",&wparam(1));
- &mov ("edx",&wparam(2));
- &sub ("esp",12);
-+
-+ &call (&label("pic_point0"));
-+ &set_label("pic_point0");
-+ &blindpop("ebx");
-+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
- &mov (&DWP(0,"esp"),"eax");
- &mov (&DWP(4,"esp"),"ecx");
- &mov (&DWP(8,"esp"),"edx");
-- &call ("AES_set_encrypt_key");
-+ &call ("AES_set_encrypt_key\@PLT");
- &add ("esp",12);
-+ &pop ("ebx");
- &cmp ("eax",0);
- &je (&label("proceed"));
- &ret ();
-diff --git a/crypto/aes/asm/aes-x86_64.pl b/crypto/aes/asm/aes-x86_64.pl
-index f616f17..2be6dd1 100755
---- a/crypto/aes/asm/aes-x86_64.pl
-+++ b/crypto/aes/asm/aes-x86_64.pl
-@@ -974,7 +974,11 @@ $code.=<<___;
- .align 16
- AES_set_decrypt_key:
- push %rdx
-+#ifdef OPENSSL_PIC
-+ call AES_set_encrypt_key\@PLT
-+#else
- call AES_set_encrypt_key
-+#endif
- cmp \$0,%eax
- je .Lproceed
- lea 24(%rsp),%rsp
-diff --git a/crypto/des/asm/desboth.pl b/crypto/des/asm/desboth.pl
-index eec0088..ab6f524 100644
---- a/crypto/des/asm/desboth.pl
-+++ b/crypto/des/asm/desboth.pl
-@@ -16,6 +16,11 @@ sub DES_encrypt3
-
- &push("edi");
-
-+ &call (&label("pic_point0"));
-+ &set_label("pic_point0");
-+ &blindpop("ebp");
-+ &add ("ebp", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
-+
- &comment("");
- &comment("Load the data words");
- &mov($L,&DWP(0,"ebx","",0));
-@@ -47,15 +52,21 @@ sub DES_encrypt3
- &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
- &mov(&swtmp(1), "eax");
- &mov(&swtmp(0), "ebx");
-- &call("DES_encrypt2");
-+ &exch("ebx", "ebp");
-+ &call("DES_encrypt2\@PLT");
-+ &exch("ebx", "ebp");
- &mov(&swtmp(2), (DWC(($enc)?"0":"1")));
- &mov(&swtmp(1), "edi");
- &mov(&swtmp(0), "ebx");
-- &call("DES_encrypt2");
-+ &exch("ebx", "ebp");
-+ &call("DES_encrypt2\@PLT");
-+ &exch("ebx", "ebp");
- &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
- &mov(&swtmp(1), "esi");
- &mov(&swtmp(0), "ebx");
-- &call("DES_encrypt2");
-+ &exch("ebx", "ebp");
-+ &call("DES_encrypt2\@PLT");
-+ &exch("ebx", "ebp");
-
- &stack_pop(3);
- &mov($L,&DWP(0,"ebx","",0));
-diff --git a/crypto/md5/Makefile b/crypto/md5/Makefile
-index 3c450fc..bb67106 100644
---- a/crypto/md5/Makefile
-+++ b/crypto/md5/Makefile
-@@ -52,7 +52,8 @@ mx86-cof.s: asm/md5-586.pl ../perlasm/x86asm.pl
- mx86-out.s: asm/md5-586.pl ../perlasm/x86asm.pl
- (cd asm; $(PERL) md5-586.pl a.out $(CFLAGS) > ../$@)
-
--md5-x86_64.s: asm/md5-x86_64.pl; $(PERL) asm/md5-x86_64.pl $@
-+md5-x86_64.s: asm/md5-x86_64.pl
-+ $(PERL) asm/md5-x86_64.pl $@
-
- files:
- $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
-diff --git a/crypto/perlasm/cbc.pl b/crypto/perlasm/cbc.pl
-index e43dc9a..688d38b 100644
---- a/crypto/perlasm/cbc.pl
-+++ b/crypto/perlasm/cbc.pl
-@@ -122,7 +122,11 @@ sub cbc
- &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
- &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
-
-- &call($enc_func);
-+ &call (&label("pic_point0"));
-+ &set_label("pic_point0");
-+ &blindpop("ebx");
-+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
-+ &call("$enc_func\@PLT");
-
- &mov("eax", &DWP($data_off,"esp","",0));
- &mov("ebx", &DWP($data_off+4,"esp","",0));
-@@ -187,7 +191,11 @@ sub cbc
- &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
- &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
-
-- &call($enc_func);
-+ &call (&label("pic_point1"));
-+ &set_label("pic_point1");
-+ &blindpop("ebx");
-+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point1") . "]");
-+ &call("$enc_func\@PLT");
-
- &mov("eax", &DWP($data_off,"esp","",0));
- &mov("ebx", &DWP($data_off+4,"esp","",0));
-@@ -220,7 +228,11 @@ sub cbc
- &mov(&DWP($data_off,"esp","",0), "eax"); # put back
- &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
-
-- &call($dec_func);
-+ &call (&label("pic_point2"));
-+ &set_label("pic_point2");
-+ &blindpop("ebx");
-+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point2") . "]");
-+ &call("$dec_func\@PLT");
-
- &mov("eax", &DWP($data_off,"esp","",0)); # get return
- &mov("ebx", &DWP($data_off+4,"esp","",0)); #
-@@ -263,7 +275,11 @@ sub cbc
- &mov(&DWP($data_off,"esp","",0), "eax"); # put back
- &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
-
-- &call($dec_func);
-+ &call (&label("pic_point3"));
-+ &set_label("pic_point3");
-+ &blindpop("ebx");
-+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point3") . "]");
-+ &call("$dec_func\@PLT");
-
- &mov("eax", &DWP($data_off,"esp","",0)); # get return
- &mov("ebx", &DWP($data_off+4,"esp","",0)); #
-diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
-index a4af769..998aeeb 100755
---- a/crypto/perlasm/x86_64-xlate.pl
-+++ b/crypto/perlasm/x86_64-xlate.pl
-@@ -62,7 +62,7 @@ my $output = shift;
- my ($outdev,$outino,@junk)=stat($output);
-
- open STDOUT,">$output" || die "can't open $output: $!"
-- if ($stddev!=$outdev || $stdino!=$outino);
-+# if ($stddev!=$outdev || $stdino!=$outino);
- }
-
- my $masmref=8 + 50727*2**-32; # 8.00.50727 shipped with VS2005
-@@ -433,7 +433,7 @@ while($line=<>) {
-
- chomp($line);
-
-- $line =~ s|[#!].*$||; # get rid of asm-style comments...
-+# $line =~ s|[#!].*$||; # get rid of asm-style comments...
- $line =~ s|/\*.*\*/||; # ... and C-style comments...
- $line =~ s|^\s+||; # ... and skip white spaces in beginning
-
-diff --git a/crypto/perlasm/x86unix.pl b/crypto/perlasm/x86unix.pl
-index a4c9471..9cc089d 100644
---- a/crypto/perlasm/x86unix.pl
-+++ b/crypto/perlasm/x86unix.pl
-@@ -400,6 +400,29 @@ EOF
- $stack=4;
- }
-
-+sub main'function_begin_B_static
-+ {
-+ local($func,$extra)=@_;
-+
-+ &main'external_label($func);
-+ $func=$under.$func;
-+
-+ local($tmp)=<<"EOF";
-+.text
-+EOF
-+ push(@out,$tmp);
-+ if ($main'cpp)
-+ { push(@out,"TYPE($func,\@function)\n"); }
-+ elsif ($main'coff)
-+ { $tmp=push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
-+ elsif ($main'aout and !$main'pic)
-+ { }
-+ else { push(@out,".type $func,\@function\n"); }
-+ push(@out,".align\t$align\n");
-+ push(@out,"$func:\n");
-+ $stack=4;
-+ }
-+
- sub main'function_end
- {
- local($func)=@_;
-@@ -694,7 +717,17 @@ sub main'initseg
- {
- $tmp=<<___;
- .section .init
-+#ifdef OPENSSL_PIC
-+ pushl %ebx
-+ call .pic_point0
-+.pic_point0:
-+ popl %ebx
-+ addl \$_GLOBAL_OFFSET_TABLE_+[.-.pic_point0],%ebx
-+ call $under$f\@PLT
-+ popl %ebx
-+#else
- call $under$f
-+#endif
- jmp .Linitalign
- .align $align
- .Linitalign:
-diff --git a/crypto/pkcs7/pk7_mime.c b/crypto/pkcs7/pk7_mime.c
-index bf19036..07c9c89 100644
---- a/crypto/pkcs7/pk7_mime.c
-+++ b/crypto/pkcs7/pk7_mime.c
-@@ -335,9 +335,9 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
-
- if(strcmp(hdr->value, "application/x-pkcs7-signature") &&
- strcmp(hdr->value, "application/pkcs7-signature")) {
-- sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
- PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_SIG_INVALID_MIME_TYPE);
- ERR_add_error_data(2, "type: ", hdr->value);
-+ sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
- sk_BIO_pop_free(parts, BIO_vfree);
- return NULL;
- }
-diff --git a/crypto/pqueue/pqueue.c b/crypto/pqueue/pqueue.c
-index 5cc1852..6c89f06 100644
---- a/crypto/pqueue/pqueue.c
-+++ b/crypto/pqueue/pqueue.c
-@@ -234,3 +234,17 @@ pqueue_next(pitem **item)
-
- return ret;
- }
-+
-+int
-+pqueue_size(pqueue_s *pq)
-+{
-+ pitem *item = pq->items;
-+ int count = 0;
-+
-+ while(item != NULL)
-+ {
-+ count++;
-+ item = item->next;
-+ }
-+ return count;
-+}
-diff --git a/crypto/pqueue/pqueue.h b/crypto/pqueue/pqueue.h
-index 02386d1..16c4072 100644
---- a/crypto/pqueue/pqueue.h
-+++ b/crypto/pqueue/pqueue.h
-@@ -91,5 +91,6 @@ pitem *pqueue_iterator(pqueue pq);
- pitem *pqueue_next(piterator *iter);
-
- void pqueue_print(pqueue pq);
-+int pqueue_size(pqueue pq);
-
- #endif /* ! HEADER_PQUEUE_H */
-diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
-index 0f8dd3e..90e3462 100644
---- a/crypto/rand/md_rand.c
-+++ b/crypto/rand/md_rand.c
-@@ -477,8 +477,10 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
- MD_Update(&m,local_md,MD_DIGEST_LENGTH);
- MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c));
- #ifndef PURIFY
-+#if 0 /* Don't add uninitialised data. */
- MD_Update(&m,buf,j); /* purify complains */
- #endif
-+#endif
- k=(st_idx+MD_DIGEST_LENGTH/2)-st_num;
- if (k > 0)
- {
-diff --git a/crypto/rc4/Makefile b/crypto/rc4/Makefile
-index f0bd767..0d476a3 100644
---- a/crypto/rc4/Makefile
-+++ b/crypto/rc4/Makefile
-@@ -51,7 +51,7 @@ rx86-cof.s: asm/rc4-586.pl ../perlasm/x86asm.pl
- rx86-out.s: asm/rc4-586.pl ../perlasm/x86asm.pl
- (cd asm; $(PERL) rc4-586.pl a.out $(CFLAGS) > ../$@)
-
--rc4-x86_64.s: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@
-+rc4-x86_64.S: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@
-
- rc4-ia64.s: asm/rc4-ia64.S
- @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \
-diff --git a/crypto/rc4/asm/rc4-x86_64.pl b/crypto/rc4/asm/rc4-x86_64.pl
-index 00c6fa2..cd05f12 100755
---- a/crypto/rc4/asm/rc4-x86_64.pl
-+++ b/crypto/rc4/asm/rc4-x86_64.pl
-@@ -270,7 +270,11 @@ RC4_set_key:
- xor %r10,%r10
- xor %r11,%r11
-
-+#ifdef OPENSSL_PIC
-+ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),$idx#d
-+#else
- mov OPENSSL_ia32cap_P(%rip),$idx#d
-+#endif
- bt \$20,$idx#d
- jnc .Lw1stloop
- bt \$30,$idx#d
-@@ -338,7 +342,11 @@ RC4_set_key:
- RC4_options:
- .picmeup %rax
- lea .Lopts-.(%rax),%rax
-+#ifdef OPENSSL_PIC
-+ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%edx
-+#else
- mov OPENSSL_ia32cap_P(%rip),%edx
-+#endif
- bt \$20,%edx
- jnc .Ldone
- add \$12,%rax
-diff --git a/crypto/sha/sha.h b/crypto/sha/sha.h
-index 47a2c29..dc5f0fe 100644
---- a/crypto/sha/sha.h
-+++ b/crypto/sha/sha.h
-@@ -59,6 +59,7 @@
- #ifndef HEADER_SHA_H
- #define HEADER_SHA_H
-
-+#include <stddef.h>
- #include <openssl/e_os2.h>
- #include <stddef.h>
-
-diff --git a/crypto/x86_64cpuid.pl b/crypto/x86_64cpuid.pl
-index 2616a03..c274275 100644
---- a/crypto/x86_64cpuid.pl
-+++ b/crypto/x86_64cpuid.pl
-@@ -95,7 +95,11 @@ OPENSSL_wipe_cpu:
- .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
-
- .section .init
-+#ifdef OPENSSL_PIC
-+ call OPENSSL_cpuid_setup\@PLT
-+#else
- call OPENSSL_cpuid_setup
-+#endif
-
- ___
-
-diff --git a/engines/Makefile b/engines/Makefile
-index 002d40c..4513346 100644
---- a/engines/Makefile
-+++ b/engines/Makefile
-@@ -100,13 +100,13 @@ install:
- *DSO_DL*) sfx="sl";; \
- *) sfx="bad";; \
- esac; \
-- cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new; \
-+ cp lib$$l.$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/lib/ssl/engines/lib$$l.$$sfx.new; \
- else \
- sfx="so"; \
- cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new; \
- fi; \
-- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new; \
-- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.$$sfx ); \
-+ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/ssl/engines/lib$$l.$$sfx.new; \
-+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/ssl/engines/lib$$l.$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/ssl/engines/lib$$l.$$sfx ); \
- done; \
- fi
-
-diff --git a/ssl/d1_both.c b/ssl/d1_both.c
-index 15a201a..7b97664 100644
---- a/ssl/d1_both.c
-+++ b/ssl/d1_both.c
-@@ -530,13 +530,14 @@ dtls1_retrieve_buffered_fragment(SSL *s, long max, int *ok)
- frag->fragment,frag->msg_header.frag_len);
- }
-
-+ unsigned long frag_len = frag->msg_header.frag_len;
- dtls1_hm_fragment_free(frag);
- pitem_free(item);
-
- if (al==0)
- {
- *ok = 1;
-- return frag->msg_header.frag_len;
-+ return frag_len;
- }
-
- ssl3_send_alert(s,SSL3_AL_FATAL,al);
-@@ -561,7 +562,16 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
- if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
- goto err;
-
-- if (msg_hdr->seq <= s->d1->handshake_read_seq)
-+ /* Try to find item in queue, to prevent duplicate entries */
-+ pq_64bit_init(&seq64);
-+ pq_64bit_assign_word(&seq64, msg_hdr->seq);
-+ item = pqueue_find(s->d1->buffered_messages, seq64);
-+ pq_64bit_free(&seq64);
-+
-+ /* Discard the message if sequence number was already there, is
-+ * too far in the future or the fragment is already in the queue */
-+ if (msg_hdr->seq <= s->d1->handshake_read_seq ||
-+ msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL)
- {
- unsigned char devnull [256];
-
-@@ -575,30 +585,31 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st* msg_hdr, int *ok)
- }
- }
-
-- frag = dtls1_hm_fragment_new(frag_len);
-- if ( frag == NULL)
-- goto err;
-+ if (frag_len)
-+ {
-+ frag = dtls1_hm_fragment_new(frag_len);
-+ if ( frag == NULL)
-+ goto err;
-
-- memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
-+ memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
-
-- if (frag_len)
-- {
-- /* read the body of the fragment (header has already been read */
-+ /* read the body of the fragment (header has already been read) */
- i = s->method->ssl_read_bytes(s,SSL3_RT_HANDSHAKE,
- frag->fragment,frag_len,0);
- if (i<=0 || (unsigned long)i!=frag_len)
- goto err;
-- }
-
-- pq_64bit_init(&seq64);
-- pq_64bit_assign_word(&seq64, msg_hdr->seq);
-+ pq_64bit_init(&seq64);
-+ pq_64bit_assign_word(&seq64, msg_hdr->seq);
-
-- item = pitem_new(seq64, frag);
-- pq_64bit_free(&seq64);
-- if ( item == NULL)
-- goto err;
-+ item = pitem_new(seq64, frag);
-+ pq_64bit_free(&seq64);
-+ if ( item == NULL)
-+ goto err;
-+
-+ pqueue_insert(s->d1->buffered_messages, item);
-+ }
-
-- pqueue_insert(s->d1->buffered_messages, item);
- return DTLS1_HM_FRAGMENT_RETRY;
-
- err:
-diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
-index eb56cf9..4ae9be5 100644
---- a/ssl/d1_pkt.c
-+++ b/ssl/d1_pkt.c
-@@ -167,6 +167,10 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, PQ_64BIT priority)
- DTLS1_RECORD_DATA *rdata;
- pitem *item;
-
-+ /* Limit the size of the queue to prevent DOS attacks */
-+ if (pqueue_size(queue->q) >= 100)
-+ return 0;
-+
- rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA));
- item = pitem_new(priority, rdata);
- if (rdata == NULL || item == NULL)
-diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
-index 9ce7269..ded4b14 100644
---- a/ssl/t1_lib.c
-+++ b/ssl/t1_lib.c
-@@ -133,6 +133,10 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned cha
- int extdatalen=0;
- unsigned char *ret = p;
-
-+ /* don't add extensions for SSLv3 */
-+ if (s->client_version == SSL3_VERSION)
-+ return p;
-+
- ret+=2;
-
- if (ret>=limit) return NULL; /* this really never occurs, but ... */
-@@ -251,6 +255,10 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned cha
- int extdatalen=0;
- unsigned char *ret = p;
-
-+ /* don't add extensions for SSLv3 */
-+ if (s->version == SSL3_VERSION)
-+ return p;
-+
- ret+=2;
- if (ret>=limit) return NULL; /* this really never occurs, but ... */
-
-diff --git a/tools/c_rehash b/tools/c_rehash
-index e614fb5..4bd6628 100644
---- a/tools/c_rehash
-+++ b/tools/c_rehash
-@@ -6,7 +6,7 @@
-
- my $openssl;
-
--my $dir = "/usr/local/ssl";
-+my $dir = "/usr/lib/ssl";
-
- if(defined $ENV{OPENSSL}) {
- $openssl = $ENV{OPENSSL};
-@@ -59,12 +59,15 @@ sub hash_dir {
- }
- }
- closedir DIR;
-- FILE: foreach $fname (grep {/\.pem$/} @flist) {
-+ FILE: foreach $fname (grep {/\.pem$|\.crt$/} @flist) {
- # Check to see if certificates and/or CRLs present.
- my ($cert, $crl) = check_file($fname);
- if(!$cert && !$crl) {
-- print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
-- next;
-+ ($cert, $crl) = check_file("$openssl x509 -in \"$fname\" -inform der -outform pem | ");
-+ if(!$cert && !$crl) {
-+ print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
-+ next;
-+ }
- }
- link_hash_cert($fname) if($cert);
- link_hash_crl($fname) if($crl);
-@@ -102,6 +105,9 @@ sub link_hash_cert {
- my $fname = $_[0];
- $fname =~ s/'/'\\''/g;
- my ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname'`;
-+ if(!$hash || !fprint) {
-+ ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname' -inform der`;
-+ }
- chomp $hash;
- chomp $fprint;
- $fprint =~ s/^.*=//;
-diff --git a/tools/c_rehash.in b/tools/c_rehash.in
-index 4497cbd..d76e693 100644
---- a/tools/c_rehash.in
-+++ b/tools/c_rehash.in
-@@ -59,12 +59,15 @@ sub hash_dir {
- }
- }
- closedir DIR;
-- FILE: foreach $fname (grep {/\.pem$/} @flist) {
-+ FILE: foreach $fname (grep {/\.pem$|\.crt$/} @flist) {
- # Check to see if certificates and/or CRLs present.
- my ($cert, $crl) = check_file($fname);
- if(!$cert && !$crl) {
-- print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
-- next;
-+ ($cert, $crl) = check_file("$openssl x509 -in \"$fname\" -inform der -outform pem | ");
-+ if(!$cert && !$crl) {
-+ print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
-+ next;
-+ }
- }
- link_hash_cert($fname) if($cert);
- link_hash_crl($fname) if($crl);
-@@ -102,6 +105,9 @@ sub link_hash_cert {
- my $fname = $_[0];
- $fname =~ s/'/'\\''/g;
- my ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname'`;
-+ if(!$hash || !fprint) {
-+ ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname' -inform der`;
-+ }
- chomp $hash;
- chomp $fprint;
- $fprint =~ s/^.*=//;
---
-1.6.3.3
-
diff --git a/patches/openssl-0.9.8l/0002-Configure-let-environment-override-RANLIB-and-AR.patch b/patches/openssl-0.9.8l/0002-Configure-let-environment-override-RANLIB-and-AR.patch
deleted file mode 100644
index ddadcd1cc..000000000
--- a/patches/openssl-0.9.8l/0002-Configure-let-environment-override-RANLIB-and-AR.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 72cbfd16d1b4f42b661ee97936c4e7f5f6db4fef Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Mon, 6 Jul 2009 12:26:06 +0200
-Subject: [PATCH 2/2] [Configure] let environment override RANLIB and AR
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- Configure | 12 ++++++++++++
- 1 files changed, 12 insertions(+), 0 deletions(-)
-
-diff --git a/Configure b/Configure
-index 0fe11a5..07cbf2f 100755
---- a/Configure
-+++ b/Configure
-@@ -1025,7 +1025,16 @@ my $shared_cflag = $fields[$idx_shared_cflag];
- my $shared_ldflag = $fields[$idx_shared_ldflag];
- my $shared_extension = $fields[$idx_shared_extension];
- my $ranlib = $fields[$idx_ranlib];
-+# Allow environment RANLIB to override ranlib...
-+if($ENV{RANLIB}) {
-+ $ranlib = $ENV{RANLIB};
-+}
- my $arflags = $fields[$idx_arflags];
-+my $ar = "ar";
-+# Allow environment AR to override ar...
-+if($ENV{AR}) {
-+ $ar = $ENV{AR};
-+}
-
- if ($fips)
- {
-@@ -1533,6 +1542,8 @@ while (<IN>)
- s/^PROCESSOR=.*/PROCESSOR= $processor/;
- s/^RANLIB=.*/RANLIB= $ranlib/;
- s/^ARFLAGS=.*/ARFLAGS= $arflags/;
-+ s/^AR=ar/AR= $ar/;
-+ s/^ARD=ar/ARD= $ar/;
- s/^PERL=.*/PERL= $perl/;
- s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/;
- s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/;
-@@ -1600,6 +1611,7 @@ print "RMD160_OBJ_ASM=$rmd160_obj\n";
- print "PROCESSOR =$processor\n";
- print "RANLIB =$ranlib\n";
- print "ARFLAGS =$arflags\n";
-+print "AR =$ar\n";
- print "PERL =$perl\n";
- print "KRB5_INCLUDES =",$withargs{"krb5-include"},"\n"
- if $withargs{"krb5-include"} ne "";
---
-1.6.3.3
-
diff --git a/patches/openssl-0.9.8l/series b/patches/openssl-0.9.8l/series
deleted file mode 100644
index 493b17081..000000000
--- a/patches/openssl-0.9.8l/series
+++ /dev/null
@@ -1,2 +0,0 @@
-0001-debian-patches.patch
-0002-Configure-let-environment-override-RANLIB-and-AR.patch
diff --git a/patches/openssl-1.0.0d/0001-debian-ca.patch b/patches/openssl-1.0.0d/0001-debian-ca.patch
new file mode 100644
index 000000000..9c21316f5
--- /dev/null
+++ b/patches/openssl-1.0.0d/0001-debian-ca.patch
@@ -0,0 +1,34 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian ca
+
+Applied ca.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ apps/CA.pl.in | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/apps/CA.pl.in b/apps/CA.pl.in
+index c783a6e..fa665b7 100644
+--- a/apps/CA.pl.in
++++ b/apps/CA.pl.in
+@@ -65,6 +65,7 @@ $RET = 0;
+ foreach (@ARGV) {
+ if ( /^(-\?|-h|-help)$/ ) {
+ print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
++ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
+ exit 0;
+ } elsif (/^-newcert$/) {
+ # create a certificate
+@@ -165,6 +166,7 @@ foreach (@ARGV) {
+ } else {
+ print STDERR "Unknown arg $_\n";
+ print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
++ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
+ exit 1;
+ }
+ }
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0002-debian-config-hurd.patch b/patches/openssl-1.0.0d/0002-debian-config-hurd.patch
new file mode 100644
index 000000000..09ac27a67
--- /dev/null
+++ b/patches/openssl-1.0.0d/0002-debian-config-hurd.patch
@@ -0,0 +1,29 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian config-hurd
+
+Applied config-hurd.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ config | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config b/config
+index 965884a..05239c1 100755
+--- a/config
++++ b/config
+@@ -170,8 +170,8 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
+ echo "${MACHINE}-whatever-linux1"; exit 0
+ ;;
+
+- GNU*)
+- echo "hurd-x86"; exit 0;
++ GNU:*|GNU/*:*)
++ echo "${MACHINE}-gnuish"; exit 0;
+ ;;
+
+ LynxOS:*)
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0003-debian-debian-targets.patch b/patches/openssl-1.0.0d/0003-debian-debian-targets.patch
new file mode 100644
index 000000000..7348e8675
--- /dev/null
+++ b/patches/openssl-1.0.0d/0003-debian-debian-targets.patch
@@ -0,0 +1,66 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian debian-targets
+
+Applied debian-targets.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Configure | 41 +++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 41 insertions(+), 0 deletions(-)
+
+diff --git a/Configure b/Configure
+index 429ab2e..52e0dc6 100755
+--- a/Configure
++++ b/Configure
+@@ -331,6 +331,47 @@ my %table=(
+ "osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
+ "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared::-msym:.so",
+
++# Debian GNU/* (various architectures)
++"debian-alpha","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-alpha-ev4","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev4 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-alpha-ev5","gcc:-DTERMIO -O3 -Wa,--noexecstack -mcpu=ev5 -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-armeb","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-armel","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-armhf","gcc:-DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-amd64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::",
++"debian-avr32", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -fomit-frame-pointer -g -Wall::-D_REENTRANT::-ldl:BN_LLONG_BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-hppa","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-hurd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mtune=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ia64","gcc:-DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386","gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i486","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i486 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i586","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i586 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i686/cmov","gcc:-DL_ENDIAN -DTERMIO -O3 -march=i686 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-m68k","gcc:-DB_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-m68k", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-sparc", "gcc:-DB_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mv8 -Wall::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-alpha","gcc:-DTERMIOS -O3 -Wa,--noexecstack -g::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-mips","gcc:-O2 -Wa,--noexecstack -g -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-powerpc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-powerpcspe","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ppc64","gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-s390","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh3", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh4", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh3eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh4eb", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-m32r","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc-v8","gcc:-DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -mcpu=v8 -g -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc-v9","gcc:-DB_ENDIAN -DTERMIO -O3 -mcpu=v9 -Wa,--noexecstack -Wa,-Av8plus -g -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc64","gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++
+ ####
+ #### Variety of LINUX:-)
+ ####
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0004-debian-engines-path.patch b/patches/openssl-1.0.0d/0004-debian-engines-path.patch
new file mode 100644
index 000000000..c7ffbc22f
--- /dev/null
+++ b/patches/openssl-1.0.0d/0004-debian-engines-path.patch
@@ -0,0 +1,95 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian engines-path
+
+Applied engines-path.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Configure | 2 +-
+ Makefile.org | 2 +-
+ engines/Makefile | 10 +++++-----
+ engines/ccgost/Makefile | 6 +++---
+ 4 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/Configure b/Configure
+index 52e0dc6..39e9f3a 100755
+--- a/Configure
++++ b/Configure
+@@ -1729,7 +1729,7 @@ while (<IN>)
+ }
+ elsif (/^#define\s+ENGINESDIR/)
+ {
+- my $foo = "$prefix/$libdir/engines";
++ my $foo = "$prefix/$libdir/openssl-1.0.0/engines";
+ $foo =~ s/\\/\\\\/g;
+ print OUT "#define ENGINESDIR \"$foo\"\n";
+ }
+diff --git a/Makefile.org b/Makefile.org
+index fb0af7e..0a1550b 100644
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -497,7 +497,7 @@ install: all install_docs install_sw
+ install_sw:
+ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
+ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
+- $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
++ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines \
+ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
+ $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
+ $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
+diff --git a/engines/Makefile b/engines/Makefile
+index 2fa9534..58e0281 100644
+--- a/engines/Makefile
++++ b/engines/Makefile
+@@ -107,7 +107,7 @@ install:
+ @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
+ @if [ -n "$(SHARED_LIBS)" ]; then \
+ set -e; \
+- $(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines; \
++ $(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines; \
+ for l in $(LIBNAMES); do \
+ ( echo installing $$l; \
+ pfx=lib; \
+@@ -119,13 +119,13 @@ install:
+ *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
+ *) sfx=".bad";; \
+ esac; \
+- cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
++ cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$$pfx$$l$$sfx.new; \
+ else \
+ sfx=".so"; \
+- cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
++ cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$$pfx$$l$$sfx.new; \
+ fi; \
+- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
+- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
++ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$$pfx$$l$$sfx.new; \
++ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$$pfx$$l$$sfx ); \
+ done; \
+ fi
+ @target=install; $(RECURSIVE_MAKE)
+diff --git a/engines/ccgost/Makefile b/engines/ccgost/Makefile
+index dadb523..2c88759 100644
+--- a/engines/ccgost/Makefile
++++ b/engines/ccgost/Makefile
+@@ -53,13 +53,13 @@ install:
+ *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
+ *) sfx=".bad";; \
+ esac; \
+- cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++ cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+ else \
+ sfx=".so"; \
+ cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+ fi; \
+- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx; \
++ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/openssl-1.0.0/engines/$${pfx}$(LIBNAME)$$sfx; \
+ fi
+
+ links:
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0005-debian-kfreebsd-pipe.patch b/patches/openssl-1.0.0d/0005-debian-kfreebsd-pipe.patch
new file mode 100644
index 000000000..1850422a1
--- /dev/null
+++ b/patches/openssl-1.0.0d/0005-debian-kfreebsd-pipe.patch
@@ -0,0 +1,27 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian kfreebsd-pipe
+
+Applied kfreebsd-pipe.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ crypto/perlasm/x86_64-xlate.pl | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
+index e47116b..bd7676c 100755
+--- a/crypto/perlasm/x86_64-xlate.pl
++++ b/crypto/perlasm/x86_64-xlate.pl
+@@ -66,7 +66,7 @@ if ($flavour =~ /\./) { $output = $flavour; undef $flavour; }
+ my ($outdev,$outino,@junk)=stat($output);
+
+ open STDOUT,">$output" || die "can't open $output: $!"
+- if ($stddev!=$outdev || $stdino!=$outino);
++# if ($stddev!=$outdev || $stdino!=$outino);
+ }
+
+ my $gas=1; $gas=0 if ($output =~ /\.asm$/);
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0006-debian-make-targets.patch b/patches/openssl-1.0.0d/0006-debian-make-targets.patch
new file mode 100644
index 000000000..91e12c18b
--- /dev/null
+++ b/patches/openssl-1.0.0d/0006-debian-make-targets.patch
@@ -0,0 +1,27 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian make-targets
+
+Applied make-targets.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile.org | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.org b/Makefile.org
+index 0a1550b..246abc4 100644
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -109,7 +109,7 @@ LIBKRB5=
+ ZLIB_INCLUDE=
+ LIBZLIB=
+
+-DIRS= crypto ssl engines apps test tools
++DIRS= crypto ssl engines apps tools
+ ENGDIRS= ccgost
+ SHLIBDIRS= crypto ssl
+
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0007-debian-man-dir.patch b/patches/openssl-1.0.0d/0007-debian-man-dir.patch
new file mode 100644
index 000000000..5144d55c8
--- /dev/null
+++ b/patches/openssl-1.0.0d/0007-debian-man-dir.patch
@@ -0,0 +1,27 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian man-dir
+
+Applied man-dir.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile.org | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.org b/Makefile.org
+index 246abc4..b8340b9 100644
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -131,7 +131,7 @@ TESTS = alltests
+
+ MAKEFILE= Makefile
+
+-MANDIR=$(OPENSSLDIR)/man
++MANDIR=/usr/share/man
+ MAN1=1
+ MAN3=3
+ MANSUFFIX=
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0008-debian-man-section.patch b/patches/openssl-1.0.0d/0008-debian-man-section.patch
new file mode 100644
index 000000000..c412c9365
--- /dev/null
+++ b/patches/openssl-1.0.0d/0008-debian-man-section.patch
@@ -0,0 +1,46 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian man-section
+
+Applied man-section.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile.org | 7 ++++---
+ 1 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.org b/Makefile.org
+index b8340b9..c7051a0 100644
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -134,7 +134,8 @@ MAKEFILE= Makefile
+ MANDIR=/usr/share/man
+ MAN1=1
+ MAN3=3
+-MANSUFFIX=
++MANSUFFIX=ssl
++MANSECTION=SSL
+ HTMLSUFFIX=html
+ HTMLDIR=$(OPENSSLDIR)/html
+ SHELL=/bin/sh
+@@ -606,7 +607,7 @@ install_docs:
+ echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
+ (cd `$(PERL) util/dirname.pl $$i`; \
+ sh -c "$$pod2man \
+- --section=$$sec --center=OpenSSL \
++ --section=$${sec}$(MANSECTION) --center=OpenSSL \
+ --release=$(VERSION) `basename $$i`") \
+ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
+ $(PERL) util/extract-names.pl < $$i | \
+@@ -623,7 +624,7 @@ install_docs:
+ echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
+ (cd `$(PERL) util/dirname.pl $$i`; \
+ sh -c "$$pod2man \
+- --section=$$sec --center=OpenSSL \
++ --section=$${sec}$(MANSECTION) --center=OpenSSL \
+ --release=$(VERSION) `basename $$i`") \
+ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
+ $(PERL) util/extract-names.pl < $$i | \
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0009-debian-no-rpath.patch b/patches/openssl-1.0.0d/0009-debian-no-rpath.patch
new file mode 100644
index 000000000..3695a598c
--- /dev/null
+++ b/patches/openssl-1.0.0d/0009-debian-no-rpath.patch
@@ -0,0 +1,27 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian no-rpath
+
+Applied no-rpath.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile.shared | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.shared b/Makefile.shared
+index e753f44..6e3f886 100644
+--- a/Makefile.shared
++++ b/Makefile.shared
+@@ -153,7 +153,7 @@ DO_GNU_SO=$(CALC_VERSIONS); \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+
+-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
++DO_GNU_APP=LDFLAGS="$(CFLAGS)"
+
+ #This is rather special. It's a special target with which one can link
+ #applications without bothering with any features that have anything to
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0010-debian-no-symbolic.patch b/patches/openssl-1.0.0d/0010-debian-no-symbolic.patch
new file mode 100644
index 000000000..9595b30d1
--- /dev/null
+++ b/patches/openssl-1.0.0d/0010-debian-no-symbolic.patch
@@ -0,0 +1,27 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian no-symbolic
+
+Applied no-symbolic.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile.shared | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.shared b/Makefile.shared
+index 6e3f886..44e3d9c 100644
+--- a/Makefile.shared
++++ b/Makefile.shared
+@@ -151,7 +151,7 @@ DO_GNU_SO=$(CALC_VERSIONS); \
+ SHLIB_SUFFIX=; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
++ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+
+ DO_GNU_APP=LDFLAGS="$(CFLAGS)"
+
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0011-debian-pic.patch b/patches/openssl-1.0.0d/0011-debian-pic.patch
new file mode 100644
index 000000000..aa5a772ea
--- /dev/null
+++ b/patches/openssl-1.0.0d/0011-debian-pic.patch
@@ -0,0 +1,263 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian pic
+
+Applied pic.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ crypto/Makefile | 4 ++--
+ crypto/aes/Makefile | 2 +-
+ crypto/aes/asm/aes-x86_64.pl | 4 ++++
+ crypto/des/asm/desboth.pl | 17 ++++++++++++++---
+ crypto/perlasm/cbc.pl | 24 ++++++++++++++++++++----
+ crypto/perlasm/x86_64-xlate.pl | 2 +-
+ crypto/perlasm/x86gas.pl | 10 ++++++++++
+ crypto/rc4/Makefile | 2 +-
+ crypto/rc4/asm/rc4-x86_64.pl | 8 ++++++++
+ crypto/x86_64cpuid.pl | 4 ++++
+ 10 files changed, 65 insertions(+), 12 deletions(-)
+
+diff --git a/crypto/Makefile b/crypto/Makefile
+index 85d9f24..0682e4a 100644
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -58,7 +58,7 @@ buildinf.h: ../Makefile
+ echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
+ echo '#endif' ) >buildinf.h
+
+-x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
++x86cpuid.S: x86cpuid.pl perlasm/x86asm.pl
+ $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+
+ applink.o: $(TOP)/ms/applink.c
+@@ -70,7 +70,7 @@ uplink.o: $(TOP)/ms/uplink.c applink.o
+ uplink-cof.s: $(TOP)/ms/uplink.pl
+ $(PERL) $(TOP)/ms/uplink.pl coff > $@
+
+-x86_64cpuid.s: x86_64cpuid.pl
++x86_64cpuid.S: x86_64cpuid.pl
+ $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
+ ia64cpuid.s: ia64cpuid.S
+ $(CC) $(CFLAGS) -E ia64cpuid.S > $@
+diff --git a/crypto/aes/Makefile b/crypto/aes/Makefile
+index c501a43..b03b331 100644
+--- a/crypto/aes/Makefile
++++ b/crypto/aes/Makefile
+@@ -51,7 +51,7 @@ aes-ia64.s: asm/aes-ia64.S
+ aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl
+ $(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+
+-aes-x86_64.s: asm/aes-x86_64.pl
++aes-x86_64.S: asm/aes-x86_64.pl
+ $(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
+
+ aes-sparcv9.s: asm/aes-sparcv9.pl
+diff --git a/crypto/aes/asm/aes-x86_64.pl b/crypto/aes/asm/aes-x86_64.pl
+index a545e89..b4c3880 100755
+--- a/crypto/aes/asm/aes-x86_64.pl
++++ b/crypto/aes/asm/aes-x86_64.pl
+@@ -1669,7 +1669,11 @@ AES_cbc_encrypt:
+ lea .LAES_Td(%rip),$sbox
+ .Lcbc_picked_te:
+
++#ifdef OPENSSL_PIC
++ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%r10d
++#else
+ mov OPENSSL_ia32cap_P(%rip),%r10d
++#endif
+ cmp \$$speed_limit,%rdx
+ jb .Lcbc_slow_prologue
+ test \$15,%rdx
+diff --git a/crypto/des/asm/desboth.pl b/crypto/des/asm/desboth.pl
+index eec0088..ab6f524 100644
+--- a/crypto/des/asm/desboth.pl
++++ b/crypto/des/asm/desboth.pl
+@@ -16,6 +16,11 @@ sub DES_encrypt3
+
+ &push("edi");
+
++ &call (&label("pic_point0"));
++ &set_label("pic_point0");
++ &blindpop("ebp");
++ &add ("ebp", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
++
+ &comment("");
+ &comment("Load the data words");
+ &mov($L,&DWP(0,"ebx","",0));
+@@ -47,15 +52,21 @@ sub DES_encrypt3
+ &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
+ &mov(&swtmp(1), "eax");
+ &mov(&swtmp(0), "ebx");
+- &call("DES_encrypt2");
++ &exch("ebx", "ebp");
++ &call("DES_encrypt2\@PLT");
++ &exch("ebx", "ebp");
+ &mov(&swtmp(2), (DWC(($enc)?"0":"1")));
+ &mov(&swtmp(1), "edi");
+ &mov(&swtmp(0), "ebx");
+- &call("DES_encrypt2");
++ &exch("ebx", "ebp");
++ &call("DES_encrypt2\@PLT");
++ &exch("ebx", "ebp");
+ &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
+ &mov(&swtmp(1), "esi");
+ &mov(&swtmp(0), "ebx");
+- &call("DES_encrypt2");
++ &exch("ebx", "ebp");
++ &call("DES_encrypt2\@PLT");
++ &exch("ebx", "ebp");
+
+ &stack_pop(3);
+ &mov($L,&DWP(0,"ebx","",0));
+diff --git a/crypto/perlasm/cbc.pl b/crypto/perlasm/cbc.pl
+index e43dc9a..688d38b 100644
+--- a/crypto/perlasm/cbc.pl
++++ b/crypto/perlasm/cbc.pl
+@@ -122,7 +122,11 @@ sub cbc
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($enc_func);
++ &call (&label("pic_point0"));
++ &set_label("pic_point0");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
++ &call("$enc_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0));
+ &mov("ebx", &DWP($data_off+4,"esp","",0));
+@@ -187,7 +191,11 @@ sub cbc
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($enc_func);
++ &call (&label("pic_point1"));
++ &set_label("pic_point1");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point1") . "]");
++ &call("$enc_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0));
+ &mov("ebx", &DWP($data_off+4,"esp","",0));
+@@ -220,7 +228,11 @@ sub cbc
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put back
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($dec_func);
++ &call (&label("pic_point2"));
++ &set_label("pic_point2");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point2") . "]");
++ &call("$dec_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0)); # get return
+ &mov("ebx", &DWP($data_off+4,"esp","",0)); #
+@@ -263,7 +275,11 @@ sub cbc
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put back
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($dec_func);
++ &call (&label("pic_point3"));
++ &set_label("pic_point3");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point3") . "]");
++ &call("$dec_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0)); # get return
+ &mov("ebx", &DWP($data_off+4,"esp","",0)); #
+diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
+index bd7676c..10c477d 100755
+--- a/crypto/perlasm/x86_64-xlate.pl
++++ b/crypto/perlasm/x86_64-xlate.pl
+@@ -638,7 +638,7 @@ while($line=<>) {
+
+ chomp($line);
+
+- $line =~ s|[#!].*$||; # get rid of asm-style comments...
++# $line =~ s|[#!].*$||; # get rid of asm-style comments...
+ $line =~ s|/\*.*\*/||; # ... and C-style comments...
+ $line =~ s|^\s+||; # ... and skip white spaces in beginning
+
+diff --git a/crypto/perlasm/x86gas.pl b/crypto/perlasm/x86gas.pl
+index 6eab727..a41f425 100644
+--- a/crypto/perlasm/x86gas.pl
++++ b/crypto/perlasm/x86gas.pl
+@@ -209,7 +209,17 @@ sub ::initseg
+ if ($::elf)
+ { $initseg.=<<___;
+ .section .init
++#ifdef OPENSSL_PIC
++ pushl %ebx
++ call .pic_point0
++.pic_point0:
++ popl %ebx
++ addl \$_GLOBAL_OFFSET_TABLE_+[.-.pic_point0],%ebx
++ call $f\@PLT
++ popl %ebx
++#else
+ call $f
++#endif
+ jmp .Linitalign
+ .align $align
+ .Linitalign:
+diff --git a/crypto/rc4/Makefile b/crypto/rc4/Makefile
+index 264451a..cd344a0 100644
+--- a/crypto/rc4/Makefile
++++ b/crypto/rc4/Makefile
+@@ -44,7 +44,7 @@ lib: $(LIBOBJ)
+ rc4-586.s: asm/rc4-586.pl ../perlasm/x86asm.pl
+ $(PERL) asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
+
+-rc4-x86_64.s: asm/rc4-x86_64.pl
++rc4-x86_64.S: asm/rc4-x86_64.pl
+ $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@
+
+ rc4-ia64.S: asm/rc4-ia64.pl
+diff --git a/crypto/rc4/asm/rc4-x86_64.pl b/crypto/rc4/asm/rc4-x86_64.pl
+index 677be5f..2007769 100755
+--- a/crypto/rc4/asm/rc4-x86_64.pl
++++ b/crypto/rc4/asm/rc4-x86_64.pl
+@@ -279,7 +279,11 @@ RC4_set_key:
+ xor %r10,%r10
+ xor %r11,%r11
+
++#ifdef OPENSSL_PIC
++ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),$idx#d
++#else
+ mov OPENSSL_ia32cap_P(%rip),$idx#d
++#endif
+ bt \$20,$idx#d
+ jnc .Lw1stloop
+ bt \$30,$idx#d
+@@ -346,7 +350,11 @@ RC4_set_key:
+ .align 16
+ RC4_options:
+ lea .Lopts(%rip),%rax
++#ifdef OPENSSL_PIC
++ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%edx
++#else
+ mov OPENSSL_ia32cap_P(%rip),%edx
++#endif
+ bt \$20,%edx
+ jnc .Ldone
+ add \$12,%rax
+diff --git a/crypto/x86_64cpuid.pl b/crypto/x86_64cpuid.pl
+index c96821a..b35762b 100644
+--- a/crypto/x86_64cpuid.pl
++++ b/crypto/x86_64cpuid.pl
+@@ -14,7 +14,11 @@ else { $arg1="%rdi"; $arg2="%rsi"; }
+ print<<___;
+ .extern OPENSSL_cpuid_setup
+ .section .init
++#ifdef OPENSSL_PIC
++ call OPENSSL_cpuid_setup\@PLT
++#else
+ call OPENSSL_cpuid_setup
++#endif
+
+ .text
+
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0012-debian-pkg-config.patch b/patches/openssl-1.0.0d/0012-debian-pkg-config.patch
new file mode 100644
index 000000000..a0bd8b0b0
--- /dev/null
+++ b/patches/openssl-1.0.0d/0012-debian-pkg-config.patch
@@ -0,0 +1,48 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian pkg-config
+
+Applied pkg-config.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Makefile.org | 9 ++++++---
+ 1 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.org b/Makefile.org
+index c7051a0..16eeea8 100644
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -323,7 +323,8 @@ libcrypto.pc: Makefile
+ echo 'Description: OpenSSL cryptography library'; \
+ echo 'Version: '$(VERSION); \
+ echo 'Requires: '; \
+- echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
++ echo 'Libs: -L$${libdir} -lcrypto'; \
++ echo 'Libs.private: $(EX_LIBS)'; \
+ echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
+
+ libssl.pc: Makefile
+@@ -336,7 +337,8 @@ libssl.pc: Makefile
+ echo 'Description: Secure Sockets Layer and cryptography libraries'; \
+ echo 'Version: '$(VERSION); \
+ echo 'Requires: '; \
+- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
++ echo 'Libs: -L$${libdir} -lssl'; \
++ echo 'Libs.private: -lcrypto $(EX_LIBS)'; \
+ echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
+
+ openssl.pc: Makefile
+@@ -349,7 +351,8 @@ openssl.pc: Makefile
+ echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
+ echo 'Version: '$(VERSION); \
+ echo 'Requires: '; \
+- echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
++ echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
++ echo 'Libs.private: $(EX_LIBS)'; \
+ echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
+
+ Makefile: Makefile.org Configure config
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0013-debian-valgrind.patch b/patches/openssl-1.0.0d/0013-debian-valgrind.patch
new file mode 100644
index 000000000..3427bbd78
--- /dev/null
+++ b/patches/openssl-1.0.0d/0013-debian-valgrind.patch
@@ -0,0 +1,34 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:43 +0100
+Subject: [PATCH] debian valgrind
+
+Applied valgrind.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ crypto/rand/md_rand.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
+index b2f04ff..79d46c6 100644
+--- a/crypto/rand/md_rand.c
++++ b/crypto/rand/md_rand.c
+@@ -476,6 +476,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
+ MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c));
+
+ #ifndef PURIFY /* purify complains */
++#if 0
+ /* The following line uses the supplied buffer as a small
+ * source of entropy: since this buffer is often uninitialised
+ * it may cause programs such as purify or valgrind to
+@@ -485,6 +486,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
+ */
+ MD_Update(&m,buf,j);
+ #endif
++#endif
+
+ k=(st_idx+MD_DIGEST_LENGTH/2)-st_num;
+ if (k > 0)
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0014-debian-rehash-crt.patch b/patches/openssl-1.0.0d/0014-debian-rehash-crt.patch
new file mode 100644
index 000000000..2b1fc4868
--- /dev/null
+++ b/patches/openssl-1.0.0d/0014-debian-rehash-crt.patch
@@ -0,0 +1,47 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:44 +0100
+Subject: [PATCH] debian rehash-crt
+
+Applied rehash-crt.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ tools/c_rehash.in | 12 +++++++++---
+ 1 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/tools/c_rehash.in b/tools/c_rehash.in
+index bfc4a69..4958e3d 100644
+--- a/tools/c_rehash.in
++++ b/tools/c_rehash.in
+@@ -75,12 +75,15 @@ sub hash_dir {
+ }
+ }
+ closedir DIR;
+- FILE: foreach $fname (grep {/\.pem$/} @flist) {
++ FILE: foreach $fname (grep {/\.pem$|\.crt$/} @flist) {
+ # Check to see if certificates and/or CRLs present.
+ my ($cert, $crl) = check_file($fname);
+ if(!$cert && !$crl) {
+- print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
+- next;
++ ($cert, $crl) = check_file("$openssl x509 -in \"$fname\" -inform der -outform pem | ");
++ if(!$cert && !$crl) {
++ print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
++ next;
++ }
+ }
+ link_hash_cert($fname) if($cert);
+ link_hash_crl($fname) if($crl);
+@@ -153,6 +156,9 @@ sub link_hash_crl {
+ my $fname = $_[0];
+ $fname =~ s/'/'\\''/g;
+ my ($hash, $fprint) = `"$openssl" crl -hash -fingerprint -noout -in '$fname'`;
++ if(!$hash || !fprint) {
++ ($hash, $fprint) = `"$openssl" crl -hash -fingerprint -noout -in '$fname' -inform der`;
++ }
+ chomp $hash;
+ chomp $fprint;
+ $fprint =~ s/^.*=//;
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0015-debian-rehash_pod.patch b/patches/openssl-1.0.0d/0015-debian-rehash_pod.patch
new file mode 100644
index 000000000..1183598f0
--- /dev/null
+++ b/patches/openssl-1.0.0d/0015-debian-rehash_pod.patch
@@ -0,0 +1,76 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:44 +0100
+Subject: [PATCH] debian rehash_pod
+
+Applied rehash_pod.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ doc/apps/c_rehash.pod | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 55 insertions(+), 0 deletions(-)
+ create mode 100644 doc/apps/c_rehash.pod
+
+diff --git a/doc/apps/c_rehash.pod b/doc/apps/c_rehash.pod
+new file mode 100644
+index 0000000..5f0c985
+--- /dev/null
++++ b/doc/apps/c_rehash.pod
+@@ -0,0 +1,55 @@
++
++=pod
++
++=head1 NAME
++
++c_rehash - Create symbolic links to files named by the hash values
++
++=head1 SYNOPSIS
++
++B<c_rehash>
++[directory] ...
++
++=head1 DESCRIPTION
++
++c_rehash scans directories and takes a hash value of each .pem and .crt file in the directory. It then creates symbolic links for each of the files named by the hash value. This is useful as many programs require directories to be set up like this in order to find the certificates they require.
++
++If any directories are named on the command line then these directories are processed in turn. If not then and the environment variable SSL_CERT_DIR is defined then that is consulted. This variable should be a colon (:) separated list of directories, all of which will be processed. If neither of these conditions are true then /usr/lib/ssl/certs is processed.
++
++For each directory that is to be processed he user must have write permissions on the directory, if they do not then nothing will be printed for that directory.
++
++Note that this program deletes all the symbolic links that look like ones that it creates before processing a directory. Beware that if you run the program on a directory that contains symbolic links for other purposes that are named in the same format as those created by this program they will be lost.
++
++The hashes for certificate files are of the form <hash>.<n> where n is an integer. If the hash value already exists then n will be incremented, unless the file is a duplicate. Duplicates are detected using the fingerprint of the certificate. A warning will be printed if a duplicate is detected. The hashes for CRL files are of the form <hash>.r<n> and have the same behavior.
++
++The program will also warn if there are files with extension .pem which are not certificate or CRL files.
++
++The program uses the openssl program to compute the hashes and fingerprints. It expects the executable to be named openssl and be on the PATH, or in the /usr/lib/ssl/bin directory. If the OPENSSL environment variable is defined then this is used instead as the executable that provides the hashes and fingerprints. When called as $OPENSSL x509 -hash -fingerprint -noout -in $file it must output the hash of $file on the first line followed by the fingerprint on the second line, optionally prefixed with some text and an equals sign (=).
++
++=head1 OPTIONS
++
++None
++
++=head1 ENVIRONMENT
++
++=over 4
++
++=item B<OPENSSL>
++
++The name (and path) of an executable to use to generate hashes and fingerprints (see above).
++
++=item B<SSL_CERT_DIR>
++
++Colon separated list of directories to operate on. Ignored if directories are listed on the command line.
++
++=head1 SEE ALSO
++
++L<openssl(1)|openssl(1)>, L<x509(1)|x509(1)>
++
++=back
++
++=head1 BUGS
++
++No known bugs
++
++=cut
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0016-debian-shared-lib-ext.patch b/patches/openssl-1.0.0d/0016-debian-shared-lib-ext.patch
new file mode 100644
index 000000000..1a98f258a
--- /dev/null
+++ b/patches/openssl-1.0.0d/0016-debian-shared-lib-ext.patch
@@ -0,0 +1,28 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:44 +0100
+Subject: [PATCH] debian shared-lib-ext
+
+Applied shared-lib-ext.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Configure | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/Configure b/Configure
+index 39e9f3a..d7f90d7 100755
+--- a/Configure
++++ b/Configure
+@@ -1601,7 +1601,8 @@ while (<IN>)
+ elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
+ {
+ my $sotmp = $1;
+- s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
++# s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
++ s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/;
+ }
+ elsif ($shared_extension ne "" && $shared_extension =~ /^\.[^\.]*\.[^\.]*\.dylib$/)
+ {
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0017-debian-stddef.patch b/patches/openssl-1.0.0d/0017-debian-stddef.patch
new file mode 100644
index 000000000..ed429beca
--- /dev/null
+++ b/patches/openssl-1.0.0d/0017-debian-stddef.patch
@@ -0,0 +1,26 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:44 +0100
+Subject: [PATCH] debian stddef
+
+Applied stddef.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ crypto/sha/sha.h | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/crypto/sha/sha.h b/crypto/sha/sha.h
+index 16cacf9..204514d 100644
+--- a/crypto/sha/sha.h
++++ b/crypto/sha/sha.h
+@@ -59,6 +59,7 @@
+ #ifndef HEADER_SHA_H
+ #define HEADER_SHA_H
+
++#include <stddef.h>
+ #include <openssl/e_os2.h>
+ #include <stddef.h>
+
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0018-debian-version-script.patch b/patches/openssl-1.0.0d/0018-debian-version-script.patch
new file mode 100644
index 000000000..b24d1a38c
--- /dev/null
+++ b/patches/openssl-1.0.0d/0018-debian-version-script.patch
@@ -0,0 +1,53 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:44 +0100
+Subject: [PATCH] debian version-script
+
+Applied version-script.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ Configure | 2 ++
+ engines/openssl.ld | 5 +++++
+ openssl.ld | 5 +++++
+ 3 files changed, 12 insertions(+), 0 deletions(-)
+ create mode 100644 engines/openssl.ld
+ create mode 100644 openssl.ld
+
+diff --git a/Configure b/Configure
+index d7f90d7..fdb7a2e 100755
+--- a/Configure
++++ b/Configure
+@@ -1511,6 +1511,8 @@ if ($strict_warnings)
+ }
+ }
+
++$shared_ldflag .= " -Wl,--version-script=openssl.ld";
++
+ open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
+ unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
+ open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
+diff --git a/engines/openssl.ld b/engines/openssl.ld
+new file mode 100644
+index 0000000..5f26d60
+--- /dev/null
++++ b/engines/openssl.ld
+@@ -0,0 +1,5 @@
++OPENSSL_1.0.0 {
++ global:
++ *;
++};
++
+diff --git a/openssl.ld b/openssl.ld
+new file mode 100644
+index 0000000..5f26d60
+--- /dev/null
++++ b/openssl.ld
+@@ -0,0 +1,5 @@
++OPENSSL_1.0.0 {
++ global:
++ *;
++};
++
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/0019-debian-gnu_source.patch b/patches/openssl-1.0.0d/0019-debian-gnu_source.patch
new file mode 100644
index 000000000..bbaf90ad5
--- /dev/null
+++ b/patches/openssl-1.0.0d/0019-debian-gnu_source.patch
@@ -0,0 +1,31 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 22 Feb 2011 13:56:44 +0100
+Subject: [PATCH] debian gnu_source
+
+Applied gnu_source.patch from openssl_1.0.0c-2.debian.tar.gz
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ crypto/dso/dso_dlfcn.c | 6 ++----
+ 1 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
+index 14bd322..b738302 100644
+--- a/crypto/dso/dso_dlfcn.c
++++ b/crypto/dso/dso_dlfcn.c
+@@ -60,10 +60,8 @@
+ that handle _GNU_SOURCE and other similar macros. Defining it later
+ is simply too late, because those headers are protected from re-
+ inclusion. */
+-#ifdef __linux
+-# ifndef _GNU_SOURCE
+-# define _GNU_SOURCE /* make sure dladdr is declared */
+-# endif
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE /* make sure dladdr is declared */
+ #endif
+
+ #include <stdio.h>
+--
+1.7.4.1
+
diff --git a/patches/openssl-1.0.0d/series b/patches/openssl-1.0.0d/series
new file mode 100644
index 000000000..b1ca71133
--- /dev/null
+++ b/patches/openssl-1.0.0d/series
@@ -0,0 +1,19 @@
+0001-debian-ca.patch
+0002-debian-config-hurd.patch
+0003-debian-debian-targets.patch
+0004-debian-engines-path.patch
+0005-debian-kfreebsd-pipe.patch
+0006-debian-make-targets.patch
+0007-debian-man-dir.patch
+0008-debian-man-section.patch
+0009-debian-no-rpath.patch
+0010-debian-no-symbolic.patch
+0011-debian-pic.patch
+0012-debian-pkg-config.patch
+0013-debian-valgrind.patch
+0014-debian-rehash-crt.patch
+0015-debian-rehash_pod.patch
+0016-debian-shared-lib-ext.patch
+0017-debian-stddef.patch
+0018-debian-version-script.patch
+0019-debian-gnu_source.patch
diff --git a/rules/openssl.make b/rules/openssl.make
index 46e5becff..0cb62c6b0 100644
--- a/rules/openssl.make
+++ b/rules/openssl.make
@@ -18,7 +18,7 @@ PACKAGES-$(PTXCONF_OPENSSL) += openssl
#
# Paths and names
#
-OPENSSL_VERSION := 0.9.8l
+OPENSSL_VERSION := 1.0.0d
OPENSSL := openssl-$(OPENSSL_VERSION)
OPENSSL_SUFFIX := tar.gz
OPENSSL_URL := http://openssl.org/source//$(OPENSSL).$(OPENSSL_SUFFIX)