From 543260c394dae55a5e7356ff6c071dd6087e71f0 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sun, 22 Nov 2009 17:44:35 +0000 Subject: [PATCH] - Updated to version 1.0.0 beta 4 - Merged patches from native Fedora openssl (up to 1.0.0-0.15.beta4) - Added patch to fix build with fips disabled --- .cvsignore | 2 +- Makefile.certificate | 4 +- make-dummy-cert | 2 +- mingw32-openssl-1.0.0-beta4-nofips.patch | 130 ++ mingw32-openssl.spec | 57 +- openssl-0.9.8b-aliasing-bug.patch | 24 - openssl-0.9.8j-ca-dir.patch | 36 - openssl-1.0.0-beta3-const.patch | 36 - openssl-1.0.0-beta3-curl.patch | 27 - openssl-1.0.0-beta3-enginesdir.patch | 52 - openssl-1.0.0-beta3-fipsmode.patch | 4 +- openssl-1.0.0-beta3-krb5.patch | 12 - openssl-1.0.0-beta3-namingblk.patch | 253 --- openssl-1.0.0-beta3-namingstr.patch | 1663 ----------------- ...atch => openssl-1.0.0-beta4-algo-doc.patch | 16 +- openssl-1.0.0-beta4-backports.patch | 45 + openssl-1.0.0-beta4-binutils.patch | 56 + openssl-1.0.0-beta4-ca-dir.patch | 36 + openssl-1.0.0-beta4-client-reneg.patch | 35 + ...=> openssl-1.0.0-beta4-default-paths.patch | 28 +- openssl-1.0.0-beta4-dtls1-abi.patch | 25 + openssl-1.0.0-beta4-enginesdir.patch | 52 + ...ps.patch => openssl-1.0.0-beta4-fips.patch | 1540 +++++++-------- ....patch => openssl-1.0.0-beta4-redhat.patch | 16 +- openssl-1.0.0-beta4-reneg-err.patch | 93 + openssl-1.0.0-beta4-reneg.patch | 237 +++ openssl-1.0.0-beta4-version.patch | 14 + sources | 2 +- 28 files changed, 1582 insertions(+), 2915 deletions(-) create mode 100644 mingw32-openssl-1.0.0-beta4-nofips.patch delete mode 100644 openssl-0.9.8b-aliasing-bug.patch delete mode 100644 openssl-0.9.8j-ca-dir.patch delete mode 100644 openssl-1.0.0-beta3-const.patch delete mode 100644 openssl-1.0.0-beta3-curl.patch delete mode 100644 openssl-1.0.0-beta3-enginesdir.patch delete mode 100644 openssl-1.0.0-beta3-krb5.patch delete mode 100644 openssl-1.0.0-beta3-namingblk.patch delete mode 100644 openssl-1.0.0-beta3-namingstr.patch rename openssl-0.9.8k-algo-doc.patch => openssl-1.0.0-beta4-algo-doc.patch (86%) create mode 100644 openssl-1.0.0-beta4-backports.patch create mode 100644 openssl-1.0.0-beta4-binutils.patch create mode 100644 openssl-1.0.0-beta4-ca-dir.patch create mode 100644 openssl-1.0.0-beta4-client-reneg.patch rename openssl-1.0.0-beta3-default-paths.patch => openssl-1.0.0-beta4-default-paths.patch (66%) create mode 100644 openssl-1.0.0-beta4-dtls1-abi.patch create mode 100644 openssl-1.0.0-beta4-enginesdir.patch rename openssl-1.0.0-beta3-fips.patch => openssl-1.0.0-beta4-fips.patch (90%) rename openssl-1.0.0-beta3-redhat.patch => openssl-1.0.0-beta4-redhat.patch (92%) create mode 100644 openssl-1.0.0-beta4-reneg-err.patch create mode 100644 openssl-1.0.0-beta4-reneg.patch create mode 100644 openssl-1.0.0-beta4-version.patch diff --git a/.cvsignore b/.cvsignore index 37e2722..3819647 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -openssl-1.0.0-beta3-usa.tar.bz2 +openssl-1.0.0-beta4-usa.tar.bz2 diff --git a/Makefile.certificate b/Makefile.certificate index bf3dc21..e839427 100644 --- a/Makefile.certificate +++ b/Makefile.certificate @@ -38,7 +38,7 @@ usage: umask 77 ; \ PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \ PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \ - /usr/bin/openssl req $(UTF8) -newkey rsa:1024 -keyout $$PEM1 -nodes -x509 -days 365 -out $$PEM2 -set_serial $(SERIAL) ; \ + /usr/bin/openssl req $(UTF8) -newkey rsa:2048 -keyout $$PEM1 -nodes -x509 -days 365 -out $$PEM2 -set_serial $(SERIAL) ; \ cat $$PEM1 > $@ ; \ echo "" >> $@ ; \ cat $$PEM2 >> $@ ; \ @@ -46,7 +46,7 @@ usage: %.key: umask 77 ; \ - /usr/bin/openssl genrsa -des3 1024 > $@ + /usr/bin/openssl genrsa -aes128 2048 > $@ %.csr: %.key umask 77 ; \ diff --git a/make-dummy-cert b/make-dummy-cert index 3aff5be..f5f0453 100755 --- a/make-dummy-cert +++ b/make-dummy-cert @@ -20,7 +20,7 @@ for target in $@ ; do PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` trap "rm -f $PEM1 $PEM2" SIGINT - answers | /usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 2> /dev/null + answers | /usr/bin/openssl req -newkey rsa:2048 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 2> /dev/null cat $PEM1 > ${target} echo "" >> ${target} cat $PEM2 >> ${target} diff --git a/mingw32-openssl-1.0.0-beta4-nofips.patch b/mingw32-openssl-1.0.0-beta4-nofips.patch new file mode 100644 index 0000000..fba1b6f --- /dev/null +++ b/mingw32-openssl-1.0.0-beta4-nofips.patch @@ -0,0 +1,130 @@ +diff -up openssl-1.0.0-beta4/crypto/dsa/dsa_key.c.mingw-nofips openssl-1.0.0-beta4/crypto/dsa/dsa_key.c +--- openssl-1.0.0-beta4/crypto/dsa/dsa_key.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/dsa/dsa_key.c 2009-11-22 19:07:58.000000000 +0200 +@@ -65,7 +65,9 @@ + #include + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include "fips_locl.h" + + static int dsa_builtin_keygen(DSA *dsa); +diff -up openssl-1.0.0-beta4/crypto/fips/fips_aes_selftest.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_aes_selftest.c +--- openssl-1.0.0-beta4/crypto/fips/fips_aes_selftest.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_aes_selftest.c 2009-11-22 19:07:58.000000000 +0200 +@@ -49,7 +49,9 @@ + + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include + + #ifdef OPENSSL_FIPS +diff -up openssl-1.0.0-beta4/crypto/fips/fips_des_selftest.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_des_selftest.c +--- openssl-1.0.0-beta4/crypto/fips/fips_des_selftest.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_des_selftest.c 2009-11-22 19:07:58.000000000 +0200 +@@ -49,7 +49,9 @@ + + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include + #include + +diff -up openssl-1.0.0-beta4/crypto/fips/fips_dsa_selftest.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_dsa_selftest.c +--- openssl-1.0.0-beta4/crypto/fips/fips_dsa_selftest.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_dsa_selftest.c 2009-11-22 19:07:58.000000000 +0200 +@@ -59,7 +59,9 @@ + #include + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include + #include + #include +diff -up openssl-1.0.0-beta4/crypto/fips/fips_hmac_selftest.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_hmac_selftest.c +--- openssl-1.0.0-beta4/crypto/fips/fips_hmac_selftest.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_hmac_selftest.c 2009-11-22 19:07:58.000000000 +0200 +@@ -49,7 +49,9 @@ + + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include + + #ifdef OPENSSL_FIPS +diff -up openssl-1.0.0-beta4/crypto/fips/fips_rand.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_rand.c +--- openssl-1.0.0-beta4/crypto/fips/fips_rand.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rand.c 2009-11-22 19:07:58.000000000 +0200 +@@ -76,7 +76,9 @@ + # endif + #endif + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include "fips_locl.h" + + #ifdef OPENSSL_FIPS +diff -up openssl-1.0.0-beta4/crypto/fips/fips_rand_selftest.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_rand_selftest.c +--- openssl-1.0.0-beta4/crypto/fips/fips_rand_selftest.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rand_selftest.c 2009-11-22 19:07:58.000000000 +0200 +@@ -49,7 +49,9 @@ + + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include + #include + +diff -up openssl-1.0.0-beta4/crypto/fips/fips_rsa_selftest.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_rsa_selftest.c +--- openssl-1.0.0-beta4/crypto/fips/fips_rsa_selftest.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rsa_selftest.c 2009-11-22 19:07:58.000000000 +0200 +@@ -49,7 +49,9 @@ + + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include + #include + #include +diff -up openssl-1.0.0-beta4/crypto/fips/fips_sha1_selftest.c.mingw-nofips openssl-1.0.0-beta4/crypto/fips/fips_sha1_selftest.c +--- openssl-1.0.0-beta4/crypto/fips/fips_sha1_selftest.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/fips/fips_sha1_selftest.c 2009-11-22 19:07:58.000000000 +0200 +@@ -49,7 +49,9 @@ + + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + #include + #include + +diff -up openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c.mingw-nofips openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c +--- openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c.mingw-nofips 2009-11-22 19:07:58.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c 2009-11-22 19:07:58.000000000 +0200 +@@ -115,7 +115,9 @@ + #include + #include + #include ++#ifdef OPENSSL_FIPS + #include ++#endif + + #ifndef RSA_NULL + diff --git a/mingw32-openssl.spec b/mingw32-openssl.spec index d530ab4..3f8f216 100644 --- a/mingw32-openssl.spec +++ b/mingw32-openssl.spec @@ -18,7 +18,7 @@ # 1.0.0 soversion = 10 %global soversion 10 -%global beta beta3 +%global beta beta4 # Enable the tests. # These only work some of the time, but fail randomly at other times @@ -31,7 +31,7 @@ Name: mingw32-openssl Version: 1.0.0 -Release: 0.4.%{beta}%{?dist} +Release: 0.5.%{beta}%{?dist} Summary: MinGW port of the OpenSSL toolkit License: OpenSSL @@ -50,37 +50,39 @@ Source10: opensslconf-new-warning.h # Patches from Fedora native package. # Build changes -Patch0: openssl-1.0.0-beta3-redhat.patch +Patch0: openssl-1.0.0-beta4-redhat.patch Patch1: openssl-1.0.0-beta3-defaults.patch -Patch2: openssl-1.0.0-beta3-krb5.patch Patch3: openssl-1.0.0-beta3-soversion.patch -Patch4: openssl-1.0.0-beta3-enginesdir.patch +Patch4: openssl-1.0.0-beta4-enginesdir.patch Patch5: openssl-0.9.8a-no-rpath.patch Patch6: openssl-0.9.8b-test-use-localhost.patch # Bug fixes -Patch21: openssl-0.9.8b-aliasing-bug.patch -Patch23: openssl-1.0.0-beta3-default-paths.patch +Patch23: openssl-1.0.0-beta4-default-paths.patch +Patch24: openssl-1.0.0-beta4-binutils.patch # Functionality changes Patch32: openssl-0.9.8g-ia64.patch -Patch33: openssl-0.9.8j-ca-dir.patch +Patch33: openssl-1.0.0-beta4-ca-dir.patch Patch34: openssl-0.9.6-x509.patch Patch35: openssl-0.9.8j-version-add-engines.patch Patch38: openssl-1.0.0-beta3-cipher-change.patch # Disabled this because it uses getaddrinfo which is lacking on Windows. #Patch39: openssl-1.0.0-beta3-ipv6-apps.patch -Patch40: openssl-1.0.0-beta3-fips.patch +Patch40: openssl-1.0.0-beta4-fips.patch Patch41: openssl-1.0.0-beta3-fipscheck.patch Patch43: openssl-1.0.0-beta3-fipsmode.patch Patch44: openssl-1.0.0-beta3-fipsrng.patch Patch45: openssl-0.9.8j-env-nozlib.patch Patch47: openssl-0.9.8j-readme-warning.patch Patch48: openssl-0.9.8j-bad-mime.patch -Patch49: openssl-0.9.8k-algo-doc.patch -Patch50: openssl-1.0.0-beta3-curl.patch -Patch51: openssl-1.0.0-beta3-const.patch +Patch49: openssl-1.0.0-beta4-algo-doc.patch +Patch50: openssl-1.0.0-beta4-dtls1-abi.patch +Patch51: openssl-1.0.0-beta4-version.patch # Backported fixes including security fixes -Patch60: openssl-1.0.0-beta3-namingstr.patch -Patch61: openssl-1.0.0-beta3-namingblk.patch +Patch60: openssl-1.0.0-beta4-reneg.patch +# This one is not backported but has to be applied after reneg patch +Patch61: openssl-1.0.0-beta4-client-reneg.patch +Patch62: openssl-1.0.0-beta4-backports.patch +Patch63: openssl-1.0.0-beta4-reneg-err.patch # MinGW-specific patches. # Use MINGW32_CFLAGS (set below) in Configure script @@ -92,6 +94,8 @@ Patch102: mingw32-openssl-1.0.0-beta3-sfx.patch # Ugly patch to fix a compilation error (the linker can't find # some symbols mentioned in an autogenerated .def file) Patch105: mingw32-openssl-1.0.0-beta3-linker-fix.patch +# Fix build without fips +Patch106: mingw32-openssl-1.0.0-beta4-nofips.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -156,15 +160,13 @@ Static version of the MinGW port of the OpenSSL toolkit. %{SOURCE1} > /dev/null %patch0 -p1 -b .redhat %patch1 -p1 -b .defaults -# Fix link line for libssl (bug #111154). -%patch2 -p1 -b .krb5 %patch3 -p1 -b .soversion %patch4 -p1 -b .enginesdir %patch5 -p1 -b .no-rpath %patch6 -p1 -b .use-localhost -%patch21 -p1 -b .aliasing-bug %patch23 -p1 -b .default-paths +%patch24 -p1 -b .binutils %patch32 -p1 -b .ia64 #patch33 is applied after make test @@ -180,15 +182,19 @@ Static version of the MinGW port of the OpenSSL toolkit. %patch47 -p1 -b .warning %patch48 -p1 -b .bad-mime %patch49 -p1 -b .algo-doc -%patch50 -p1 -b .curl -%patch51 -p1 -b .const -%patch60 -p1 -b .namingstr -%patch61 -p1 -b .namingblk +%patch50 -p1 -b .dtls1-abi +%patch51 -p1 -b .version + +%patch60 -p1 -b .reneg +%patch61 -p1 -b .client-reneg +%patch62 -p1 -b .backports +%patch63 -p1 -b .reneg-err %patch100 -p1 -b .mingw-configure %patch101 -p1 -b .mingw-libversion %patch102 -p1 -b .mingw-sfx %patch105 -p0 -b .mingw-linker-fix +%patch106 -p1 -b .mingw-nofips # Modify the various perl scripts to reference perl in the right location. perl util/perlpath.pl `dirname %{__perl}` @@ -206,9 +212,9 @@ export MINGW32_CFLAGS="%{_mingw32_cflags}"; \ --openssldir=%{_mingw32_sysconfdir}/pki/tls \ zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 \ enable-cms enable-md2 no-idea no-mdc2 no-rc5 no-ec no-ecdh no-ecdsa \ - no-hw shared --cross-compile-prefix=%{_mingw32_target}- \ + no-hw --cross-compile-prefix=%{_mingw32_target}- \ --enginesdir=%{_mingw32_libdir}/openssl/engines \ - mingw + shared mingw # --with-krb5-flavor=MIT # -I%{_mingw32_prefix}/kerberos/include -L%{_mingw32_prefix}/kerberos/%{_lib} make depend @@ -347,6 +353,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Nov 22 2009 Kalev Lember - 1.0.0-0.5.beta4 +- Updated to version 1.0.0 beta 4 +- Merged patches from native Fedora openssl (up to 1.0.0-0.15.beta4) +- Added patch to fix build with fips disabled + * Fri Sep 18 2009 Kalev Lember - 1.0.0-0.4.beta3 - Rebuilt to fix debuginfo diff --git a/openssl-0.9.8b-aliasing-bug.patch b/openssl-0.9.8b-aliasing-bug.patch deleted file mode 100644 index 8d3b36a..0000000 --- a/openssl-0.9.8b-aliasing-bug.patch +++ /dev/null @@ -1,24 +0,0 @@ - -This patch fixes a violation of the C aliasing rules that can cause -miscompilation with some compiler versions. - ---- openssl-0.9.8b/crypto/dso/dso_dlfcn.c.orig 2006-10-30 18:21:35.000000000 +0100 -+++ openssl-0.9.8b/crypto/dso/dso_dlfcn.c 2006-10-30 18:21:37.000000000 +0100 -@@ -237,7 +237,7 @@ static void *dlfcn_bind_var(DSO *dso, co - static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname) - { - void *ptr; -- DSO_FUNC_TYPE sym, *tsym = &sym; -+ DSO_FUNC_TYPE sym; - - if((dso == NULL) || (symname == NULL)) - { -@@ -255,7 +255,7 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO - DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_NULL_HANDLE); - return(NULL); - } -- *(void **)(tsym) = dlsym(ptr, symname); -+ sym = dlsym(ptr, symname); - if(sym == NULL) - { - DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_SYM_FAILURE); diff --git a/openssl-0.9.8j-ca-dir.patch b/openssl-0.9.8j-ca-dir.patch deleted file mode 100644 index 52c0025..0000000 --- a/openssl-0.9.8j-ca-dir.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -up openssl-0.9.8j/apps/openssl.cnf.ca-dir openssl-0.9.8j/apps/openssl.cnf ---- openssl-0.9.8j/apps/openssl.cnf.ca-dir 2009-01-13 23:20:10.000000000 +0100 -+++ openssl-0.9.8j/apps/openssl.cnf 2009-01-13 23:20:10.000000000 +0100 -@@ -34,7 +34,7 @@ default_ca = CA_default # The default c - #################################################################### - [ CA_default ] - --dir = ./demoCA # Where everything is kept -+dir = ../../CA # Where everything is kept - certs = $dir/certs # Where the issued certs are kept - crl_dir = $dir/crl # Where the issued crl are kept - database = $dir/index.txt # database index file. -diff -up openssl-0.9.8j/apps/CA.sh.ca-dir openssl-0.9.8j/apps/CA.sh ---- openssl-0.9.8j/apps/CA.sh.ca-dir 2005-07-04 23:44:22.000000000 +0200 -+++ openssl-0.9.8j/apps/CA.sh 2009-01-13 23:20:10.000000000 +0100 -@@ -39,7 +39,7 @@ CA="$OPENSSL ca $SSLEAY_CONFIG" - VERIFY="$OPENSSL verify" - X509="$OPENSSL x509" - --CATOP=./demoCA -+CATOP=../../CA - CAKEY=./cakey.pem - CAREQ=./careq.pem - CACERT=./cacert.pem -diff -up openssl-0.9.8j/apps/CA.pl.in.ca-dir openssl-0.9.8j/apps/CA.pl.in ---- openssl-0.9.8j/apps/CA.pl.in.ca-dir 2006-04-28 02:28:51.000000000 +0200 -+++ openssl-0.9.8j/apps/CA.pl.in 2009-01-13 23:20:10.000000000 +0100 -@@ -53,7 +53,7 @@ $VERIFY="$openssl verify"; - $X509="$openssl x509"; - $PKCS12="$openssl pkcs12"; - --$CATOP="./demoCA"; -+$CATOP="../../CA"; - $CAKEY="cakey.pem"; - $CAREQ="careq.pem"; - $CACERT="cacert.pem"; diff --git a/openssl-1.0.0-beta3-const.patch b/openssl-1.0.0-beta3-const.patch deleted file mode 100644 index 77c1c95..0000000 --- a/openssl-1.0.0-beta3-const.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -up openssl-1.0.0-beta3/doc/ssl/SSL_CIPHER_get_name.pod.const openssl-1.0.0-beta3/doc/ssl/SSL_CIPHER_get_name.pod ---- openssl-1.0.0-beta3/doc/ssl/SSL_CIPHER_get_name.pod.const 2009-02-14 22:49:37.000000000 +0100 -+++ openssl-1.0.0-beta3/doc/ssl/SSL_CIPHER_get_name.pod 2009-08-22 16:15:32.000000000 +0200 -@@ -11,7 +11,7 @@ SSL_CIPHER_get_name, SSL_CIPHER_get_bits - const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher); - int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits); - char *SSL_CIPHER_get_version(const SSL_CIPHER *cipher); -- char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int size); -+ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int size); - - =head1 DESCRIPTION - -diff -up openssl-1.0.0-beta3/ssl/ssl_ciph.c.const openssl-1.0.0-beta3/ssl/ssl_ciph.c ---- openssl-1.0.0-beta3/ssl/ssl_ciph.c.const 2009-08-22 15:56:12.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/ssl_ciph.c 2009-08-22 15:56:12.000000000 +0200 -@@ -1458,7 +1458,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_ - return(cipherstack); - } - --char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len) -+char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) - { - int is_export,pkl,kl; - const char *ver,*exp_str; -diff -up openssl-1.0.0-beta3/ssl/ssl.h.const openssl-1.0.0-beta3/ssl/ssl.h ---- openssl-1.0.0-beta3/ssl/ssl.h.const 2009-08-22 15:56:11.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/ssl.h 2009-08-22 15:56:12.000000000 +0200 -@@ -1638,7 +1638,7 @@ long SSL_get_default_timeout(const SSL * - - int SSL_library_init(void ); - --char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); -+char *SSL_CIPHER_description(const SSL_CIPHER *,char *buf,int size); - STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk); - - SSL *SSL_dup(SSL *ssl); diff --git a/openssl-1.0.0-beta3-curl.patch b/openssl-1.0.0-beta3-curl.patch deleted file mode 100644 index 6141c0e..0000000 --- a/openssl-1.0.0-beta3-curl.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -up openssl-1.0.0-beta3/apps/tsget.curl openssl-1.0.0-beta3/apps/tsget ---- openssl-1.0.0-beta3/apps/tsget.curl 2006-02-13 00:11:21.000000000 +0100 -+++ openssl-1.0.0-beta3/apps/tsget 2009-08-21 15:37:24.000000000 +0200 -@@ -7,7 +7,7 @@ use strict; - use IO::Handle; - use Getopt::Std; - use File::Basename; --use WWW::Curl::easy; -+use WWW::Curl::Easy; - - use vars qw(%options); - -@@ -37,7 +37,7 @@ sub create_curl { - my $url = shift; - - # Create Curl object. -- my $curl = WWW::Curl::easy::new(); -+ my $curl = WWW::Curl::Easy::new(); - - # Error-handling related options. - $curl->setopt(CURLOPT_VERBOSE, 1) if $options{d}; -@@ -192,4 +192,4 @@ REQUEST: foreach (@ARGV) { - STDERR->printflush(", $output written.\n") if $options{v}; - } - $curl->cleanup(); --WWW::Curl::easy::global_cleanup(); -+WWW::Curl::Easy::global_cleanup(); diff --git a/openssl-1.0.0-beta3-enginesdir.patch b/openssl-1.0.0-beta3-enginesdir.patch deleted file mode 100644 index 78a3c50..0000000 --- a/openssl-1.0.0-beta3-enginesdir.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff -up openssl-1.0.0-beta3/Configure.enginesdir openssl-1.0.0-beta3/Configure ---- openssl-1.0.0-beta3/Configure.enginesdir 2009-08-10 19:46:32.000000000 +0200 -+++ openssl-1.0.0-beta3/Configure 2009-08-10 19:46:32.000000000 +0200 -@@ -616,6 +616,7 @@ my $idx_multilib = $idx++; - - my $prefix=""; - my $openssldir=""; -+my $enginesdir=""; - my $exe_ext=""; - my $install_prefix=""; - my $cross_compile_prefix=""; -@@ -820,6 +821,10 @@ PROCESS_ARGS: - { - $openssldir=$1; - } -+ elsif (/^--enginesdir=(.*)$/) -+ { -+ $enginesdir=$1; -+ } - elsif (/^--install.prefix=(.*)$/) - { - $install_prefix=$1; -@@ -1037,7 +1042,7 @@ chop $prefix if $prefix =~ /.\/$/; - - $openssldir=$prefix . "/ssl" if $openssldir eq ""; - $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/; -- -+$enginesdir="$prefix/lib/engines" if $enginesdir eq ""; - - print "IsMK1MF=$IsMK1MF\n"; - -@@ -1645,7 +1650,7 @@ while () - # $foo is to become "$prefix/lib$multilib/engines"; - # as Makefile.org and engines/Makefile are adapted for - # $multilib suffix. -- my $foo = "$prefix/lib/engines"; -+ my $foo = "$enginesdir"; - $foo =~ s/\\/\\\\/g; - print OUT "#define ENGINESDIR \"$foo\"\n"; - } -diff -up openssl-1.0.0-beta3/engines/Makefile.enginesdir openssl-1.0.0-beta3/engines/Makefile ---- openssl-1.0.0-beta3/engines/Makefile.enginesdir 2009-06-14 04:37:22.000000000 +0200 -+++ openssl-1.0.0-beta3/engines/Makefile 2009-08-10 19:46:48.000000000 +0200 -@@ -123,7 +123,7 @@ install: - sfx=".so"; \ - cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new; \ - fi; \ -- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new; \ -+ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/$$pfx$$l$$sfx ); \ - done; \ - fi diff --git a/openssl-1.0.0-beta3-fipsmode.patch b/openssl-1.0.0-beta3-fipsmode.patch index 643654e..2fbf0a6 100644 --- a/openssl-1.0.0-beta3-fipsmode.patch +++ b/openssl-1.0.0-beta3-fipsmode.patch @@ -222,7 +222,7 @@ diff -up openssl-1.0.0-beta3/ssl/ssl_algs.c.fipsmode openssl-1.0.0-beta3/ssl/ssl #ifndef OPENSSL_NO_DES EVP_add_cipher(EVP_des_cbc()); EVP_add_cipher(EVP_des_ede3_cbc()); -@@ -115,6 +121,38 @@ int SSL_library_init(void) +@@ -115,6 +121,40 @@ int SSL_library_init(void) EVP_add_digest(EVP_sha()); EVP_add_digest(EVP_dss()); #endif @@ -241,6 +241,8 @@ diff -up openssl-1.0.0-beta3/ssl/ssl_algs.c.fipsmode openssl-1.0.0-beta3/ssl/ssl +#ifndef OPENSSL_NO_MD5 + /* needed even in the FIPS mode for TLS MAC */ + EVP_add_digest(EVP_md5()); ++ EVP_add_digest_alias(SN_md5,"ssl2-md5"); ++ EVP_add_digest_alias(SN_md5,"ssl3-md5"); +#endif +#ifndef OPENSSL_NO_SHA + EVP_add_digest(EVP_sha1()); /* RSA with sha1 */ diff --git a/openssl-1.0.0-beta3-krb5.patch b/openssl-1.0.0-beta3-krb5.patch deleted file mode 100644 index ef7ccde..0000000 --- a/openssl-1.0.0-beta3-krb5.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up openssl-1.0.0-beta3/Makefile.org.krb5 openssl-1.0.0-beta3/Makefile.org ---- openssl-1.0.0-beta3/Makefile.org.krb5 2009-04-23 18:12:09.000000000 +0200 -+++ openssl-1.0.0-beta3/Makefile.org 2009-08-04 23:01:16.000000000 +0200 -@@ -299,7 +299,7 @@ build-shared: do_$(SHLIB_TARGET) link-sh - - do_$(SHLIB_TARGET): - @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \ -- if [ "$(SHLIBDIRS)" = "ssl" -a -n "$(LIBKRB5)" ]; then \ -+ if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \ - libs="$(LIBKRB5) $$libs"; \ - fi; \ - $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \ diff --git a/openssl-1.0.0-beta3-namingblk.patch b/openssl-1.0.0-beta3-namingblk.patch deleted file mode 100644 index d43e56c..0000000 --- a/openssl-1.0.0-beta3-namingblk.patch +++ /dev/null @@ -1,253 +0,0 @@ -Index: openssl/crypto/asn1/a_set.c -RCS File: /v/openssl/cvs/openssl/crypto/asn1/a_set.c,v -rcsdiff -q -kk '-r1.20' '-r1.20.2.1' -u '/v/openssl/cvs/openssl/crypto/asn1/a_set.c,v' 2>/dev/null ---- openssl/crypto/asn1/a_set.c 2009/01/01 18:30:50 1.20 -+++ openssl/crypto/asn1/a_set.c 2009/07/27 21:21:25 1.20.2.1 -@@ -85,7 +85,7 @@ - } - - /* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */ --int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp, -+int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, - i2d_of_void *i2d, int ex_tag, int ex_class, - int is_set) - { -@@ -97,8 +97,8 @@ - int totSize; - - if (a == NULL) return(0); -- for (i=sk_BLOCK_num(a)-1; i>=0; i--) -- ret+=i2d(sk_BLOCK_value(a,i),NULL); -+ for (i=sk_OPENSSL_BLOCK_num(a)-1; i>=0; i--) -+ ret+=i2d(sk_OPENSSL_BLOCK_value(a,i),NULL); - r=ASN1_object_size(1,ret,ex_tag); - if (pp == NULL) return(r); - -@@ -109,10 +109,10 @@ - /* And then again by Ben */ - /* And again by Steve */ - -- if(!is_set || (sk_BLOCK_num(a) < 2)) -+ if(!is_set || (sk_OPENSSL_BLOCK_num(a) < 2)) - { -- for (i=0; i/dev/null ---- openssl/crypto/asn1/asn1.h 2009/07/24 11:15:55 1.166.2.3 -+++ openssl/crypto/asn1/asn1.h 2009/07/27 21:21:25 1.166.2.4 -@@ -887,12 +887,13 @@ - ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); - int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); - --int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp, -+int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, - i2d_of_void *i2d, int ex_tag, int ex_class, - int is_set); --STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp, -+STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, -+ const unsigned char **pp, - long length, d2i_of_void *d2i, -- void (*free_func)(BLOCK), int ex_tag, -+ void (*free_func)(OPENSSL_BLOCK), int ex_tag, - int ex_class); - - #ifndef OPENSSL_NO_BIO -@@ -1045,9 +1046,9 @@ - int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, - unsigned char *data, int max_len); - --STACK_OF(BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, -- d2i_of_void *d2i, void (*free_func)(BLOCK)); --unsigned char *ASN1_seq_pack(STACK_OF(BLOCK) *safes, i2d_of_void *i2d, -+STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, -+ d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); -+unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, - unsigned char **buf, int *len ); - void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); - void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); -Index: openssl/crypto/asn1/asn_pack.c -RCS File: /v/openssl/cvs/openssl/crypto/asn1/asn_pack.c,v -rcsdiff -q -kk '-r1.19' '-r1.19.2.1' -u '/v/openssl/cvs/openssl/crypto/asn1/asn_pack.c,v' 2>/dev/null ---- openssl/crypto/asn1/asn_pack.c 2008/11/12 03:57:49 1.19 -+++ openssl/crypto/asn1/asn_pack.c 2009/07/27 21:21:25 1.19.2.1 -@@ -66,10 +66,10 @@ - - /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ - --STACK_OF(BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, -- d2i_of_void *d2i, void (*free_func)(BLOCK)) -+STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, -+ d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)) - { -- STACK_OF(BLOCK) *sk; -+ STACK_OF(OPENSSL_BLOCK) *sk; - const unsigned char *pbuf; - pbuf = buf; - if (!(sk = d2i_ASN1_SET(NULL, &pbuf, len, d2i, free_func, -@@ -82,7 +82,7 @@ - * OPENSSL_malloc'ed buffer - */ - --unsigned char *ASN1_seq_pack(STACK_OF(BLOCK) *safes, i2d_of_void *i2d, -+unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, - unsigned char **buf, int *len) - { - int safelen; -Index: openssl/crypto/stack/safestack.h -RCS File: /v/openssl/cvs/openssl/crypto/stack/safestack.h,v -rcsdiff -q -kk '-r1.72.2.4' '-r1.72.2.5' -u '/v/openssl/cvs/openssl/crypto/stack/safestack.h,v' 2>/dev/null ---- openssl/crypto/stack/safestack.h 2009/07/27 21:08:50 1.72.2.4 -+++ openssl/crypto/stack/safestack.h 2009/07/27 21:21:25 1.72.2.5 -@@ -128,8 +128,8 @@ - * nul-terminated. These should also be distinguished from "normal" - * stacks. */ - --typedef void *BLOCK; --DECLARE_SPECIAL_STACK_OF(BLOCK, void) -+typedef void *OPENSSL_BLOCK; -+DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) - - /* SKM_sk_... stack macros are internal to safestack.h: - * never use them directly, use sk__... instead */ -@@ -2055,29 +2055,29 @@ - #define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) - - --#define sk_BLOCK_new(cmp) ((STACK_OF(BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) --#define sk_BLOCK_new_null() ((STACK_OF(BLOCK) *)sk_new_null()) --#define sk_BLOCK_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_PTR_OF(void, val)) --#define sk_BLOCK_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_PTR_OF(void, val)) --#define sk_BLOCK_value(st, i) ((BLOCK)sk_value(CHECKED_PTR_OF(STACK_OF(BLOCK), st), i)) --#define sk_BLOCK_num(st) SKM_sk_num(BLOCK, st) --#define sk_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_SK_FREE_FUNC2(BLOCK, free_func)) --#define sk_BLOCK_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_PTR_OF(void, val), i) --#define sk_BLOCK_free(st) SKM_sk_free(BLOCK, st) --#define sk_BLOCK_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(BLOCK), st), i, CHECKED_PTR_OF(void, val)) --#define sk_BLOCK_zero(st) SKM_sk_zero(BLOCK, (st)) --#define sk_BLOCK_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_PTR_OF(void, val)) --#define sk_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(BLOCK), st), CHECKED_CONST_PTR_OF(void, val)) --#define sk_BLOCK_delete(st, i) SKM_sk_delete(BLOCK, (st), (i)) --#define sk_BLOCK_delete_ptr(st, ptr) (BLOCK *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_PTR_OF(void, ptr)) --#define sk_BLOCK_set_cmp_func(st, cmp) \ -+#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) -+#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) -+#define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val)) -+#define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val)) -+#define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), i)) -+#define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st) -+#define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_SK_FREE_FUNC2(OPENSSL_BLOCK, free_func)) -+#define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val), i) -+#define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st) -+#define sk_OPENSSL_BLOCK_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), i, CHECKED_PTR_OF(void, val)) -+#define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st)) -+#define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val)) -+#define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val)) -+#define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i)) -+#define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, ptr)) -+#define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp) \ - ((int (*)(const void * const *,const void * const *)) \ -- sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(BLOCK), st), CHECKED_SK_CMP_FUNC(void, cmp))) --#define sk_BLOCK_dup(st) SKM_sk_dup(BLOCK, st) --#define sk_BLOCK_shift(st) SKM_sk_shift(BLOCK, (st)) --#define sk_BLOCK_pop(st) (void *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(BLOCK), st)) --#define sk_BLOCK_sort(st) SKM_sk_sort(BLOCK, (st)) --#define sk_BLOCK_is_sorted(st) SKM_sk_is_sorted(BLOCK, (st)) -+ sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_SK_CMP_FUNC(void, cmp))) -+#define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st) -+#define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st)) -+#define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st)) -+#define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st)) -+#define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) - - - #define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) diff --git a/openssl-1.0.0-beta3-namingstr.patch b/openssl-1.0.0-beta3-namingstr.patch deleted file mode 100644 index 44dee95..0000000 --- a/openssl-1.0.0-beta3-namingstr.patch +++ /dev/null @@ -1,1663 +0,0 @@ -Index: openssl/apps/apps.c -RCS File: /v/openssl/cvs/openssl/apps/apps.c,v -rcsdiff -q -kk '-r1.133.2.6' '-r1.133.2.7' -u '/v/openssl/cvs/openssl/apps/apps.c,v' 2>/dev/null ---- openssl/apps/apps.c 2009/06/29 16:09:58 1.133.2.6 -+++ openssl/apps/apps.c 2009/07/27 21:08:43 1.133.2.7 -@@ -1488,7 +1488,7 @@ - return p; - } - --static unsigned long index_serial_hash(const CSTRING *a) -+static unsigned long index_serial_hash(const OPENSSL_CSTRING *a) - { - const char *n; - -@@ -1497,7 +1497,7 @@ - return(lh_strhash(n)); - } - --static int index_serial_cmp(const CSTRING *a, const CSTRING *b) -+static int index_serial_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b) - { - const char *aa,*bb; - -@@ -1509,16 +1509,16 @@ - static int index_name_qual(char **a) - { return(a[0][0] == 'V'); } - --static unsigned long index_name_hash(const CSTRING *a) -+static unsigned long index_name_hash(const OPENSSL_CSTRING *a) - { return(lh_strhash(a[DB_name])); } - --int index_name_cmp(const CSTRING *a, const CSTRING *b) -+int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b) - { return(strcmp(a[DB_name], b[DB_name])); } - --static IMPLEMENT_LHASH_HASH_FN(index_serial, CSTRING) --static IMPLEMENT_LHASH_COMP_FN(index_serial, CSTRING) --static IMPLEMENT_LHASH_HASH_FN(index_name, CSTRING) --static IMPLEMENT_LHASH_COMP_FN(index_name, CSTRING) -+static IMPLEMENT_LHASH_HASH_FN(index_serial, OPENSSL_CSTRING) -+static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING) -+static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING) -+static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING) - - #undef BSIZE - #define BSIZE 256 -Index: openssl/apps/apps.h -RCS File: /v/openssl/cvs/openssl/apps/apps.h,v -rcsdiff -q -kk '-r1.91' '-r1.91.2.1' -u '/v/openssl/cvs/openssl/apps/apps.h,v' 2>/dev/null ---- openssl/apps/apps.h 2008/11/24 17:27:05 1.91 -+++ openssl/apps/apps.h 2009/07/27 21:08:44 1.91.2.1 -@@ -295,9 +295,9 @@ - int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix); - void free_index(CA_DB *db); - #define index_name_cmp_noconst(a, b) \ -- index_name_cmp((const CSTRING *)CHECKED_PTR_OF(STRING, a), \ -- (const CSTRING *)CHECKED_PTR_OF(STRING, b)) --int index_name_cmp(const CSTRING *a, const CSTRING *b); -+ index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \ -+ (const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b)) -+int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b); - int parse_yesno(const char *str, int def); - - X509_NAME *parse_name(char *str, long chtype, int multirdn); -Index: openssl/apps/asn1pars.c -RCS File: /v/openssl/cvs/openssl/apps/asn1pars.c,v -rcsdiff -q -kk '-r1.26' '-r1.26.2.1' -u '/v/openssl/cvs/openssl/apps/asn1pars.c,v' 2>/dev/null ---- openssl/apps/asn1pars.c 2008/11/05 18:38:51 1.26 -+++ openssl/apps/asn1pars.c 2009/07/27 21:08:44 1.26.2.1 -@@ -96,7 +96,7 @@ - unsigned char *tmpbuf; - const unsigned char *ctmpbuf; - BUF_MEM *buf=NULL; -- STACK_OF(STRING) *osk=NULL; -+ STACK_OF(OPENSSL_STRING) *osk=NULL; - ASN1_TYPE *at=NULL; - - informat=FORMAT_PEM; -@@ -113,7 +113,7 @@ - prog=argv[0]; - argc--; - argv++; -- if ((osk=sk_STRING_new_null()) == NULL) -+ if ((osk=sk_OPENSSL_STRING_new_null()) == NULL) - { - BIO_printf(bio_err,"Memory allocation failure\n"); - goto end; -@@ -169,7 +169,7 @@ - else if (strcmp(*argv,"-strparse") == 0) - { - if (--argc < 1) goto bad; -- sk_STRING_push(osk,*(++argv)); -+ sk_OPENSSL_STRING_push(osk,*(++argv)); - } - else if (strcmp(*argv,"-genstr") == 0) - { -@@ -302,18 +302,18 @@ - - /* If any structs to parse go through in sequence */ - -- if (sk_STRING_num(osk)) -+ if (sk_OPENSSL_STRING_num(osk)) - { - tmpbuf=(unsigned char *)str; - tmplen=num; -- for (i=0; i/dev/null ---- openssl/apps/ca.c 2009/03/09 13:59:07 1.167 -+++ openssl/apps/ca.c 2009/07/27 21:08:44 1.167.2.1 -@@ -883,9 +883,9 @@ - if (db == NULL) goto err; - - /* Lets check some fields */ -- for (i=0; idb->data); i++) -+ for (i=0; idb->data); i++) - { -- pp=sk_PSTRING_value(db->db->data,i); -+ pp=sk_OPENSSL_PSTRING_value(db->db->data,i); - if ((pp[DB_type][0] != DB_TYPE_REV) && - (pp[DB_rev_date][0] != '\0')) - { -@@ -938,7 +938,7 @@ - #endif - TXT_DB_write(out,db->db); - BIO_printf(bio_err,"%d entries loaded from the database\n", -- sk_PSTRING_num(db->db->data)); -+ sk_OPENSSL_PSTRING_num(db->db->data)); - BIO_printf(bio_err,"generating index\n"); - } - -@@ -1408,9 +1408,9 @@ - - ASN1_TIME_free(tmptm); - -- for (i=0; idb->data); i++) -+ for (i=0; idb->data); i++) - { -- pp=sk_PSTRING_value(db->db->data,i); -+ pp=sk_OPENSSL_PSTRING_value(db->db->data,i); - if (pp[DB_type][0] == DB_TYPE_REV) - { - if ((r=X509_REVOKED_new()) == NULL) goto err; -@@ -1685,9 +1685,9 @@ - int ok= -1,i,j,last,nid; - const char *p; - CONF_VALUE *cv; -- STRING row[DB_NUMBER]; -- STRING *irow=NULL; -- STRING *rrow=NULL; -+ OPENSSL_STRING row[DB_NUMBER]; -+ OPENSSL_STRING *irow=NULL; -+ OPENSSL_STRING *rrow=NULL; - char buf[25]; - - tmptm=ASN1_UTCTIME_new(); -@@ -1929,7 +1929,7 @@ - - if (db->attributes.unique_subject) - { -- STRING *crow=row; -+ OPENSSL_STRING *crow=row; - - rrow=TXT_DB_get_by_index(db->db,DB_name,crow); - if (rrow != NULL) -@@ -2632,9 +2632,9 @@ - else - a_y2k = 0; - -- for (i = 0; i < sk_PSTRING_num(db->db->data); i++) -+ for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) - { -- rrow = sk_PSTRING_value(db->db->data, i); -+ rrow = sk_OPENSSL_PSTRING_value(db->db->data, i); - - if (rrow[DB_type][0] == 'V') - { -Index: openssl/apps/cms.c -RCS File: /v/openssl/cvs/openssl/apps/cms.c,v -rcsdiff -q -kk '-r1.23.2.1' '-r1.23.2.2' -u '/v/openssl/cvs/openssl/apps/cms.c,v' 2>/dev/null ---- openssl/apps/cms.c 2009/04/16 17:22:47 1.23.2.1 -+++ openssl/apps/cms.c 2009/07/27 21:08:44 1.23.2.2 -@@ -71,9 +71,9 @@ - static int save_certs(char *signerfile, STACK_OF(X509) *signers); - static int cms_cb(int ok, X509_STORE_CTX *ctx); - static void receipt_request_print(BIO *out, CMS_ContentInfo *cms); --static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to, -+static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to, - int rr_allorfirst, -- STACK_OF(STRING) *rr_from); -+ STACK_OF(OPENSSL_STRING) *rr_from); - - #define SMIME_OP 0x10 - #define SMIME_IP 0x20 -@@ -108,7 +108,7 @@ - const char *inmode = "r", *outmode = "w"; - char *infile = NULL, *outfile = NULL, *rctfile = NULL; - char *signerfile = NULL, *recipfile = NULL; -- STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL; -+ STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL; - char *certfile = NULL, *keyfile = NULL, *contfile=NULL; - char *certsoutfile = NULL; - const EVP_CIPHER *cipher = NULL; -@@ -122,7 +122,7 @@ - int flags = CMS_DETACHED, noout = 0, print = 0; - int verify_retcode = 0; - int rr_print = 0, rr_allorfirst = -1; -- STACK_OF(STRING) *rr_to = NULL, *rr_from = NULL; -+ STACK_OF(OPENSSL_STRING) *rr_to = NULL, *rr_from = NULL; - CMS_ReceiptRequest *rr = NULL; - char *to = NULL, *from = NULL, *subject = NULL; - char *CAfile = NULL, *CApath = NULL; -@@ -281,8 +281,8 @@ - goto argerr; - args++; - if (!rr_from) -- rr_from = sk_STRING_new_null(); -- sk_STRING_push(rr_from, *args); -+ rr_from = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(rr_from, *args); - } - else if (!strcmp(*args,"-receipt_request_to")) - { -@@ -290,8 +290,8 @@ - goto argerr; - args++; - if (!rr_to) -- rr_to = sk_STRING_new_null(); -- sk_STRING_push(rr_to, *args); -+ rr_to = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(rr_to, *args); - } - else if (!strcmp (*args, "-print")) - { -@@ -387,13 +387,13 @@ - if (signerfile) - { - if (!sksigners) -- sksigners = sk_STRING_new_null(); -- sk_STRING_push(sksigners, signerfile); -+ sksigners = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(sksigners, signerfile); - if (!keyfile) - keyfile = signerfile; - if (!skkeys) -- skkeys = sk_STRING_new_null(); -- sk_STRING_push(skkeys, keyfile); -+ skkeys = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(skkeys, keyfile); - keyfile = NULL; - } - signerfile = *++args; -@@ -435,12 +435,12 @@ - goto argerr; - } - if (!sksigners) -- sksigners = sk_STRING_new_null(); -- sk_STRING_push(sksigners, signerfile); -+ sksigners = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(sksigners, signerfile); - signerfile = NULL; - if (!skkeys) -- skkeys = sk_STRING_new_null(); -- sk_STRING_push(skkeys, keyfile); -+ skkeys = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(skkeys, keyfile); - } - keyfile = *++args; - } -@@ -539,13 +539,13 @@ - if (signerfile) - { - if (!sksigners) -- sksigners = sk_STRING_new_null(); -- sk_STRING_push(sksigners, signerfile); -+ sksigners = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(sksigners, signerfile); - if (!skkeys) -- skkeys = sk_STRING_new_null(); -+ skkeys = sk_OPENSSL_STRING_new_null(); - if (!keyfile) - keyfile = signerfile; -- sk_STRING_push(skkeys, keyfile); -+ sk_OPENSSL_STRING_push(skkeys, keyfile); - } - if (!sksigners) - { -@@ -980,11 +980,11 @@ - } - else - flags |= CMS_REUSE_DIGEST; -- for (i = 0; i < sk_STRING_num(sksigners); i++) -+ for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++) - { - CMS_SignerInfo *si; -- signerfile = sk_STRING_value(sksigners, i); -- keyfile = sk_STRING_value(skkeys, i); -+ signerfile = sk_OPENSSL_STRING_value(sksigners, i); -+ keyfile = sk_OPENSSL_STRING_value(skkeys, i); - signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL, - e, "signer certificate"); - if (!signer) -@@ -1160,9 +1160,9 @@ - if (vpm) - X509_VERIFY_PARAM_free(vpm); - if (sksigners) -- sk_STRING_free(sksigners); -+ sk_OPENSSL_STRING_free(sksigners); - if (skkeys) -- sk_STRING_free(skkeys); -+ sk_OPENSSL_STRING_free(skkeys); - if (secret_key) - OPENSSL_free(secret_key); - if (secret_keyid) -@@ -1172,9 +1172,9 @@ - if (rr) - CMS_ReceiptRequest_free(rr); - if (rr_to) -- sk_STRING_free(rr_to); -+ sk_OPENSSL_STRING_free(rr_to); - if (rr_from) -- sk_STRING_free(rr_from); -+ sk_OPENSSL_STRING_free(rr_from); - X509_STORE_free(store); - X509_free(cert); - X509_free(recip); -@@ -1296,7 +1296,7 @@ - } - } - --static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns) -+static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(OPENSSL_STRING) *ns) - { - int i; - STACK_OF(GENERAL_NAMES) *ret; -@@ -1305,9 +1305,9 @@ - ret = sk_GENERAL_NAMES_new_null(); - if (!ret) - goto err; -- for (i = 0; i < sk_STRING_num(ns); i++) -+ for (i = 0; i < sk_OPENSSL_STRING_num(ns); i++) - { -- char *str = sk_STRING_value(ns, i); -+ char *str = sk_OPENSSL_STRING_value(ns, i); - gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0); - if (!gen) - goto err; -@@ -1335,9 +1335,9 @@ - } - - --static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to, -+static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to, - int rr_allorfirst, -- STACK_OF(STRING) *rr_from) -+ STACK_OF(OPENSSL_STRING) *rr_from) - { - STACK_OF(GENERAL_NAMES) *rct_to, *rct_from; - CMS_ReceiptRequest *rr; -Index: openssl/apps/crl2p7.c -RCS File: /v/openssl/cvs/openssl/apps/crl2p7.c,v -rcsdiff -q -kk '-r1.19' '-r1.19.2.1' -u '/v/openssl/cvs/openssl/apps/crl2p7.c,v' 2>/dev/null ---- openssl/apps/crl2p7.c 2008/06/04 11:00:45 1.19 -+++ openssl/apps/crl2p7.c 2009/07/27 21:08:45 1.19.2.1 -@@ -92,7 +92,7 @@ - PKCS7 *p7 = NULL; - PKCS7_SIGNED *p7s = NULL; - X509_CRL *crl=NULL; -- STACK_OF(STRING) *certflst=NULL; -+ STACK_OF(OPENSSL_STRING) *certflst=NULL; - STACK_OF(X509_CRL) *crl_stack=NULL; - STACK_OF(X509) *cert_stack=NULL; - int ret=1,nocrl=0; -@@ -140,8 +140,8 @@ - else if (strcmp(*argv,"-certfile") == 0) - { - if (--argc < 1) goto bad; -- if(!certflst) certflst = sk_STRING_new_null(); -- sk_STRING_push(certflst,*(++argv)); -+ if(!certflst) certflst = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(certflst,*(++argv)); - } - else - { -@@ -226,8 +226,8 @@ - if ((cert_stack=sk_X509_new_null()) == NULL) goto end; - p7s->cert=cert_stack; - -- if(certflst) for(i = 0; i < sk_STRING_num(certflst); i++) { -- certfile = sk_STRING_value(certflst, i); -+ if(certflst) for(i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) { -+ certfile = sk_OPENSSL_STRING_value(certflst, i); - if (add_certs_from_file(cert_stack,certfile) < 0) - { - BIO_printf(bio_err, "error loading certificates\n"); -@@ -236,7 +236,7 @@ - } - } - -- sk_STRING_free(certflst); -+ sk_OPENSSL_STRING_free(certflst); - - if (outfile == NULL) - { -Index: openssl/apps/dgst.c -RCS File: /v/openssl/cvs/openssl/apps/dgst.c,v -rcsdiff -q -kk '-r1.54.2.3' '-r1.54.2.4' -u '/v/openssl/cvs/openssl/apps/dgst.c,v' 2>/dev/null ---- openssl/apps/dgst.c 2009/04/26 12:16:12 1.54.2.3 -+++ openssl/apps/dgst.c 2009/07/27 21:08:45 1.54.2.4 -@@ -127,7 +127,7 @@ - #endif - char *hmac_key=NULL; - char *mac_name=NULL; -- STACK_OF(STRING) *sigopts = NULL, *macopts = NULL; -+ STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL; - - apps_startup(); - -@@ -230,8 +230,8 @@ - if (--argc < 1) - break; - if (!sigopts) -- sigopts = sk_STRING_new_null(); -- if (!sigopts || !sk_STRING_push(sigopts, *(++argv))) -+ sigopts = sk_OPENSSL_STRING_new_null(); -+ if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv))) - break; - } - else if (strcmp(*argv,"-macopt") == 0) -@@ -239,8 +239,8 @@ - if (--argc < 1) - break; - if (!macopts) -- macopts = sk_STRING_new_null(); -- if (!macopts || !sk_STRING_push(macopts, *(++argv))) -+ macopts = sk_OPENSSL_STRING_new_null(); -+ if (!macopts || !sk_OPENSSL_STRING_push(macopts, *(++argv))) - break; - } - else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL) -@@ -365,9 +365,9 @@ - if (macopts) - { - char *macopt; -- for (i = 0; i < sk_STRING_num(macopts); i++) -+ for (i = 0; i < sk_OPENSSL_STRING_num(macopts); i++) - { -- macopt = sk_STRING_value(macopts, i); -+ macopt = sk_OPENSSL_STRING_value(macopts, i); - if (pkey_ctrl_string(mac_ctx, macopt) <= 0) - { - BIO_printf(bio_err, -@@ -424,9 +424,9 @@ - if (sigopts) - { - char *sigopt; -- for (i = 0; i < sk_STRING_num(sigopts); i++) -+ for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) - { -- sigopt = sk_STRING_value(sigopts, i); -+ sigopt = sk_OPENSSL_STRING_value(sigopts, i); - if (pkey_ctrl_string(pctx, sigopt) <= 0) - { - BIO_printf(bio_err, -@@ -531,9 +531,9 @@ - BIO_free_all(out); - EVP_PKEY_free(sigkey); - if (sigopts) -- sk_STRING_free(sigopts); -+ sk_OPENSSL_STRING_free(sigopts); - if (macopts) -- sk_STRING_free(macopts); -+ sk_OPENSSL_STRING_free(macopts); - if(sigbuf) OPENSSL_free(sigbuf); - if (bmd != NULL) BIO_free(bmd); - apps_shutdown(); -Index: openssl/apps/engine.c -RCS File: /v/openssl/cvs/openssl/apps/engine.c,v -rcsdiff -q -kk '-r1.34' '-r1.34.2.1' -u '/v/openssl/cvs/openssl/apps/engine.c,v' 2>/dev/null ---- openssl/apps/engine.c 2009/02/15 15:29:59 1.34 -+++ openssl/apps/engine.c 2009/07/27 21:08:45 1.34.2.1 -@@ -200,7 +200,7 @@ - char *desc = NULL; - int flags; - int xpos = 0; -- STACK_OF(STRING) *cmds = NULL; -+ STACK_OF(OPENSSL_STRING) *cmds = NULL; - if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) || - ((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE, - 0, NULL, NULL)) <= 0)) -@@ -211,7 +211,7 @@ - return 1; - } - -- cmds = sk_STRING_new_null(); -+ cmds = sk_OPENSSL_STRING_new_null(); - - if(!cmds) - goto err; -@@ -284,16 +284,16 @@ - BIO_printf(bio_out, "\n"); - ret = 1; - err: -- if(cmds) sk_STRING_pop_free(cmds, identity); -+ if(cmds) sk_OPENSSL_STRING_pop_free(cmds, identity); - if(name) OPENSSL_free(name); - if(desc) OPENSSL_free(desc); - return ret; - } - --static void util_do_cmds(ENGINE *e, STACK_OF(STRING) *cmds, BIO *bio_out, -- const char *indent) -+static void util_do_cmds(ENGINE *e, STACK_OF(OPENSSL_STRING) *cmds, -+ BIO *bio_out, const char *indent) - { -- int loop, res, num = sk_STRING_num(cmds); -+ int loop, res, num = sk_OPENSSL_STRING_num(cmds); - - if(num < 0) - { -@@ -304,7 +304,7 @@ - { - char buf[256]; - const char *cmd, *arg; -- cmd = sk_STRING_value(cmds, loop); -+ cmd = sk_OPENSSL_STRING_value(cmds, loop); - res = 1; /* assume success */ - /* Check if this command has no ":arg" */ - if((arg = strstr(cmd, ":")) == NULL) -@@ -344,9 +344,9 @@ - const char **pp; - int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0; - ENGINE *e; -- STACK_OF(STRING) *engines = sk_STRING_new_null(); -- STACK_OF(STRING) *pre_cmds = sk_STRING_new_null(); -- STACK_OF(STRING) *post_cmds = sk_STRING_new_null(); -+ STACK_OF(OPENSSL_STRING) *engines = sk_OPENSSL_STRING_new_null(); -+ STACK_OF(OPENSSL_STRING) *pre_cmds = sk_OPENSSL_STRING_new_null(); -+ STACK_OF(OPENSSL_STRING) *post_cmds = sk_OPENSSL_STRING_new_null(); - int badops=1; - BIO *bio_out=NULL; - const char *indent = " "; -@@ -393,20 +393,20 @@ - argc--; argv++; - if (argc == 0) - goto skip_arg_loop; -- sk_STRING_push(pre_cmds,*argv); -+ sk_OPENSSL_STRING_push(pre_cmds,*argv); - } - else if (strcmp(*argv,"-post") == 0) - { - argc--; argv++; - if (argc == 0) - goto skip_arg_loop; -- sk_STRING_push(post_cmds,*argv); -+ sk_OPENSSL_STRING_push(post_cmds,*argv); - } - else if ((strncmp(*argv,"-h",2) == 0) || - (strcmp(*argv,"-?") == 0)) - goto skip_arg_loop; - else -- sk_STRING_push(engines,*argv); -+ sk_OPENSSL_STRING_push(engines,*argv); - argc--; - argv++; - } -@@ -421,17 +421,17 @@ - goto end; - } - -- if (sk_STRING_num(engines) == 0) -+ if (sk_OPENSSL_STRING_num(engines) == 0) - { - for(e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e)) - { -- sk_STRING_push(engines,(char *)ENGINE_get_id(e)); -+ sk_OPENSSL_STRING_push(engines,(char *)ENGINE_get_id(e)); - } - } - -- for (i=0; i/dev/null ---- openssl/apps/ocsp.c 2009/04/02 15:19:03 1.54.2.1 -+++ openssl/apps/ocsp.c 2009/07/27 21:08:45 1.54.2.2 -@@ -99,7 +99,7 @@ - static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, const EVP_MD * cert_id_md, X509 *issuer, - STACK_OF(OCSP_CERTID) *ids); - static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req, -- STACK_OF(STRING) *names, -+ STACK_OF(OPENSSL_STRING) *names, - STACK_OF(OCSP_CERTID) *ids, long nsec, - long maxage); - -@@ -153,7 +153,7 @@ - int badarg = 0; - int i; - int ignore_err = 0; -- STACK_OF(STRING) *reqnames = NULL; -+ STACK_OF(OPENSSL_STRING) *reqnames = NULL; - STACK_OF(OCSP_CERTID) *ids = NULL; - - X509 *rca_cert = NULL; -@@ -170,7 +170,7 @@ - SSL_load_error_strings(); - OpenSSL_add_ssl_algorithms(); - args = argv + 1; -- reqnames = sk_STRING_new_null(); -+ reqnames = sk_OPENSSL_STRING_new_null(); - ids = sk_OCSP_CERTID_new_null(); - while (!badarg && *args && *args[0] == '-') - { -@@ -432,7 +432,7 @@ - if (!cert_id_md) cert_id_md = EVP_sha1(); - if(!add_ocsp_cert(&req, cert, cert_id_md, issuer, ids)) - goto end; -- if(!sk_STRING_push(reqnames, *args)) -+ if(!sk_OPENSSL_STRING_push(reqnames, *args)) - goto end; - } - else badarg = 1; -@@ -445,7 +445,7 @@ - if (!cert_id_md) cert_id_md = EVP_sha1(); - if(!add_ocsp_serial(&req, *args, cert_id_md, issuer, ids)) - goto end; -- if(!sk_STRING_push(reqnames, *args)) -+ if(!sk_OPENSSL_STRING_push(reqnames, *args)) - goto end; - } - else badarg = 1; -@@ -901,7 +901,7 @@ - OCSP_REQUEST_free(req); - OCSP_RESPONSE_free(resp); - OCSP_BASICRESP_free(bs); -- sk_STRING_free(reqnames); -+ sk_OPENSSL_STRING_free(reqnames); - sk_OCSP_CERTID_free(ids); - sk_X509_pop_free(sign_other, X509_free); - sk_X509_pop_free(verify_other, X509_free); -@@ -971,7 +971,7 @@ - } - - static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req, -- STACK_OF(STRING) *names, -+ STACK_OF(OPENSSL_STRING) *names, - STACK_OF(OCSP_CERTID) *ids, long nsec, - long maxage) - { -@@ -983,13 +983,13 @@ - - ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd; - -- if (!bs || !req || !sk_STRING_num(names) || !sk_OCSP_CERTID_num(ids)) -+ if (!bs || !req || !sk_OPENSSL_STRING_num(names) || !sk_OCSP_CERTID_num(ids)) - return 1; - - for (i = 0; i < sk_OCSP_CERTID_num(ids); i++) - { - id = sk_OCSP_CERTID_value(ids, i); -- name = sk_STRING_value(names, i); -+ name = sk_OPENSSL_STRING_value(names, i); - BIO_printf(out, "%s: ", name); - - if(!OCSP_resp_find_status(bs, id, &status, &reason, -Index: openssl/apps/pkcs12.c -RCS File: /v/openssl/cvs/openssl/apps/pkcs12.c,v -rcsdiff -q -kk '-r1.92.2.1' '-r1.92.2.2' -u '/v/openssl/cvs/openssl/apps/pkcs12.c,v' 2>/dev/null ---- openssl/apps/pkcs12.c 2009/06/17 12:05:49 1.92.2.1 -+++ openssl/apps/pkcs12.c 2009/07/27 21:08:45 1.92.2.2 -@@ -117,7 +117,7 @@ - int ret = 1; - int macver = 1; - int noprompt = 0; -- STACK_OF(STRING) *canames = NULL; -+ STACK_OF(OPENSSL_STRING) *canames = NULL; - char *cpass = NULL, *mpass = NULL; - char *passargin = NULL, *passargout = NULL, *passarg = NULL; - char *passin = NULL, *passout = NULL; -@@ -222,8 +222,8 @@ - } else if (!strcmp (*args, "-caname")) { - if (args[1]) { - args++; -- if (!canames) canames = sk_STRING_new_null(); -- sk_STRING_push(canames, *args); -+ if (!canames) canames = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(canames, *args); - } else badarg = 1; - } else if (!strcmp (*args, "-in")) { - if (args[1]) { -@@ -549,9 +549,9 @@ - - /* Add any CA names */ - -- for (i = 0; i < sk_STRING_num(canames); i++) -+ for (i = 0; i < sk_OPENSSL_STRING_num(canames); i++) - { -- catmp = (unsigned char *)sk_STRING_value(canames, i); -+ catmp = (unsigned char *)sk_OPENSSL_STRING_value(canames, i); - X509_alias_set1(sk_X509_value(certs, i), catmp, -1); - } - -@@ -687,7 +687,7 @@ - #endif - BIO_free(in); - BIO_free_all(out); -- if (canames) sk_STRING_free(canames); -+ if (canames) sk_OPENSSL_STRING_free(canames); - if(passin) OPENSSL_free(passin); - if(passout) OPENSSL_free(passout); - apps_shutdown(); -Index: openssl/apps/req.c -RCS File: /v/openssl/cvs/openssl/apps/req.c,v -rcsdiff -q -kk '-r1.139.2.2' '-r1.139.2.3' -u '/v/openssl/cvs/openssl/apps/req.c,v' 2>/dev/null ---- openssl/apps/req.c 2009/04/23 17:16:38 1.139.2.2 -+++ openssl/apps/req.c 2009/07/27 21:08:45 1.139.2.3 -@@ -165,7 +165,7 @@ - EVP_PKEY_CTX *genctx = NULL; - const char *keyalg = NULL; - char *keyalgstr = NULL; -- STACK_OF(STRING) *pkeyopts = NULL; -+ STACK_OF(OPENSSL_STRING) *pkeyopts = NULL; - EVP_PKEY *pkey=NULL; - int i=0,badops=0,newreq=0,verbose=0,pkey_type=-1; - long newkey = -1; -@@ -306,8 +306,8 @@ - if (--argc < 1) - goto bad; - if (!pkeyopts) -- pkeyopts = sk_STRING_new_null(); -- if (!pkeyopts || !sk_STRING_push(pkeyopts, *(++argv))) -+ pkeyopts = sk_OPENSSL_STRING_new_null(); -+ if (!pkeyopts || !sk_OPENSSL_STRING_push(pkeyopts, *(++argv))) - goto bad; - } - else if (strcmp(*argv,"-batch") == 0) -@@ -667,9 +667,9 @@ - if (pkeyopts) - { - char *genopt; -- for (i = 0; i < sk_STRING_num(pkeyopts); i++) -+ for (i = 0; i < sk_OPENSSL_STRING_num(pkeyopts); i++) - { -- genopt = sk_STRING_value(pkeyopts, i); -+ genopt = sk_OPENSSL_STRING_value(pkeyopts, i); - if (pkey_ctrl_string(genctx, genopt) <= 0) - { - BIO_printf(bio_err, -@@ -1083,7 +1083,7 @@ - if (genctx) - EVP_PKEY_CTX_free(genctx); - if (pkeyopts) -- sk_STRING_free(pkeyopts); -+ sk_OPENSSL_STRING_free(pkeyopts); - #ifndef OPENSSL_NO_ENGINE - if (gen_eng) - ENGINE_free(gen_eng); -Index: openssl/apps/s_server.c -RCS File: /v/openssl/cvs/openssl/apps/s_server.c,v -rcsdiff -q -kk '-r1.136.2.4' '-r1.136.2.5' -u '/v/openssl/cvs/openssl/apps/s_server.c,v' 2>/dev/null ---- openssl/apps/s_server.c 2009/06/30 16:10:24 1.136.2.4 -+++ openssl/apps/s_server.c 2009/07/27 21:08:46 1.136.2.5 -@@ -712,7 +712,7 @@ - int use_ssl; - unsigned char *rspder = NULL; - int rspderlen; -- STACK_OF(STRING) *aia = NULL; -+ STACK_OF(OPENSSL_STRING) *aia = NULL; - X509 *x = NULL; - X509_STORE_CTX inctx; - X509_OBJECT obj; -@@ -734,7 +734,7 @@ - aia = X509_get1_ocsp(x); - if (aia) - { -- if (!OCSP_parse_url(sk_STRING_value(aia, 0), -+ if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0), - &host, &port, &path, &use_ssl)) - { - BIO_puts(err, "cert_status: can't parse AIA URL\n"); -@@ -742,7 +742,7 @@ - } - if (srctx->verbose) - BIO_printf(err, "cert_status: AIA URL: %s\n", -- sk_STRING_value(aia, 0)); -+ sk_OPENSSL_STRING_value(aia, 0)); - } - else - { -Index: openssl/apps/smime.c -RCS File: /v/openssl/cvs/openssl/apps/smime.c,v -rcsdiff -q -kk '-r1.69' '-r1.69.2.1' -u '/v/openssl/cvs/openssl/apps/smime.c,v' 2>/dev/null ---- openssl/apps/smime.c 2008/11/05 18:38:51 1.69 -+++ openssl/apps/smime.c 2009/07/27 21:08:46 1.69.2.1 -@@ -93,7 +93,7 @@ - const char *inmode = "r", *outmode = "w"; - char *infile = NULL, *outfile = NULL; - char *signerfile = NULL, *recipfile = NULL; -- STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL; -+ STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL; - char *certfile = NULL, *keyfile = NULL, *contfile=NULL; - const EVP_CIPHER *cipher = NULL; - PKCS7 *p7 = NULL; -@@ -260,13 +260,13 @@ - if (signerfile) - { - if (!sksigners) -- sksigners = sk_STRING_new_null(); -- sk_STRING_push(sksigners, signerfile); -+ sksigners = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(sksigners, signerfile); - if (!keyfile) - keyfile = signerfile; - if (!skkeys) -- skkeys = sk_STRING_new_null(); -- sk_STRING_push(skkeys, keyfile); -+ skkeys = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(skkeys, keyfile); - keyfile = NULL; - } - signerfile = *++args; -@@ -302,12 +302,12 @@ - goto argerr; - } - if (!sksigners) -- sksigners = sk_STRING_new_null(); -- sk_STRING_push(sksigners, signerfile); -+ sksigners = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(sksigners, signerfile); - signerfile = NULL; - if (!skkeys) -- skkeys = sk_STRING_new_null(); -- sk_STRING_push(skkeys, keyfile); -+ skkeys = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(skkeys, keyfile); - } - keyfile = *++args; - } -@@ -389,13 +389,13 @@ - if (signerfile) - { - if (!sksigners) -- sksigners = sk_STRING_new_null(); -- sk_STRING_push(sksigners, signerfile); -+ sksigners = sk_OPENSSL_STRING_new_null(); -+ sk_OPENSSL_STRING_push(sksigners, signerfile); - if (!skkeys) -- skkeys = sk_STRING_new_null(); -+ skkeys = sk_OPENSSL_STRING_new_null(); - if (!keyfile) - keyfile = signerfile; -- sk_STRING_push(skkeys, keyfile); -+ sk_OPENSSL_STRING_push(skkeys, keyfile); - } - if (!sksigners) - { -@@ -707,10 +707,10 @@ - } - else - flags |= PKCS7_REUSE_DIGEST; -- for (i = 0; i < sk_STRING_num(sksigners); i++) -+ for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++) - { -- signerfile = sk_STRING_value(sksigners, i); -- keyfile = sk_STRING_value(skkeys, i); -+ signerfile = sk_OPENSSL_STRING_value(sksigners, i); -+ keyfile = sk_OPENSSL_STRING_value(skkeys, i); - signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL, - e, "signer certificate"); - if (!signer) -@@ -807,9 +807,9 @@ - if (vpm) - X509_VERIFY_PARAM_free(vpm); - if (sksigners) -- sk_STRING_free(sksigners); -+ sk_OPENSSL_STRING_free(sksigners); - if (skkeys) -- sk_STRING_free(skkeys); -+ sk_OPENSSL_STRING_free(skkeys); - X509_STORE_free(store); - X509_free(cert); - X509_free(recip); -Index: openssl/apps/x509.c -RCS File: /v/openssl/cvs/openssl/apps/x509.c,v -rcsdiff -q -kk '-r1.102.2.3' '-r1.102.2.4' -u '/v/openssl/cvs/openssl/apps/x509.c,v' 2>/dev/null ---- openssl/apps/x509.c 2009/07/14 15:14:39 1.102.2.3 -+++ openssl/apps/x509.c 2009/07/27 21:08:46 1.102.2.4 -@@ -738,14 +738,14 @@ - else if ((email == i) || (ocsp_uri == i)) - { - int j; -- STACK_OF(STRING) *emlst; -+ STACK_OF(OPENSSL_STRING) *emlst; - if (email == i) - emlst = X509_get1_email(x); - else - emlst = X509_get1_ocsp(x); -- for (j = 0; j < sk_STRING_num(emlst); j++) -+ for (j = 0; j < sk_OPENSSL_STRING_num(emlst); j++) - BIO_printf(STDout, "%s\n", -- sk_STRING_value(emlst, j)); -+ sk_OPENSSL_STRING_value(emlst, j)); - X509_email_free(emlst); - } - else if (aliasout == i) -Index: openssl/crypto/cryptlib.c -RCS File: /v/openssl/cvs/openssl/crypto/cryptlib.c,v -rcsdiff -q -kk '-r1.75.2.2' '-r1.75.2.3' -u '/v/openssl/cvs/openssl/crypto/cryptlib.c,v' 2>/dev/null ---- openssl/crypto/cryptlib.c 2009/05/05 19:23:14 1.75.2.2 -+++ openssl/crypto/cryptlib.c 2009/07/27 21:08:48 1.75.2.3 -@@ -174,7 +174,7 @@ - - /* This is for applications to allocate new type names in the non-dynamic - array of lock names. These are numbered with positive numbers. */ --static STACK_OF(STRING) *app_locks=NULL; -+static STACK_OF(OPENSSL_STRING) *app_locks=NULL; - - /* For applications that want a more dynamic way of handling threads, the - following stack is used. These are externally numbered with negative -@@ -210,7 +210,7 @@ - SSLeay_MSVC5_hack=(double)name[0]*(double)name[1]; - #endif - -- if ((app_locks == NULL) && ((app_locks=sk_STRING_new_null()) == NULL)) -+ if ((app_locks == NULL) && ((app_locks=sk_OPENSSL_STRING_new_null()) == NULL)) - { - CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID,ERR_R_MALLOC_FAILURE); - return(0); -@@ -220,7 +220,7 @@ - CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID,ERR_R_MALLOC_FAILURE); - return(0); - } -- i=sk_STRING_push(app_locks,str); -+ i=sk_OPENSSL_STRING_push(app_locks,str); - if (!i) - OPENSSL_free(str); - else -@@ -651,10 +651,10 @@ - return("dynamic"); - else if (type < CRYPTO_NUM_LOCKS) - return(lock_names[type]); -- else if (type-CRYPTO_NUM_LOCKS > sk_STRING_num(app_locks)) -+ else if (type-CRYPTO_NUM_LOCKS > sk_OPENSSL_STRING_num(app_locks)) - return("ERROR"); - else -- return(sk_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS)); -+ return(sk_OPENSSL_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS)); - } - - #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ -Index: openssl/crypto/engine/eng_dyn.c -RCS File: /v/openssl/cvs/openssl/crypto/engine/eng_dyn.c,v -rcsdiff -q -kk '-r1.14' '-r1.14.2.1' -u '/v/openssl/cvs/openssl/crypto/engine/eng_dyn.c,v' 2>/dev/null ---- openssl/crypto/engine/eng_dyn.c 2008/06/04 11:01:29 1.14 -+++ openssl/crypto/engine/eng_dyn.c 2009/07/27 21:08:49 1.14.2.1 -@@ -146,7 +146,7 @@ - * 'dirs' for loading. Default is to use 'dirs' as a fallback. */ - int dir_load; - /* A stack of directories from which ENGINEs could be loaded */ -- STACK_OF(STRING) *dirs; -+ STACK_OF(OPENSSL_STRING) *dirs; - }; - - /* This is the "ex_data" index we obtain and reserve for use with our context -@@ -174,7 +174,7 @@ - if(ctx->engine_id) - OPENSSL_free((void*)ctx->engine_id); - if(ctx->dirs) -- sk_STRING_pop_free(ctx->dirs, int_free_str); -+ sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str); - OPENSSL_free(ctx); - } - } -@@ -203,7 +203,7 @@ - c->DYNAMIC_F1 = "v_check"; - c->DYNAMIC_F2 = "bind_engine"; - c->dir_load = 1; -- c->dirs = sk_STRING_new_null(); -+ c->dirs = sk_OPENSSL_STRING_new_null(); - if(!c->dirs) - { - ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE); -@@ -393,7 +393,7 @@ - ERR_R_MALLOC_FAILURE); - return 0; - } -- sk_STRING_insert(ctx->dirs, tmp_str, -1); -+ sk_OPENSSL_STRING_insert(ctx->dirs, tmp_str, -1); - } - return 1; - default: -@@ -411,11 +411,11 @@ - ctx->DYNAMIC_LIBNAME, NULL, 0)) != NULL) - return 1; - /* If we're not allowed to use 'dirs' or we have none, fail */ -- if(!ctx->dir_load || (num = sk_STRING_num(ctx->dirs)) < 1) -+ if(!ctx->dir_load || (num = sk_OPENSSL_STRING_num(ctx->dirs)) < 1) - return 0; - for(loop = 0; loop < num; loop++) - { -- const char *s = sk_STRING_value(ctx->dirs, loop); -+ const char *s = sk_OPENSSL_STRING_value(ctx->dirs, loop); - char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s); - if(!merge) - return 0; -Index: openssl/crypto/lhash/lhash.h -RCS File: /v/openssl/cvs/openssl/crypto/lhash/lhash.h,v -rcsdiff -q -kk '-r1.23' '-r1.23.2.1' -u '/v/openssl/cvs/openssl/crypto/lhash/lhash.h,v' 2>/dev/null ---- openssl/crypto/lhash/lhash.h 2008/06/04 11:01:31 1.23 -+++ openssl/crypto/lhash/lhash.h 2009/07/27 21:08:50 1.23.2.1 -@@ -230,8 +230,8 @@ - lh_stats_bio(CHECKED_LHASH_OF(type, lh), out) - #define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh)) - --DECLARE_LHASH_OF(STRING); --DECLARE_LHASH_OF(CSTRING); -+DECLARE_LHASH_OF(OPENSSL_STRING); -+DECLARE_LHASH_OF(OPENSSL_CSTRING); - - #ifdef __cplusplus - } -Index: openssl/crypto/stack/safestack.h -RCS File: /v/openssl/cvs/openssl/crypto/stack/safestack.h,v -rcsdiff -q -kk '-r1.72.2.3' '-r1.72.2.4' -u '/v/openssl/cvs/openssl/crypto/stack/safestack.h,v' 2>/dev/null ---- openssl/crypto/stack/safestack.h 2009/04/28 21:56:04 1.72.2.3 -+++ openssl/crypto/stack/safestack.h 2009/07/27 21:08:50 1.72.2.4 -@@ -110,9 +110,9 @@ - * string. For now, I'm settling for dealing with the fact it is a - * string at all. - */ --typedef char *STRING; -+typedef char *OPENSSL_STRING; - --typedef const char *CSTRING; -+typedef const char *OPENSSL_CSTRING; - - /* Confusingly, LHASH_OF(STRING) deals with char ** throughout, but - * STACK_OF(STRING) is really more like STACK_OF(char), only, as -@@ -122,7 +122,7 @@ - * macros below. - */ - --DECLARE_SPECIAL_STACK_OF(STRING, char) -+DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char) - - /* Similarly, we sometimes use a block of characters, NOT - * nul-terminated. These should also be distinguished from "normal" -@@ -2030,29 +2030,29 @@ - #define sk_void_sort(st) SKM_sk_sort(void, (st)) - #define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st)) - --#define sk_STRING_new(cmp) ((STACK_OF(STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) --#define sk_STRING_new_null() ((STACK_OF(STRING) *)sk_new_null()) --#define sk_STRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val)) --#define sk_STRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val)) --#define sk_STRING_value(st, i) ((STRING)sk_value(CHECKED_PTR_OF(STACK_OF(STRING), st), i)) --#define sk_STRING_num(st) SKM_sk_num(STRING, st) --#define sk_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_SK_FREE_FUNC2(STRING, free_func)) --#define sk_STRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val), i) --#define sk_STRING_free(st) SKM_sk_free(STRING, st) --#define sk_STRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), i, CHECKED_PTR_OF(char, val)) --#define sk_STRING_zero(st) SKM_sk_zero(STRING, (st)) --#define sk_STRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, val)) --#define sk_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(STRING), st), CHECKED_CONST_PTR_OF(char, val)) --#define sk_STRING_delete(st, i) SKM_sk_delete(STRING, (st), (i)) --#define sk_STRING_delete_ptr(st, ptr) (STRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_PTR_OF(char, ptr)) --#define sk_STRING_set_cmp_func(st, cmp) \ -+#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) -+#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null()) -+#define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) -+#define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) -+#define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i)) -+#define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st) -+#define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_STRING, free_func)) -+#define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val), i) -+#define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st) -+#define sk_OPENSSL_STRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i, CHECKED_PTR_OF(char, val)) -+#define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st)) -+#define sk_OPENSSL_STRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) -+#define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val)) -+#define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i)) -+#define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, ptr)) -+#define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \ - ((int (*)(const char * const *,const char * const *)) \ -- sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st), CHECKED_SK_CMP_FUNC(char, cmp))) --#define sk_STRING_dup(st) SKM_sk_dup(STRING, st) --#define sk_STRING_shift(st) SKM_sk_shift(STRING, (st)) --#define sk_STRING_pop(st) (char *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(STRING), st)) --#define sk_STRING_sort(st) SKM_sk_sort(STRING, (st)) --#define sk_STRING_is_sorted(st) SKM_sk_is_sorted(STRING, (st)) -+ sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_CMP_FUNC(char, cmp))) -+#define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st) -+#define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st)) -+#define sk_OPENSSL_STRING_pop(st) (char *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st)) -+#define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st)) -+#define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) - - - #define sk_BLOCK_new(cmp) ((STACK_OF(BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) -@@ -2080,29 +2080,29 @@ - #define sk_BLOCK_is_sorted(st) SKM_sk_is_sorted(BLOCK, (st)) - - --#define sk_PSTRING_new(cmp) ((STACK_OF(PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(STRING, cmp))) --#define sk_PSTRING_new_null() ((STACK_OF(PSTRING) *)sk_new_null()) --#define sk_PSTRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val)) --#define sk_PSTRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val)) --#define sk_PSTRING_value(st, i) ((PSTRING)sk_value(CHECKED_PTR_OF(STACK_OF(PSTRING), st), i)) --#define sk_PSTRING_num(st) SKM_sk_num(PSTRING, st) --#define sk_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_SK_FREE_FUNC2(PSTRING, free_func)) --#define sk_PSTRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val), i) --#define sk_PSTRING_free(st) SKM_sk_free(PSTRING, st) --#define sk_PSTRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), i, CHECKED_PTR_OF(STRING, val)) --#define sk_PSTRING_zero(st) SKM_sk_zero(PSTRING, (st)) --#define sk_PSTRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, val)) --#define sk_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(PSTRING), st), CHECKED_CONST_PTR_OF(STRING, val)) --#define sk_PSTRING_delete(st, i) SKM_sk_delete(PSTRING, (st), (i)) --#define sk_PSTRING_delete_ptr(st, ptr) (PSTRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_PTR_OF(STRING, ptr)) --#define sk_PSTRING_set_cmp_func(st, cmp) \ -- ((int (*)(const STRING * const *,const STRING * const *)) \ -- sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st), CHECKED_SK_CMP_FUNC(STRING, cmp))) --#define sk_PSTRING_dup(st) SKM_sk_dup(PSTRING, st) --#define sk_PSTRING_shift(st) SKM_sk_shift(PSTRING, (st)) --#define sk_PSTRING_pop(st) (STRING *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(PSTRING), st)) --#define sk_PSTRING_sort(st) SKM_sk_sort(PSTRING, (st)) --#define sk_PSTRING_is_sorted(st) SKM_sk_is_sorted(PSTRING, (st)) -+#define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) -+#define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) -+#define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) -+#define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) -+#define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), i)) -+#define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) -+#define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func)) -+#define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) -+#define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) -+#define sk_OPENSSL_PSTRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) -+#define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) -+#define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) -+#define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) -+#define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) -+#define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) -+#define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ -+ ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ -+ sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) -+#define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) -+#define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) -+#define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st)) -+#define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) -+#define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) - - - #define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ -@@ -2390,24 +2390,6 @@ - LHM_lh_stats_bio(CONF_VALUE,lh,out) - #define lh_CONF_VALUE_free(lh) LHM_lh_free(CONF_VALUE,lh) - --#define lh_CSTRING_new() LHM_lh_new(CSTRING,cstring) --#define lh_CSTRING_insert(lh,inst) LHM_lh_insert(CSTRING,lh,inst) --#define lh_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(CSTRING,lh,inst) --#define lh_CSTRING_delete(lh,inst) LHM_lh_delete(CSTRING,lh,inst) --#define lh_CSTRING_doall(lh,fn) LHM_lh_doall(CSTRING,lh,fn) --#define lh_CSTRING_doall_arg(lh,fn,arg_type,arg) \ -- LHM_lh_doall_arg(CSTRING,lh,fn,arg_type,arg) --#define lh_CSTRING_error(lh) LHM_lh_error(CSTRING,lh) --#define lh_CSTRING_num_items(lh) LHM_lh_num_items(CSTRING,lh) --#define lh_CSTRING_down_load(lh) LHM_lh_down_load(CSTRING,lh) --#define lh_CSTRING_node_stats_bio(lh,out) \ -- LHM_lh_node_stats_bio(CSTRING,lh,out) --#define lh_CSTRING_node_usage_stats_bio(lh,out) \ -- LHM_lh_node_usage_stats_bio(CSTRING,lh,out) --#define lh_CSTRING_stats_bio(lh,out) \ -- LHM_lh_stats_bio(CSTRING,lh,out) --#define lh_CSTRING_free(lh) LHM_lh_free(CSTRING,lh) -- - #define lh_ENGINE_PILE_new() LHM_lh_new(ENGINE_PILE,engine_pile) - #define lh_ENGINE_PILE_insert(lh,inst) LHM_lh_insert(ENGINE_PILE,lh,inst) - #define lh_ENGINE_PILE_retrieve(lh,inst) LHM_lh_retrieve(ENGINE_PILE,lh,inst) -@@ -2534,6 +2516,42 @@ - LHM_lh_stats_bio(OBJ_NAME,lh,out) - #define lh_OBJ_NAME_free(lh) LHM_lh_free(OBJ_NAME,lh) - -+#define lh_OPENSSL_CSTRING_new() LHM_lh_new(OPENSSL_CSTRING,openssl_cstring) -+#define lh_OPENSSL_CSTRING_insert(lh,inst) LHM_lh_insert(OPENSSL_CSTRING,lh,inst) -+#define lh_OPENSSL_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_CSTRING,lh,inst) -+#define lh_OPENSSL_CSTRING_delete(lh,inst) LHM_lh_delete(OPENSSL_CSTRING,lh,inst) -+#define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn) -+#define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \ -+ LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg) -+#define lh_OPENSSL_CSTRING_error(lh) LHM_lh_error(OPENSSL_CSTRING,lh) -+#define lh_OPENSSL_CSTRING_num_items(lh) LHM_lh_num_items(OPENSSL_CSTRING,lh) -+#define lh_OPENSSL_CSTRING_down_load(lh) LHM_lh_down_load(OPENSSL_CSTRING,lh) -+#define lh_OPENSSL_CSTRING_node_stats_bio(lh,out) \ -+ LHM_lh_node_stats_bio(OPENSSL_CSTRING,lh,out) -+#define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh,out) \ -+ LHM_lh_node_usage_stats_bio(OPENSSL_CSTRING,lh,out) -+#define lh_OPENSSL_CSTRING_stats_bio(lh,out) \ -+ LHM_lh_stats_bio(OPENSSL_CSTRING,lh,out) -+#define lh_OPENSSL_CSTRING_free(lh) LHM_lh_free(OPENSSL_CSTRING,lh) -+ -+#define lh_OPENSSL_STRING_new() LHM_lh_new(OPENSSL_STRING,openssl_string) -+#define lh_OPENSSL_STRING_insert(lh,inst) LHM_lh_insert(OPENSSL_STRING,lh,inst) -+#define lh_OPENSSL_STRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_STRING,lh,inst) -+#define lh_OPENSSL_STRING_delete(lh,inst) LHM_lh_delete(OPENSSL_STRING,lh,inst) -+#define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn) -+#define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \ -+ LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg) -+#define lh_OPENSSL_STRING_error(lh) LHM_lh_error(OPENSSL_STRING,lh) -+#define lh_OPENSSL_STRING_num_items(lh) LHM_lh_num_items(OPENSSL_STRING,lh) -+#define lh_OPENSSL_STRING_down_load(lh) LHM_lh_down_load(OPENSSL_STRING,lh) -+#define lh_OPENSSL_STRING_node_stats_bio(lh,out) \ -+ LHM_lh_node_stats_bio(OPENSSL_STRING,lh,out) -+#define lh_OPENSSL_STRING_node_usage_stats_bio(lh,out) \ -+ LHM_lh_node_usage_stats_bio(OPENSSL_STRING,lh,out) -+#define lh_OPENSSL_STRING_stats_bio(lh,out) \ -+ LHM_lh_stats_bio(OPENSSL_STRING,lh,out) -+#define lh_OPENSSL_STRING_free(lh) LHM_lh_free(OPENSSL_STRING,lh) -+ - #define lh_SSL_SESSION_new() LHM_lh_new(SSL_SESSION,ssl_session) - #define lh_SSL_SESSION_insert(lh,inst) LHM_lh_insert(SSL_SESSION,lh,inst) - #define lh_SSL_SESSION_retrieve(lh,inst) LHM_lh_retrieve(SSL_SESSION,lh,inst) -@@ -2551,24 +2569,6 @@ - #define lh_SSL_SESSION_stats_bio(lh,out) \ - LHM_lh_stats_bio(SSL_SESSION,lh,out) - #define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh) -- --#define lh_STRING_new() LHM_lh_new(STRING,string) --#define lh_STRING_insert(lh,inst) LHM_lh_insert(STRING,lh,inst) --#define lh_STRING_retrieve(lh,inst) LHM_lh_retrieve(STRING,lh,inst) --#define lh_STRING_delete(lh,inst) LHM_lh_delete(STRING,lh,inst) --#define lh_STRING_doall(lh,fn) LHM_lh_doall(STRING,lh,fn) --#define lh_STRING_doall_arg(lh,fn,arg_type,arg) \ -- LHM_lh_doall_arg(STRING,lh,fn,arg_type,arg) --#define lh_STRING_error(lh) LHM_lh_error(STRING,lh) --#define lh_STRING_num_items(lh) LHM_lh_num_items(STRING,lh) --#define lh_STRING_down_load(lh) LHM_lh_down_load(STRING,lh) --#define lh_STRING_node_stats_bio(lh,out) \ -- LHM_lh_node_stats_bio(STRING,lh,out) --#define lh_STRING_node_usage_stats_bio(lh,out) \ -- LHM_lh_node_usage_stats_bio(STRING,lh,out) --#define lh_STRING_stats_bio(lh,out) \ -- LHM_lh_stats_bio(STRING,lh,out) --#define lh_STRING_free(lh) LHM_lh_free(STRING,lh) - /* End of util/mkstack.pl block, you may now edit :-) */ - - #endif /* !defined HEADER_SAFESTACK_H */ -Index: openssl/crypto/txt_db/txt_db.c -RCS File: /v/openssl/cvs/openssl/crypto/txt_db/txt_db.c,v -rcsdiff -q -kk '-r1.25' '-r1.25.2.1' -u '/v/openssl/cvs/openssl/crypto/txt_db/txt_db.c,v' 2>/dev/null ---- openssl/crypto/txt_db/txt_db.c 2008/07/04 23:12:51 1.25 -+++ openssl/crypto/txt_db/txt_db.c 2009/07/27 21:08:51 1.25.2.1 -@@ -78,7 +78,7 @@ - int size=BUFSIZE; - int offset=0; - char *p,*f; -- STRING *pp; -+ OPENSSL_STRING *pp; - BUF_MEM *buf=NULL; - - if ((buf=BUF_MEM_new()) == NULL) goto err; -@@ -89,7 +89,7 @@ - ret->num_fields=num; - ret->index=NULL; - ret->qual=NULL; -- if ((ret->data=sk_PSTRING_new_null()) == NULL) -+ if ((ret->data=sk_OPENSSL_PSTRING_new_null()) == NULL) - goto err; - if ((ret->index=OPENSSL_malloc(sizeof(*ret->index)*num)) == NULL) - goto err; -@@ -163,7 +163,7 @@ - goto err; - } - pp[n]=p; -- if (!sk_PSTRING_push(ret->data,pp)) -+ if (!sk_OPENSSL_PSTRING_push(ret->data,pp)) - { - #if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporary fix :-( */ - fprintf(stderr,"failure in sk_push\n"); -@@ -182,7 +182,7 @@ - #endif - if (ret != NULL) - { -- if (ret->data != NULL) sk_PSTRING_free(ret->data); -+ if (ret->data != NULL) sk_OPENSSL_PSTRING_free(ret->data); - if (ret->index != NULL) OPENSSL_free(ret->index); - if (ret->qual != NULL) OPENSSL_free(ret->qual); - if (ret != NULL) OPENSSL_free(ret); -@@ -193,10 +193,10 @@ - return(ret); - } - --STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, STRING *value) -+OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value) - { -- STRING *ret; -- LHASH_OF(STRING) *lh; -+ OPENSSL_STRING *ret; -+ LHASH_OF(OPENSSL_STRING) *lh; - - if (idx >= db->num_fields) - { -@@ -209,16 +209,16 @@ - db->error=DB_ERROR_NO_INDEX; - return(NULL); - } -- ret=lh_STRING_retrieve(lh,value); -+ ret=lh_OPENSSL_STRING_retrieve(lh,value); - db->error=DB_ERROR_OK; - return(ret); - } - --int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(STRING *), -+int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *), - LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp) - { -- LHASH_OF(STRING) *idx; -- STRING *r; -+ LHASH_OF(OPENSSL_STRING) *idx; -+ OPENSSL_STRING *r; - int i,n; - - if (field >= db->num_fields) -@@ -227,26 +227,26 @@ - return(0); - } - /* FIXME: we lose type checking at this point */ -- if ((idx=(LHASH_OF(STRING) *)lh_new(hash,cmp)) == NULL) -+ if ((idx=(LHASH_OF(OPENSSL_STRING) *)lh_new(hash,cmp)) == NULL) - { - db->error=DB_ERROR_MALLOC; - return(0); - } -- n=sk_PSTRING_num(db->data); -+ n=sk_OPENSSL_PSTRING_num(db->data); - for (i=0; idata,i); -+ r=sk_OPENSSL_PSTRING_value(db->data,i); - if ((qual != NULL) && (qual(r) == 0)) continue; -- if ((r=lh_STRING_insert(idx,r)) != NULL) -+ if ((r=lh_OPENSSL_STRING_insert(idx,r)) != NULL) - { - db->error=DB_ERROR_INDEX_CLASH; -- db->arg1=sk_PSTRING_find(db->data,r); -+ db->arg1=sk_OPENSSL_PSTRING_find(db->data,r); - db->arg2=i; -- lh_STRING_free(idx); -+ lh_OPENSSL_STRING_free(idx); - return(0); - } - } -- if (db->index[field] != NULL) lh_STRING_free(db->index[field]); -+ if (db->index[field] != NULL) lh_OPENSSL_STRING_free(db->index[field]); - db->index[field]=idx; - db->qual[field]=qual; - return(1); -@@ -261,11 +261,11 @@ - - if ((buf=BUF_MEM_new()) == NULL) - goto err; -- n=sk_PSTRING_num(db->data); -+ n=sk_OPENSSL_PSTRING_num(db->data); - nn=db->num_fields; - for (i=0; idata,i); -+ pp=sk_OPENSSL_PSTRING_value(db->data,i); - - l=0; - for (j=0; jnum_fields; i++) - { -@@ -311,7 +311,7 @@ - { - if ((db->qual[i] != NULL) && - (db->qual[i](row) == 0)) continue; -- r=lh_STRING_retrieve(db->index[i],row); -+ r=lh_OPENSSL_STRING_retrieve(db->index[i],row); - if (r != NULL) - { - db->error=DB_ERROR_INDEX_CLASH; -@@ -322,7 +322,7 @@ - } - } - /* We have passed the index checks, now just append and insert */ -- if (!sk_PSTRING_push(db->data,row)) -+ if (!sk_OPENSSL_PSTRING_push(db->data,row)) - { - db->error=DB_ERROR_MALLOC; - goto err; -@@ -334,7 +334,7 @@ - { - if ((db->qual[i] != NULL) && - (db->qual[i](row) == 0)) continue; -- (void)lh_STRING_insert(db->index[i],row); -+ (void)lh_OPENSSL_STRING_insert(db->index[i],row); - } - } - return(1); -@@ -353,18 +353,18 @@ - if (db->index != NULL) - { - for (i=db->num_fields-1; i>=0; i--) -- if (db->index[i] != NULL) lh_STRING_free(db->index[i]); -+ if (db->index[i] != NULL) lh_OPENSSL_STRING_free(db->index[i]); - OPENSSL_free(db->index); - } - if (db->qual != NULL) - OPENSSL_free(db->qual); - if (db->data != NULL) - { -- for (i=sk_PSTRING_num(db->data)-1; i>=0; i--) -+ for (i=sk_OPENSSL_PSTRING_num(db->data)-1; i>=0; i--) - { - /* check if any 'fields' have been allocated - * from outside of the initial block */ -- p=sk_PSTRING_value(db->data,i); -+ p=sk_OPENSSL_PSTRING_value(db->data,i); - max=p[db->num_fields]; /* last address */ - if (max == NULL) /* new row */ - { -@@ -380,9 +380,9 @@ - OPENSSL_free(p[n]); - } - } -- OPENSSL_free(sk_PSTRING_value(db->data,i)); -+ OPENSSL_free(sk_OPENSSL_PSTRING_value(db->data,i)); - } -- sk_PSTRING_free(db->data); -+ sk_OPENSSL_PSTRING_free(db->data); - } - OPENSSL_free(db); - } -Index: openssl/crypto/txt_db/txt_db.h -RCS File: /v/openssl/cvs/openssl/crypto/txt_db/txt_db.h,v -rcsdiff -q -kk '-r1.11' '-r1.11.2.1' -u '/v/openssl/cvs/openssl/crypto/txt_db/txt_db.h,v' 2>/dev/null ---- openssl/crypto/txt_db/txt_db.h 2008/06/04 11:01:38 1.11 -+++ openssl/crypto/txt_db/txt_db.h 2009/07/27 21:08:51 1.11.2.1 -@@ -77,19 +77,19 @@ - extern "C" { - #endif - --typedef STRING *PSTRING; --DECLARE_SPECIAL_STACK_OF(PSTRING, STRING) -+typedef OPENSSL_STRING *OPENSSL_PSTRING; -+DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) - - typedef struct txt_db_st - { - int num_fields; -- STACK_OF(PSTRING) *data; -- LHASH_OF(STRING) **index; -- int (**qual)(STRING *); -+ STACK_OF(OPENSSL_PSTRING) *data; -+ LHASH_OF(OPENSSL_STRING) **index; -+ int (**qual)(OPENSSL_STRING *); - long error; - long arg1; - long arg2; -- STRING *arg_row; -+ OPENSSL_STRING *arg_row; - } TXT_DB; - - #ifndef OPENSSL_NO_BIO -@@ -99,11 +99,11 @@ - TXT_DB *TXT_DB_read(char *in, int num); - long TXT_DB_write(char *out, TXT_DB *db); - #endif --int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(STRING *), -+int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(OPENSSL_STRING *), - LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); - void TXT_DB_free(TXT_DB *db); --STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, STRING *value); --int TXT_DB_insert(TXT_DB *db, STRING *value); -+OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value); -+int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); - - #ifdef __cplusplus - } -Index: openssl/crypto/x509v3/v3_utl.c -RCS File: /v/openssl/cvs/openssl/crypto/x509v3/v3_utl.c,v -rcsdiff -q -kk '-r1.44' '-r1.44.2.1' -u '/v/openssl/cvs/openssl/crypto/x509v3/v3_utl.c,v' 2>/dev/null ---- openssl/crypto/x509v3/v3_utl.c 2009/02/14 21:49:36 1.44 -+++ openssl/crypto/x509v3/v3_utl.c 2009/07/27 21:08:53 1.44.2.1 -@@ -67,9 +67,9 @@ - - static char *strip_spaces(char *name); - static int sk_strcmp(const char * const *a, const char * const *b); --static STACK_OF(STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens); --static void str_free(STRING str); --static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email); -+static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens); -+static void str_free(OPENSSL_STRING str); -+static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email); - - static int ipv4_from_asc(unsigned char *v4, const char *in); - static int ipv6_from_asc(unsigned char *v6, const char *in); -@@ -463,10 +463,10 @@ - return strcmp(*a, *b); - } - --STACK_OF(STRING) *X509_get1_email(X509 *x) -+STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x) - { - GENERAL_NAMES *gens; -- STACK_OF(STRING) *ret; -+ STACK_OF(OPENSSL_STRING) *ret; - - gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); - ret = get_email(X509_get_subject_name(x), gens); -@@ -474,10 +474,10 @@ - return ret; - } - --STACK_OF(STRING) *X509_get1_ocsp(X509 *x) -+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x) - { - AUTHORITY_INFO_ACCESS *info; -- STACK_OF(STRING) *ret = NULL; -+ STACK_OF(OPENSSL_STRING) *ret = NULL; - int i; - - info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL); -@@ -499,11 +499,11 @@ - return ret; - } - --STACK_OF(STRING) *X509_REQ_get1_email(X509_REQ *x) -+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x) - { - GENERAL_NAMES *gens; - STACK_OF(X509_EXTENSION) *exts; -- STACK_OF(STRING) *ret; -+ STACK_OF(OPENSSL_STRING) *ret; - - exts = X509_REQ_get_extensions(x); - gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL); -@@ -514,9 +514,9 @@ - } - - --static STACK_OF(STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) -+static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) - { -- STACK_OF(STRING) *ret = NULL; -+ STACK_OF(OPENSSL_STRING) *ret = NULL; - X509_NAME_ENTRY *ne; - ASN1_IA5STRING *email; - GENERAL_NAME *gen; -@@ -539,23 +539,23 @@ - return ret; - } - --static void str_free(STRING str) -+static void str_free(OPENSSL_STRING str) - { - OPENSSL_free(str); - } - --static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email) -+static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) - { - char *emtmp; - /* First some sanity checks */ - if(email->type != V_ASN1_IA5STRING) return 1; - if(!email->data || !email->length) return 1; -- if(!*sk) *sk = sk_STRING_new(sk_strcmp); -+ if(!*sk) *sk = sk_OPENSSL_STRING_new(sk_strcmp); - if(!*sk) return 0; - /* Don't add duplicates */ -- if(sk_STRING_find(*sk, (char *)email->data) != -1) return 1; -+ if(sk_OPENSSL_STRING_find(*sk, (char *)email->data) != -1) return 1; - emtmp = BUF_strdup((char *)email->data); -- if(!emtmp || !sk_STRING_push(*sk, emtmp)) { -+ if(!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { - X509_email_free(*sk); - *sk = NULL; - return 0; -@@ -563,9 +563,9 @@ - return 1; - } - --void X509_email_free(STACK_OF(STRING) *sk) -+void X509_email_free(STACK_OF(OPENSSL_STRING) *sk) - { -- sk_STRING_pop_free(sk, str_free); -+ sk_OPENSSL_STRING_pop_free(sk, str_free); - } - - /* Convert IP addresses both IPv4 and IPv6 into an -Index: openssl/crypto/x509v3/x509v3.h -RCS File: /v/openssl/cvs/openssl/crypto/x509v3/x509v3.h,v -rcsdiff -q -kk '-r1.126.2.1' '-r1.126.2.2' -u '/v/openssl/cvs/openssl/crypto/x509v3/x509v3.h,v' 2>/dev/null ---- openssl/crypto/x509v3/x509v3.h 2009/04/19 17:58:01 1.126.2.1 -+++ openssl/crypto/x509v3/x509v3.h 2009/07/27 21:08:53 1.126.2.2 -@@ -693,10 +693,10 @@ - void X509_PURPOSE_cleanup(void); - int X509_PURPOSE_get_id(X509_PURPOSE *); - --STACK_OF(STRING) *X509_get1_email(X509 *x); --STACK_OF(STRING) *X509_REQ_get1_email(X509_REQ *x); --void X509_email_free(STACK_OF(STRING) *sk); --STACK_OF(STRING) *X509_get1_ocsp(X509 *x); -+STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); -+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); -+void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); -+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); - - ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); - ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); diff --git a/openssl-0.9.8k-algo-doc.patch b/openssl-1.0.0-beta4-algo-doc.patch similarity index 86% rename from openssl-0.9.8k-algo-doc.patch rename to openssl-1.0.0-beta4-algo-doc.patch index 27521a4..2f18f3f 100644 --- a/openssl-0.9.8k-algo-doc.patch +++ b/openssl-1.0.0-beta4-algo-doc.patch @@ -1,6 +1,6 @@ -diff -up openssl-0.9.8k/doc/crypto/EVP_DigestInit.pod.algo-doc openssl-0.9.8k/doc/crypto/EVP_DigestInit.pod ---- openssl-0.9.8k/doc/crypto/EVP_DigestInit.pod.algo-doc 2004-05-20 23:39:50.000000000 +0200 -+++ openssl-0.9.8k/doc/crypto/EVP_DigestInit.pod 2009-06-30 12:04:47.000000000 +0200 +diff -up openssl-1.0.0-beta4/doc/crypto/EVP_DigestInit.pod.algo-doc openssl-1.0.0-beta4/doc/crypto/EVP_DigestInit.pod +--- openssl-1.0.0-beta4/doc/crypto/EVP_DigestInit.pod.algo-doc 2009-10-16 17:29:34.000000000 +0200 ++++ openssl-1.0.0-beta4/doc/crypto/EVP_DigestInit.pod 2009-11-12 14:13:21.000000000 +0100 @@ -6,7 +6,8 @@ EVP_MD_CTX_init, EVP_MD_CTX_create, EVP_ EVP_DigestFinal_ex, EVP_MD_CTX_cleanup, EVP_MD_CTX_destroy, EVP_MAX_MD_SIZE, EVP_MD_CTX_copy_ex, EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, @@ -45,8 +45,8 @@ diff -up openssl-0.9.8k/doc/crypto/EVP_DigestInit.pod.algo-doc openssl-0.9.8k/do +signature algorithm is RSA in each case. EVP_dss() and EVP_dss1() return B structures for SHA and SHA1 digest - algorithms but using DSS (DSA) for the signature algorithm. -@@ -156,7 +163,8 @@ EVP_MD_size(), EVP_MD_block_size(), EVP_ + algorithms but using DSS (DSA) for the signature algorithm. Note: there is +@@ -158,7 +165,8 @@ EVP_MD_size(), EVP_MD_block_size(), EVP_ EVP_MD_CTX_block_size() and EVP_MD_block_size() return the digest or block size in bytes. @@ -56,9 +56,9 @@ diff -up openssl-0.9.8k/doc/crypto/EVP_DigestInit.pod.algo-doc openssl-0.9.8k/do EVP_dss1(), EVP_mdc2() and EVP_ripemd160() return pointers to the corresponding EVP_MD structures. -diff -up openssl-0.9.8k/doc/crypto/EVP_EncryptInit.pod.algo-doc openssl-0.9.8k/doc/crypto/EVP_EncryptInit.pod ---- openssl-0.9.8k/doc/crypto/EVP_EncryptInit.pod.algo-doc 2005-04-15 18:01:35.000000000 +0200 -+++ openssl-0.9.8k/doc/crypto/EVP_EncryptInit.pod 2009-06-30 12:04:47.000000000 +0200 +diff -up openssl-1.0.0-beta4/doc/crypto/EVP_EncryptInit.pod.algo-doc openssl-1.0.0-beta4/doc/crypto/EVP_EncryptInit.pod +--- openssl-1.0.0-beta4/doc/crypto/EVP_EncryptInit.pod.algo-doc 2005-04-15 18:01:35.000000000 +0200 ++++ openssl-1.0.0-beta4/doc/crypto/EVP_EncryptInit.pod 2009-11-12 14:11:03.000000000 +0100 @@ -91,6 +91,32 @@ EVP_CIPHER_CTX_set_padding - EVP cipher int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); diff --git a/openssl-1.0.0-beta4-backports.patch b/openssl-1.0.0-beta4-backports.patch new file mode 100644 index 0000000..ad4c7e4 --- /dev/null +++ b/openssl-1.0.0-beta4-backports.patch @@ -0,0 +1,45 @@ +diff -up openssl-1.0.0-beta4/crypto/asn1/d2i_pu.c.backports openssl-1.0.0-beta4/crypto/asn1/d2i_pu.c +--- openssl-1.0.0-beta4/crypto/asn1/d2i_pu.c.backports 2008-11-12 04:57:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/asn1/d2i_pu.c 2009-11-18 14:11:14.000000000 +0100 +@@ -87,9 +87,13 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PK + } + else ret= *a; + +- ret->save_type=type; +- ret->type=EVP_PKEY_type(type); +- switch (ret->type) ++ if (!EVP_PKEY_set_type(ret, type)) ++ { ++ ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB); ++ goto err; ++ } ++ ++ switch (EVP_PKEY_id(ret)) + { + #ifndef OPENSSL_NO_RSA + case EVP_PKEY_RSA: +diff -up openssl-1.0.0-beta4/crypto/evp/p_lib.c.backports openssl-1.0.0-beta4/crypto/evp/p_lib.c +--- openssl-1.0.0-beta4/crypto/evp/p_lib.c.backports 2006-07-04 22:27:44.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/evp/p_lib.c 2009-11-18 14:11:26.000000000 +0100 +@@ -220,7 +220,10 @@ static int pkey_set_type(EVP_PKEY *pkey, + #ifndef OPENSSL_NO_ENGINE + /* If we have an ENGINE release it */ + if (pkey->engine) ++ { + ENGINE_finish(pkey->engine); ++ pkey->engine = NULL; ++ } + #endif + } + if (str) +diff -up openssl-1.0.0-beta4/crypto/x509/x509_vfy.c.backports openssl-1.0.0-beta4/crypto/x509/x509_vfy.c +--- openssl-1.0.0-beta4/crypto/x509/x509_vfy.c.backports 2009-10-31 20:21:47.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/x509/x509_vfy.c 2009-11-18 14:11:31.000000000 +0100 +@@ -1727,6 +1727,7 @@ int X509_cmp_time(const ASN1_TIME *ctm, + offset= -offset; + } + atm.type=ctm->type; ++ atm.flags = 0; + atm.length=sizeof(buff2); + atm.data=(unsigned char *)buff2; + diff --git a/openssl-1.0.0-beta4-binutils.patch b/openssl-1.0.0-beta4-binutils.patch new file mode 100644 index 0000000..d39b2e6 --- /dev/null +++ b/openssl-1.0.0-beta4-binutils.patch @@ -0,0 +1,56 @@ +diff -up openssl-1.0.0-beta4/crypto/md5/asm/md5-x86_64.pl.binutils openssl-1.0.0-beta4/crypto/md5/asm/md5-x86_64.pl +--- openssl-1.0.0-beta4/crypto/md5/asm/md5-x86_64.pl.binutils 2009-11-12 15:17:29.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/md5/asm/md5-x86_64.pl 2009-11-12 17:26:08.000000000 +0100 +@@ -19,6 +19,7 @@ my $code; + sub round1_step + { + my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_; ++ $T_i = unpack("l",pack("l", hex($T_i))); # convert to 32-bit signed decimal + $code .= " mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */\n" if ($pos == -1); + $code .= " mov %edx, %r11d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1); + $code .= <= (d+n-2)) + { ++#if 0 + /* Because the client does not see any renegotiation during an + attack, we must enforce this on all server hellos, even the + first */ +@@ -994,6 +995,7 @@ int ssl_parse_serverhello_tlsext(SSL *s, + *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ + return 0; + } ++#endif + return 1; + } + +@@ -1126,12 +1128,14 @@ int ssl_parse_serverhello_tlsext(SSL *s, + return 0; + } + ++#if 0 + if (!renegotiate_seen + && !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) + { + *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ + return 0; + } ++#endif + + if (!s->hit && tlsext_servername == 1) + { diff --git a/openssl-1.0.0-beta3-default-paths.patch b/openssl-1.0.0-beta4-default-paths.patch similarity index 66% rename from openssl-1.0.0-beta3-default-paths.patch rename to openssl-1.0.0-beta4-default-paths.patch index 4ed02e0..0b48a27 100644 --- a/openssl-1.0.0-beta3-default-paths.patch +++ b/openssl-1.0.0-beta4-default-paths.patch @@ -1,7 +1,7 @@ -diff -up openssl-1.0.0-beta3/apps/s_client.c.default-paths openssl-1.0.0-beta3/apps/s_client.c ---- openssl-1.0.0-beta3/apps/s_client.c.default-paths 2009-06-30 18:10:24.000000000 +0200 -+++ openssl-1.0.0-beta3/apps/s_client.c 2009-08-05 18:17:52.000000000 +0200 -@@ -888,12 +888,13 @@ bad: +diff -up openssl-1.0.0-beta4/apps/s_client.c.default-paths openssl-1.0.0-beta4/apps/s_client.c +--- openssl-1.0.0-beta4/apps/s_client.c.default-paths 2009-08-12 15:21:26.000000000 +0200 ++++ openssl-1.0.0-beta4/apps/s_client.c 2009-11-12 12:26:32.000000000 +0100 +@@ -889,12 +889,13 @@ bad: if (!set_cert_key_stuff(ctx,cert,key)) goto end; @@ -19,10 +19,10 @@ diff -up openssl-1.0.0-beta3/apps/s_client.c.default-paths openssl-1.0.0-beta3/a } #ifndef OPENSSL_NO_TLSEXT -diff -up openssl-1.0.0-beta3/apps/s_server.c.default-paths openssl-1.0.0-beta3/apps/s_server.c ---- openssl-1.0.0-beta3/apps/s_server.c.default-paths 2009-06-30 18:10:24.000000000 +0200 -+++ openssl-1.0.0-beta3/apps/s_server.c 2009-08-05 18:18:40.000000000 +0200 -@@ -1403,12 +1403,13 @@ bad: +diff -up openssl-1.0.0-beta4/apps/s_server.c.default-paths openssl-1.0.0-beta4/apps/s_server.c +--- openssl-1.0.0-beta4/apps/s_server.c.default-paths 2009-10-28 18:49:37.000000000 +0100 ++++ openssl-1.0.0-beta4/apps/s_server.c 2009-11-12 12:31:23.000000000 +0100 +@@ -1408,12 +1408,13 @@ bad: } #endif @@ -40,9 +40,9 @@ diff -up openssl-1.0.0-beta3/apps/s_server.c.default-paths openssl-1.0.0-beta3/a } if (vpm) SSL_CTX_set1_param(ctx, vpm); -@@ -1457,8 +1458,11 @@ bad: - - SSL_CTX_sess_set_cache_size(ctx2,128); +@@ -1465,8 +1466,11 @@ bad: + else + SSL_CTX_sess_set_cache_size(ctx2,128); - if ((!SSL_CTX_load_verify_locations(ctx2,CAfile,CApath)) || - (!SSL_CTX_set_default_verify_paths(ctx2))) @@ -54,9 +54,9 @@ diff -up openssl-1.0.0-beta3/apps/s_server.c.default-paths openssl-1.0.0-beta3/a { ERR_print_errors(bio_err); } -diff -up openssl-1.0.0-beta3/apps/s_time.c.default-paths openssl-1.0.0-beta3/apps/s_time.c ---- openssl-1.0.0-beta3/apps/s_time.c.default-paths 2006-04-17 14:22:13.000000000 +0200 -+++ openssl-1.0.0-beta3/apps/s_time.c 2009-08-05 18:00:35.000000000 +0200 +diff -up openssl-1.0.0-beta4/apps/s_time.c.default-paths openssl-1.0.0-beta4/apps/s_time.c +--- openssl-1.0.0-beta4/apps/s_time.c.default-paths 2006-04-17 14:22:13.000000000 +0200 ++++ openssl-1.0.0-beta4/apps/s_time.c 2009-11-12 12:26:32.000000000 +0100 @@ -373,12 +373,13 @@ int MAIN(int argc, char **argv) SSL_load_error_strings(); diff --git a/openssl-1.0.0-beta4-dtls1-abi.patch b/openssl-1.0.0-beta4-dtls1-abi.patch new file mode 100644 index 0000000..a50f55d --- /dev/null +++ b/openssl-1.0.0-beta4-dtls1-abi.patch @@ -0,0 +1,25 @@ +Adding struct member is ABI breaker however as the structure is always allocated by +the library calls we just move it to the end and it should be reasonably safe. +diff -up openssl-1.0.0-beta4/ssl/dtls1.h.dtls1-abi openssl-1.0.0-beta4/ssl/dtls1.h +--- openssl-1.0.0-beta4/ssl/dtls1.h.dtls1-abi 2009-11-12 14:34:37.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/dtls1.h 2009-11-12 14:47:57.000000000 +0100 +@@ -216,9 +216,6 @@ typedef struct dtls1_state_st + */ + record_pqueue buffered_app_data; + +- /* Is set when listening for new connections with dtls1_listen() */ +- unsigned int listen; +- + unsigned int mtu; /* max DTLS packet size */ + + struct hm_header_st w_msg_hdr; +@@ -242,6 +239,9 @@ typedef struct dtls1_state_st + unsigned int retransmitting; + unsigned int change_cipher_spec_ok; + ++ /* Is set when listening for new connections with dtls1_listen() */ ++ unsigned int listen; ++ + } DTLS1_STATE; + + typedef struct dtls1_record_data_st diff --git a/openssl-1.0.0-beta4-enginesdir.patch b/openssl-1.0.0-beta4-enginesdir.patch new file mode 100644 index 0000000..0a304ce --- /dev/null +++ b/openssl-1.0.0-beta4-enginesdir.patch @@ -0,0 +1,52 @@ +diff -up openssl-1.0.0-beta4/Configure.enginesdir openssl-1.0.0-beta4/Configure +--- openssl-1.0.0-beta4/Configure.enginesdir 2009-11-12 12:17:59.000000000 +0100 ++++ openssl-1.0.0-beta4/Configure 2009-11-12 12:19:45.000000000 +0100 +@@ -622,6 +622,7 @@ my $idx_multilib = $idx++; + my $prefix=""; + my $libdir=""; + my $openssldir=""; ++my $enginesdir=""; + my $exe_ext=""; + my $install_prefix= "$ENV{'INSTALL_PREFIX'}"; + my $cross_compile_prefix=""; +@@ -833,6 +834,10 @@ PROCESS_ARGS: + { + $openssldir=$1; + } ++ elsif (/^--enginesdir=(.*)$/) ++ { ++ $enginesdir=$1; ++ } + elsif (/^--install.prefix=(.*)$/) + { + $install_prefix=$1; +@@ -1055,7 +1060,7 @@ chop $prefix if $prefix =~ /.\/$/; + + $openssldir=$prefix . "/ssl" if $openssldir eq ""; + $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/; +- ++$enginesdir="$prefix/lib/engines" if $enginesdir eq ""; + + print "IsMK1MF=$IsMK1MF\n"; + +@@ -1676,7 +1681,7 @@ while () + # $foo is to become "$prefix/lib$multilib/engines"; + # as Makefile.org and engines/Makefile are adapted for + # $multilib suffix. +- my $foo = "$prefix/lib/engines"; ++ my $foo = "$enginesdir"; + $foo =~ s/\\/\\\\/g; + print OUT "#define ENGINESDIR \"$foo\"\n"; + } +diff -up openssl-1.0.0-beta4/engines/Makefile.enginesdir openssl-1.0.0-beta4/engines/Makefile +--- openssl-1.0.0-beta4/engines/Makefile.enginesdir 2009-11-10 02:52:52.000000000 +0100 ++++ openssl-1.0.0-beta4/engines/Makefile 2009-11-12 12:23:06.000000000 +0100 +@@ -124,7 +124,7 @@ install: + sfx=".so"; \ + cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \ + fi; \ +- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \ ++ chmod 755 $(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 ); \ + done; \ + fi diff --git a/openssl-1.0.0-beta3-fips.patch b/openssl-1.0.0-beta4-fips.patch similarity index 90% rename from openssl-1.0.0-beta3-fips.patch rename to openssl-1.0.0-beta4-fips.patch index d552198..bc81d71 100644 --- a/openssl-1.0.0-beta3-fips.patch +++ b/openssl-1.0.0-beta4-fips.patch @@ -1,7 +1,7 @@ -diff -up openssl-1.0.0-beta3/Configure.fips openssl-1.0.0-beta3/Configure ---- openssl-1.0.0-beta3/Configure.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/Configure 2009-08-11 18:07:30.000000000 +0200 -@@ -654,6 +654,7 @@ my $cmll_enc="camellia.o cmll_misc.o cml +diff -up openssl-1.0.0-beta4/Configure.fips openssl-1.0.0-beta4/Configure +--- openssl-1.0.0-beta4/Configure.fips 2009-11-12 12:36:50.000000000 +0100 ++++ openssl-1.0.0-beta4/Configure 2009-11-12 12:36:50.000000000 +0100 +@@ -660,6 +660,7 @@ my $cmll_enc="camellia.o cmll_misc.o cml my $processor=""; my $default_ranlib; my $perl; @@ -9,7 +9,7 @@ diff -up openssl-1.0.0-beta3/Configure.fips openssl-1.0.0-beta3/Configure # All of the following is disabled by default (RC5 was enabled before 0.9.8): -@@ -797,6 +798,10 @@ PROCESS_ARGS: +@@ -806,6 +807,10 @@ PROCESS_ARGS: } elsif (/^386$/) { $processor=386; } @@ -20,7 +20,7 @@ diff -up openssl-1.0.0-beta3/Configure.fips openssl-1.0.0-beta3/Configure elsif (/^rsaref$/) { # No RSAref support any more since it's not needed. -@@ -1349,6 +1354,11 @@ $cflags.=" -DOPENSSL_IA32_SSE2" if (!$no +@@ -1368,6 +1373,11 @@ $cflags.=" -DOPENSSL_IA32_SSE2" if (!$no $cflags.=" -DOPENSSL_BN_ASM_MONT" if ($bn_obj =~ /-mont/); @@ -32,7 +32,7 @@ diff -up openssl-1.0.0-beta3/Configure.fips openssl-1.0.0-beta3/Configure $cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/); $des_obj=$des_enc unless ($des_obj =~ /\.o$/); $bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/); -@@ -1504,6 +1514,10 @@ while () +@@ -1535,6 +1545,10 @@ while () s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/; s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/; s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/; @@ -43,9 +43,9 @@ diff -up openssl-1.0.0-beta3/Configure.fips openssl-1.0.0-beta3/Configure s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/; s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/; s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared); -diff -up openssl-1.0.0-beta3/crypto/bf/bf_skey.c.fips openssl-1.0.0-beta3/crypto/bf/bf_skey.c ---- openssl-1.0.0-beta3/crypto/bf/bf_skey.c.fips 2008-11-12 04:57:52.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/bf/bf_skey.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/bf/bf_skey.c.fips openssl-1.0.0-beta4/crypto/bf/bf_skey.c +--- openssl-1.0.0-beta4/crypto/bf/bf_skey.c.fips 2008-11-12 04:57:52.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/bf/bf_skey.c 2009-11-12 12:36:50.000000000 +0100 @@ -59,10 +59,15 @@ #include #include @@ -63,9 +63,9 @@ diff -up openssl-1.0.0-beta3/crypto/bf/bf_skey.c.fips openssl-1.0.0-beta3/crypto { int i; BF_LONG *p,ri,in[2]; -diff -up openssl-1.0.0-beta3/crypto/bf/blowfish.h.fips openssl-1.0.0-beta3/crypto/bf/blowfish.h ---- openssl-1.0.0-beta3/crypto/bf/blowfish.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/bf/blowfish.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/bf/blowfish.h.fips openssl-1.0.0-beta4/crypto/bf/blowfish.h +--- openssl-1.0.0-beta4/crypto/bf/blowfish.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/bf/blowfish.h 2009-11-12 12:36:50.000000000 +0100 @@ -104,7 +104,9 @@ typedef struct bf_key_st BF_LONG S[4*256]; } BF_KEY; @@ -77,9 +77,9 @@ diff -up openssl-1.0.0-beta3/crypto/bf/blowfish.h.fips openssl-1.0.0-beta3/crypt void BF_set_key(BF_KEY *key, int len, const unsigned char *data); void BF_encrypt(BF_LONG *data,const BF_KEY *key); -diff -up openssl-1.0.0-beta3/crypto/bn/bn.h.fips openssl-1.0.0-beta3/crypto/bn/bn.h ---- openssl-1.0.0-beta3/crypto/bn/bn.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/bn/bn.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/bn/bn.h.fips openssl-1.0.0-beta4/crypto/bn/bn.h +--- openssl-1.0.0-beta4/crypto/bn/bn.h.fips 2009-11-12 12:36:50.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/bn/bn.h 2009-11-12 12:36:50.000000000 +0100 @@ -540,6 +540,17 @@ int BN_is_prime_ex(const BIGNUM *p,int n int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, int do_trial_division, BN_GENCB *cb); @@ -98,9 +98,9 @@ diff -up openssl-1.0.0-beta3/crypto/bn/bn.h.fips openssl-1.0.0-beta3/crypto/bn/b BN_MONT_CTX *BN_MONT_CTX_new(void ); void BN_MONT_CTX_init(BN_MONT_CTX *ctx); int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b, -diff -up /dev/null openssl-1.0.0-beta3/crypto/bn/bn_x931p.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/bn/bn_x931p.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/bn/bn_x931p.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/bn/bn_x931p.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,272 @@ +/* bn_x931p.c */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL @@ -374,9 +374,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/bn/bn_x931p.c + + } + -diff -up openssl-1.0.0-beta3/crypto/bn/Makefile.fips openssl-1.0.0-beta3/crypto/bn/Makefile ---- openssl-1.0.0-beta3/crypto/bn/Makefile.fips 2008-11-12 09:19:02.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/bn/Makefile 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/bn/Makefile.fips openssl-1.0.0-beta4/crypto/bn/Makefile +--- openssl-1.0.0-beta4/crypto/bn/Makefile.fips 2008-11-12 09:19:02.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/bn/Makefile 2009-11-12 12:36:50.000000000 +0100 @@ -26,13 +26,13 @@ LIBSRC= bn_add.c bn_div.c bn_exp.c bn_li bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_asm.c \ @@ -393,9 +393,9 @@ diff -up openssl-1.0.0-beta3/crypto/bn/Makefile.fips openssl-1.0.0-beta3/crypto/ SRC= $(LIBSRC) -diff -up openssl-1.0.0-beta3/crypto/camellia/asm/cmll-x86.pl.fips openssl-1.0.0-beta3/crypto/camellia/asm/cmll-x86.pl ---- openssl-1.0.0-beta3/crypto/camellia/asm/cmll-x86.pl.fips 2009-04-06 16:25:02.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/camellia/asm/cmll-x86.pl 2009-08-20 16:54:59.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/camellia/asm/cmll-x86.pl.fips openssl-1.0.0-beta4/crypto/camellia/asm/cmll-x86.pl +--- openssl-1.0.0-beta4/crypto/camellia/asm/cmll-x86.pl.fips 2009-04-06 16:25:02.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/camellia/asm/cmll-x86.pl 2009-11-12 12:36:50.000000000 +0100 @@ -722,12 +722,15 @@ my $bias=int(@T[0])?shift(@T):0; } &function_end("Camellia_Ekeygen"); @@ -422,9 +422,9 @@ diff -up openssl-1.0.0-beta3/crypto/camellia/asm/cmll-x86.pl.fips openssl-1.0.0- } @SBOX=( -diff -up openssl-1.0.0-beta3/crypto/camellia/camellia.h.fips openssl-1.0.0-beta3/crypto/camellia/camellia.h ---- openssl-1.0.0-beta3/crypto/camellia/camellia.h.fips 2009-08-11 18:07:29.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/camellia/camellia.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/camellia/camellia.h.fips openssl-1.0.0-beta4/crypto/camellia/camellia.h +--- openssl-1.0.0-beta4/crypto/camellia/camellia.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/camellia/camellia.h 2009-11-12 12:36:50.000000000 +0100 @@ -88,6 +88,11 @@ struct camellia_key_st }; typedef struct camellia_key_st CAMELLIA_KEY; @@ -437,9 +437,9 @@ diff -up openssl-1.0.0-beta3/crypto/camellia/camellia.h.fips openssl-1.0.0-beta3 int Camellia_set_key(const unsigned char *userKey, const int bits, CAMELLIA_KEY *key); -diff -up openssl-1.0.0-beta3/crypto/camellia/cmll_fblk.c.fips openssl-1.0.0-beta3/crypto/camellia/cmll_fblk.c ---- openssl-1.0.0-beta3/crypto/camellia/cmll_fblk.c.fips 2009-08-20 17:01:56.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/camellia/cmll_fblk.c 2009-08-20 17:03:21.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/camellia/cmll_fblk.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/camellia/cmll_fblk.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,68 @@ +/* crypto/camellia/camellia_misc.c -*- mode:C; c-file-style: "eay" -*- */ +/* ==================================================================== @@ -509,9 +509,9 @@ diff -up openssl-1.0.0-beta3/crypto/camellia/cmll_fblk.c.fips openssl-1.0.0-beta + return private_Camellia_set_key(userKey, bits, key); + } +#endif -diff -up openssl-1.0.0-beta3/crypto/camellia/cmll_misc.c.fips openssl-1.0.0-beta3/crypto/camellia/cmll_misc.c ---- openssl-1.0.0-beta3/crypto/camellia/cmll_misc.c.fips 2008-10-28 13:13:52.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/camellia/cmll_misc.c 2009-08-20 17:04:10.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/camellia/cmll_misc.c.fips openssl-1.0.0-beta4/crypto/camellia/cmll_misc.c +--- openssl-1.0.0-beta4/crypto/camellia/cmll_misc.c.fips 2008-10-28 13:13:52.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/camellia/cmll_misc.c 2009-11-12 12:36:50.000000000 +0100 @@ -52,11 +52,20 @@ #include #include @@ -533,9 +533,9 @@ diff -up openssl-1.0.0-beta3/crypto/camellia/cmll_misc.c.fips openssl-1.0.0-beta { if(!userKey || !key) return -1; -diff -up openssl-1.0.0-beta3/crypto/camellia/Makefile.fips openssl-1.0.0-beta3/crypto/camellia/Makefile ---- openssl-1.0.0-beta3/crypto/camellia/Makefile.fips 2008-12-23 12:33:00.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/camellia/Makefile 2009-08-20 17:02:56.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/camellia/Makefile.fips openssl-1.0.0-beta4/crypto/camellia/Makefile +--- openssl-1.0.0-beta4/crypto/camellia/Makefile.fips 2008-12-23 12:33:00.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/camellia/Makefile 2009-11-12 12:36:50.000000000 +0100 @@ -23,9 +23,9 @@ APPS= LIB=$(TOP)/libcrypto.a @@ -548,9 +548,9 @@ diff -up openssl-1.0.0-beta3/crypto/camellia/Makefile.fips openssl-1.0.0-beta3/c SRC= $(LIBSRC) -diff -up openssl-1.0.0-beta3/crypto/cast/cast.h.fips openssl-1.0.0-beta3/crypto/cast/cast.h ---- openssl-1.0.0-beta3/crypto/cast/cast.h.fips 2009-08-11 18:07:29.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/cast/cast.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/cast/cast.h.fips openssl-1.0.0-beta4/crypto/cast/cast.h +--- openssl-1.0.0-beta4/crypto/cast/cast.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/cast/cast.h 2009-11-12 12:36:50.000000000 +0100 @@ -83,7 +83,9 @@ typedef struct cast_key_st int short_key; /* Use reduced rounds for short key */ } CAST_KEY; @@ -562,9 +562,9 @@ diff -up openssl-1.0.0-beta3/crypto/cast/cast.h.fips openssl-1.0.0-beta3/crypto/ void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key, int enc); -diff -up openssl-1.0.0-beta3/crypto/cast/c_skey.c.fips openssl-1.0.0-beta3/crypto/cast/c_skey.c ---- openssl-1.0.0-beta3/crypto/cast/c_skey.c.fips 2000-06-03 16:13:35.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/cast/c_skey.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/cast/c_skey.c.fips openssl-1.0.0-beta4/crypto/cast/c_skey.c +--- openssl-1.0.0-beta4/crypto/cast/c_skey.c.fips 2000-06-03 16:13:35.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/cast/c_skey.c 2009-11-12 12:36:50.000000000 +0100 @@ -57,6 +57,11 @@ */ @@ -586,9 +586,9 @@ diff -up openssl-1.0.0-beta3/crypto/cast/c_skey.c.fips openssl-1.0.0-beta3/crypt { CAST_LONG x[16]; CAST_LONG z[16]; -diff -up openssl-1.0.0-beta3/crypto/crypto.h.fips openssl-1.0.0-beta3/crypto/crypto.h ---- openssl-1.0.0-beta3/crypto/crypto.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/crypto.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/crypto.h.fips openssl-1.0.0-beta4/crypto/crypto.h +--- openssl-1.0.0-beta4/crypto/crypto.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/crypto.h 2009-11-12 12:36:50.000000000 +0100 @@ -546,12 +546,69 @@ void OpenSSLDie(const char *file,int lin unsigned long *OPENSSL_ia32cap_loc(void); #define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) @@ -659,9 +659,9 @@ diff -up openssl-1.0.0-beta3/crypto/crypto.h.fips openssl-1.0.0-beta3/crypto/cry /* Error codes for the CRYPTO functions. */ /* Function codes. */ -diff -up openssl-1.0.0-beta3/crypto/dh/dh_err.c.fips openssl-1.0.0-beta3/crypto/dh/dh_err.c ---- openssl-1.0.0-beta3/crypto/dh/dh_err.c.fips 2006-11-21 22:29:37.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/dh/dh_err.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/dh/dh_err.c.fips openssl-1.0.0-beta4/crypto/dh/dh_err.c +--- openssl-1.0.0-beta4/crypto/dh/dh_err.c.fips 2006-11-21 22:29:37.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/dh/dh_err.c 2009-11-12 12:36:50.000000000 +0100 @@ -73,6 +73,8 @@ static ERR_STRING_DATA DH_str_functs[]= {ERR_FUNC(DH_F_COMPUTE_KEY), "COMPUTE_KEY"}, {ERR_FUNC(DH_F_DHPARAMS_PRINT_FP), "DHparams_print_fp"}, @@ -679,9 +679,9 @@ diff -up openssl-1.0.0-beta3/crypto/dh/dh_err.c.fips openssl-1.0.0-beta3/crypto/ {ERR_REASON(DH_R_KEYS_NOT_SET) ,"keys not set"}, {ERR_REASON(DH_R_MODULUS_TOO_LARGE) ,"modulus too large"}, {ERR_REASON(DH_R_NO_PARAMETERS_SET) ,"no parameters set"}, -diff -up openssl-1.0.0-beta3/crypto/dh/dh_gen.c.fips openssl-1.0.0-beta3/crypto/dh/dh_gen.c ---- openssl-1.0.0-beta3/crypto/dh/dh_gen.c.fips 2005-04-26 20:53:15.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/dh/dh_gen.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/dh/dh_gen.c.fips openssl-1.0.0-beta4/crypto/dh/dh_gen.c +--- openssl-1.0.0-beta4/crypto/dh/dh_gen.c.fips 2005-04-26 20:53:15.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/dh/dh_gen.c 2009-11-12 12:36:50.000000000 +0100 @@ -65,6 +65,10 @@ #include "cryptlib.h" #include @@ -714,9 +714,9 @@ diff -up openssl-1.0.0-beta3/crypto/dh/dh_gen.c.fips openssl-1.0.0-beta3/crypto/ ctx=BN_CTX_new(); if (ctx == NULL) goto err; BN_CTX_start(ctx); -diff -up openssl-1.0.0-beta3/crypto/dh/dh.h.fips openssl-1.0.0-beta3/crypto/dh/dh.h ---- openssl-1.0.0-beta3/crypto/dh/dh.h.fips 2009-08-11 18:07:29.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/dh/dh.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/dh/dh.h.fips openssl-1.0.0-beta4/crypto/dh/dh.h +--- openssl-1.0.0-beta4/crypto/dh/dh.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/dh/dh.h 2009-11-12 12:36:50.000000000 +0100 @@ -77,6 +77,8 @@ # define OPENSSL_DH_MAX_MODULUS_BITS 10000 #endif @@ -726,7 +726,7 @@ diff -up openssl-1.0.0-beta3/crypto/dh/dh.h.fips openssl-1.0.0-beta3/crypto/dh/d #define DH_FLAG_CACHE_MONT_P 0x01 #define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH * implementation now uses constant time -@@ -240,6 +242,8 @@ void ERR_load_DH_strings(void); +@@ -241,6 +243,8 @@ void ERR_load_DH_strings(void); #define DH_F_GENERATE_PARAMETERS 104 #define DH_F_PKEY_DH_DERIVE 112 #define DH_F_PKEY_DH_KEYGEN 113 @@ -735,7 +735,7 @@ diff -up openssl-1.0.0-beta3/crypto/dh/dh.h.fips openssl-1.0.0-beta3/crypto/dh/d /* Reason codes. */ #define DH_R_BAD_GENERATOR 101 -@@ -252,6 +256,7 @@ void ERR_load_DH_strings(void); +@@ -253,6 +257,7 @@ void ERR_load_DH_strings(void); #define DH_R_NO_PARAMETERS_SET 107 #define DH_R_NO_PRIVATE_VALUE 100 #define DH_R_PARAMETER_ENCODING_ERROR 105 @@ -743,9 +743,9 @@ diff -up openssl-1.0.0-beta3/crypto/dh/dh.h.fips openssl-1.0.0-beta3/crypto/dh/d #ifdef __cplusplus } -diff -up openssl-1.0.0-beta3/crypto/dh/dh_key.c.fips openssl-1.0.0-beta3/crypto/dh/dh_key.c ---- openssl-1.0.0-beta3/crypto/dh/dh_key.c.fips 2007-03-28 02:15:23.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/dh/dh_key.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/dh/dh_key.c.fips openssl-1.0.0-beta4/crypto/dh/dh_key.c +--- openssl-1.0.0-beta4/crypto/dh/dh_key.c.fips 2007-03-28 02:15:23.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/dh/dh_key.c 2009-11-12 12:36:50.000000000 +0100 @@ -61,6 +61,9 @@ #include #include @@ -795,9 +795,9 @@ diff -up openssl-1.0.0-beta3/crypto/dh/dh_key.c.fips openssl-1.0.0-beta3/crypto/ dh->flags |= DH_FLAG_CACHE_MONT_P; return(1); } -diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_gen.c.fips openssl-1.0.0-beta3/crypto/dsa/dsa_gen.c ---- openssl-1.0.0-beta3/crypto/dsa/dsa_gen.c.fips 2008-12-26 18:17:21.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/dsa/dsa_gen.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/dsa/dsa_gen.c.fips openssl-1.0.0-beta4/crypto/dsa/dsa_gen.c +--- openssl-1.0.0-beta4/crypto/dsa/dsa_gen.c.fips 2008-12-26 18:17:21.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/dsa/dsa_gen.c 2009-11-12 12:36:50.000000000 +0100 @@ -77,8 +77,12 @@ #include "cryptlib.h" #include @@ -833,9 +833,9 @@ diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_gen.c.fips openssl-1.0.0-beta3/crypt if (qsize != SHA_DIGEST_LENGTH && qsize != SHA224_DIGEST_LENGTH && qsize != SHA256_DIGEST_LENGTH) /* invalid q size */ -diff -up openssl-1.0.0-beta3/crypto/dsa/dsa.h.fips openssl-1.0.0-beta3/crypto/dsa/dsa.h ---- openssl-1.0.0-beta3/crypto/dsa/dsa.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/dsa/dsa.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/dsa/dsa.h.fips openssl-1.0.0-beta4/crypto/dsa/dsa.h +--- openssl-1.0.0-beta4/crypto/dsa/dsa.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/dsa/dsa.h 2009-11-12 12:36:50.000000000 +0100 @@ -88,6 +88,8 @@ # define OPENSSL_DSA_MAX_MODULUS_BITS 10000 #endif @@ -892,18 +892,16 @@ diff -up openssl-1.0.0-beta3/crypto/dsa/dsa.h.fips openssl-1.0.0-beta3/crypto/ds #define DSA_R_PARAMETER_ENCODING_ERROR 105 #ifdef __cplusplus -diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_key.c.fips openssl-1.0.0-beta3/crypto/dsa/dsa_key.c ---- openssl-1.0.0-beta3/crypto/dsa/dsa_key.c.fips 2007-03-28 02:15:25.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/dsa/dsa_key.c 2009-08-11 18:09:42.000000000 +0200 -@@ -65,9 +65,42 @@ +diff -up openssl-1.0.0-beta4/crypto/dsa/dsa_key.c.fips openssl-1.0.0-beta4/crypto/dsa/dsa_key.c +--- openssl-1.0.0-beta4/crypto/dsa/dsa_key.c.fips 2007-03-28 02:15:25.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/dsa/dsa_key.c 2009-11-12 12:36:50.000000000 +0100 +@@ -63,9 +63,53 @@ #include #include #include +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include "fips_locl.h" static int dsa_builtin_keygen(DSA *dsa); @@ -919,26 +917,39 @@ diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_key.c.fips openssl-1.0.0-beta3/crypt + +int fips_check_dsa(DSA *dsa) + { -+ EVP_PKEY pk; ++ EVP_PKEY *pk; + unsigned char tbs[] = "DSA Pairwise Check Data"; -+ pk.type = EVP_PKEY_DSA; -+ pk.pkey.dsa = dsa; ++ int ret = 0; + -+ if (!fips_pkey_signature_test(&pk, tbs, -1, -+ NULL, 0, EVP_dss1(), 0, NULL)) ++ if ((pk=EVP_PKEY_new()) == NULL) ++ goto err; ++ ++ EVP_PKEY_set1_DSA(pk, dsa); ++ ++ if (!fips_pkey_signature_test(pk, tbs, -1, ++ NULL, 0, EVP_sha1(), 0, NULL)) ++ goto err; ++ ++ ret = 1; ++ ++err: ++ if (ret == 0) + { -+ FIPSerr(FIPS_F_FIPS_CHECK_DSA,FIPS_R_PAIRWISE_TEST_FAILED); + fips_set_selftest_fail(); -+ return 0; ++ FIPSerr(FIPS_F_FIPS_CHECK_DSA,FIPS_R_PAIRWISE_TEST_FAILED); + } -+ return 1; ++ ++ if (pk) ++ EVP_PKEY_free(pk); ++ ++ return ret; + } +#endif + int DSA_generate_key(DSA *dsa) { if(dsa->meth->dsa_keygen) -@@ -79,6 +110,14 @@ static int dsa_builtin_keygen(DSA *dsa) +@@ -79,6 +123,14 @@ static int dsa_builtin_keygen(DSA *dsa) BN_CTX *ctx=NULL; BIGNUM *pub_key=NULL,*priv_key=NULL; @@ -953,7 +964,7 @@ diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_key.c.fips openssl-1.0.0-beta3/crypt if ((ctx=BN_CTX_new()) == NULL) goto err; if (dsa->priv_key == NULL) -@@ -117,6 +156,15 @@ static int dsa_builtin_keygen(DSA *dsa) +@@ -117,6 +169,15 @@ static int dsa_builtin_keygen(DSA *dsa) dsa->priv_key=priv_key; dsa->pub_key=pub_key; @@ -969,9 +980,9 @@ diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_key.c.fips openssl-1.0.0-beta3/crypt ok=1; err: -diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_ossl.c.fips openssl-1.0.0-beta3/crypto/dsa/dsa_ossl.c ---- openssl-1.0.0-beta3/crypto/dsa/dsa_ossl.c.fips 2007-03-28 02:15:26.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/dsa/dsa_ossl.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/dsa/dsa_ossl.c.fips openssl-1.0.0-beta4/crypto/dsa/dsa_ossl.c +--- openssl-1.0.0-beta4/crypto/dsa/dsa_ossl.c.fips 2007-03-28 02:15:26.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/dsa/dsa_ossl.c 2009-11-12 12:36:50.000000000 +0100 @@ -65,6 +65,9 @@ #include #include @@ -1043,9 +1054,9 @@ diff -up openssl-1.0.0-beta3/crypto/dsa/dsa_ossl.c.fips openssl-1.0.0-beta3/cryp dsa->flags|=DSA_FLAG_CACHE_MONT_P; return(1); } -diff -up openssl-1.0.0-beta3/crypto/err/err_all.c.fips openssl-1.0.0-beta3/crypto/err/err_all.c ---- openssl-1.0.0-beta3/crypto/err/err_all.c.fips 2008-11-24 18:27:06.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/err/err_all.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/err/err_all.c.fips openssl-1.0.0-beta4/crypto/err/err_all.c +--- openssl-1.0.0-beta4/crypto/err/err_all.c.fips 2009-08-09 16:58:05.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/err/err_all.c 2009-11-12 12:36:50.000000000 +0100 @@ -96,6 +96,9 @@ #include #include @@ -1056,7 +1067,7 @@ diff -up openssl-1.0.0-beta3/crypto/err/err_all.c.fips openssl-1.0.0-beta3/crypt #ifndef OPENSSL_NO_CMS #include #endif -@@ -148,6 +151,9 @@ void ERR_load_crypto_strings(void) +@@ -149,6 +152,9 @@ void ERR_load_crypto_strings(void) #endif ERR_load_OCSP_strings(); ERR_load_UI_strings(); @@ -1066,9 +1077,9 @@ diff -up openssl-1.0.0-beta3/crypto/err/err_all.c.fips openssl-1.0.0-beta3/crypt #ifndef OPENSSL_NO_CMS ERR_load_CMS_strings(); #endif -diff -up openssl-1.0.0-beta3/crypto/evp/digest.c.fips openssl-1.0.0-beta3/crypto/evp/digest.c ---- openssl-1.0.0-beta3/crypto/evp/digest.c.fips 2008-11-04 13:06:09.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/evp/digest.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/digest.c.fips openssl-1.0.0-beta4/crypto/evp/digest.c +--- openssl-1.0.0-beta4/crypto/evp/digest.c.fips 2008-11-04 13:06:09.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/digest.c 2009-11-12 12:36:50.000000000 +0100 @@ -116,6 +116,7 @@ #ifndef OPENSSL_NO_ENGINE #include @@ -1167,9 +1178,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/digest.c.fips openssl-1.0.0-beta3/crypto OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); ret=ctx->digest->final(ctx,md); -diff -up openssl-1.0.0-beta3/crypto/evp/e_aes.c.fips openssl-1.0.0-beta3/crypto/evp/e_aes.c ---- openssl-1.0.0-beta3/crypto/evp/e_aes.c.fips 2004-01-28 20:05:33.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/evp/e_aes.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/e_aes.c.fips openssl-1.0.0-beta4/crypto/evp/e_aes.c +--- openssl-1.0.0-beta4/crypto/evp/e_aes.c.fips 2004-01-28 20:05:33.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/e_aes.c 2009-11-12 12:36:50.000000000 +0100 @@ -69,32 +69,29 @@ typedef struct IMPLEMENT_BLOCK_CIPHER(aes_128, ks, AES, EVP_AES_KEY, @@ -1222,9 +1233,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/e_aes.c.fips openssl-1.0.0-beta3/crypto/ static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) -diff -up openssl-1.0.0-beta3/crypto/evp/e_camellia.c.fips openssl-1.0.0-beta3/crypto/evp/e_camellia.c ---- openssl-1.0.0-beta3/crypto/evp/e_camellia.c.fips 2006-08-31 22:56:20.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/evp/e_camellia.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/e_camellia.c.fips openssl-1.0.0-beta4/crypto/evp/e_camellia.c +--- openssl-1.0.0-beta4/crypto/evp/e_camellia.c.fips 2006-08-31 22:56:20.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/evp/e_camellia.c 2009-11-12 12:36:50.000000000 +0100 @@ -93,7 +93,7 @@ IMPLEMENT_BLOCK_CIPHER(camellia_256, ks, EVP_CIPHER_get_asn1_iv, NULL) @@ -1234,9 +1245,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/e_camellia.c.fips openssl-1.0.0-beta3/cr IMPLEMENT_CAMELLIA_CFBR(128,1) IMPLEMENT_CAMELLIA_CFBR(192,1) -diff -up openssl-1.0.0-beta3/crypto/evp/e_des3.c.fips openssl-1.0.0-beta3/crypto/evp/e_des3.c ---- openssl-1.0.0-beta3/crypto/evp/e_des3.c.fips 2008-12-29 13:35:47.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/evp/e_des3.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/e_des3.c.fips openssl-1.0.0-beta4/crypto/evp/e_des3.c +--- openssl-1.0.0-beta4/crypto/evp/e_des3.c.fips 2008-12-29 13:35:47.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/e_des3.c 2009-11-12 12:36:50.000000000 +0100 @@ -206,9 +206,9 @@ static int des_ede3_cfb8_cipher(EVP_CIPH } @@ -1281,9 +1292,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/e_des3.c.fips openssl-1.0.0-beta3/crypto des3_ctrl) static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, -diff -up openssl-1.0.0-beta3/crypto/evp/e_null.c.fips openssl-1.0.0-beta3/crypto/evp/e_null.c ---- openssl-1.0.0-beta3/crypto/evp/e_null.c.fips 2008-10-31 20:48:24.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/evp/e_null.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/e_null.c.fips openssl-1.0.0-beta4/crypto/evp/e_null.c +--- openssl-1.0.0-beta4/crypto/evp/e_null.c.fips 2008-10-31 20:48:24.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/e_null.c 2009-11-12 12:36:50.000000000 +0100 @@ -69,7 +69,7 @@ static const EVP_CIPHER n_cipher= { NID_undef, @@ -1293,9 +1304,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/e_null.c.fips openssl-1.0.0-beta3/crypto null_init_key, null_cipher, NULL, -diff -up openssl-1.0.0-beta3/crypto/evp/evp_enc.c.fips openssl-1.0.0-beta3/crypto/evp/evp_enc.c ---- openssl-1.0.0-beta3/crypto/evp/evp_enc.c.fips 2008-11-12 04:58:00.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/evp/evp_enc.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/evp_enc.c.fips openssl-1.0.0-beta4/crypto/evp/evp_enc.c +--- openssl-1.0.0-beta4/crypto/evp/evp_enc.c.fips 2008-11-12 04:58:00.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/evp_enc.c 2009-11-12 12:36:50.000000000 +0100 @@ -68,8 +68,53 @@ const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT; @@ -1388,9 +1399,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp_enc.c.fips openssl-1.0.0-beta3/crypt if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { if(!ctx->cipher->init(ctx,key,iv,enc)) return 0; } -diff -up openssl-1.0.0-beta3/crypto/evp/evp_err.c.fips openssl-1.0.0-beta3/crypto/evp/evp_err.c ---- openssl-1.0.0-beta3/crypto/evp/evp_err.c.fips 2008-12-29 17:11:54.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/evp/evp_err.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/evp_err.c.fips openssl-1.0.0-beta4/crypto/evp/evp_err.c +--- openssl-1.0.0-beta4/crypto/evp/evp_err.c.fips 2008-12-29 17:11:54.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/evp_err.c 2009-11-12 12:36:50.000000000 +0100 @@ -154,6 +154,7 @@ static ERR_STRING_DATA EVP_str_reasons[] {ERR_REASON(EVP_R_DECODE_ERROR) ,"decode error"}, {ERR_REASON(EVP_R_DIFFERENT_KEY_TYPES) ,"different key types"}, @@ -1399,9 +1410,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp_err.c.fips openssl-1.0.0-beta3/crypt {ERR_REASON(EVP_R_ENCODE_ERROR) ,"encode error"}, {ERR_REASON(EVP_R_EVP_PBE_CIPHERINIT_ERROR),"evp pbe cipherinit error"}, {ERR_REASON(EVP_R_EXPECTING_AN_RSA_KEY) ,"expecting an rsa key"}, -diff -up openssl-1.0.0-beta3/crypto/evp/evp.h.fips openssl-1.0.0-beta3/crypto/evp/evp.h ---- openssl-1.0.0-beta3/crypto/evp/evp.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/evp/evp.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/evp.h.fips openssl-1.0.0-beta4/crypto/evp/evp.h +--- openssl-1.0.0-beta4/crypto/evp/evp.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/evp.h 2009-11-12 12:36:50.000000000 +0100 @@ -75,6 +75,10 @@ #include #endif @@ -1433,7 +1444,18 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp.h.fips openssl-1.0.0-beta3/crypto/ev #define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest * in FIPS mode */ -@@ -330,6 +332,14 @@ struct evp_cipher_st +@@ -284,6 +286,10 @@ struct env_md_ctx_st + #define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */ + #define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */ + #define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */ ++#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \ ++ ((ctx->flags>>16) &0xFFFF) /* seed length */ ++#define EVP_MD_CTX_FLAG_PSS_MDLEN 0xFFFF /* salt len same as digest */ ++#define EVP_MD_CTX_FLAG_PSS_MREC 0xFFFE /* salt max or auto recovered */ + + #define EVP_MD_CTX_FLAG_NO_INIT 0x0100 /* Don't initialize md_data */ + +@@ -330,6 +336,14 @@ struct evp_cipher_st #define EVP_CIPH_NO_PADDING 0x100 /* cipher handles random key generation */ #define EVP_CIPH_RAND_KEY 0x200 @@ -1448,7 +1470,7 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp.h.fips openssl-1.0.0-beta3/crypto/ev /* ctrl() values */ -@@ -507,6 +517,10 @@ int EVP_BytesToKey(const EVP_CIPHER *typ +@@ -507,6 +521,10 @@ int EVP_BytesToKey(const EVP_CIPHER *typ const unsigned char *salt, const unsigned char *data, int datal, int count, unsigned char *key,unsigned char *iv); @@ -1459,7 +1481,7 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp.h.fips openssl-1.0.0-beta3/crypto/ev int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv); int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, -@@ -1225,6 +1239,7 @@ void ERR_load_EVP_strings(void); +@@ -1225,6 +1243,7 @@ void ERR_load_EVP_strings(void); #define EVP_R_DECODE_ERROR 114 #define EVP_R_DIFFERENT_KEY_TYPES 101 #define EVP_R_DIFFERENT_PARAMETERS 153 @@ -1467,9 +1489,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp.h.fips openssl-1.0.0-beta3/crypto/ev #define EVP_R_ENCODE_ERROR 115 #define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 #define EVP_R_EXPECTING_AN_RSA_KEY 127 -diff -up openssl-1.0.0-beta3/crypto/evp/evp_lib.c.fips openssl-1.0.0-beta3/crypto/evp/evp_lib.c ---- openssl-1.0.0-beta3/crypto/evp/evp_lib.c.fips 2009-04-10 12:30:27.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/evp/evp_lib.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/evp_lib.c.fips openssl-1.0.0-beta4/crypto/evp/evp_lib.c +--- openssl-1.0.0-beta4/crypto/evp/evp_lib.c.fips 2009-04-10 12:30:27.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/evp/evp_lib.c 2009-11-12 12:36:50.000000000 +0100 @@ -67,6 +67,8 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_ if (c->cipher->set_asn1_parameters != NULL) @@ -1517,9 +1539,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp_lib.c.fips openssl-1.0.0-beta3/crypt + { + return (ctx->flags & flags); + } -diff -up openssl-1.0.0-beta3/crypto/evp/evp_locl.h.fips openssl-1.0.0-beta3/crypto/evp/evp_locl.h ---- openssl-1.0.0-beta3/crypto/evp/evp_locl.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/evp/evp_locl.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/evp_locl.h.fips openssl-1.0.0-beta4/crypto/evp/evp_locl.h +--- openssl-1.0.0-beta4/crypto/evp/evp_locl.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/evp_locl.h 2009-11-12 12:36:50.000000000 +0100 @@ -111,11 +111,11 @@ static int cname##_cbc_cipher(EVP_CIPHER static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \ {\ @@ -1569,21 +1591,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/evp_locl.h.fips openssl-1.0.0-beta3/cryp struct evp_pkey_ctx_st { -diff -up openssl-1.0.0-beta3/crypto/evp/m_dss1.c.fips openssl-1.0.0-beta3/crypto/evp/m_dss1.c ---- openssl-1.0.0-beta3/crypto/evp/m_dss1.c.fips 2006-04-19 19:05:57.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/evp/m_dss1.c 2009-08-11 18:07:30.000000000 +0200 -@@ -82,7 +82,7 @@ static const EVP_MD dss1_md= - NID_dsa, - NID_dsaWithSHA1, - SHA_DIGEST_LENGTH, -- EVP_MD_FLAG_PKEY_DIGEST, -+ EVP_MD_FLAG_PKEY_DIGEST|EVP_MD_FLAG_FIPS, - init, - update, - final, -diff -up openssl-1.0.0-beta3/crypto/evp/m_dss.c.fips openssl-1.0.0-beta3/crypto/evp/m_dss.c ---- openssl-1.0.0-beta3/crypto/evp/m_dss.c.fips 2006-04-19 19:05:57.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/evp/m_dss.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/m_dss.c.fips openssl-1.0.0-beta4/crypto/evp/m_dss.c +--- openssl-1.0.0-beta4/crypto/evp/m_dss.c.fips 2006-04-19 19:05:57.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/evp/m_dss.c 2009-11-12 12:36:50.000000000 +0100 @@ -81,7 +81,7 @@ static const EVP_MD dsa_md= NID_dsaWithSHA, NID_dsaWithSHA, @@ -1593,9 +1603,21 @@ diff -up openssl-1.0.0-beta3/crypto/evp/m_dss.c.fips openssl-1.0.0-beta3/crypto/ init, update, final, -diff -up openssl-1.0.0-beta3/crypto/evp/m_sha1.c.fips openssl-1.0.0-beta3/crypto/evp/m_sha1.c ---- openssl-1.0.0-beta3/crypto/evp/m_sha1.c.fips 2008-03-12 22:14:24.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/evp/m_sha1.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/m_dss1.c.fips openssl-1.0.0-beta4/crypto/evp/m_dss1.c +--- openssl-1.0.0-beta4/crypto/evp/m_dss1.c.fips 2006-04-19 19:05:57.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/evp/m_dss1.c 2009-11-12 12:36:50.000000000 +0100 +@@ -82,7 +82,7 @@ static const EVP_MD dss1_md= + NID_dsa, + NID_dsaWithSHA1, + SHA_DIGEST_LENGTH, +- EVP_MD_FLAG_PKEY_DIGEST, ++ EVP_MD_FLAG_PKEY_DIGEST|EVP_MD_FLAG_FIPS, + init, + update, + final, +diff -up openssl-1.0.0-beta4/crypto/evp/m_sha1.c.fips openssl-1.0.0-beta4/crypto/evp/m_sha1.c +--- openssl-1.0.0-beta4/crypto/evp/m_sha1.c.fips 2008-03-12 22:14:24.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/m_sha1.c 2009-11-12 12:36:50.000000000 +0100 @@ -82,7 +82,8 @@ static const EVP_MD sha1_md= NID_sha1, NID_sha1WithRSAEncryption, @@ -1646,9 +1668,9 @@ diff -up openssl-1.0.0-beta3/crypto/evp/m_sha1.c.fips openssl-1.0.0-beta3/crypto init512, update512, final512, -diff -up openssl-1.0.0-beta3/crypto/evp/names.c.fips openssl-1.0.0-beta3/crypto/evp/names.c ---- openssl-1.0.0-beta3/crypto/evp/names.c.fips 2009-04-10 12:30:27.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/evp/names.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/names.c.fips openssl-1.0.0-beta4/crypto/evp/names.c +--- openssl-1.0.0-beta4/crypto/evp/names.c.fips 2009-04-10 12:30:27.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/evp/names.c 2009-11-12 12:36:50.000000000 +0100 @@ -66,6 +66,10 @@ int EVP_add_cipher(const EVP_CIPHER *c) { int r; @@ -1671,9 +1693,77 @@ diff -up openssl-1.0.0-beta3/crypto/evp/names.c.fips openssl-1.0.0-beta3/crypto/ name=OBJ_nid2sn(md->type); r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(const char *)md); if (r == 0) return(0); -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_aesavs.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_aesavs.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/evp/p_sign.c.fips openssl-1.0.0-beta4/crypto/evp/p_sign.c +--- openssl-1.0.0-beta4/crypto/evp/p_sign.c.fips 2006-05-24 15:29:30.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/evp/p_sign.c 2009-11-12 12:36:50.000000000 +0100 +@@ -61,6 +61,7 @@ + #include + #include + #include ++#include + + #ifdef undef + void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) +@@ -101,6 +102,22 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsig + goto err; + if (EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) <= 0) + goto err; ++ if (ctx->flags & EVP_MD_CTX_FLAG_PAD_X931) ++ if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_X931_PADDING) <= 0) ++ goto err; ++ if (ctx->flags & EVP_MD_CTX_FLAG_PAD_PSS) ++ { ++ int saltlen; ++ if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_PKCS1_PSS_PADDING) <= 0) ++ goto err; ++ saltlen = M_EVP_MD_CTX_FLAG_PSS_SALT(ctx); ++ if (saltlen == EVP_MD_CTX_FLAG_PSS_MDLEN) ++ saltlen = -1; ++ else if (saltlen == EVP_MD_CTX_FLAG_PSS_MREC) ++ saltlen = -2; ++ if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkctx, saltlen) <= 0) ++ goto err; ++ } + if (EVP_PKEY_sign(pkctx, sigret, &sltmp, m, m_len) <= 0) + goto err; + *siglen = sltmp; +diff -up openssl-1.0.0-beta4/crypto/evp/p_verify.c.fips openssl-1.0.0-beta4/crypto/evp/p_verify.c +--- openssl-1.0.0-beta4/crypto/evp/p_verify.c.fips 2008-11-12 04:58:01.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/evp/p_verify.c 2009-11-12 12:36:50.000000000 +0100 +@@ -61,6 +61,7 @@ + #include + #include + #include ++#include + + int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, + unsigned int siglen, EVP_PKEY *pkey) +@@ -86,6 +87,22 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, con + goto err; + if (EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) <= 0) + goto err; ++ if (ctx->flags & EVP_MD_CTX_FLAG_PAD_X931) ++ if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_X931_PADDING) <= 0) ++ goto err; ++ if (ctx->flags & EVP_MD_CTX_FLAG_PAD_PSS) ++ { ++ int saltlen; ++ if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_PKCS1_PSS_PADDING) <= 0) ++ goto err; ++ saltlen = M_EVP_MD_CTX_FLAG_PSS_SALT(ctx); ++ if (saltlen == EVP_MD_CTX_FLAG_PSS_MDLEN) ++ saltlen = -1; ++ else if (saltlen == EVP_MD_CTX_FLAG_PSS_MREC) ++ saltlen = -2; ++ if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkctx, saltlen) <= 0) ++ goto err; ++ } + i = EVP_PKEY_verify(pkctx, sigbuf, siglen, m, m_len); + err: + EVP_PKEY_CTX_free(pkctx); +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_aesavs.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_aesavs.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,939 @@ +/* ==================================================================== + * Copyright (c) 2004 The OpenSSL Project. All rights reserved. @@ -2614,9 +2704,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_aesavs.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_desmovs.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_desmovs.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_desmovs.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_desmovs.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,702 @@ +/* ==================================================================== + * Copyright (c) 2004 The OpenSSL Project. All rights reserved. @@ -3320,9 +3410,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_desmovs.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_dssvs.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_dssvs.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_dssvs.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_dssvs.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,537 @@ +#include + @@ -3861,9 +3951,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_dssvs.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rngvs.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_rngvs.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_rngvs.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_rngvs.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,230 @@ +/* + * Crude test driver for processing the VST and MCT testvector files @@ -4095,9 +4185,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rngvs.c + return 0; + } +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsagtest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsagtest.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_rsagtest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_rsagtest.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,390 @@ +/* fips_rsagtest.c */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL @@ -4489,9 +4579,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsagtest.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsastest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsastest.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_rsastest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_rsastest.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,370 @@ +/* fips_rsastest.c */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL @@ -4863,9 +4953,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsastest.c + return ret; + } +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsavtest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsavtest.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_rsavtest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_rsavtest.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,377 @@ +/* fips_rsavtest.c */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL @@ -5244,9 +5334,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_rsavtest.c + return ret; + } +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_shatest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_shatest.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_shatest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_shatest.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,388 @@ +/* fips_shatest.c */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL @@ -5636,9 +5726,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_shatest.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_utl.h ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/cavs/fips_utl.h 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/cavs/fips_utl.h +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/cavs/fips_utl.h 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,343 @@ +/* ==================================================================== + * Copyright (c) 2007 The OpenSSL Project. All rights reserved. @@ -5983,9 +6073,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/cavs/fips_utl.h +#endif + } + -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips_err.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips_err.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips_err.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips_err.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,7 @@ +#include + @@ -5994,9 +6084,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips_err.c +#else +static void *dummy=&dummy; +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips_err.h ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips_err.h 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips_err.h +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips_err.h 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,137 @@ +/* crypto/fips_err.h */ +/* ==================================================================== @@ -6135,10 +6225,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips_err.h + } +#endif + } -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_aes_selftest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_aes_selftest.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,103 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_aes_selftest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_aes_selftest.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,101 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. + * @@ -6190,9 +6280,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_aes_selftest.c + +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include + +#ifdef OPENSSL_FIPS @@ -6242,9 +6330,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_aes_selftest.c + return ret; + } +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,419 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. @@ -6665,10 +6753,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips.c + + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_des_selftest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_des_selftest.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,139 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_des_selftest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_des_selftest.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,137 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. + * @@ -6720,9 +6808,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_des_selftest.c + +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include +#include + @@ -6808,10 +6894,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_des_selftest.c + return ret; + } +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_dsa_selftest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_dsa_selftest.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,182 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_dsa_selftest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_dsa_selftest.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,184 @@ +/* crypto/dsa/dsatest.c */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. @@ -6873,9 +6959,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_dsa_selftest.c +#include +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include +#include +#include @@ -6931,13 +7015,13 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_dsa_selftest.c + +int FIPS_selftest_dsa() + { -+ DSA *dsa=NULL; ++ DSA *dsa; + int counter,i,j, ret = 0; + unsigned int slen; + unsigned char buf[256]; + unsigned long h; + EVP_MD_CTX mctx; -+ EVP_PKEY pk; ++ EVP_PKEY *pk = NULL; + + EVP_MD_CTX_init(&mctx); + @@ -6966,37 +7050,41 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_dsa_selftest.c + if (i != j || memcmp(buf,out_g,i) != 0) + goto err; + DSA_generate_key(dsa); -+ pk.type = EVP_PKEY_DSA; -+ pk.pkey.dsa = dsa; ++ ++ if ((pk=EVP_PKEY_new()) == NULL) ++ goto err; ++ EVP_PKEY_assign_DSA(pk, dsa); + + if (!EVP_SignInit_ex(&mctx, EVP_dss1(), NULL)) + goto err; + if (!EVP_SignUpdate(&mctx, str1, 20)) + goto err; -+ if (!EVP_SignFinal(&mctx, buf, &slen, &pk)) ++ if (!EVP_SignFinal(&mctx, buf, &slen, pk)) + goto err; + + if (!EVP_VerifyInit_ex(&mctx, EVP_dss1(), NULL)) + goto err; + if (!EVP_VerifyUpdate(&mctx, str1, 20)) + goto err; -+ if (EVP_VerifyFinal(&mctx, buf, slen, &pk) != 1) ++ if (EVP_VerifyFinal(&mctx, buf, slen, pk) != 1) + goto err; + + ret = 1; + + err: + EVP_MD_CTX_cleanup(&mctx); -+ if (dsa) ++ if (pk) ++ EVP_PKEY_free(pk); ++ else if (dsa) + DSA_free(dsa); + if (ret == 0) + FIPSerr(FIPS_F_FIPS_SELFTEST_DSA,FIPS_R_SELFTEST_FAILED); + return ret; + } +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips.h ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips.h 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips.h +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips.h 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,163 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. @@ -7161,10 +7249,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips.h +} +#endif +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_hmac_selftest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_hmac_selftest.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,137 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_hmac_selftest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_hmac_selftest.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,135 @@ +/* ==================================================================== + * Copyright (c) 2005 The OpenSSL Project. All rights reserved. + * @@ -7216,9 +7304,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_hmac_selftest.c + +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include + +#ifdef OPENSSL_FIPS @@ -7302,10 +7388,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_hmac_selftest.c + return 1; + } +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_rand.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,412 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_rand.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rand.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,410 @@ +/* ==================================================================== + * Copyright (c) 2007 The OpenSSL Project. All rights reserved. + * @@ -7384,9 +7470,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand.c +# endif +#endif +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include "fips_locl.h" + +#ifdef OPENSSL_FIPS @@ -7718,9 +7802,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand.c +} + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand.h ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_rand.h 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_rand.h +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rand.h 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,77 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. @@ -7799,10 +7883,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand.h +#endif +#endif +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand_selftest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_rand_selftest.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,373 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_rand_selftest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rand_selftest.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,371 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. + * @@ -7854,9 +7938,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand_selftest.c + +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include +#include + @@ -8176,9 +8258,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rand_selftest.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_randtest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_randtest.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_randtest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_randtest.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,248 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. @@ -8428,10 +8510,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_randtest.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rsa_selftest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_rsa_selftest.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,434 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_rsa_selftest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rsa_selftest.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,439 @@ +/* ==================================================================== + * Copyright (c) 2003-2007 The OpenSSL Project. All rights reserved. + * @@ -8483,9 +8565,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rsa_selftest.c + +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include +#include +#include @@ -8775,83 +8855,87 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rsa_selftest.c +int FIPS_selftest_rsa() + { + int ret = 0; -+ RSA *key = NULL; -+ EVP_PKEY pk; -+ key=RSA_new(); -+ setrsakey(key); -+ pk.type = EVP_PKEY_RSA; -+ pk.pkey.rsa = key; ++ RSA *key; ++ EVP_PKEY *pk = NULL; + -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if ((key=RSA_new()) == NULL) ++ goto err; ++ setrsakey(key); ++ if ((pk=EVP_PKEY_new()) == NULL) ++ goto err; ++ ++ EVP_PKEY_assign_RSA(pk, key); ++ ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_SHA1, sizeof(kat_RSA_SHA1), + EVP_sha1(), EVP_MD_CTX_FLAG_PAD_PKCS1, + "RSA SHA1 PKCS#1")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_SHA224, sizeof(kat_RSA_SHA224), + EVP_sha224(), EVP_MD_CTX_FLAG_PAD_PKCS1, + "RSA SHA224 PKCS#1")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_SHA256, sizeof(kat_RSA_SHA256), + EVP_sha256(), EVP_MD_CTX_FLAG_PAD_PKCS1, + "RSA SHA256 PKCS#1")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_SHA384, sizeof(kat_RSA_SHA384), + EVP_sha384(), EVP_MD_CTX_FLAG_PAD_PKCS1, + "RSA SHA384 PKCS#1")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_SHA512, sizeof(kat_RSA_SHA512), + EVP_sha512(), EVP_MD_CTX_FLAG_PAD_PKCS1, + "RSA SHA512 PKCS#1")) + goto err; + -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_PSS_SHA1, sizeof(kat_RSA_PSS_SHA1), + EVP_sha1(), EVP_MD_CTX_FLAG_PAD_PSS, + "RSA SHA1 PSS")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_PSS_SHA224, sizeof(kat_RSA_PSS_SHA224), + EVP_sha224(), EVP_MD_CTX_FLAG_PAD_PSS, + "RSA SHA224 PSS")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_PSS_SHA256, sizeof(kat_RSA_PSS_SHA256), + EVP_sha256(), EVP_MD_CTX_FLAG_PAD_PSS, + "RSA SHA256 PSS")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_PSS_SHA384, sizeof(kat_RSA_PSS_SHA384), + EVP_sha384(), EVP_MD_CTX_FLAG_PAD_PSS, + "RSA SHA384 PSS")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_PSS_SHA512, sizeof(kat_RSA_PSS_SHA512), + EVP_sha512(), EVP_MD_CTX_FLAG_PAD_PSS, + "RSA SHA512 PSS")) + goto err; + + -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_X931_SHA1, sizeof(kat_RSA_X931_SHA1), + EVP_sha1(), EVP_MD_CTX_FLAG_PAD_X931, + "RSA SHA1 X931")) + goto err; + /* NB: SHA224 not supported in X9.31 */ -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_X931_SHA256, sizeof(kat_RSA_X931_SHA256), + EVP_sha256(), EVP_MD_CTX_FLAG_PAD_X931, + "RSA SHA256 X931")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_X931_SHA384, sizeof(kat_RSA_X931_SHA384), + EVP_sha384(), EVP_MD_CTX_FLAG_PAD_X931, + "RSA SHA384 X931")) + goto err; -+ if (!fips_pkey_signature_test(&pk, kat_tbs, sizeof(kat_tbs) - 1, ++ if (!fips_pkey_signature_test(pk, kat_tbs, sizeof(kat_tbs) - 1, + kat_RSA_X931_SHA512, sizeof(kat_RSA_X931_SHA512), + EVP_sha512(), EVP_MD_CTX_FLAG_PAD_X931, + "RSA SHA512 X931")) @@ -8861,14 +8945,17 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rsa_selftest.c + ret = 1; + + err: -+ RSA_free(key); ++ if (pk) ++ EVP_PKEY_free(pk); ++ else if (key) ++ RSA_free(key); + return ret; + } + +#endif /* def OPENSSL_FIPS */ -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rsa_x931g.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_rsa_x931g.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_rsa_x931g.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_rsa_x931g.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,281 @@ +/* crypto/rsa/rsa_gen.c */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) @@ -9151,10 +9238,10 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_rsa_x931g.c + return 0; + + } -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_sha1_selftest.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_sha1_selftest.c 2009-08-11 18:07:30.000000000 +0200 -@@ -0,0 +1,99 @@ +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_sha1_selftest.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_sha1_selftest.c 2009-11-12 12:36:50.000000000 +0100 +@@ -0,0 +1,97 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. + * @@ -9206,9 +9293,7 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_sha1_selftest.c + +#include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif +#include +#include + @@ -9254,9 +9339,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_sha1_selftest.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_standalone_sha1.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_standalone_sha1.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_standalone_sha1.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_standalone_sha1.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,173 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. @@ -9431,9 +9516,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_standalone_sha1.c + } + + -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_test_suite.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/fips_test_suite.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/fips_test_suite.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/fips_test_suite.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,588 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. @@ -10023,9 +10108,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/fips_test_suite.c + } + +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips_locl.h ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips_locl.h 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips_locl.h +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips_locl.h 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,72 @@ +/* ==================================================================== + * Copyright (c) 2003 The OpenSSL Project. All rights reserved. @@ -10099,9 +10184,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips_locl.h +} +#endif +#endif -diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/Makefile ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/fips/Makefile 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/fips/Makefile +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/fips/Makefile 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,81 @@ +# +# OpenSSL/crypto/fips/Makefile @@ -10184,9 +10269,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/fips/Makefile + +# DO NOT DELETE THIS LINE -- make depend depends on it. + -diff -up openssl-1.0.0-beta3/crypto/hmac/hmac.c.fips openssl-1.0.0-beta3/crypto/hmac/hmac.c ---- openssl-1.0.0-beta3/crypto/hmac/hmac.c.fips 2008-11-12 04:58:02.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/hmac/hmac.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/hmac/hmac.c.fips openssl-1.0.0-beta4/crypto/hmac/hmac.c +--- openssl-1.0.0-beta4/crypto/hmac/hmac.c.fips 2008-11-12 04:58:02.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/hmac/hmac.c 2009-11-12 12:36:50.000000000 +0100 @@ -77,6 +77,13 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const vo if (key != NULL) @@ -10212,9 +10297,9 @@ diff -up openssl-1.0.0-beta3/crypto/hmac/hmac.c.fips openssl-1.0.0-beta3/crypto/ + EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); + } + -diff -up openssl-1.0.0-beta3/crypto/hmac/hmac.h.fips openssl-1.0.0-beta3/crypto/hmac/hmac.h ---- openssl-1.0.0-beta3/crypto/hmac/hmac.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/hmac/hmac.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/hmac/hmac.h.fips openssl-1.0.0-beta4/crypto/hmac/hmac.h +--- openssl-1.0.0-beta4/crypto/hmac/hmac.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/hmac/hmac.h 2009-11-12 12:36:50.000000000 +0100 @@ -101,6 +101,7 @@ unsigned char *HMAC(const EVP_MD *evp_md unsigned int *md_len); int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); @@ -10223,9 +10308,9 @@ diff -up openssl-1.0.0-beta3/crypto/hmac/hmac.h.fips openssl-1.0.0-beta3/crypto/ #ifdef __cplusplus } -diff -up openssl-1.0.0-beta3/crypto/Makefile.fips openssl-1.0.0-beta3/crypto/Makefile ---- openssl-1.0.0-beta3/crypto/Makefile.fips 2009-04-06 16:31:35.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/Makefile 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/Makefile.fips openssl-1.0.0-beta4/crypto/Makefile +--- openssl-1.0.0-beta4/crypto/Makefile.fips 2009-04-06 16:31:35.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/Makefile 2009-11-12 12:36:50.000000000 +0100 @@ -34,14 +34,14 @@ GENERAL=Makefile README crypto-lib.com i LIB= $(TOP)/libcrypto.a @@ -10244,120 +10329,9 @@ diff -up openssl-1.0.0-beta3/crypto/Makefile.fips openssl-1.0.0-beta3/crypto/Mak ALL= $(GENERAL) $(SRC) $(HEADER) -diff -up openssl-1.0.0-beta3/crypto/md2/md2_dgst.c.fips openssl-1.0.0-beta3/crypto/md2/md2_dgst.c ---- openssl-1.0.0-beta3/crypto/md2/md2_dgst.c.fips 2007-08-31 12:12:35.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/md2/md2_dgst.c 2009-08-11 18:07:30.000000000 +0200 -@@ -62,6 +62,11 @@ - #include - #include - #include -+#ifdef OPENSSL_FIPS -+#include -+#endif -+ -+#include - - const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; - -@@ -116,7 +121,7 @@ const char *MD2_options(void) - return("md2(int)"); - } - --int MD2_Init(MD2_CTX *c) -+FIPS_NON_FIPS_MD_Init(MD2) - { - c->num=0; - memset(c->state,0,sizeof c->state); -diff -up openssl-1.0.0-beta3/crypto/md2/md2.h.fips openssl-1.0.0-beta3/crypto/md2/md2.h ---- openssl-1.0.0-beta3/crypto/md2/md2.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/md2/md2.h 2009-08-11 18:07:30.000000000 +0200 -@@ -81,6 +81,9 @@ typedef struct MD2state_st - } MD2_CTX; - - const char *MD2_options(void); -+#ifdef OPENSSL_FIPS -+int private_MD2_Init(MD2_CTX *c); -+#endif - int MD2_Init(MD2_CTX *c); - int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); - int MD2_Final(unsigned char *md, MD2_CTX *c); -diff -up openssl-1.0.0-beta3/crypto/md4/md4_dgst.c.fips openssl-1.0.0-beta3/crypto/md4/md4_dgst.c ---- openssl-1.0.0-beta3/crypto/md4/md4_dgst.c.fips 2007-01-21 14:07:11.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/md4/md4_dgst.c 2009-08-11 18:07:30.000000000 +0200 -@@ -59,6 +59,11 @@ - #include - #include "md4_locl.h" - #include -+#include -+#ifdef OPENSSL_FIPS -+#include -+#endif -+ - - const char MD4_version[]="MD4" OPENSSL_VERSION_PTEXT; - -@@ -70,7 +75,7 @@ const char MD4_version[]="MD4" OPENSSL_V - #define INIT_DATA_C (unsigned long)0x98badcfeL - #define INIT_DATA_D (unsigned long)0x10325476L - --int MD4_Init(MD4_CTX *c) -+FIPS_NON_FIPS_MD_Init(MD4) - { - memset (c,0,sizeof(*c)); - c->A=INIT_DATA_A; -diff -up openssl-1.0.0-beta3/crypto/md4/md4.h.fips openssl-1.0.0-beta3/crypto/md4/md4.h ---- openssl-1.0.0-beta3/crypto/md4/md4.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/md4/md4.h 2009-08-11 18:07:30.000000000 +0200 -@@ -105,6 +105,9 @@ typedef struct MD4state_st - unsigned int num; - } MD4_CTX; - -+#ifdef OPENSSL_FIPS -+int private_MD4_Init(MD4_CTX *c); -+#endif - int MD4_Init(MD4_CTX *c); - int MD4_Update(MD4_CTX *c, const void *data, size_t len); - int MD4_Final(unsigned char *md, MD4_CTX *c); -diff -up openssl-1.0.0-beta3/crypto/md5/md5_dgst.c.fips openssl-1.0.0-beta3/crypto/md5/md5_dgst.c ---- openssl-1.0.0-beta3/crypto/md5/md5_dgst.c.fips 2007-01-21 14:07:11.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/md5/md5_dgst.c 2009-08-11 18:07:30.000000000 +0200 -@@ -59,6 +59,11 @@ - #include - #include "md5_locl.h" - #include -+#include -+#ifdef OPENSSL_FIPS -+#include -+#endif -+ - - const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT; - -@@ -70,7 +75,7 @@ const char MD5_version[]="MD5" OPENSSL_V - #define INIT_DATA_C (unsigned long)0x98badcfeL - #define INIT_DATA_D (unsigned long)0x10325476L - --int MD5_Init(MD5_CTX *c) -+FIPS_NON_FIPS_MD_Init(MD5) - { - memset (c,0,sizeof(*c)); - c->A=INIT_DATA_A; -diff -up openssl-1.0.0-beta3/crypto/md5/md5.h.fips openssl-1.0.0-beta3/crypto/md5/md5.h ---- openssl-1.0.0-beta3/crypto/md5/md5.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/md5/md5.h 2009-08-11 18:07:30.000000000 +0200 -@@ -105,6 +105,9 @@ typedef struct MD5state_st - unsigned int num; - } MD5_CTX; - -+#ifdef OPENSSL_FIPS -+int private_MD5_Init(MD5_CTX *c); -+#endif - int MD5_Init(MD5_CTX *c); - int MD5_Update(MD5_CTX *c, const void *data, size_t len); - int MD5_Final(unsigned char *md, MD5_CTX *c); -diff -up openssl-1.0.0-beta3/crypto/mdc2/mdc2dgst.c.fips openssl-1.0.0-beta3/crypto/mdc2/mdc2dgst.c ---- openssl-1.0.0-beta3/crypto/mdc2/mdc2dgst.c.fips 2004-07-25 21:10:41.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/mdc2/mdc2dgst.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/mdc2/mdc2dgst.c.fips openssl-1.0.0-beta4/crypto/mdc2/mdc2dgst.c +--- openssl-1.0.0-beta4/crypto/mdc2/mdc2dgst.c.fips 2004-07-25 21:10:41.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/mdc2/mdc2dgst.c 2009-11-12 12:36:50.000000000 +0100 @@ -61,6 +61,11 @@ #include #include @@ -10379,9 +10353,9 @@ diff -up openssl-1.0.0-beta3/crypto/mdc2/mdc2dgst.c.fips openssl-1.0.0-beta3/cry { c->num=0; c->pad_type=1; -diff -up openssl-1.0.0-beta3/crypto/mdc2/mdc2.h.fips openssl-1.0.0-beta3/crypto/mdc2/mdc2.h ---- openssl-1.0.0-beta3/crypto/mdc2/mdc2.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/mdc2/mdc2.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/mdc2/mdc2.h.fips openssl-1.0.0-beta4/crypto/mdc2/mdc2.h +--- openssl-1.0.0-beta4/crypto/mdc2/mdc2.h.fips 2009-11-12 12:36:50.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/mdc2/mdc2.h 2009-11-12 12:36:50.000000000 +0100 @@ -80,7 +80,9 @@ typedef struct mdc2_ctx_st int pad_type; /* either 1 or 2, default 1 */ } MDC2_CTX; @@ -10393,9 +10367,120 @@ diff -up openssl-1.0.0-beta3/crypto/mdc2/mdc2.h.fips openssl-1.0.0-beta3/crypto/ int MDC2_Init(MDC2_CTX *c); int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); int MDC2_Final(unsigned char *md, MDC2_CTX *c); -diff -up openssl-1.0.0-beta3/crypto/mem.c.fips openssl-1.0.0-beta3/crypto/mem.c ---- openssl-1.0.0-beta3/crypto/mem.c.fips 2008-11-12 04:57:47.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/mem.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/md2/md2_dgst.c.fips openssl-1.0.0-beta4/crypto/md2/md2_dgst.c +--- openssl-1.0.0-beta4/crypto/md2/md2_dgst.c.fips 2007-08-31 12:12:35.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/md2/md2_dgst.c 2009-11-12 12:36:50.000000000 +0100 +@@ -62,6 +62,11 @@ + #include + #include + #include ++#ifdef OPENSSL_FIPS ++#include ++#endif ++ ++#include + + const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; + +@@ -116,7 +121,7 @@ const char *MD2_options(void) + return("md2(int)"); + } + +-int MD2_Init(MD2_CTX *c) ++FIPS_NON_FIPS_MD_Init(MD2) + { + c->num=0; + memset(c->state,0,sizeof c->state); +diff -up openssl-1.0.0-beta4/crypto/md2/md2.h.fips openssl-1.0.0-beta4/crypto/md2/md2.h +--- openssl-1.0.0-beta4/crypto/md2/md2.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/md2/md2.h 2009-11-12 12:36:50.000000000 +0100 +@@ -81,6 +81,9 @@ typedef struct MD2state_st + } MD2_CTX; + + const char *MD2_options(void); ++#ifdef OPENSSL_FIPS ++int private_MD2_Init(MD2_CTX *c); ++#endif + int MD2_Init(MD2_CTX *c); + int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); + int MD2_Final(unsigned char *md, MD2_CTX *c); +diff -up openssl-1.0.0-beta4/crypto/md4/md4_dgst.c.fips openssl-1.0.0-beta4/crypto/md4/md4_dgst.c +--- openssl-1.0.0-beta4/crypto/md4/md4_dgst.c.fips 2007-01-21 14:07:11.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/md4/md4_dgst.c 2009-11-12 12:36:50.000000000 +0100 +@@ -59,6 +59,11 @@ + #include + #include "md4_locl.h" + #include ++#include ++#ifdef OPENSSL_FIPS ++#include ++#endif ++ + + const char MD4_version[]="MD4" OPENSSL_VERSION_PTEXT; + +@@ -70,7 +75,7 @@ const char MD4_version[]="MD4" OPENSSL_V + #define INIT_DATA_C (unsigned long)0x98badcfeL + #define INIT_DATA_D (unsigned long)0x10325476L + +-int MD4_Init(MD4_CTX *c) ++FIPS_NON_FIPS_MD_Init(MD4) + { + memset (c,0,sizeof(*c)); + c->A=INIT_DATA_A; +diff -up openssl-1.0.0-beta4/crypto/md4/md4.h.fips openssl-1.0.0-beta4/crypto/md4/md4.h +--- openssl-1.0.0-beta4/crypto/md4/md4.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/md4/md4.h 2009-11-12 12:36:50.000000000 +0100 +@@ -105,6 +105,9 @@ typedef struct MD4state_st + unsigned int num; + } MD4_CTX; + ++#ifdef OPENSSL_FIPS ++int private_MD4_Init(MD4_CTX *c); ++#endif + int MD4_Init(MD4_CTX *c); + int MD4_Update(MD4_CTX *c, const void *data, size_t len); + int MD4_Final(unsigned char *md, MD4_CTX *c); +diff -up openssl-1.0.0-beta4/crypto/md5/md5_dgst.c.fips openssl-1.0.0-beta4/crypto/md5/md5_dgst.c +--- openssl-1.0.0-beta4/crypto/md5/md5_dgst.c.fips 2007-01-21 14:07:11.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/md5/md5_dgst.c 2009-11-12 12:36:50.000000000 +0100 +@@ -59,6 +59,11 @@ + #include + #include "md5_locl.h" + #include ++#include ++#ifdef OPENSSL_FIPS ++#include ++#endif ++ + + const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT; + +@@ -70,7 +75,7 @@ const char MD5_version[]="MD5" OPENSSL_V + #define INIT_DATA_C (unsigned long)0x98badcfeL + #define INIT_DATA_D (unsigned long)0x10325476L + +-int MD5_Init(MD5_CTX *c) ++FIPS_NON_FIPS_MD_Init(MD5) + { + memset (c,0,sizeof(*c)); + c->A=INIT_DATA_A; +diff -up openssl-1.0.0-beta4/crypto/md5/md5.h.fips openssl-1.0.0-beta4/crypto/md5/md5.h +--- openssl-1.0.0-beta4/crypto/md5/md5.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/md5/md5.h 2009-11-12 12:36:50.000000000 +0100 +@@ -105,6 +105,9 @@ typedef struct MD5state_st + unsigned int num; + } MD5_CTX; + ++#ifdef OPENSSL_FIPS ++int private_MD5_Init(MD5_CTX *c); ++#endif + int MD5_Init(MD5_CTX *c); + int MD5_Update(MD5_CTX *c, const void *data, size_t len); + int MD5_Final(unsigned char *md, MD5_CTX *c); +diff -up openssl-1.0.0-beta4/crypto/mem.c.fips openssl-1.0.0-beta4/crypto/mem.c +--- openssl-1.0.0-beta4/crypto/mem.c.fips 2008-11-12 04:57:47.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/mem.c 2009-11-12 12:36:50.000000000 +0100 @@ -101,7 +101,7 @@ static void (*free_locked_func)(void *) /* may be changed as long as 'allow_customize_debug' is set */ @@ -10405,9 +10490,9 @@ diff -up openssl-1.0.0-beta3/crypto/mem.c.fips openssl-1.0.0-beta3/crypto/mem.c /* use default functions from mem_dbg.c */ static void (*malloc_debug_func)(void *,int,const char *,int,int) = CRYPTO_dbg_malloc; -diff -up /dev/null openssl-1.0.0-beta3/crypto/o_init.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/o_init.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/o_init.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/o_init.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,80 @@ +/* o_init.c */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL @@ -10489,9 +10574,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/o_init.c + } + + -diff -up openssl-1.0.0-beta3/crypto/opensslconf.h.in.fips openssl-1.0.0-beta3/crypto/opensslconf.h.in ---- openssl-1.0.0-beta3/crypto/opensslconf.h.in.fips 2005-12-16 11:37:23.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/opensslconf.h.in 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/opensslconf.h.in.fips openssl-1.0.0-beta4/crypto/opensslconf.h.in +--- openssl-1.0.0-beta4/crypto/opensslconf.h.in.fips 2005-12-16 11:37:23.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/opensslconf.h.in 2009-11-12 12:36:50.000000000 +0100 @@ -1,5 +1,20 @@ /* crypto/opensslconf.h.in */ @@ -10513,9 +10598,9 @@ diff -up openssl-1.0.0-beta3/crypto/opensslconf.h.in.fips openssl-1.0.0-beta3/cr /* Generate 80386 code? */ #undef I386_ONLY -diff -up openssl-1.0.0-beta3/crypto/pkcs12/p12_crt.c.fips openssl-1.0.0-beta3/crypto/pkcs12/p12_crt.c ---- openssl-1.0.0-beta3/crypto/pkcs12/p12_crt.c.fips 2009-03-09 14:08:04.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/pkcs12/p12_crt.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/pkcs12/p12_crt.c.fips openssl-1.0.0-beta4/crypto/pkcs12/p12_crt.c +--- openssl-1.0.0-beta4/crypto/pkcs12/p12_crt.c.fips 2009-03-09 14:08:04.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/pkcs12/p12_crt.c 2009-11-12 12:36:50.000000000 +0100 @@ -59,6 +59,10 @@ #include #include "cryptlib.h" @@ -10542,9 +10627,9 @@ diff -up openssl-1.0.0-beta3/crypto/pkcs12/p12_crt.c.fips openssl-1.0.0-beta3/cr if (!nid_key) nid_key = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; if (!iter) -diff -up openssl-1.0.0-beta3/crypto/rand/md_rand.c.fips openssl-1.0.0-beta3/crypto/rand/md_rand.c ---- openssl-1.0.0-beta3/crypto/rand/md_rand.c.fips 2009-01-03 10:25:32.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rand/md_rand.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rand/md_rand.c.fips openssl-1.0.0-beta4/crypto/rand/md_rand.c +--- openssl-1.0.0-beta4/crypto/rand/md_rand.c.fips 2009-01-03 10:25:32.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rand/md_rand.c 2009-11-12 12:36:50.000000000 +0100 @@ -126,6 +126,10 @@ #include @@ -10571,9 +10656,9 @@ diff -up openssl-1.0.0-beta3/crypto/rand/md_rand.c.fips openssl-1.0.0-beta3/cryp #ifdef PREDICT if (rand_predictable) { -diff -up openssl-1.0.0-beta3/crypto/rand/rand_err.c.fips openssl-1.0.0-beta3/crypto/rand/rand_err.c ---- openssl-1.0.0-beta3/crypto/rand/rand_err.c.fips 2006-11-21 22:29:41.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rand/rand_err.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rand/rand_err.c.fips openssl-1.0.0-beta4/crypto/rand/rand_err.c +--- openssl-1.0.0-beta4/crypto/rand/rand_err.c.fips 2006-11-21 22:29:41.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rand/rand_err.c 2009-11-12 12:36:50.000000000 +0100 @@ -70,6 +70,13 @@ static ERR_STRING_DATA RAND_str_functs[]= @@ -10606,9 +10691,9 @@ diff -up openssl-1.0.0-beta3/crypto/rand/rand_err.c.fips openssl-1.0.0-beta3/cry {0,NULL} }; -diff -up openssl-1.0.0-beta3/crypto/rand/rand.h.fips openssl-1.0.0-beta3/crypto/rand/rand.h ---- openssl-1.0.0-beta3/crypto/rand/rand.h.fips 2009-08-11 18:07:29.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rand/rand.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rand/rand.h.fips openssl-1.0.0-beta4/crypto/rand/rand.h +--- openssl-1.0.0-beta4/crypto/rand/rand.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rand/rand.h 2009-11-12 12:36:50.000000000 +0100 @@ -128,11 +128,28 @@ void ERR_load_RAND_strings(void); /* Error codes for the RAND functions. */ @@ -10638,9 +10723,9 @@ diff -up openssl-1.0.0-beta3/crypto/rand/rand.h.fips openssl-1.0.0-beta3/crypto/ #ifdef __cplusplus } -diff -up openssl-1.0.0-beta3/crypto/rand/rand_lib.c.fips openssl-1.0.0-beta3/crypto/rand/rand_lib.c ---- openssl-1.0.0-beta3/crypto/rand/rand_lib.c.fips 2008-11-12 04:58:04.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rand/rand_lib.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rand/rand_lib.c.fips openssl-1.0.0-beta4/crypto/rand/rand_lib.c +--- openssl-1.0.0-beta4/crypto/rand/rand_lib.c.fips 2008-11-12 04:58:04.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rand/rand_lib.c 2009-11-12 12:36:50.000000000 +0100 @@ -60,6 +60,12 @@ #include #include "cryptlib.h" @@ -10674,9 +10759,9 @@ diff -up openssl-1.0.0-beta3/crypto/rand/rand_lib.c.fips openssl-1.0.0-beta3/cry return default_RAND_meth; } -diff -up openssl-1.0.0-beta3/crypto/rc2/rc2.h.fips openssl-1.0.0-beta3/crypto/rc2/rc2.h ---- openssl-1.0.0-beta3/crypto/rc2/rc2.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rc2/rc2.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rc2/rc2.h.fips openssl-1.0.0-beta4/crypto/rc2/rc2.h +--- openssl-1.0.0-beta4/crypto/rc2/rc2.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rc2/rc2.h 2009-11-12 12:36:50.000000000 +0100 @@ -79,7 +79,9 @@ typedef struct rc2_key_st RC2_INT data[64]; } RC2_KEY; @@ -10688,9 +10773,9 @@ diff -up openssl-1.0.0-beta3/crypto/rc2/rc2.h.fips openssl-1.0.0-beta3/crypto/rc void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, int enc); -diff -up openssl-1.0.0-beta3/crypto/rc2/rc2_skey.c.fips openssl-1.0.0-beta3/crypto/rc2/rc2_skey.c ---- openssl-1.0.0-beta3/crypto/rc2/rc2_skey.c.fips 2007-09-18 23:10:32.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rc2/rc2_skey.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rc2/rc2_skey.c.fips openssl-1.0.0-beta4/crypto/rc2/rc2_skey.c +--- openssl-1.0.0-beta4/crypto/rc2/rc2_skey.c.fips 2007-09-18 23:10:32.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/rc2/rc2_skey.c 2009-11-12 12:36:50.000000000 +0100 @@ -57,6 +57,11 @@ */ @@ -10724,9 +10809,31 @@ diff -up openssl-1.0.0-beta3/crypto/rc2/rc2_skey.c.fips openssl-1.0.0-beta3/cryp int i,j; unsigned char *k; RC2_INT *ki; -diff -up openssl-1.0.0-beta3/crypto/rc4/asm/rc4-586.pl.fips openssl-1.0.0-beta3/crypto/rc4/asm/rc4-586.pl ---- openssl-1.0.0-beta3/crypto/rc4/asm/rc4-586.pl.fips 2007-12-02 22:32:03.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rc4/asm/rc4-586.pl 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rc4/asm/rc4-s390x.pl.fips openssl-1.0.0-beta4/crypto/rc4/asm/rc4-s390x.pl +--- openssl-1.0.0-beta4/crypto/rc4/asm/rc4-s390x.pl.fips 2009-02-12 15:48:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rc4/asm/rc4-s390x.pl 2009-11-12 12:36:50.000000000 +0100 +@@ -202,4 +202,6 @@ RC4_options: + .string "rc4(8x,char)" + ___ + ++$code =~ s/RC4_set_key/private_RC4_set_key/g if ($ENV{FIPS} ne ""); ++ + print $code; +diff -up openssl-1.0.0-beta4/crypto/rc4/asm/rc4-x86_64.pl.fips openssl-1.0.0-beta4/crypto/rc4/asm/rc4-x86_64.pl +--- openssl-1.0.0-beta4/crypto/rc4/asm/rc4-x86_64.pl.fips 2009-04-27 21:31:04.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/rc4/asm/rc4-x86_64.pl 2009-11-12 12:36:50.000000000 +0100 +@@ -499,6 +499,8 @@ ___ + + $code =~ s/#([bwd])/$1/gm; + ++$code =~ s/RC4_set_key/private_RC4_set_key/g if ($ENV{FIPS} ne ""); ++ + print $code; + + close STDOUT; +diff -up openssl-1.0.0-beta4/crypto/rc4/asm/rc4-586.pl.fips openssl-1.0.0-beta4/crypto/rc4/asm/rc4-586.pl +--- openssl-1.0.0-beta4/crypto/rc4/asm/rc4-586.pl.fips 2007-12-02 22:32:03.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rc4/asm/rc4-586.pl 2009-11-12 12:36:50.000000000 +0100 @@ -166,8 +166,12 @@ $idx="edx"; &external_label("OPENSSL_ia32cap_P"); @@ -10750,31 +10857,9 @@ diff -up openssl-1.0.0-beta3/crypto/rc4/asm/rc4-586.pl.fips openssl-1.0.0-beta3/ # const char *RC4_options(void); &function_begin_B("RC4_options"); -diff -up openssl-1.0.0-beta3/crypto/rc4/asm/rc4-s390x.pl.fips openssl-1.0.0-beta3/crypto/rc4/asm/rc4-s390x.pl ---- openssl-1.0.0-beta3/crypto/rc4/asm/rc4-s390x.pl.fips 2009-02-12 15:48:49.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rc4/asm/rc4-s390x.pl 2009-08-11 18:07:30.000000000 +0200 -@@ -202,4 +202,6 @@ RC4_options: - .string "rc4(8x,char)" - ___ - -+$code =~ s/RC4_set_key/private_RC4_set_key/g if ($ENV{FIPS} ne ""); -+ - print $code; -diff -up openssl-1.0.0-beta3/crypto/rc4/asm/rc4-x86_64.pl.fips openssl-1.0.0-beta3/crypto/rc4/asm/rc4-x86_64.pl ---- openssl-1.0.0-beta3/crypto/rc4/asm/rc4-x86_64.pl.fips 2009-04-27 21:31:04.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rc4/asm/rc4-x86_64.pl 2009-08-11 18:07:30.000000000 +0200 -@@ -499,6 +499,8 @@ ___ - - $code =~ s/#([bwd])/$1/gm; - -+$code =~ s/RC4_set_key/private_RC4_set_key/g if ($ENV{FIPS} ne ""); -+ - print $code; - - close STDOUT; -diff -up openssl-1.0.0-beta3/crypto/rc4/Makefile.fips openssl-1.0.0-beta3/crypto/rc4/Makefile ---- openssl-1.0.0-beta3/crypto/rc4/Makefile.fips 2009-02-11 11:01:36.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rc4/Makefile 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rc4/Makefile.fips openssl-1.0.0-beta4/crypto/rc4/Makefile +--- openssl-1.0.0-beta4/crypto/rc4/Makefile.fips 2009-02-11 11:01:36.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rc4/Makefile 2009-11-12 12:36:50.000000000 +0100 @@ -21,8 +21,8 @@ TEST=rc4test.c APPS= @@ -10786,9 +10871,9 @@ diff -up openssl-1.0.0-beta3/crypto/rc4/Makefile.fips openssl-1.0.0-beta3/crypto SRC= $(LIBSRC) -diff -up /dev/null openssl-1.0.0-beta3/crypto/rc4/rc4_fblk.c ---- /dev/null 2009-07-27 08:39:22.849064505 +0200 -+++ openssl-1.0.0-beta3/crypto/rc4/rc4_fblk.c 2009-08-11 18:07:30.000000000 +0200 +diff -up /dev/null openssl-1.0.0-beta4/crypto/rc4/rc4_fblk.c +--- /dev/null 2009-11-04 12:00:58.801002276 +0100 ++++ openssl-1.0.0-beta4/crypto/rc4/rc4_fblk.c 2009-11-12 12:36:50.000000000 +0100 @@ -0,0 +1,75 @@ +/* crypto/rc4/rc4_fblk.c */ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL @@ -10865,9 +10950,9 @@ diff -up /dev/null openssl-1.0.0-beta3/crypto/rc4/rc4_fblk.c + } +#endif + -diff -up openssl-1.0.0-beta3/crypto/rc4/rc4.h.fips openssl-1.0.0-beta3/crypto/rc4/rc4.h ---- openssl-1.0.0-beta3/crypto/rc4/rc4.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rc4/rc4.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rc4/rc4.h.fips openssl-1.0.0-beta4/crypto/rc4/rc4.h +--- openssl-1.0.0-beta4/crypto/rc4/rc4.h.fips 2009-11-12 12:36:50.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rc4/rc4.h 2009-11-12 12:36:50.000000000 +0100 @@ -78,6 +78,9 @@ typedef struct rc4_key_st @@ -10878,9 +10963,9 @@ diff -up openssl-1.0.0-beta3/crypto/rc4/rc4.h.fips openssl-1.0.0-beta3/crypto/rc void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, unsigned char *outdata); -diff -up openssl-1.0.0-beta3/crypto/rc4/rc4_skey.c.fips openssl-1.0.0-beta3/crypto/rc4/rc4_skey.c ---- openssl-1.0.0-beta3/crypto/rc4/rc4_skey.c.fips 2007-01-21 14:07:13.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rc4/rc4_skey.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rc4/rc4_skey.c.fips openssl-1.0.0-beta4/crypto/rc4/rc4_skey.c +--- openssl-1.0.0-beta4/crypto/rc4/rc4_skey.c.fips 2007-01-21 14:07:13.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rc4/rc4_skey.c 2009-11-12 12:36:50.000000000 +0100 @@ -59,6 +59,11 @@ #include #include "rc4_locl.h" @@ -10918,9 +11003,9 @@ diff -up openssl-1.0.0-beta3/crypto/rc4/rc4_skey.c.fips openssl-1.0.0-beta3/cryp unsigned char *cp=(unsigned char *)d; for (i=0;i<256;i++) cp[i]=i; -diff -up openssl-1.0.0-beta3/crypto/ripemd/ripemd.h.fips openssl-1.0.0-beta3/crypto/ripemd/ripemd.h ---- openssl-1.0.0-beta3/crypto/ripemd/ripemd.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/ripemd/ripemd.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/ripemd/ripemd.h.fips openssl-1.0.0-beta4/crypto/ripemd/ripemd.h +--- openssl-1.0.0-beta4/crypto/ripemd/ripemd.h.fips 2009-11-12 12:36:50.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/ripemd/ripemd.h 2009-11-12 12:36:50.000000000 +0100 @@ -91,6 +91,9 @@ typedef struct RIPEMD160state_st unsigned int num; } RIPEMD160_CTX; @@ -10931,9 +11016,9 @@ diff -up openssl-1.0.0-beta3/crypto/ripemd/ripemd.h.fips openssl-1.0.0-beta3/cry int RIPEMD160_Init(RIPEMD160_CTX *c); int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); -diff -up openssl-1.0.0-beta3/crypto/ripemd/rmd_dgst.c.fips openssl-1.0.0-beta3/crypto/ripemd/rmd_dgst.c ---- openssl-1.0.0-beta3/crypto/ripemd/rmd_dgst.c.fips 2007-01-21 14:07:13.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/ripemd/rmd_dgst.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/ripemd/rmd_dgst.c.fips openssl-1.0.0-beta4/crypto/ripemd/rmd_dgst.c +--- openssl-1.0.0-beta4/crypto/ripemd/rmd_dgst.c.fips 2007-01-21 14:07:13.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/ripemd/rmd_dgst.c 2009-11-12 12:36:50.000000000 +0100 @@ -59,6 +59,11 @@ #include #include "rmd_locl.h" @@ -10955,17 +11040,15 @@ diff -up openssl-1.0.0-beta3/crypto/ripemd/rmd_dgst.c.fips openssl-1.0.0-beta3/c { memset (c,0,sizeof(*c)); c->A=RIPEMD160_A; -diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_eay.c.fips openssl-1.0.0-beta3/crypto/rsa/rsa_eay.c ---- openssl-1.0.0-beta3/crypto/rsa/rsa_eay.c.fips 2008-09-14 15:51:44.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rsa/rsa_eay.c 2009-08-11 18:07:30.000000000 +0200 -@@ -116,6 +116,10 @@ +diff -up openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c.fips openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c +--- openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c.fips 2008-09-14 15:51:44.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/rsa/rsa_eay.c 2009-11-12 12:36:50.000000000 +0100 +@@ -114,6 +114,8 @@ #include #include #include +#include -+#ifdef OPENSSL_FIPS +#include -+#endif #ifndef RSA_NULL @@ -11218,9 +11301,9 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_eay.c.fips openssl-1.0.0-beta3/crypt rsa->flags|=RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE; return(1); } -diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_err.c.fips openssl-1.0.0-beta3/crypto/rsa/rsa_err.c ---- openssl-1.0.0-beta3/crypto/rsa/rsa_err.c.fips 2008-12-29 17:11:56.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/rsa/rsa_err.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rsa/rsa_err.c.fips openssl-1.0.0-beta4/crypto/rsa/rsa_err.c +--- openssl-1.0.0-beta4/crypto/rsa/rsa_err.c.fips 2008-12-29 17:11:56.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rsa/rsa_err.c 2009-11-12 12:36:50.000000000 +0100 @@ -111,8 +111,12 @@ static ERR_STRING_DATA RSA_str_functs[]= {ERR_FUNC(RSA_F_RSA_PRINT_FP), "RSA_print_fp"}, {ERR_FUNC(RSA_F_RSA_PRIV_DECODE), "RSA_PRIV_DECODE"}, @@ -11247,10 +11330,10 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_err.c.fips openssl-1.0.0-beta3/crypt {ERR_REASON(RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),"operation not supported for this keytype"}, {ERR_REASON(RSA_R_PADDING_CHECK_FAILED) ,"padding check failed"}, {ERR_REASON(RSA_R_P_NOT_PRIME) ,"p not prime"}, -diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c.fips openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c ---- openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c.fips 2007-03-28 02:15:27.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c 2009-08-11 18:07:30.000000000 +0200 -@@ -67,6 +67,77 @@ +diff -up openssl-1.0.0-beta4/crypto/rsa/rsa_gen.c.fips openssl-1.0.0-beta4/crypto/rsa/rsa_gen.c +--- openssl-1.0.0-beta4/crypto/rsa/rsa_gen.c.fips 2007-03-28 02:15:27.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/rsa/rsa_gen.c 2009-11-12 12:36:50.000000000 +0100 +@@ -67,6 +67,82 @@ #include "cryptlib.h" #include #include @@ -11272,16 +11355,19 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c.fips openssl-1.0.0-beta3/crypt + const unsigned char tbs[] = "RSA Pairwise Check Data"; + unsigned char *ctbuf = NULL, *ptbuf = NULL; + int len, ret = 0; -+ EVP_PKEY pk; -+ pk.type = EVP_PKEY_RSA; -+ pk.pkey.rsa = rsa; ++ EVP_PKEY *pk; ++ ++ if ((pk=EVP_PKEY_new()) == NULL) ++ goto err; ++ ++ EVP_PKEY_set1_RSA(pk, rsa); + + /* Perform pairwise consistency signature test */ -+ if (!fips_pkey_signature_test(&pk, tbs, -1, ++ if (!fips_pkey_signature_test(pk, tbs, -1, + NULL, 0, EVP_sha1(), EVP_MD_CTX_FLAG_PAD_PKCS1, NULL) -+ || !fips_pkey_signature_test(&pk, tbs, -1, ++ || !fips_pkey_signature_test(pk, tbs, -1, + NULL, 0, EVP_sha1(), EVP_MD_CTX_FLAG_PAD_X931, NULL) -+ || !fips_pkey_signature_test(&pk, tbs, -1, ++ || !fips_pkey_signature_test(pk, tbs, -1, + NULL, 0, EVP_sha1(), EVP_MD_CTX_FLAG_PAD_PSS, NULL)) + goto err; + /* Now perform pairwise consistency encrypt/decrypt test */ @@ -11321,6 +11407,8 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c.fips openssl-1.0.0-beta3/crypt + OPENSSL_free(ctbuf); + if (ptbuf) + OPENSSL_free(ptbuf); ++ if (pk) ++ EVP_PKEY_free(pk); + + return ret; + } @@ -11328,7 +11416,7 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c.fips openssl-1.0.0-beta3/crypt static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); -@@ -90,6 +161,23 @@ static int rsa_builtin_keygen(RSA *rsa, +@@ -90,6 +166,23 @@ static int rsa_builtin_keygen(RSA *rsa, int bitsp,bitsq,ok= -1,n=0; BN_CTX *ctx=NULL; @@ -11352,7 +11440,7 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c.fips openssl-1.0.0-beta3/crypt ctx=BN_CTX_new(); if (ctx == NULL) goto err; BN_CTX_start(ctx); -@@ -201,6 +289,17 @@ static int rsa_builtin_keygen(RSA *rsa, +@@ -201,6 +294,17 @@ static int rsa_builtin_keygen(RSA *rsa, p = rsa->p; if (!BN_mod_inverse(rsa->iqmp,rsa->q,p,ctx)) goto err; @@ -11370,9 +11458,9 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_gen.c.fips openssl-1.0.0-beta3/crypt ok=1; err: if (ok == -1) -diff -up openssl-1.0.0-beta3/crypto/rsa/rsa.h.fips openssl-1.0.0-beta3/crypto/rsa/rsa.h ---- openssl-1.0.0-beta3/crypto/rsa/rsa.h.fips 2009-08-11 18:07:29.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rsa/rsa.h 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rsa/rsa.h.fips openssl-1.0.0-beta4/crypto/rsa/rsa.h +--- openssl-1.0.0-beta4/crypto/rsa/rsa.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/rsa/rsa.h 2009-11-12 12:36:50.000000000 +0100 @@ -74,6 +74,21 @@ #error RSA is disabled. #endif @@ -11442,9 +11530,9 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa.h.fips openssl-1.0.0-beta3/crypto/rs #define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 #define RSA_R_PADDING_CHECK_FAILED 114 #define RSA_R_P_NOT_PRIME 128 -diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_lib.c.fips openssl-1.0.0-beta3/crypto/rsa/rsa_lib.c ---- openssl-1.0.0-beta3/crypto/rsa/rsa_lib.c.fips 2008-08-06 17:54:14.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rsa/rsa_lib.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rsa/rsa_lib.c.fips openssl-1.0.0-beta4/crypto/rsa/rsa_lib.c +--- openssl-1.0.0-beta4/crypto/rsa/rsa_lib.c.fips 2009-08-05 17:04:16.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/rsa/rsa_lib.c 2009-11-12 12:36:50.000000000 +0100 @@ -80,6 +80,13 @@ RSA *RSA_new(void) void RSA_set_default_method(const RSA_METHOD *meth) @@ -11520,63 +11608,9 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_lib.c.fips openssl-1.0.0-beta3/crypt return(rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding)); } -@@ -422,51 +462,8 @@ err: - BN_CTX_end(ctx); - if (in_ctx == NULL) - BN_CTX_free(ctx); -+ if(rsa->e == NULL) -+ BN_free(e); - - return ret; - } -- --int RSA_memory_lock(RSA *r) -- { -- int i,j,k,off; -- char *p; -- BIGNUM *bn,**t[6],*b; -- BN_ULONG *ul; -- -- if (r->d == NULL) return(1); -- t[0]= &r->d; -- t[1]= &r->p; -- t[2]= &r->q; -- t[3]= &r->dmp1; -- t[4]= &r->dmq1; -- t[5]= &r->iqmp; -- k=sizeof(BIGNUM)*6; -- off=k/sizeof(BN_ULONG)+1; -- j=1; -- for (i=0; i<6; i++) -- j+= (*t[i])->top; -- if ((p=OPENSSL_malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL) -- { -- RSAerr(RSA_F_RSA_MEMORY_LOCK,ERR_R_MALLOC_FAILURE); -- return(0); -- } -- bn=(BIGNUM *)p; -- ul=(BN_ULONG *)&(p[off]); -- for (i=0; i<6; i++) -- { -- b= *(t[i]); -- *(t[i])= &(bn[i]); -- memcpy((char *)&(bn[i]),(char *)b,sizeof(BIGNUM)); -- bn[i].flags=BN_FLG_STATIC_DATA; -- bn[i].d=ul; -- memcpy((char *)ul,b->d,sizeof(BN_ULONG)*b->top); -- ul+=b->top; -- BN_clear_free(b); -- } -- -- /* I should fix this so it can still be done */ -- r->flags&= ~(RSA_FLAG_CACHE_PRIVATE|RSA_FLAG_CACHE_PUBLIC); -- -- r->bignum_data=p; -- return(1); -- } -diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_sign.c.fips openssl-1.0.0-beta3/crypto/rsa/rsa_sign.c ---- openssl-1.0.0-beta3/crypto/rsa/rsa_sign.c.fips 2007-04-24 03:05:42.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/rsa/rsa_sign.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/rsa/rsa_sign.c.fips openssl-1.0.0-beta4/crypto/rsa/rsa_sign.c +--- openssl-1.0.0-beta4/crypto/rsa/rsa_sign.c.fips 2007-04-24 03:05:42.000000000 +0200 ++++ openssl-1.0.0-beta4/crypto/rsa/rsa_sign.c 2009-11-12 12:36:50.000000000 +0100 @@ -130,7 +130,8 @@ int RSA_sign(int type, const unsigned ch i2d_X509_SIG(&sig,&p); s=tmps; @@ -11608,9 +11642,57 @@ diff -up openssl-1.0.0-beta3/crypto/rsa/rsa_sign.c.fips openssl-1.0.0-beta3/cryp if (i <= 0) goto err; -diff -up openssl-1.0.0-beta3/crypto/sha/sha1dgst.c.fips openssl-1.0.0-beta3/crypto/sha/sha1dgst.c ---- openssl-1.0.0-beta3/crypto/sha/sha1dgst.c.fips 2007-01-21 14:07:14.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/sha/sha1dgst.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/sha/sha_dgst.c.fips openssl-1.0.0-beta4/crypto/sha/sha_dgst.c +--- openssl-1.0.0-beta4/crypto/sha/sha_dgst.c.fips 2007-01-21 14:07:14.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/sha/sha_dgst.c 2009-11-12 12:36:50.000000000 +0100 +@@ -57,6 +57,12 @@ + */ + + #include ++#include ++#ifdef OPENSSL_FIPS ++#include ++#endif ++ ++#include + #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) + + #undef SHA_1 +diff -up openssl-1.0.0-beta4/crypto/sha/sha.h.fips openssl-1.0.0-beta4/crypto/sha/sha.h +--- openssl-1.0.0-beta4/crypto/sha/sha.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/sha/sha.h 2009-11-12 12:36:50.000000000 +0100 +@@ -106,6 +106,9 @@ typedef struct SHAstate_st + } SHA_CTX; + + #ifndef OPENSSL_NO_SHA0 ++#ifdef OPENSSL_FIPS ++int private_SHA_Init(SHA_CTX *c); ++#endif + int SHA_Init(SHA_CTX *c); + int SHA_Update(SHA_CTX *c, const void *data, size_t len); + int SHA_Final(unsigned char *md, SHA_CTX *c); +diff -up openssl-1.0.0-beta4/crypto/sha/sha_locl.h.fips openssl-1.0.0-beta4/crypto/sha/sha_locl.h +--- openssl-1.0.0-beta4/crypto/sha/sha_locl.h.fips 2009-11-12 12:36:49.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/sha/sha_locl.h 2009-11-12 12:36:50.000000000 +0100 +@@ -122,8 +122,15 @@ void sha1_block_data_order (SHA_CTX *c, + #define INIT_DATA_h3 0x10325476UL + #define INIT_DATA_h4 0xc3d2e1f0UL + ++#if defined(SHA_0) && defined(OPENSSL_FIPS) ++FIPS_NON_FIPS_MD_Init(SHA) ++#else + int HASH_INIT (SHA_CTX *c) ++#endif + { ++#if defined(SHA_1) && defined(OPENSSL_FIPS) ++ FIPS_selftest_check(); ++#endif + memset (c,0,sizeof(*c)); + c->h0=INIT_DATA_h0; + c->h1=INIT_DATA_h1; +diff -up openssl-1.0.0-beta4/crypto/sha/sha1dgst.c.fips openssl-1.0.0-beta4/crypto/sha/sha1dgst.c +--- openssl-1.0.0-beta4/crypto/sha/sha1dgst.c.fips 2007-01-21 14:07:14.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/sha/sha1dgst.c 2009-11-12 12:36:50.000000000 +0100 @@ -63,6 +63,10 @@ #define SHA_1 @@ -11622,9 +11704,9 @@ diff -up openssl-1.0.0-beta3/crypto/sha/sha1dgst.c.fips openssl-1.0.0-beta3/cryp const char SHA1_version[]="SHA1" OPENSSL_VERSION_PTEXT; -diff -up openssl-1.0.0-beta3/crypto/sha/sha256.c.fips openssl-1.0.0-beta3/crypto/sha/sha256.c ---- openssl-1.0.0-beta3/crypto/sha/sha256.c.fips 2007-01-21 14:07:14.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/sha/sha256.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/sha/sha256.c.fips openssl-1.0.0-beta4/crypto/sha/sha256.c +--- openssl-1.0.0-beta4/crypto/sha/sha256.c.fips 2007-01-21 14:07:14.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/sha/sha256.c 2009-11-12 12:36:50.000000000 +0100 @@ -12,12 +12,19 @@ #include @@ -11655,9 +11737,9 @@ diff -up openssl-1.0.0-beta3/crypto/sha/sha256.c.fips openssl-1.0.0-beta3/crypto memset (c,0,sizeof(*c)); c->h[0]=0x6a09e667UL; c->h[1]=0xbb67ae85UL; c->h[2]=0x3c6ef372UL; c->h[3]=0xa54ff53aUL; -diff -up openssl-1.0.0-beta3/crypto/sha/sha512.c.fips openssl-1.0.0-beta3/crypto/sha/sha512.c ---- openssl-1.0.0-beta3/crypto/sha/sha512.c.fips 2008-12-29 13:35:48.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/sha/sha512.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/crypto/sha/sha512.c.fips openssl-1.0.0-beta4/crypto/sha/sha512.c +--- openssl-1.0.0-beta4/crypto/sha/sha512.c.fips 2008-12-29 13:35:48.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/sha/sha512.c 2009-11-12 12:36:50.000000000 +0100 @@ -5,6 +5,10 @@ * ==================================================================== */ @@ -11698,58 +11780,10 @@ diff -up openssl-1.0.0-beta3/crypto/sha/sha512.c.fips openssl-1.0.0-beta3/crypto asm ("rotrdi %0,%1,%2" \ : "=r"(ret) \ : "r"(a),"K"(n)); ret; }) -diff -up openssl-1.0.0-beta3/crypto/sha/sha_dgst.c.fips openssl-1.0.0-beta3/crypto/sha/sha_dgst.c ---- openssl-1.0.0-beta3/crypto/sha/sha_dgst.c.fips 2007-01-21 14:07:14.000000000 +0100 -+++ openssl-1.0.0-beta3/crypto/sha/sha_dgst.c 2009-08-11 18:07:30.000000000 +0200 -@@ -57,6 +57,12 @@ - */ - - #include -+#include -+#ifdef OPENSSL_FIPS -+#include -+#endif -+ -+#include - #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) - - #undef SHA_1 -diff -up openssl-1.0.0-beta3/crypto/sha/sha.h.fips openssl-1.0.0-beta3/crypto/sha/sha.h ---- openssl-1.0.0-beta3/crypto/sha/sha.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/sha/sha.h 2009-08-11 18:07:30.000000000 +0200 -@@ -106,6 +106,9 @@ typedef struct SHAstate_st - } SHA_CTX; - - #ifndef OPENSSL_NO_SHA0 -+#ifdef OPENSSL_FIPS -+int private_SHA_Init(SHA_CTX *c); -+#endif - int SHA_Init(SHA_CTX *c); - int SHA_Update(SHA_CTX *c, const void *data, size_t len); - int SHA_Final(unsigned char *md, SHA_CTX *c); -diff -up openssl-1.0.0-beta3/crypto/sha/sha_locl.h.fips openssl-1.0.0-beta3/crypto/sha/sha_locl.h ---- openssl-1.0.0-beta3/crypto/sha/sha_locl.h.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/crypto/sha/sha_locl.h 2009-08-11 18:07:30.000000000 +0200 -@@ -122,8 +122,15 @@ void sha1_block_data_order (SHA_CTX *c, - #define INIT_DATA_h3 0x10325476UL - #define INIT_DATA_h4 0xc3d2e1f0UL - -+#if defined(SHA_0) && defined(OPENSSL_FIPS) -+FIPS_NON_FIPS_MD_Init(SHA) -+#else - int HASH_INIT (SHA_CTX *c) -+#endif - { -+#if defined(SHA_1) && defined(OPENSSL_FIPS) -+ FIPS_selftest_check(); -+#endif - memset (c,0,sizeof(*c)); - c->h0=INIT_DATA_h0; - c->h1=INIT_DATA_h1; -diff -up openssl-1.0.0-beta3/Makefile.org.fips openssl-1.0.0-beta3/Makefile.org ---- openssl-1.0.0-beta3/Makefile.org.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/Makefile.org 2009-08-11 18:07:30.000000000 +0200 -@@ -109,6 +109,9 @@ LIBKRB5= +diff -up openssl-1.0.0-beta4/Makefile.org.fips openssl-1.0.0-beta4/Makefile.org +--- openssl-1.0.0-beta4/Makefile.org.fips 2009-11-12 12:36:50.000000000 +0100 ++++ openssl-1.0.0-beta4/Makefile.org 2009-11-12 12:36:50.000000000 +0100 +@@ -110,6 +110,9 @@ LIBKRB5= ZLIB_INCLUDE= LIBZLIB= @@ -11759,7 +11793,7 @@ diff -up openssl-1.0.0-beta3/Makefile.org.fips openssl-1.0.0-beta3/Makefile.org DIRS= crypto ssl engines apps test tools ENGDIRS= ccgost SHLIBDIRS= crypto ssl -@@ -121,7 +124,7 @@ SDIRS= \ +@@ -122,7 +125,7 @@ SDIRS= \ bn ec rsa dsa ecdsa dh ecdh dso engine \ buffer bio stack lhash rand err \ evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ @@ -11768,7 +11802,7 @@ diff -up openssl-1.0.0-beta3/Makefile.org.fips openssl-1.0.0-beta3/Makefile.org # keep in mind that the above list is adjusted by ./Configure # according to no-xxx arguments... -@@ -204,6 +207,7 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESS +@@ -206,6 +209,7 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESS RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ WP_ASM_OBJ='$(WP_ASM_OBJ)' \ PERLASM_SCHEME='$(PERLASM_SCHEME)' \ @@ -11776,124 +11810,9 @@ diff -up openssl-1.0.0-beta3/Makefile.org.fips openssl-1.0.0-beta3/Makefile.org THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, # which in turn eliminates ambiguities in variable treatment with -e. -diff -up openssl-1.0.0-beta3/ssl/s23_clnt.c.fips openssl-1.0.0-beta3/ssl/s23_clnt.c ---- openssl-1.0.0-beta3/ssl/s23_clnt.c.fips 2009-04-07 19:01:07.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/s23_clnt.c 2009-08-11 18:07:30.000000000 +0200 -@@ -332,6 +332,14 @@ static int ssl23_client_hello(SSL *s) - version_major = TLS1_VERSION_MAJOR; - version_minor = TLS1_VERSION_MINOR; - } -+#ifdef OPENSSL_FIPS -+ else if(FIPS_mode()) -+ { -+ SSLerr(SSL_F_SSL23_CLIENT_HELLO, -+ SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); -+ return -1; -+ } -+#endif - else if (version == SSL3_VERSION) - { - version_major = SSL3_VERSION_MAJOR; -@@ -615,6 +623,14 @@ static int ssl23_get_server_hello(SSL *s - if ((p[2] == SSL3_VERSION_MINOR) && - !(s->options & SSL_OP_NO_SSLv3)) - { -+#ifdef OPENSSL_FIPS -+ if(FIPS_mode()) -+ { -+ SSLerr(SSL_F_SSL23_GET_SERVER_HELLO, -+ SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); -+ goto err; -+ } -+#endif - s->version=SSL3_VERSION; - s->method=SSLv3_client_method(); - } -diff -up openssl-1.0.0-beta3/ssl/s23_srvr.c.fips openssl-1.0.0-beta3/ssl/s23_srvr.c ---- openssl-1.0.0-beta3/ssl/s23_srvr.c.fips 2008-06-03 04:48:34.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/s23_srvr.c 2009-08-11 18:07:30.000000000 +0200 -@@ -386,6 +386,15 @@ int ssl23_get_client_hello(SSL *s) - } - } - -+#ifdef OPENSSL_FIPS -+ if (FIPS_mode() && (s->version < TLS1_VERSION)) -+ { -+ SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO, -+ SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); -+ goto err; -+ } -+#endif -+ - if (s->state == SSL23_ST_SR_CLNT_HELLO_B) - { - /* we have SSLv3/TLSv1 in an SSLv2 header -diff -up openssl-1.0.0-beta3/ssl/s3_clnt.c.fips openssl-1.0.0-beta3/ssl/s3_clnt.c ---- openssl-1.0.0-beta3/ssl/s3_clnt.c.fips 2009-06-16 18:39:20.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/s3_clnt.c 2009-08-11 18:07:30.000000000 +0200 -@@ -156,6 +156,10 @@ - #include - #include - #include -+#ifdef OPENSSL_FIPS -+#include -+#endif -+ - #ifndef OPENSSL_NO_DH - #include - #endif -@@ -1524,6 +1528,8 @@ int ssl3_get_key_exchange(SSL *s) - q=md_buf; - for (num=2; num > 0; num--) - { -+ EVP_MD_CTX_set_flags(&md_ctx, -+ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - EVP_DigestInit_ex(&md_ctx,(num == 2) - ?s->ctx->md5:s->ctx->sha1, NULL); - EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); -diff -up openssl-1.0.0-beta3/ssl/s3_enc.c.fips openssl-1.0.0-beta3/ssl/s3_enc.c ---- openssl-1.0.0-beta3/ssl/s3_enc.c.fips 2009-04-16 19:22:50.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/s3_enc.c 2009-08-11 18:07:30.000000000 +0200 -@@ -170,6 +170,7 @@ static int ssl3_generate_key_block(SSL * - #endif - k=0; - EVP_MD_CTX_init(&m5); -+ EVP_MD_CTX_set_flags(&m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - EVP_MD_CTX_init(&s1); - for (i=0; (int)is3->tmp.new_cipher->algorithm2) && md) - { - s->s3->handshake_dgst[i]=EVP_MD_CTX_create(); -+ EVP_MD_CTX_set_flags(s->s3->handshake_dgst[i], -+ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - EVP_DigestInit_ex(s->s3->handshake_dgst[i],md,NULL); - EVP_DigestUpdate(s->s3->handshake_dgst[i],hdata,hdatalen); - } -@@ -670,6 +673,7 @@ static int ssl3_handshake_mac(SSL *s, in - return 0; - } - EVP_MD_CTX_init(&ctx); -+ EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - EVP_MD_CTX_copy_ex(&ctx,d); - n=EVP_MD_CTX_size(&ctx); - if (n < 0) -diff -up openssl-1.0.0-beta3/ssl/s3_srvr.c.fips openssl-1.0.0-beta3/ssl/s3_srvr.c ---- openssl-1.0.0-beta3/ssl/s3_srvr.c.fips 2009-06-26 17:04:22.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/s3_srvr.c 2009-08-11 18:07:30.000000000 +0200 -@@ -1674,6 +1674,8 @@ int ssl3_send_server_key_exchange(SSL *s - j=0; - for (num=2; num > 0; num--) - { -+ EVP_MD_CTX_set_flags(&md_ctx, -+ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - EVP_DigestInit_ex(&md_ctx,(num == 2) - ?s->ctx->md5:s->ctx->sha1, NULL); - EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); -diff -up openssl-1.0.0-beta3/ssl/ssl_ciph.c.fips openssl-1.0.0-beta3/ssl/ssl_ciph.c ---- openssl-1.0.0-beta3/ssl/ssl_ciph.c.fips 2009-04-07 14:10:59.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/ssl_ciph.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/ssl/ssl_ciph.c.fips openssl-1.0.0-beta4/ssl/ssl_ciph.c +--- openssl-1.0.0-beta4/ssl/ssl_ciph.c.fips 2009-09-13 01:18:09.000000000 +0200 ++++ openssl-1.0.0-beta4/ssl/ssl_ciph.c 2009-11-12 12:36:50.000000000 +0100 @@ -727,6 +727,9 @@ static void ssl_cipher_collect_ciphers(c !(c->algorithm_auth & disabled_auth) && !(c->algorithm_enc & disabled_enc) && @@ -11916,10 +11835,10 @@ diff -up openssl-1.0.0-beta3/ssl/ssl_ciph.c.fips openssl-1.0.0-beta3/ssl/ssl_cip { sk_SSL_CIPHER_push(cipherstack, curr->cipher); #ifdef CIPHER_DEBUG -diff -up openssl-1.0.0-beta3/ssl/ssl_lib.c.fips openssl-1.0.0-beta3/ssl/ssl_lib.c ---- openssl-1.0.0-beta3/ssl/ssl_lib.c.fips 2009-06-30 13:57:24.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/ssl_lib.c 2009-08-11 18:07:30.000000000 +0200 -@@ -1470,6 +1470,14 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *m +diff -up openssl-1.0.0-beta4/ssl/ssl_lib.c.fips openssl-1.0.0-beta4/ssl/ssl_lib.c +--- openssl-1.0.0-beta4/ssl/ssl_lib.c.fips 2009-10-16 15:41:52.000000000 +0200 ++++ openssl-1.0.0-beta4/ssl/ssl_lib.c 2009-11-12 12:36:50.000000000 +0100 +@@ -1471,6 +1471,14 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *m return(NULL); } @@ -11934,9 +11853,9 @@ diff -up openssl-1.0.0-beta3/ssl/ssl_lib.c.fips openssl-1.0.0-beta3/ssl/ssl_lib. if (SSL_get_ex_data_X509_STORE_CTX_idx() < 0) { SSLerr(SSL_F_SSL_CTX_NEW,SSL_R_X509_VERIFICATION_SETUP_PROBLEMS); -diff -up openssl-1.0.0-beta3/ssl/ssltest.c.fips openssl-1.0.0-beta3/ssl/ssltest.c ---- openssl-1.0.0-beta3/ssl/ssltest.c.fips 2009-08-11 18:07:30.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/ssltest.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/ssl/ssltest.c.fips openssl-1.0.0-beta4/ssl/ssltest.c +--- openssl-1.0.0-beta4/ssl/ssltest.c.fips 2009-11-12 12:36:50.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/ssltest.c 2009-11-12 12:36:50.000000000 +0100 @@ -265,6 +265,9 @@ static void sv_usage(void) { fprintf(stderr,"usage: ssltest [args ...]\n"); @@ -12011,9 +11930,124 @@ diff -up openssl-1.0.0-beta3/ssl/ssltest.c.fips openssl-1.0.0-beta3/ssl/ssltest. if(s->version == TLS1_VERSION) FIPS_allow_md5(0); # endif -diff -up openssl-1.0.0-beta3/ssl/t1_enc.c.fips openssl-1.0.0-beta3/ssl/t1_enc.c ---- openssl-1.0.0-beta3/ssl/t1_enc.c.fips 2009-04-19 20:03:13.000000000 +0200 -+++ openssl-1.0.0-beta3/ssl/t1_enc.c 2009-08-11 18:07:30.000000000 +0200 +diff -up openssl-1.0.0-beta4/ssl/s23_clnt.c.fips openssl-1.0.0-beta4/ssl/s23_clnt.c +--- openssl-1.0.0-beta4/ssl/s23_clnt.c.fips 2009-08-05 17:29:14.000000000 +0200 ++++ openssl-1.0.0-beta4/ssl/s23_clnt.c 2009-11-12 12:36:50.000000000 +0100 +@@ -335,6 +335,14 @@ static int ssl23_client_hello(SSL *s) + version_major = TLS1_VERSION_MAJOR; + version_minor = TLS1_VERSION_MINOR; + } ++#ifdef OPENSSL_FIPS ++ else if(FIPS_mode()) ++ { ++ SSLerr(SSL_F_SSL23_CLIENT_HELLO, ++ SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); ++ return -1; ++ } ++#endif + else if (version == SSL3_VERSION) + { + version_major = SSL3_VERSION_MAJOR; +@@ -618,6 +626,14 @@ static int ssl23_get_server_hello(SSL *s + if ((p[2] == SSL3_VERSION_MINOR) && + !(s->options & SSL_OP_NO_SSLv3)) + { ++#ifdef OPENSSL_FIPS ++ if(FIPS_mode()) ++ { ++ SSLerr(SSL_F_SSL23_GET_SERVER_HELLO, ++ SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); ++ goto err; ++ } ++#endif + s->version=SSL3_VERSION; + s->method=SSLv3_client_method(); + } +diff -up openssl-1.0.0-beta4/ssl/s23_srvr.c.fips openssl-1.0.0-beta4/ssl/s23_srvr.c +--- openssl-1.0.0-beta4/ssl/s23_srvr.c.fips 2008-06-03 04:48:34.000000000 +0200 ++++ openssl-1.0.0-beta4/ssl/s23_srvr.c 2009-11-12 12:36:50.000000000 +0100 +@@ -386,6 +386,15 @@ int ssl23_get_client_hello(SSL *s) + } + } + ++#ifdef OPENSSL_FIPS ++ if (FIPS_mode() && (s->version < TLS1_VERSION)) ++ { ++ SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO, ++ SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); ++ goto err; ++ } ++#endif ++ + if (s->state == SSL23_ST_SR_CLNT_HELLO_B) + { + /* we have SSLv3/TLSv1 in an SSLv2 header +diff -up openssl-1.0.0-beta4/ssl/s3_clnt.c.fips openssl-1.0.0-beta4/ssl/s3_clnt.c +--- openssl-1.0.0-beta4/ssl/s3_clnt.c.fips 2009-10-30 15:06:18.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/s3_clnt.c 2009-11-12 12:36:50.000000000 +0100 +@@ -156,6 +156,10 @@ + #include + #include + #include ++#ifdef OPENSSL_FIPS ++#include ++#endif ++ + #ifndef OPENSSL_NO_DH + #include + #endif +@@ -1530,6 +1534,8 @@ int ssl3_get_key_exchange(SSL *s) + q=md_buf; + for (num=2; num > 0; num--) + { ++ EVP_MD_CTX_set_flags(&md_ctx, ++ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); + EVP_DigestInit_ex(&md_ctx,(num == 2) + ?s->ctx->md5:s->ctx->sha1, NULL); + EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); +diff -up openssl-1.0.0-beta4/ssl/s3_enc.c.fips openssl-1.0.0-beta4/ssl/s3_enc.c +--- openssl-1.0.0-beta4/ssl/s3_enc.c.fips 2009-04-16 19:22:50.000000000 +0200 ++++ openssl-1.0.0-beta4/ssl/s3_enc.c 2009-11-12 12:36:50.000000000 +0100 +@@ -170,6 +170,7 @@ static int ssl3_generate_key_block(SSL * + #endif + k=0; + EVP_MD_CTX_init(&m5); ++ EVP_MD_CTX_set_flags(&m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); + EVP_MD_CTX_init(&s1); + for (i=0; (int)is3->tmp.new_cipher->algorithm2) && md) + { + s->s3->handshake_dgst[i]=EVP_MD_CTX_create(); ++ EVP_MD_CTX_set_flags(s->s3->handshake_dgst[i], ++ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); + EVP_DigestInit_ex(s->s3->handshake_dgst[i],md,NULL); + EVP_DigestUpdate(s->s3->handshake_dgst[i],hdata,hdatalen); + } +@@ -670,6 +673,7 @@ static int ssl3_handshake_mac(SSL *s, in + return 0; + } + EVP_MD_CTX_init(&ctx); ++ EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); + EVP_MD_CTX_copy_ex(&ctx,d); + n=EVP_MD_CTX_size(&ctx); + if (n < 0) +diff -up openssl-1.0.0-beta4/ssl/s3_srvr.c.fips openssl-1.0.0-beta4/ssl/s3_srvr.c +--- openssl-1.0.0-beta4/ssl/s3_srvr.c.fips 2009-10-30 14:22:44.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/s3_srvr.c 2009-11-12 12:36:50.000000000 +0100 +@@ -1679,6 +1679,8 @@ int ssl3_send_server_key_exchange(SSL *s + j=0; + for (num=2; num > 0; num--) + { ++ EVP_MD_CTX_set_flags(&md_ctx, ++ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); + EVP_DigestInit_ex(&md_ctx,(num == 2) + ?s->ctx->md5:s->ctx->sha1, NULL); + EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); +diff -up openssl-1.0.0-beta4/ssl/t1_enc.c.fips openssl-1.0.0-beta4/ssl/t1_enc.c +--- openssl-1.0.0-beta4/ssl/t1_enc.c.fips 2009-04-19 20:03:13.000000000 +0200 ++++ openssl-1.0.0-beta4/ssl/t1_enc.c 2009-11-12 12:36:50.000000000 +0100 @@ -169,6 +169,8 @@ static void tls1_P_hash(const EVP_MD *md HMAC_CTX_init(&ctx); diff --git a/openssl-1.0.0-beta3-redhat.patch b/openssl-1.0.0-beta4-redhat.patch similarity index 92% rename from openssl-1.0.0-beta3-redhat.patch rename to openssl-1.0.0-beta4-redhat.patch index bd6b9af..4356e41 100644 --- a/openssl-1.0.0-beta3-redhat.patch +++ b/openssl-1.0.0-beta4-redhat.patch @@ -1,7 +1,7 @@ -diff -up openssl-1.0.0-beta3/Configure.redhat openssl-1.0.0-beta3/Configure ---- openssl-1.0.0-beta3/Configure.redhat 2009-07-08 10:50:52.000000000 +0200 -+++ openssl-1.0.0-beta3/Configure 2009-08-04 22:46:59.000000000 +0200 -@@ -331,32 +331,32 @@ my %table=( +diff -up openssl-1.0.0-beta4/Configure.redhat openssl-1.0.0-beta4/Configure +--- openssl-1.0.0-beta4/Configure.redhat 2009-11-09 15:11:13.000000000 +0100 ++++ openssl-1.0.0-beta4/Configure 2009-11-12 12:15:27.000000000 +0100 +@@ -336,32 +336,32 @@ my %table=( #### # *-generic* is endian-neutral target, but ./config is free to # throw in -D[BL]_ENDIAN, whichever appropriate... @@ -22,14 +22,14 @@ diff -up openssl-1.0.0-beta3/Configure.redhat openssl-1.0.0-beta3/Configure -"linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -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):::64", -"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -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)", -+"linux-generic64","gcc:-DTERMIO -Wall \$(RPM_OPT_FLAGS)::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC:\$(RPM_OPT_FLAGS):\$(SHLIB_SONAMEVER)", ++"linux-generic64","gcc:-DTERMIO -Wall \$(RPM_OPT_FLAGS)::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC:\$(RPM_OPT_FLAGS):.so.\$(SHLIB_SONAMEVER)", +"linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -Wall \$(RPM_OPT_FLAGS)::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64 \$(RPM_OPT_FLAGS):.so.\$(SHLIB_SONAMEVER):::64", +"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -Wall \$(RPM_OPT_FLAGS)::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC:\$(RPM_OPT_FLAGS):.so.\$(SHLIB_SONAMEVER)", "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", --"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +-"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -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):::64", -"linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", -+"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -Wall \$(RPM_OPT_FLAGS) -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64 \$(RPM_OPT_FLAGS):.so.\$(SHLIB_SONAMEVER):::64", ++"linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -Wall \$(RPM_OPT_FLAGS) -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 \$(RPM_OPT_FLAGS):.so.\$(SHLIB_SONAMEVER):::64", +"linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -Wall \$(RPM_OPT_FLAGS)::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64 \$(RPM_OPT_FLAGS):.so.\$(SHLIB_SONAMEVER):::64", #### SPARC Linux setups # Ray Miller has patiently @@ -46,7 +46,7 @@ diff -up openssl-1.0.0-beta3/Configure.redhat openssl-1.0.0-beta3/Configure #### Alpha Linux with GNU C and Compaq C setups # Special notes: # - linux-alpha+bwx-gcc is ment to be used from ./config only. If you -@@ -370,8 +370,8 @@ my %table=( +@@ -375,8 +375,8 @@ my %table=( # # # diff --git a/openssl-1.0.0-beta4-reneg-err.patch b/openssl-1.0.0-beta4-reneg-err.patch new file mode 100644 index 0000000..271dbe7 --- /dev/null +++ b/openssl-1.0.0-beta4-reneg-err.patch @@ -0,0 +1,93 @@ +Better error reporting for unsafe renegotiation. +diff -up openssl-1.0.0-beta4/ssl/ssl_err.c.reneg-err openssl-1.0.0-beta4/ssl/ssl_err.c +--- openssl-1.0.0-beta4/ssl/ssl_err.c.reneg-err 2009-11-09 19:45:42.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/ssl_err.c 2009-11-20 17:56:57.000000000 +0100 +@@ -226,7 +226,9 @@ static ERR_STRING_DATA SSL_str_functs[]= + {ERR_FUNC(SSL_F_SSL_LOAD_CLIENT_CA_FILE), "SSL_load_client_CA_file"}, + {ERR_FUNC(SSL_F_SSL_NEW), "SSL_new"}, + {ERR_FUNC(SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT), "SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT"}, ++{ERR_FUNC(SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT), "SSL_PARSE_CLIENTHELLO_TLSEXT"}, + {ERR_FUNC(SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT), "SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT"}, ++{ERR_FUNC(SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT), "SSL_PARSE_SERVERHELLO_TLSEXT"}, + {ERR_FUNC(SSL_F_SSL_PEEK), "SSL_peek"}, + {ERR_FUNC(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT), "SSL_PREPARE_CLIENTHELLO_TLSEXT"}, + {ERR_FUNC(SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT), "SSL_PREPARE_SERVERHELLO_TLSEXT"}, +@@ -526,6 +528,7 @@ static ERR_STRING_DATA SSL_str_reasons[] + {ERR_REASON(SSL_R_UNKNOWN_REMOTE_ERROR_TYPE),"unknown remote error type"}, + {ERR_REASON(SSL_R_UNKNOWN_SSL_VERSION) ,"unknown ssl version"}, + {ERR_REASON(SSL_R_UNKNOWN_STATE) ,"unknown state"}, ++{ERR_REASON(SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED),"unsafe legacy renegotiation disabled"}, + {ERR_REASON(SSL_R_UNSUPPORTED_CIPHER) ,"unsupported cipher"}, + {ERR_REASON(SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM),"unsupported compression algorithm"}, + {ERR_REASON(SSL_R_UNSUPPORTED_DIGEST_TYPE),"unsupported digest type"}, +diff -up openssl-1.0.0-beta4/ssl/ssl.h.reneg-err openssl-1.0.0-beta4/ssl/ssl.h +--- openssl-1.0.0-beta4/ssl/ssl.h.reneg-err 2009-11-12 15:17:29.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/ssl.h 2009-11-20 17:56:57.000000000 +0100 +@@ -1934,7 +1934,9 @@ void ERR_load_SSL_strings(void); + #define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185 + #define SSL_F_SSL_NEW 186 + #define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300 ++#define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302 + #define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301 ++#define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303 + #define SSL_F_SSL_PEEK 270 + #define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281 + #define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282 +@@ -2231,6 +2233,7 @@ void ERR_load_SSL_strings(void); + #define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253 + #define SSL_R_UNKNOWN_SSL_VERSION 254 + #define SSL_R_UNKNOWN_STATE 255 ++#define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338 + #define SSL_R_UNSUPPORTED_CIPHER 256 + #define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257 + #define SSL_R_UNSUPPORTED_DIGEST_TYPE 326 +diff -up openssl-1.0.0-beta4/ssl/s23_srvr.c.reneg-err openssl-1.0.0-beta4/ssl/s23_srvr.c +--- openssl-1.0.0-beta4/ssl/s23_srvr.c.reneg-err 2009-11-12 15:17:29.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/s23_srvr.c 2009-11-20 17:57:23.000000000 +0100 +@@ -497,6 +497,11 @@ int ssl23_get_client_hello(SSL *s) + SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_UNSUPPORTED_PROTOCOL); + goto err; + #else ++ if (!(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) ++ { ++ SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); ++ goto err; ++ } + /* we are talking sslv2 */ + /* we need to clean up the SSLv3/TLSv1 setup and put in the + * sslv2 stuff. */ +diff -up openssl-1.0.0-beta4/ssl/t1_lib.c.reneg-err openssl-1.0.0-beta4/ssl/t1_lib.c +--- openssl-1.0.0-beta4/ssl/t1_lib.c.reneg-err 2009-11-18 14:04:19.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/t1_lib.c 2009-11-20 17:56:57.000000000 +0100 +@@ -636,6 +636,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, + { + /* We should always see one extension: the renegotiate extension */ + *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ ++ SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); + return 0; + } + return 1; +@@ -965,6 +966,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, + if (s->new_session && !renegotiate_seen + && !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) + { ++ SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); + *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ + return 0; + } +@@ -993,6 +995,7 @@ int ssl_parse_serverhello_tlsext(SSL *s, + { + /* We should always see one extension: the renegotiate extension */ + *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ ++ SSLerr(SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); + return 0; + } + #endif +@@ -1133,6 +1136,7 @@ int ssl_parse_serverhello_tlsext(SSL *s, + && !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) + { + *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ ++ SSLerr(SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); + return 0; + } + #endif diff --git a/openssl-1.0.0-beta4-reneg.patch b/openssl-1.0.0-beta4-reneg.patch new file mode 100644 index 0000000..92e206d --- /dev/null +++ b/openssl-1.0.0-beta4-reneg.patch @@ -0,0 +1,237 @@ +diff -up openssl-1.0.0-beta4/apps/s_cb.c.reneg openssl-1.0.0-beta4/apps/s_cb.c +--- openssl-1.0.0-beta4/apps/s_cb.c.reneg 2009-10-15 20:48:47.000000000 +0200 ++++ openssl-1.0.0-beta4/apps/s_cb.c 2009-11-12 15:02:30.000000000 +0100 +@@ -669,6 +669,10 @@ void MS_CALLBACK tlsext_cb(SSL *s, int c + extname = "server ticket"; + break; + ++ case TLSEXT_TYPE_renegotiate: ++ extname = "renegotiate"; ++ break; ++ + #ifdef TLSEXT_TYPE_opaque_prf_input + case TLSEXT_TYPE_opaque_prf_input: + extname = "opaque PRF input"; +diff -up openssl-1.0.0-beta4/apps/s_client.c.reneg openssl-1.0.0-beta4/apps/s_client.c +--- openssl-1.0.0-beta4/apps/s_client.c.reneg 2009-11-12 14:57:48.000000000 +0100 ++++ openssl-1.0.0-beta4/apps/s_client.c 2009-11-12 15:01:48.000000000 +0100 +@@ -343,6 +343,7 @@ static void sc_usage(void) + BIO_printf(bio_err," -status - request certificate status from server\n"); + BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); + #endif ++ BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); + } + + #ifndef OPENSSL_NO_TLSEXT +@@ -657,6 +658,8 @@ int MAIN(int argc, char **argv) + #endif + else if (strcmp(*argv,"-serverpref") == 0) + off|=SSL_OP_CIPHER_SERVER_PREFERENCE; ++ else if (strcmp(*argv,"-legacy_renegotiation") == 0) ++ off|=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; + else if (strcmp(*argv,"-cipher") == 0) + { + if (--argc < 1) goto bad; +diff -up openssl-1.0.0-beta4/apps/s_server.c.reneg openssl-1.0.0-beta4/apps/s_server.c +--- openssl-1.0.0-beta4/apps/s_server.c.reneg 2009-11-12 14:57:48.000000000 +0100 ++++ openssl-1.0.0-beta4/apps/s_server.c 2009-11-12 15:01:48.000000000 +0100 +@@ -491,6 +491,7 @@ static void sv_usage(void) + BIO_printf(bio_err," not specified (default is %s)\n",TEST_CERT2); + BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n"); + BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); ++ BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); + #endif + } + +@@ -1013,6 +1014,8 @@ int MAIN(int argc, char *argv[]) + verify_return_error = 1; + else if (strcmp(*argv,"-serverpref") == 0) + { off|=SSL_OP_CIPHER_SERVER_PREFERENCE; } ++ else if (strcmp(*argv,"-legacy_renegotiation") == 0) ++ off|=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; + else if (strcmp(*argv,"-cipher") == 0) + { + if (--argc < 1) goto bad; +diff -up openssl-1.0.0-beta4/ssl/tls1.h.reneg openssl-1.0.0-beta4/ssl/tls1.h +--- openssl-1.0.0-beta4/ssl/tls1.h.reneg 2009-11-12 14:57:47.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/tls1.h 2009-11-12 15:02:30.000000000 +0100 +@@ -201,6 +201,9 @@ extern "C" { + # define TLSEXT_TYPE_opaque_prf_input ?? */ + #endif + ++/* Temporary extension type */ ++#define TLSEXT_TYPE_renegotiate 0xff01 ++ + /* NameType value from RFC 3546 */ + #define TLSEXT_NAMETYPE_host_name 0 + /* status request value from RFC 3546 */ +diff -up openssl-1.0.0-beta4/ssl/t1_lib.c.reneg openssl-1.0.0-beta4/ssl/t1_lib.c +--- openssl-1.0.0-beta4/ssl/t1_lib.c.reneg 2009-11-08 15:36:32.000000000 +0100 ++++ openssl-1.0.0-beta4/ssl/t1_lib.c 2009-11-12 15:02:30.000000000 +0100 +@@ -315,6 +315,30 @@ unsigned char *ssl_add_clienthello_tlsex + ret+=size_str; + } + ++ /* Add the renegotiation option: TODOEKR switch */ ++ { ++ int el; ++ ++ if(!ssl_add_clienthello_renegotiate_ext(s, 0, &el, 0)) ++ { ++ SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); ++ return NULL; ++ } ++ ++ if((limit - p - 4 - el) < 0) return NULL; ++ ++ s2n(TLSEXT_TYPE_renegotiate,ret); ++ s2n(el,ret); ++ ++ if(!ssl_add_clienthello_renegotiate_ext(s, ret, &el, el)) ++ { ++ SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); ++ return NULL; ++ } ++ ++ ret += el; ++ } ++ + #ifndef OPENSSL_NO_EC + if (s->tlsext_ecpointformatlist != NULL) + { +@@ -490,6 +514,31 @@ unsigned char *ssl_add_serverhello_tlsex + s2n(TLSEXT_TYPE_server_name,ret); + s2n(0,ret); + } ++ ++ if(s->s3->send_connection_binding) ++ { ++ int el; ++ ++ if(!ssl_add_serverhello_renegotiate_ext(s, 0, &el, 0)) ++ { ++ SSLerr(SSL_F_SSL_ADD_SERVERHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); ++ return NULL; ++ } ++ ++ if((limit - p - 4 - el) < 0) return NULL; ++ ++ s2n(TLSEXT_TYPE_renegotiate,ret); ++ s2n(el,ret); ++ ++ if(!ssl_add_serverhello_renegotiate_ext(s, ret, &el, el)) ++ { ++ SSLerr(SSL_F_SSL_ADD_SERVERHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); ++ return NULL; ++ } ++ ++ ret += el; ++ } ++ + #ifndef OPENSSL_NO_EC + if (s->tlsext_ecpointformatlist != NULL) + { +@@ -574,11 +623,23 @@ int ssl_parse_clienthello_tlsext(SSL *s, + unsigned short size; + unsigned short len; + unsigned char *data = *p; ++ int renegotiate_seen = 0; ++ + s->servername_done = 0; + s->tlsext_status_type = -1; ++ s->s3->send_connection_binding = 0; + + if (data >= (d+n-2)) ++ { ++ if (s->new_session ++ && !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) ++ { ++ /* We should always see one extension: the renegotiate extension */ ++ *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ ++ return 0; ++ } + return 1; ++ } + n2s(data,len); + + if (data > (d+n-len)) +@@ -790,6 +851,12 @@ int ssl_parse_clienthello_tlsext(SSL *s, + return 0; + } + } ++ else if (type == TLSEXT_TYPE_renegotiate) ++ { ++ if(!ssl_parse_clienthello_renegotiate_ext(s, data, size, al)) ++ return 0; ++ renegotiate_seen = 1; ++ } + else if (type == TLSEXT_TYPE_status_request + && s->ctx->tlsext_status_cb) + { +@@ -894,6 +961,14 @@ int ssl_parse_clienthello_tlsext(SSL *s, + /* session ticket processed earlier */ + data+=size; + } ++ ++ if (s->new_session && !renegotiate_seen ++ && !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) ++ { ++ *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ ++ return 0; ++ } ++ + + *p = data; + return 1; +@@ -905,11 +980,22 @@ int ssl_parse_serverhello_tlsext(SSL *s, + unsigned short size; + unsigned short len; + unsigned char *data = *p; +- + int tlsext_servername = 0; ++ int renegotiate_seen = 0; + + if (data >= (d+n-2)) ++ { ++ /* Because the client does not see any renegotiation during an ++ attack, we must enforce this on all server hellos, even the ++ first */ ++ if (!(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) ++ { ++ /* We should always see one extension: the renegotiate extension */ ++ *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ ++ return 0; ++ } + return 1; ++ } + + n2s(data,len); + +@@ -1025,7 +1111,12 @@ int ssl_parse_serverhello_tlsext(SSL *s, + /* Set flag to expect CertificateStatus message */ + s->tlsext_status_expected = 1; + } +- ++ else if (type == TLSEXT_TYPE_renegotiate) ++ { ++ if(!ssl_parse_serverhello_renegotiate_ext(s, data, size, al)) ++ return 0; ++ renegotiate_seen = 1; ++ } + data+=size; + } + +@@ -1035,6 +1126,13 @@ int ssl_parse_serverhello_tlsext(SSL *s, + return 0; + } + ++ if (!renegotiate_seen ++ && !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) ++ { ++ *al = SSL_AD_ILLEGAL_PARAMETER; /* is this the right alert? */ ++ return 0; ++ } ++ + if (!s->hit && tlsext_servername == 1) + { + if (s->tlsext_hostname) diff --git a/openssl-1.0.0-beta4-version.patch b/openssl-1.0.0-beta4-version.patch new file mode 100644 index 0000000..ab12be0 --- /dev/null +++ b/openssl-1.0.0-beta4-version.patch @@ -0,0 +1,14 @@ +We have to keep the beta status on 3 as some applications (OpenSSH) incorrectly insist +on having the same beta status of OpenSSL library as they were built against. +diff -up openssl-1.0.0-beta4/crypto/opensslv.h.version openssl-1.0.0-beta4/crypto/opensslv.h +--- openssl-1.0.0-beta4/crypto/opensslv.h.version 2009-11-12 15:17:28.000000000 +0100 ++++ openssl-1.0.0-beta4/crypto/opensslv.h 2009-11-13 12:39:08.000000000 +0100 +@@ -25,7 +25,7 @@ + * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for + * major minor fix final patch/beta) + */ +-#define OPENSSL_VERSION_NUMBER 0x10000004L ++#define OPENSSL_VERSION_NUMBER 0x10000003L + #ifdef OPENSSL_FIPS + #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0-fips-beta4 10 Nov 2009" + #else diff --git a/sources b/sources index ccd2532..8a2c648 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9926dcf78e797a12d8e3ffd7a018824b openssl-1.0.0-beta3-usa.tar.bz2 +1fc0e41c230d0698f834413dfba864ad openssl-1.0.0-beta4-usa.tar.bz2