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.
Bug: 18434518
Change-Id: I4eb1395fc122df5185af74500f4155a1095535c5
diff --git a/Crypto-config-host.mk b/Crypto-config-host.mk
index 1e94f10..50b889a 100644
--- a/Crypto-config-host.mk
+++ b/Crypto-config-host.mk
@@ -709,6 +709,9 @@
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 be342d4..00682c0 100644
--- a/Crypto-config-target.mk
+++ b/Crypto-config-target.mk
@@ -709,6 +709,9 @@
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 dc4049c..1844c5b 100755
--- a/import_openssl.sh
+++ b/import_openssl.sh
@@ -453,6 +453,12 @@
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)