diff --git a/openssl-1.0.0b-s390bn.patch b/openssl-1.0.0b-s390bn.patch new file mode 100644 index 0000000..a360815 --- /dev/null +++ b/openssl-1.0.0b-s390bn.patch @@ -0,0 +1,177 @@ +diff -up openssl-1.0.0b/crypto/bn/asm/s390x.S.s390bn openssl-1.0.0b/crypto/bn/asm/s390x.S +--- openssl-1.0.0b/crypto/bn/asm/s390x.S.s390bn 2010-09-10 16:55:24.000000000 +0200 ++++ openssl-1.0.0b/crypto/bn/asm/s390x.S 2007-06-20 16:10:16.000000000 +0200 +@@ -1,4 +1,4 @@ +-.ident "s390x.S, version 1.1" ++.ident "s390x.S, version 1.0" + // ==================================================================== + // Written by Andy Polyakov for the OpenSSL + // project. +@@ -24,67 +24,67 @@ bn_mul_add_words: + bler %r14 // if (len<=0) return 0; + + stmg %r6,%r10,48(%r15) +- lghi %r10,3 + lghi %r8,0 // carry = 0 +- nr %r10,%r4 // len%4 +- sra %r4,2 // cnt=len/4 +- jz .Loop1_madd // carry is incidentally cleared if branch taken +- algr zero,zero // clear carry ++ srag %r10,%r4,2 // cnt=len/4 ++ jz .Loop1_madd + + .Loop4_madd: + lg %r7,0(%r2,%r3) // ap[i] + mlgr %r6,%r5 // *=w +- alcgr %r7,%r8 // +=carry ++ algr %r7,%r8 // +=carry + alcgr %r6,zero + alg %r7,0(%r2,%r1) // +=rp[i] ++ alcgr %r6,zero + stg %r7,0(%r2,%r1) // rp[i]= + + lg %r9,8(%r2,%r3) + mlgr %r8,%r5 +- alcgr %r9,%r6 ++ algr %r9,%r6 + alcgr %r8,zero + alg %r9,8(%r2,%r1) ++ alcgr %r8,zero + stg %r9,8(%r2,%r1) + + lg %r7,16(%r2,%r3) + mlgr %r6,%r5 +- alcgr %r7,%r8 ++ algr %r7,%r8 + alcgr %r6,zero + alg %r7,16(%r2,%r1) ++ alcgr %r6,zero + stg %r7,16(%r2,%r1) + + lg %r9,24(%r2,%r3) + mlgr %r8,%r5 +- alcgr %r9,%r6 ++ algr %r9,%r6 + alcgr %r8,zero + alg %r9,24(%r2,%r1) ++ alcgr %r8,zero + stg %r9,24(%r2,%r1) + + la %r2,32(%r2) // i+=4 +- brct %r4,.Loop4_madd +- +- la %r10,1(%r10) // see if len%4 is zero ... +- brct %r10,.Loop1_madd // without touching condition code:-) ++ brct %r10,.Loop4_madd + +-.Lend_madd: +- alcgr %r8,zero // collect carry bit +- lgr %r2,%r8 +- lmg %r6,%r10,48(%r15) +- br %r14 ++ lghi %r10,3 ++ nr %r4,%r10 // cnt=len%4 ++ jz .Lend_madd + + .Loop1_madd: + lg %r7,0(%r2,%r3) // ap[i] + mlgr %r6,%r5 // *=w +- alcgr %r7,%r8 // +=carry ++ algr %r7,%r8 // +=carry + alcgr %r6,zero + alg %r7,0(%r2,%r1) // +=rp[i] ++ alcgr %r6,zero + stg %r7,0(%r2,%r1) // rp[i]= + + lgr %r8,%r6 + la %r2,8(%r2) // i++ +- brct %r10,.Loop1_madd ++ brct %r4,.Loop1_madd + +- j .Lend_madd ++.Lend_madd: ++ lgr %r2,%r8 ++ lmg %r6,%r10,48(%r15) ++ br %r14 + .size bn_mul_add_words,.-bn_mul_add_words + + // BN_ULONG bn_mul_words(BN_ULONG *r2,BN_ULONG *r3,int r4,BN_ULONG r5); +@@ -99,57 +99,57 @@ bn_mul_words: + bler %r14 // if (len<=0) return 0; + + stmg %r6,%r10,48(%r15) +- lghi %r10,3 + lghi %r8,0 // carry = 0 +- nr %r10,%r4 // len%4 +- sra %r4,2 // cnt=len/4 +- jz .Loop1_mul // carry is incidentally cleared if branch taken +- algr zero,zero // clear carry ++ srag %r10,%r4,2 // cnt=len/4 ++ jz .Loop1_mul + + .Loop4_mul: + lg %r7,0(%r2,%r3) // ap[i] + mlgr %r6,%r5 // *=w +- alcgr %r7,%r8 // +=carry ++ algr %r7,%r8 // +=carry ++ alcgr %r6,zero + stg %r7,0(%r2,%r1) // rp[i]= + + lg %r9,8(%r2,%r3) + mlgr %r8,%r5 +- alcgr %r9,%r6 ++ algr %r9,%r6 ++ alcgr %r8,zero + stg %r9,8(%r2,%r1) + + lg %r7,16(%r2,%r3) + mlgr %r6,%r5 +- alcgr %r7,%r8 ++ algr %r7,%r8 ++ alcgr %r6,zero + stg %r7,16(%r2,%r1) + + lg %r9,24(%r2,%r3) + mlgr %r8,%r5 +- alcgr %r9,%r6 ++ algr %r9,%r6 ++ alcgr %r8,zero + stg %r9,24(%r2,%r1) + + la %r2,32(%r2) // i+=4 +- brct %r4,.Loop4_mul +- +- la %r10,1(%r10) // see if len%4 is zero ... +- brct %r10,.Loop1_madd // without touching condition code:-) ++ brct %r10,.Loop4_mul + +-.Lend_mul: +- alcgr %r8,zero // collect carry bit +- lgr %r2,%r8 +- lmg %r6,%r10,48(%r15) +- br %r14 ++ lghi %r10,3 ++ nr %r4,%r10 // cnt=len%4 ++ jz .Lend_mul + + .Loop1_mul: + lg %r7,0(%r2,%r3) // ap[i] + mlgr %r6,%r5 // *=w +- alcgr %r7,%r8 // +=carry ++ algr %r7,%r8 // +=carry ++ alcgr %r6,zero + stg %r7,0(%r2,%r1) // rp[i]= + + lgr %r8,%r6 + la %r2,8(%r2) // i++ +- brct %r10,.Loop1_mul ++ brct %r4,.Loop1_mul + +- j .Lend_mul ++.Lend_mul: ++ lgr %r2,%r8 ++ lmg %r6,%r10,48(%r15) ++ br %r14 + .size bn_mul_words,.-bn_mul_words + + // void bn_sqr_words(BN_ULONG *r2,BN_ULONG *r2,int r4) diff --git a/openssl.spec b/openssl.spec index 8e4a9de..2295a61 100644 --- a/openssl.spec +++ b/openssl.spec @@ -21,7 +21,7 @@ Summary: A general purpose cryptography library with TLS implementation Name: openssl Version: 1.0.0b -Release: 1%{?dist} +Release: 2%{?dist} # We remove certain patented algorithms from the openssl source tarball # with the hobble-openssl script which is included below. Source: openssl-%{version}-usa.tar.bz2 @@ -44,6 +44,7 @@ Patch7: openssl-1.0.0-timezone.patch Patch23: openssl-1.0.0-beta4-default-paths.patch Patch24: openssl-0.9.8j-bad-mime.patch Patch25: openssl-1.0.0a-manfix.patch +Patch26: openssl-1.0.0b-s390bn.patch # Functionality changes Patch32: openssl-0.9.8g-ia64.patch Patch33: openssl-1.0.0-beta4-ca-dir.patch @@ -126,6 +127,7 @@ from other formats to the formats used by the OpenSSL toolkit. %patch23 -p1 -b .default-paths %patch24 -p1 -b .bad-mime %patch25 -p1 -b .manfix +%patch26 -p1 -b .s390bn %patch32 -p1 -b .ia64 %patch33 -p1 -b .ca-dir @@ -393,6 +395,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/fipscanister.* %postun -p /sbin/ldconfig %changelog +* Mon Nov 22 2010 Tomas Mraz 1.0.0b-2 +- revert upstream change in s390x bignum asm routines + * Tue Nov 16 2010 Tomas Mraz 1.0.0b-1 - new upstream version fixing CVE-2010-3864 (#649304)