# HG changeset patch # User Misaki Miyashita # Date 1415980574 28800 # Node ID 64e8c961a4a2d8fd9c720f117de72ceabb430407 # Parent e71c20dca64be72757444c2c98c33e53ad5eea20 20018650 openssl-1.0.1-fips-140 x86 build tries to apply sparc patch to x86 file 19230646 "openssl speed -multi" fails with pkcs11 engine diff -r e71c20dca64b -r 64e8c961a4a2 components/openssl/openssl-1.0.1-fips-140/patches-post-config/opensslconf.patch --- a/components/openssl/openssl-1.0.1-fips-140/patches-post-config/opensslconf.patch Wed Nov 12 16:36:55 2014 -0800 +++ b/components/openssl/openssl-1.0.1-fips-140/patches-post-config/opensslconf.patch Fri Nov 14 07:56:14 2014 -0800 @@ -1,19 +1,6 @@ ---- /tmp/opensslconf.h Thu Mar 10 06:46:57 2011 -+++ /tmp/opensslconf.h.new Thu Mar 10 06:47:41 2011 -@@ -2,9 +2,12 @@ - /* WARNING: Generated automatically from opensslconf.h.in by Configure. */ - - /* OpenSSL was configured with the following options: */ -+#if defined(__sparcv9) - #ifndef OPENSSL_SYSNAME_ULTRASPARC - # define OPENSSL_SYSNAME_ULTRASPARC - #endif -+#endif -+ - #ifndef OPENSSL_DOING_MAKEDEPEND - - -@@ -185,10 +188,14 @@ +--- /tmp/opensslconf.h Fri Feb 11 15:36:12 2011 ++++ openssl-1.0.0d/crypto/opensslconf.h Fri Feb 11 16:58:36 2011 +@@ -181,7 +181,11 @@ #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) @@ -21,14 +8,11 @@ +#define ENGINESDIR "/lib/openssl/engines/64" +#else #define ENGINESDIR "/lib/openssl/engines" ++#endif #define OPENSSLDIR "/etc/openssl" #endif #endif -+#endif - - #undef OPENSSL_UNISTD - #define OPENSSL_UNISTD -@@ -232,21 +239,34 @@ +@@ -228,21 +232,39 @@ /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a * %20 speed up (longs are 8 bytes, int's are 4). */ #ifndef DES_LONG @@ -42,7 +26,11 @@ #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) #define CONFIG_HEADER_BN_H -+#if defined(__sparcv9) || defined(__x86_64) ++/* ++ * OpenSSL revision 1.521 from 2005-12-15 in OpenSSL_1_0_0-stable branch changed ++ * 64 bit sparcv9 configuration from SIXTY_FOUR_BIT_LONG to BN_LLONG. ++ */ ++#if defined(__x86_64) +#undef BN_LLONG +#else #define BN_LLONG @@ -51,16 +39,16 @@ /* Should we define BN_DIV2W here? */ /* Only one for the following should be defined */ -+#if defined(__sparcv9) || defined(__x86_64) ++#if defined(__x86_64) +#define SIXTY_FOUR_BIT_LONG +#undef THIRTY_TWO_BIT +#else #undef SIXTY_FOUR_BIT_LONG --#undef SIXTY_FOUR_BIT + #undef SIXTY_FOUR_BIT #define THIRTY_TWO_BIT #endif +#undef SIXTY_FOUR_BIT -+ #endif ++#endif #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) #define CONFIG_HEADER_RC4_LOCL_H diff -r e71c20dca64b -r 64e8c961a4a2 components/openssl/openssl-1.0.1/engines/pkcs11/e_pk11.c --- a/components/openssl/openssl-1.0.1/engines/pkcs11/e_pk11.c Wed Nov 12 16:36:55 2014 -0800 +++ b/components/openssl/openssl-1.0.1/engines/pkcs11/e_pk11.c Fri Nov 14 07:56:14 2014 -0800 @@ -1076,6 +1076,9 @@ if (!pk11_library_initialized) return; + /* invalidate the global session */ + global_session = CK_INVALID_HANDLE; + for (i = OP_MAX - 1; i >= 0; i--) { (void) pthread_mutex_unlock(session_cache[i].lock);