[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssl-dev
Subject:    [openssl-dev] [openssl.org #3885] [BUGFIX] OpenSSL fails to cross-compile on 32-bit->64-bit
From:       "Short, Todd via RT" <rt () openssl ! org>
Date:       2015-05-30 7:48:33
Message-ID: rt-4.0.4-5737-1432972112-794.3885-21-0 () openssl ! org
[Download RAW message or body]

Hello OpenSSL Org:

This is a change that Akamai has made to its implementation of OpenSSL.

Version: master branch
Description:  OpenSSL fails to cross-compile on 32-bit->64-bit

Older/32-bit versions of perl cannot handle 64-bit numbers, so when
the x86_64-xlate.pl script encounters a 64-bit number, the oct()
function munges it into a double-precision rather than a 64-bit
integer. In this case, we know it's either a hex number or an octal
number. So, if hex, just pass through as hex string, otherwise allow
oct() to handle it.

This is a problem in ghash-x86_64.pl (ghash-x86_64.s), and the solution
has an impact all 64-bit platforms. Ran the unit tests to make sure it's
OK

Github link:

https://github.com/akamai/openssl/commit/89808ba6a3e3ab69b12518dc5ba651eb29c18ee7

And attachment.

Thank you.
--
-Todd Short
// tshort@akamai.com
// "One if by land, two if by sea, three if by the Internet."



["0004-OpenSSL-fails-to-cross-compile-on-32-bit-64-bit.patch" (application/octet-stream)]

From 89808ba6a3e3ab69b12518dc5ba651eb29c18ee7 Mon Sep 17 00:00:00 2001
From: Todd Short <tshort@akamai.com>
Date: Tue, 19 May 2015 14:46:40 -0400
Subject: [PATCH 4/4] OpenSSL fails to cross-compile on 32-bit->64-bit

Older/32-bit versions of perl cannot handle 64-bit numbers, so when
the x86_64-xlate.pl script encounters a 64-bit number, the oct()
function munges it into a double-precision rather than a 64-bit
integer. In this case, we know it's either a hex number or an octal
number. So, if hex, just pass through as hex string, otherwise allow
oct() to handle it.

This is a problem in ghash-x86_64.pl (ghash-x86_64.s), and the solution
has an impact all 64-bit platforms. Ran the unit tests to make sure it's
OK

(cherry picked from commit d7caa2d1663b50e20dfe0a19735c192f84f7730f)
---
 crypto/perlasm/x86_64-xlate.pl | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
index aae8288..fa254dd 100755
--- a/crypto/perlasm/x86_64-xlate.pl
+++ b/crypto/perlasm/x86_64-xlate.pl
@@ -192,13 +192,19 @@ my %globals;
 	}
 	$ret;
     }
+    sub myoct {
+        my $v = shift;
+	return $v if ($v =~ /^0x/); # if hex leave as-is
+        use integer;
+        return oct($v);
+    }
     sub out {
     	my $self = shift;
 
 	if ($gas) {
 	    # Solaris /usr/ccs/bin/as can't handle multiplications
 	    # in $self->{value}
-	    $self->{value} =~ s/(?<![\w\$\.])(0x?[0-9a-f]+)/oct($1)/egi;
+	    $self->{value} =~ s/(?<![\w\$\.])(0x?[0-9a-f]+)/myoct($1)/egi;
 	    $self->{value} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
 	    sprintf "\$%s",$self->{value};
 	} else {
-- 
2.3.2 (Apple Git-55)



_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic