From 400de09d530bedf6538852f767727a99a300f2fb Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Mon, 4 Jan 2010 10:12:24 +0100 Subject: [PATCH] openssl: fixed x86_64 build while using newer binutils/gas which requires sign extention New gas requires sign extention in lea instruction. This resolves md5-x86_64.pl and sha1-x86_64.pl bugs, but without modifying the code. PR: 2094,2095 http://cvs.openssl.org/chngview?cn=18869 Fix for out range of signed 32bit displacement error on newer binutils in file sha1-x86_64.pl. http://cvs.openssl.org/chngview?cn=18864 --- .../openssl/x86_64-binutils-gas-fix.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 security/openssl/x86_64-binutils-gas-fix.patch diff --git a/security/openssl/x86_64-binutils-gas-fix.patch b/security/openssl/x86_64-binutils-gas-fix.patch new file mode 100644 index 000000000..2e599ce0d --- /dev/null +++ b/security/openssl/x86_64-binutils-gas-fix.patch @@ -0,0 +1,62 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../openssl/x86_64-binutils-gas-fix.patch +# Copyright (C) 2010 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +New gas requires sign extention in lea instruction. This resolves md5-x86_64.pl +and sha1-x86_64.pl bugs, but without modifying the code. PR: 2094,2095 + +http://cvs.openssl.org/chngview?cn=18869 + +Fix for out range of signed 32bit displacement error on newer binutils in file +sha1-x86_64.pl. + +http://cvs.openssl.org/chngview?cn=18864 + +diff -ruN openssl-0.9.8l-orig/crypto/perlasm/x86_64-xlate.pl openssl-0.9.8l/crypto/perlasm/x86_64-xlate.pl +--- openssl-0.9.8l-orig/crypto/perlasm/x86_64-xlate.pl 2008-02-13 21:01:48.000000000 +0100 ++++ openssl-0.9.8l/crypto/perlasm/x86_64-xlate.pl 2010-01-01 19:55:13.000000000 +0100 +@@ -188,8 +188,9 @@ + + if (!$masm) { + # Solaris /usr/ccs/bin/as can't handle multiplications +- # in $self->{label} +- $self->{label} =~ s/(?{label}, new gas requires sign extension... ++ use integer; ++ $self->{label} =~ s/(?>32/egi; + $self->{label} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg; + + if (defined($self->{index})) { +diff -ruN openssl-0.9.8l-orig/crypto/sha/asm/sha1-x86_64.pl openssl-0.9.8l/crypto/sha/asm/sha1-x86_64.pl +--- openssl-0.9.8l-orig/crypto/sha/asm/sha1-x86_64.pl 2007-11-11 14:56:47.000000000 +0100 ++++ openssl-0.9.8l/crypto/sha/asm/sha1-x86_64.pl 2010-01-01 20:24:47.000000000 +0100 +@@ -143,7 +143,7 @@ + sub BODY_20_39 { + my ($i,$a,$b,$c,$d,$e,$f)=@_; + my $j=$i+1; +-my $K=($i<40)?0x6ed9eba1:0xca62c1d6; ++my $K=($i<40)?0x6ed9eba1:-0x359d3e2a; + $code.=<<___ if ($i<79); + lea $K($xi,$e),$f + mov `4*($j%16)`(%rsp),$xi +@@ -180,7 +180,7 @@ + my ($i,$a,$b,$c,$d,$e,$f)=@_; + my $j=$i+1; + $code.=<<___; +- lea 0x8f1bbcdc($xi,$e),$f ++ lea -0x70e44324($xi,$e),$f + mov `4*($j%16)`(%rsp),$xi + mov $b,$t0 + mov $b,$t1