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
diff --git a/Crypto-config-host.mk b/Crypto-config-host.mk
index eaff7bb..5c63e9e 100644
--- a/Crypto-config-host.mk
+++ b/Crypto-config-host.mk
@@ -697,6 +697,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 e3b867f..6fee75b 100644
--- a/Crypto-config-target.mk
+++ b/Crypto-config-target.mk
@@ -697,6 +697,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 f16596b..ea5f361 100755
--- a/import_openssl.sh
+++ b/import_openssl.sh
@@ -450,6 +450,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)