From 87955877681c4c832ee3df0bdba67d3e2e3d49f2 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 19 Nov 2014 11:04:10 -0800 Subject: Add hack to fix RC4_INT problems The opensslconf.h for 64-bit has a special case for linux-x86_64 that sets RC4_INT to "unsigned int" instead of "unsigned char" Without this hack, any server that chooses RC4-SHA for the SSL connection will segmentation fault on x86-64 since the assembly code disagrees with the field size that C believes it is. (cherry picked from commit 9eca647003c7969ecb6fce2b5ff3965d3536fa67) Bug: 18434518 Change-Id: I4eb1395fc122df5185af74500f4155a1095535c5 --- Crypto-config-host.mk | 3 +++ Crypto-config-target.mk | 3 +++ import_openssl.sh | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/Crypto-config-host.mk b/Crypto-config-host.mk index eaff7bbdce..5c63e9ecd0 100644 --- a/Crypto-config-host.mk +++ b/Crypto-config-host.mk @@ -697,6 +697,9 @@ mips_exclude_files := \ crypto/bn/bn_asm.c \ +# "Temporary" hack until this can be fixed in openssl.config +x86_64_cflags += -DRC4_INT="unsigned int" + LOCAL_CFLAGS += $(common_cflags) LOCAL_C_INCLUDES += $(common_c_includes) $(local_c_includes) diff --git a/Crypto-config-target.mk b/Crypto-config-target.mk index e3b867f173..6fee75b357 100644 --- a/Crypto-config-target.mk +++ b/Crypto-config-target.mk @@ -697,6 +697,9 @@ mips_exclude_files := \ crypto/bn/bn_asm.c \ +# "Temporary" hack until this can be fixed in openssl.config +x86_64_cflags += -DRC4_INT="unsigned int" + LOCAL_CFLAGS += $(common_cflags) LOCAL_C_INCLUDES += $(common_c_includes) diff --git a/import_openssl.sh b/import_openssl.sh index f16596bc81..ea5f361d6c 100755 --- a/import_openssl.sh +++ b/import_openssl.sh @@ -450,6 +450,12 @@ LOCAL_ADDITIONAL_DEPENDENCIES += \$(LOCAL_PATH)/$(basename $output) done + if [ $prefix == "CRYPTO" ]; then + echo " +# \"Temporary\" hack until this can be fixed in openssl.config +x86_64_cflags += -DRC4_INT=\"unsigned int\"" + fi + if [ $3 == "target" ]; then echo " LOCAL_CFLAGS += \$(common_cflags) -- cgit v1.2.3