[Pkg-openssl-devel] Bug#532336: openssl: wrong results of rc4 on kfreebsd-amd64 with genuine Intel CPUs

Petr Salinger Petr.Salinger at seznam.cz
Mon Jun 8 15:45:40 UTC 2009


Package: openssl
Severity: important
Tags: patch
Version: 0.9.8g-15
User: glibc-bsd-devel at lists.alioth.debian.org
Usertags: kfreebsd

Hi,

the current version gives wrong results of rc4 on kfreebsd-amd64 with 
genuine Intel CPUs. It also FTBFS on kfreebsd-amd64 with genuine Intel 
CPU.

The problem is strongly related to #532323.
The setting for amd64 cpu ($x86_64_asm) are common for both linux and 
GNU/kFreeBSD operating systems. But other settings are not common, they 
are different.

Contrary to upstream, under debian linux on amd64 uses RC4_CHAR
and does not use asm file rc4-x86_64.pl.

The current crypto/rc4/rc4_skey.c does expect use of this asm file,
but this case is not activated with RC4_CHAR, therefore linux-amd64 is 
unaffected. On contrary, the kfreebsd-amd64 have different settings,
there is active test whether CPU is genuine Intel, and on genuine Intel
it fails.

In mean time please apply fix bellow. It does not affect current
linux-amd64, as sizeof(RC4_INT) is due to RC4_CHAR equal to 1.

Thanks in advance.

 		                Petr

only in patch2:
unchanged:
--- openssl-0.9.8k.orig/crypto/rc4/rc4_skey.c
+++ openssl-0.9.8k/crypto/rc4/rc4_skey.c
@@ -115,8 +115,7 @@

  #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM)
  # if   defined(__i386)   || defined(__i386__)   || defined(_M_IX86) || \
-       defined(__INTEL__) || \
-       defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64)
+       defined(__INTEL__)
         if (sizeof(RC4_INT) > 1) {
                 /*
                  * Unlike all other x86 [and x86_64] implementations,







More information about the Pkg-openssl-devel mailing list