SF.net SVN: gar:[25052] csw/mgar/pkg/openssl1/trunk/files

janholzh at users.sourceforge.net janholzh at users.sourceforge.net
Tue Jun 2 10:25:57 CEST 2015


Revision: 25052
          http://sourceforge.net/p/gar/code/25052
Author:   janholzh
Date:     2015-06-02 08:25:57 +0000 (Tue, 02 Jun 2015)
Log Message:
-----------
openssl1/trunk: Use older pachtes again since new one need more work

Modified Paths:
--------------
    csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-fork_safe.patch
    csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-t4-engine.sparc.5.11.patch
    csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-wanboot.patch

Modified: csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-fork_safe.patch
===================================================================
--- csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-fork_safe.patch	2015-06-02 07:53:16 UTC (rev 25051)
+++ csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-fork_safe.patch	2015-06-02 08:25:57 UTC (rev 25052)
@@ -1,7 +1,5 @@
-#
 # This file adds the code to setup internal mutexes and callback function.
 #	PSARC/2014/077
-#	PSARC/2015/043
 # This change was implemented in-house.  The issue was brought up to
 # the upstream engineers, but there was no commitment.
 #
@@ -24,43 +22,7 @@
  static void (MS_FAR *locking_callback) (int mode, int type,
                                          const char *file, int line) = 0;
  static int (MS_FAR *add_lock_callback) (int *pointer, int amount,
-@@ -373,7 +376,10 @@
- void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*func)
-                                          (const char *file, int line))
- {
--    dynlock_create_callback = func;
-+    /*
-+     * we now setup our own dynamic locking callback, and disallow
-+     * setting of another locking callback.
-+     */
- }
-
- void CRYPTO_set_dynlock_lock_callback(void (*func) (int mode,
-@@ -382,7 +388,10 @@
-                                                     const char *file,
-                                                     int line))
- {
--    dynlock_lock_callback = func;
-+    /*
-+     * we now setup our own dynamic locking callback, and disallow
-+     * setting of another locking callback.
-+     */
- }
-
- void CRYPTO_set_dynlock_destroy_callback(void (*func)
-@@ -389,7 +398,10 @@
-                                           (struct CRYPTO_dynlock_value *l,
-                                            const char *file, int line))
- {
--    dynlock_destroy_callback = func;
-+    /*
-+     * we now setup our own dynamic locking callback, and disallow
-+     * setting of another locking callback.
-+     */
- }
-
- void (*CRYPTO_get_locking_callback(void)) (int mode, int type,
-@@ -402,6 +414,129@@
+@@ -402,6 +405,79 @@
      return (add_lock_callback);
  }
 
@@ -70,121 +32,71 @@
 + */ 
 +static void solaris_locking_callback(int mode, int type, const char *file,
 +    int line)
-+{
-+    if (mode & CRYPTO_LOCK) {
-+        pthread_mutex_lock(&solaris_openssl_locks[type]);
-+    } else {
-+        pthread_mutex_unlock(&solaris_openssl_locks[type]);
-+    }
-+}
++	{
++	if (mode & CRYPTO_LOCK)
++		{
++		pthread_mutex_lock(&solaris_openssl_locks[type]);
++		}
++	else
++		{
++		pthread_mutex_unlock(&solaris_openssl_locks[type]);
++		}
++	}
 +
 +
 +/*
-+ * Implement Solaris's own dynamic locking routines.
-+ */
-+static struct CRYPTO_dynlock_value *
-+solaris_dynlock_create(const char *file, int line)
-+{
-+    int                        ret;
-+    pthread_mutex_t    *dynlock;
-+
-+    dynlock = OPENSSL_malloc(sizeof(pthread_mutex_t));
-+    if (dynlock == NULL) {
-+        return (NULL);
-+    }
-+
-+    ret = pthread_mutex_init(dynlock, NULL);
-+    OPENSSL_assert(ret);
-+
-+    return ((struct CRYPTO_dynlock_value *)dynlock);
-+}
-+
-+static void
-+solaris_dynlock_lock(int mode, struct CRYPTO_dynlock_valud *dynlock,
-+    const char *file, int line)
-+{
-+    int        ret;
-+
-+    if (mode & CRYPTO_LOCK) {
-+        ret = pthread_mutex_lock((pthread_mutex_t *)dynlock);
-+    } else {
-+        ret = pthread_mutex_unlock((pthread_mutex_t *)dynlock);
-+    }
-+
-+    OPENSSL_assert(ret == 0);
-+}
-+
-+static void
-+solaris_dynlock_destroy(struct CRYPTO_dynlock_value *dynlock,
-+    const char *file, int line)
-+{
-+    int ret;
-+    ret = pthread_mutex_destroy((pthread_mutex_t *)dynlock);
-+    OPENSSL_assert(ret);
-+}
-+
-+
-+/*
 + * This function is called when a child process is forked to setup its own
 + * global locking callback function ptr and mutexes.
 + */
 +static void solaris_fork_child(void)
-+{
-+    /*
-+     * clear locking_callback to indicate that locks should
-+     * be reinitialized.
-+     */
-+    locking_callback = NULL;
-+    solaris_locking_setup();
-+}
++	{
++		/*
++		 * clear locking_callback to indicate that locks should
++		 * be reinitialized.
++		 */
++		locking_callback = NULL;
++		solaris_locking_setup();
++	}
 +
 +/*
 + * This function allocates and initializes the global mutex array, and
 + * sets the locking callback.
 + */
 +void solaris_locking_setup()
-+{
-+    int i;
-+    int num_locks;
++	{
++	int i;
++	int num_locks;
 +
-+    /* setup the dynlock callback if not already */
-+    if (dynlock_create_callback == NULL) {
-+        dynlock_create_callback = solaris_dynlock_create;
-+    }
-+    if (dynlock_lock_callback == NULL) {
-+        dynlock_lock_callback = solaris_dynlock_lock;
-+    }
-+    if (dynlock_destroy_callback == NULL) {
-+        dynlock_destroy_callback = solaris_dynlock_destroy;
-+    }
++	/* locking callback is already setup. Nothing to do */
++	if (locking_callback != NULL)
++		{
++		return;
++		}
 +
-+    /* locking callback is already setup. Nothing to do */
-+    if (locking_callback != NULL) {
-+        return;
-+    }
++	/*
++	 * Set atfork handler so that child can setup its own mutexes and
++	 * locking callbacks when it is forked
++	 */
++	(void) pthread_atfork(NULL, NULL, solaris_fork_child);
 +
-+    /*
-+     * Set atfork handler so that child can setup its own mutexes and
-+     * locking callbacks when it is forked
-+     */
-+    (void) pthread_atfork(NULL, NULL, solaris_fork_child);
++	/* allocate locks needed by OpenSSL  */
++	num_locks = CRYPTO_num_locks();
++	solaris_openssl_locks =
++	    OPENSSL_malloc(sizeof (pthread_mutex_t) * num_locks);
++	if (solaris_openssl_locks == NULL)
++		{
++		fprintf(stderr,
++			"solaris_locking_setup: memory allocation failure.\n");
++		abort();
++		}
 +
-+    /* allocate locks needed by OpenSSL  */
-+    num_locks = CRYPTO_num_locks();
-+    solaris_openssl_locks =
-+        OPENSSL_malloc(sizeof (pthread_mutex_t) * num_locks);
-+    if (solaris_openssl_locks == NULL) {
-+        fprintf(stderr,
-+            "solaris_locking_setup: memory allocation failure.\n");
-+        abort();
-+    }
++	/* initialize openssl mutexes */
++	for (i = 0; i < num_locks; i++)
++		{
++		pthread_mutex_init(&solaris_openssl_locks[i], NULL);
++		}
++	locking_callback = solaris_locking_callback;
 +
-+    /* initialize openssl mutexes */
-+    for (i = 0; i < num_locks; i++) {
-+        pthread_mutex_init(&solaris_openssl_locks[i], NULL);
-+    }
-+    locking_callback = solaris_locking_callback;
-+
 +}
 +
  void CRYPTO_set_locking_callback(void (*func) (int mode, int type,
@@ -196,39 +108,13 @@
      OPENSSL_init();
 -    locking_callback = func;
 +
-+    /*
-+     * we now setup our own locking callback and mutexes, and disallow
-+     * setting of another locking callback.
-+     */
++	/*
++	 * we now setup our own locking callback and mutexes, and disallow
++	 * setting of another locking callback.
++	 */
  }
  
  void CRYPTO_set_add_lock_callback(int (*func) (int *num, int mount, int type,
-@@ -471,9 +551,10 @@
- 
- int CRYPTO_THREADID_set_callback(void (*func) (CRYPTO_THREADID *))
- {
--    if (threadid_callback)
--        return 0;
--    threadid_callback = func;
-+    /*
-+     * Use the backup method (the address of 'errno') to identify the
-+     * thread and disallow setting the threadid callback.
-+     */
-     return 1;
- }
- 
-@@ -531,7 +611,10 @@
- 
- void CRYPTO_set_id_callback(unsigned long (*func) (void))
- {
--    id_callback = func;
-+    /*
-+     * Use the backup method to identify the thread/process.
-+     * Setting the id callback is disallowed.
-+     */
- }
- 
- unsigned long CRYPTO_thread_id(void)
 --- openssl-1.0.1f/crypto/cryptlib.h.~1~	Fri Feb  7 10:41:42 2014
 +++ openssl-1.0.1f/crypto/cryptlib.h	Thu Feb  6 16:04:16 2014
 @@ -104,6 +104,8 @@

Modified: csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-t4-engine.sparc.5.11.patch
===================================================================
--- csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-t4-engine.sparc.5.11.patch	2015-06-02 07:53:16 UTC (rev 25051)
+++ csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-t4-engine.sparc.5.11.patch	2015-06-02 08:25:57 UTC (rev 25052)
@@ -1,4 +1,3 @@
-#
 # This file adds inline T4 instruction support to OpenSSL upstream code.
 # The change was brought in from OpenSSL 1.0.2.
 #
@@ -13,9 +12,9 @@
  my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void";
 -my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void";
 +my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o vis3-mont.o sparct4-mont.o sparcv9-gf2m.o:des_enc-sparc.o fcrypt_b.o dest4-sparcv9.o:aes_core.o aes_cbc.o aes-sparcv9.o aest4-sparcv9.o::md5-sparcv9.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void";
- my $fips_sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void";
  my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::::void";
  my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o:::::sha1-alpha.o:::::::ghash-alpha.o::void";
+ my $mips32_asm=":bn-mips.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o::::::::";
 Index: crypto/sparccpuid.S
 ===================================================================
 diff -ru openssl-1.0.1e/crypto/sparccpuid.S openssl-1.0.1e/crypto/sparccpuid.S
@@ -29,7 +28,20 @@
  #if defined(__SUNPRO_C) && defined(__sparcv9)
  # define ABI64  /* They've said -xarch=v9 at command line */
  #elif defined(__GNUC__) && defined(__arch64__)
-@@ -241,7 +245,12 @@
+@@ -235,10 +239,10 @@
+ .global	_sparcv9_vis1_probe
+ .align	8
+ _sparcv9_vis1_probe:
++	.word	0x81b00d80	!fxor	%f0,%f0,%f0
+ 	add	%sp,BIAS+2,%o1
+-	.word	0xc19a5a40	!ldda	[%o1]ASI_FP16_P,%f0
+ 	retl
+-	.word	0x81b00d80	!fxor	%f0,%f0,%f0
++	.word	0xc19a5a40	!ldda	[%o1]ASI_FP16_P,%f0
+ .type	_sparcv9_vis1_probe,#function
+ .size	_sparcv9_vis1_probe,.-_sparcv9_vis1_probe
+ 
+@@ -251,7 +255,12 @@
  !	UltraSPARC IIe		7
  !	UltraSPARC III		7
  !	UltraSPARC T1		24
@@ -42,7 +54,7 @@
  ! Numbers for T2 and SPARC64 V-VII are more than welcomed.
  !
  ! It would be possible to detect specifically US-T1 by instrumenting
-@@ -250,6 +259,8 @@
+@@ -260,6 +269,8 @@
  .global	_sparcv9_vis1_instrument
  .align	8
  _sparcv9_vis1_instrument:
@@ -51,9 +63,9 @@
  	.word	0x91410000	!rd	%tick,%o0
  	.word	0x81b00d80	!fxor	%f0,%f0,%f0
  	.word	0x85b08d82	!fxor	%f2,%f2,%f2
-@@ -286,6 +297,30 @@
- .type	_sparcv9_vis1_instrument,#function
- .size	_sparcv9_vis1_instrument,.-_sparcv9_vis1_instrument
+@@ -314,6 +325,30 @@
+ .type	_sparcv9_fmadd_probe,#function
+ .size	_sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe
  
 +.global	_sparcv9_rdcfr
 +.align	8
@@ -82,7 +94,7 @@
  .global	OPENSSL_cleanse
  .align	32
  OPENSSL_cleanse:
-@@ -370,6 +405,102 @@
+@@ -398,6 +433,102 @@
  .size	OPENSSL_cleanse,.-OPENSSL_cleanse
  
  #ifndef _BOOT
@@ -190,20 +202,18 @@
 diff -ru openssl-1.0.1e/crypto/sparcv9cap.c openssl-1.0.1e/crypto/sparcv9cap.c
 --- openssl-1.0.1e/crypto/sparcv9cap.c 2011-05-24 17:02:24.000000000 -0700
 +++ openssl-1.0.1e/crypto/sparcv9cap.c 2011-07-27 10:48:17.817470000 -0700
-@@ -3,36 +3,59 @@
- #include <string.h>
+@@ -4,34 +4,58 @@
  #include <setjmp.h>
+ #include <signal.h>
  #include <sys/time.h>
 +#include <unistd.h>
  #include <openssl/bn.h>
- #include <sys/auxv.h>
  
 -#define SPARCV9_TICK_PRIVILEGED (1<<0)
 -#define SPARCV9_PREFER_FPU      (1<<1)
 -#define SPARCV9_VIS1            (1<<2)
 -#define SPARCV9_VIS2            (1<<3) /* reserved */
 -#define SPARCV9_FMADD           (1<<4) /* reserved for SPARC64 V */
--#define SPARCV9_BLK             (1<<5)
 +#include "sparc_arch.h"
  
 +#if defined(__GNUC__) && defined(__linux)
@@ -264,11 +274,13 @@
  }
  
  unsigned long _sparcv9_rdtick(void);
-@@ -37,11 +60,16 @@
- 
- unsigned long _sparcv9_rdtick(void);
+@@ -39,11 +63,18 @@
  unsigned long _sparcv9_vis1_instrument(void);
+ void _sparcv9_vis2_probe(void);
+ void _sparcv9_fmadd_probe(void);
 +unsigned long _sparcv9_rdcfr(void);
++void _sparcv9_vis3_probe(void);
++unsigned long _sparcv9_random(void);
 +#ifndef _BOOT
 +size_t _sparcv9_vis1_instrument_bus(unsigned int *,size_t);
 +size_t _sparcv9_vis1_instrument_bus2(unsigned int *,size_t,size_t);
@@ -282,7 +294,7 @@
  #if defined(__sun) && defined(__SVR4)
          return gethrtime();
  #else
-@@ -50,6 +80,24 @@
+@@ -52,6 +83,24 @@
      else
          return _sparcv9_rdtick();
  }
@@ -307,7 +319,7 @@
  #endif
 
  #if defined(_BOOT)
-@@ -59,7 +107,7 @@
+@@ -61,7 +110,7 @@
   */
  void OPENSSL_cpuid_setup(void)
         {
@@ -316,7 +328,7 @@
         }
  
  #elif 0 && defined(__sun) && defined(__SVR4)
-@@ -88,11 +136,11 @@
+@@ -90,11 +139,11 @@
      if (!strcmp(name, "SUNW,UltraSPARC") ||
          /* covers II,III,IV */
          !strncmp(name, "SUNW,UltraSPARC-I", 17)) {
@@ -330,7 +342,7 @@
  
          return DI_WALK_TERMINATE;
      }
-@@ -98,7 +146,7 @@
+@@ -100,7 +149,7 @@
      }
      /* This is expected to catch remaining UltraSPARCs, such as T1 */
      else if (!strncmp(name, "SUNW,UltraSPARC", 15)) {
@@ -339,7 +351,7 @@
  
          return DI_WALK_TERMINATE;
      }
-@@ -117,7 +165,7 @@
+@@ -119,7 +168,7 @@
      trigger = 1;
  
      if ((e = getenv("OPENSSL_sparcv9cap"))) {
@@ -348,7 +360,7 @@
          return;
      }
  
-@@ -124,15 +172,15 @@
+@@ -126,15 +175,15 @@
      if (sysinfo(SI_MACHINE, si, sizeof(si)) > 0) {
          if (strcmp(si, "sun4v"))
              /* FPU is preferred for all CPUs, but US-T1/2 */
@@ -368,7 +380,7 @@
              return;
          }
      }
-@@ -195,7 +241,9 @@
+@@ -204,12 +253,14 @@
      trigger = 1;
  
      if ((e = getenv("OPENSSL_sparcv9cap"))) {
@@ -379,48 +391,73 @@
          return;
      }
  
-@@ -202,21 +250,48 @@
-     (void) getisax(&ui, 1);
- 
      /* Initial value, fits UltraSPARC-I&II... */
--    OPENSSL_sparcv9cap_P = SPARCV9_BLK;
-+    OPENSSL_sparcv9cap_P[0] = SPARCV9_BLK;
+-    OPENSSL_sparcv9cap_P = SPARCV9_PREFER_FPU | SPARCV9_TICK_PRIVILEGED;
++    OPENSSL_sparcv9cap_P[0] = SPARCV9_PREFER_FPU | SPARCV9_TICK_PRIVILEGED;
  
-     if (ui & AV_SPARC_VIS) {
--        /* detect UltraSPARC-Tx, see sparccpuid.S for details... */
-+        /* detect UltraSPARC-Tx, see sparccpud.S for details... */
-         if (_sparcv9_vis1_instrument() < 7)
--            OPENSSL_sparcv9cap_P |= SPARCV9_TICK_PRIVILEGED;
-+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_TICK_PRIVILEGED;
-         if (_sparcv9_vis1_instrument() < 12) {
--            OPENSSL_sparcv9cap_P |= SPARCV9_VIS1|SPARCV9_PREFER_FPU;
-+            OPENSSL_sparcv9cap_P[0] |= (SPARCV9_VIS1 | SPARCV9_PREFER_FPU);
-             if (ui & AV_SPARC_VIS2)
--                OPENSSL_sparcv9cap_P |= SPARCV9_VIS2;
--        }
-+                OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2;
-+         }
+     sigfillset(&all_masked);
+     sigdelset(&all_masked, SIGILL);
+@@ -232,18 +283,18 @@
+ 
+     if (sigsetjmp(common_jmp, 1) == 0) {
+         _sparcv9_rdtick();
+-        OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
++        OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED;
      }
  
-     if (ui & AV_SPARC_FMAF)
+     if (sigsetjmp(common_jmp, 1) == 0) {
+         _sparcv9_vis1_probe();
+-        OPENSSL_sparcv9cap_P |= SPARCV9_VIS1;
++        OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1 | SPARCV9_BLK;
+         /* detect UltraSPARC-Tx, see sparccpud.S for details... */
+         if (_sparcv9_vis1_instrument() >= 12)
+-            OPENSSL_sparcv9cap_P &= ~(SPARCV9_VIS1 | SPARCV9_PREFER_FPU);
++            OPENSSL_sparcv9cap_P[0] &= ~(SPARCV9_VIS1 | SPARCV9_PREFER_FPU);
+         else {
+             _sparcv9_vis2_probe();
+-            OPENSSL_sparcv9cap_P |= SPARCV9_VIS2;
++            OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2;
+         }
+     }
+ 
+@@ -249,13 +300,50 @@
+ 
+     if (sigsetjmp(common_jmp, 1) == 0) {
+         _sparcv9_fmadd_probe();
 -        OPENSSL_sparcv9cap_P |= SPARCV9_FMADD;
 +        OPENSSL_sparcv9cap_P[0] |= SPARCV9_FMADD;
-+
+     }
+ 
 +    /*
 +     * VIS3 flag is tested independently from VIS1, unlike VIS2 that is,
 +     * because VIS3 defines even integer instructions.
 +     */
-+    if (ui & AV_SPARC_VIS3)
-+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3;
++    if (sigsetjmp(common_jmp,1) == 0) {
++        _sparcv9_vis3_probe();
++        OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3;
++    }
 +
-+#define AV_T4_MECHS     (AV_SPARC_AES | AV_SPARC_DES | AV_SPARC_KASUMI | \
-+                         AV_SPARC_CAMELLIA | AV_SPARC_MD5 | AV_SPARC_SHA1 | \
-+                         AV_SPARC_SHA256 | AV_SPARC_SHA512 | AV_SPARC_MPMUL | \
-+                         AV_SPARC_CRC32C)
++    if (sigsetjmp(common_jmp,1) == 0) {
++        (void)_sparcv9_random();
++        OPENSSL_sparcv9cap_P[0] |= SPARCV9_RANDOM;
++    }
 +
-+    if ((OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS3) && (ui & AV_T4_MECHS))
++    /*
++     * In wait for better solution _sparcv9_rdcfr is masked by
++     * VIS3 flag, because it goes to uninterruptable endless
++     * loop on UltraSPARC II running Solaris. Things might be
++     * different on Linux...
++     */
++    if ((OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS3) &&
++        sigsetjmp(common_jmp, 1) == 0) {
 +        OPENSSL_sparcv9cap_P[1] = (unsigned int)_sparcv9_rdcfr();
++    }
 +
+     sigaction(SIGBUS, &bus_oact, NULL);
+     sigaction(SIGILL, &ill_oact, NULL);
+ 
+     sigprocmask(SIG_SETMASK, &oset, NULL);
++
 +    if (sizeof(size_t) == 8)
 +        OPENSSL_sparcv9cap_P[0] |= SPARCV9_64BIT_STACK;
 +#ifdef __linux
@@ -2231,7 +2268,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/sparc_arch.h openssl-1.0.1m/crypto/sparc_arch.h
 --- openssl-1.0.1m/crypto/sparc_arch.h 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/sparc_arch.h 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/sparc_arch.h 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,101 @@
 +#ifndef __SPARC_ARCH_H__
 +#define	__SPARC_ARCH_H__
@@ -2338,7 +2375,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/md5/asm/md5-sparcv9.pl openssl-1.0.1m/crypto/md5/asm/md5-sparcv9.pl
 --- openssl-1.0.1m/crypto/md5/asm/md5-sparcv9.pl 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/md5/asm/md5-sparcv9.pl 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/md5/asm/md5-sparcv9.pl 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,434 @@
 +#!/usr/bin/env perl
 +
@@ -2778,7 +2815,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/aes/asm/aest4-sparcv9.pl openssl-1.0.1m/crypto/aes/asm/aest4-sparcv9.pl
 --- openssl-1.0.1m/crypto/aes/asm/aest4-sparcv9.pl 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/aes/asm/aest4-sparcv9.pl 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/aes/asm/aest4-sparcv9.pl 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,902 @@
 +#!/usr/bin/env perl
 +
@@ -3686,7 +3723,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/des/asm/dest4-sparcv9.pl openssl-1.0.1m/crypto/des/asm/dest4-sparcv9.pl
 --- openssl-1.0.1m/crypto/des/asm/dest4-sparcv9.pl 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/des/asm/dest4-sparcv9.pl 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/des/asm/dest4-sparcv9.pl 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,602 @@
 +#!/usr/bin/env perl
 +
@@ -4294,7 +4331,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/perlasm/sparcv9_modes.pl openssl-1.0.1m/crypto/perlasm/sparcv9_modes.pl
 --- openssl-1.0.1m/crypto/perlasm/sparcv9_modes.pl 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/perlasm/sparcv9_modes.pl 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/perlasm/sparcv9_modes.pl 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,1680 @@
 +#!/usr/bin/env perl
 +
@@ -5980,7 +6017,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/bn/asm/vis3-mont.pl openssl-1.0.1m/crypto/bn/asm/vis3-mont.pl
 --- openssl-1.0.1m/crypto/bn/asm/vis3-mont.pl 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/bn/asm/vis3-mont.pl 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/bn/asm/vis3-mont.pl 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,373 @@
 +#!/usr/bin/env perl
 +
@@ -6359,7 +6396,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/bn/asm/sparcv9-gf2m.pl openssl-1.0.1m/crypto/bn/asm/sparcv9-gf2m.pl
 --- openssl-1.0.1m/crypto/bn/asm/sparcv9-gf2m.pl 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/bn/asm/sparcv9-gf2m.pl 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/bn/asm/sparcv9-gf2m.pl 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,198 @@
 +#!/usr/bin/env perl
 +#
@@ -6563,7 +6600,7 @@
 ===================================================================
 diff -uNr openssl-1.0.1m/crypto/bn/asm/sparct4-mont.pl openssl-1.0.1m/crypto/bn/asm/sparct4-mont.pl
 --- openssl-1.0.1m/crypto/bn/asm/sparct4-mont.pl 1970-01-01 01:00:00.000000000 +0100
-+++ openssl-1.0.1m/crypto/bn/asm/sparct4-mont.pl 2015-06-02 09:52:11.809148396 +0200
++++ openssl-1.0.1m/crypto/bn/asm/sparct4-mont.pl 2015-03-21 16:27:38.578043100 +0100
 @@ -0,0 +1,1222 @@
 +#!/usr/bin/env perl
 +

Modified: csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-wanboot.patch
===================================================================
--- csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-wanboot.patch	2015-06-02 07:53:16 UTC (rev 25051)
+++ csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-wanboot.patch	2015-06-02 08:25:57 UTC (rev 25052)
@@ -1,92 +1,47 @@
-#
 # This patch file makes the changes neccessary to build wanboot-openssl.o
 # binary. This is Solaris-specific: not suitable for upstream.
 #
---- openssl-1.0.0e/crypto/cryptlib.c    2011-06-22 08:39:00.000000000 -0700
-+++ openssl-1.0.0e_patched/crypto/cryptlib.c    2011-12-12 06:17:45.422476900 -0800
-@@ -421,11 +421,13 @@
+--- openssl-1.0.0e/crypto/cryptlib.c	2011-06-22 08:39:00.000000000 -0700
++++ openssl-1.0.0e_patched/crypto/cryptlib.c	2011-12-12 06:17:45.422476900 -0800
+@@ -412,6 +412,7 @@
  static void solaris_locking_callback(int mode, int type, const char *file,
      int line)
- {
-+#ifndef    _BOOT
-     if (mode & CRYPTO_LOCK) {
-         pthread_mutex_lock(&solaris_openssl_locks[type]);
-     } else {
-         pthread_mutex_unlock(&solaris_openssl_locks[type]);
-     }
+ 	{
++#ifndef	_BOOT
+ 	if (mode & CRYPTO_LOCK)
+ 		{
+ 		pthread_mutex_lock(&solaris_openssl_locks[type]);
+@@ -420,6 +421,7 @@
+ 		{
+ 		pthread_mutex_unlock(&solaris_openssl_locks[type]);
+ 		}
 +#endif
- }
+ 	}
  
  
-@@ -435,6 +437,7 @@
- static struct CRYPTO_dynlock_value *
- solaris_dynlock_create(const char *file, int line)
- {
-+#ifndef    _BOOT
-     int                        ret;
-     pthread_mutex_t    *dynlock;
-
-@@ -447,6 +450,9 @@
-     OPENSSL_assert(ret);
-
-     return ((struct CRYPTO_dynlock_value *)dynlock);
-+#else
-+    return (NULL);
-+#endif
- }
-
- static void
-@@ -453,6 +459,7 @@
- solaris_dynlock_lock(int mode, struct CRYPTO_dynlock_valud *dynlock,
-     const char *file, int line)
- {
-+#ifndef    _BOOT
-     int        ret;
-
-     if (mode & CRYPTO_LOCK) {
-@@ -462,6 +469,7 @@
-     }
-
-     OPENSSL_assert(ret == 0);
-+#endif
- }
-
- static void
-@@ -468,9 +476,11 @@
- solaris_dynlock_destroy(struct CRYPTO_dynlock_value *dynlock,
-     const char *file, int line)
- {
-+#ifndef    _BOOT
-     int ret;
-     ret = pthread_mutex_destroy((pthread_mutex_t *)dynlock);
-     OPENSSL_assert(ret);
-+#endif
- }
-
-
-@@ -514,6 +524,12 @@
-     }
+@@ -453,6 +455,12 @@
+ 		}
  
-     /*
-+     * pthread_* can't be used in wanboot.
-+     * wanboot needs not be thread-safe and mutexes and locking callback
-+     * function will not be setup for wanboot.
-+     */
-+#ifndef    _BOOT
-+    /*
-      * Set atfork handler so that child can setup its own mutexes and
-      * locking callbacks when it is forked
-      */
-@@ -534,7 +550,7 @@
-         pthread_mutex_init(&solaris_openssl_locks[i], NULL);
-     }
-     locking_callback = solaris_locking_callback;
+ 	/*
++	 * pthread_* can't be used in wanboot.
++	 * wanboot needs not be thread-safe and mutexes and locking callback
++	 * function will not be setup for wanboot.
++	 */
++#ifndef	_BOOT
++	/*
+ 	 * Set atfork handler so that child can setup its own mutexes and
+ 	 * locking callbacks when it is forked
+ 	 */
+@@ -475,7 +483,7 @@
+ 		pthread_mutex_init(&solaris_openssl_locks[i], NULL);
+ 		}
+ 	locking_callback = solaris_locking_callback;
 -
 +#endif
  }
  
  void CRYPTO_set_locking_callback(void (*func) (int mode, int type,
-@@ -1084,6 +1100,12 @@
+@@ -1021,6 +1029,12 @@
          MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONSTOP);
  }
  #else
@@ -95,36 +50,36 @@
 + * OPENSSL_showfatal() is not used anywhere else then here we can safely use
 + * the code from 0.9.7d version.
 + */
-+#ifndef    _BOOT
++#ifndef	_BOOT
  void OPENSSL_showfatal(const char *fmta, ...)
  {
      va_list ap;
-@@ -1092,6 +1114,7 @@
+@@ -1029,6 +1043,7 @@
      vfprintf(stderr, fmta, ap);
      va_end(ap);
  }
-+#endif    /* _BOOT */
++#endif	/* _BOOT */
  
  int OPENSSL_isservice(void)
  {
-@@ -1101,9 +1124,15 @@
+@@ -1038,9 +1053,15 @@
  
  void OpenSSLDie(const char *file, int line, const char *assertion)
  {
-+#ifndef    _BOOT        
++#ifndef	_BOOT		
      OPENSSL_showfatal
          ("%s(%d): OpenSSL internal error, assertion failed: %s\n", file, line,
           assertion);
 +#else
-+    fprintf(stderr,
-+        "%s(%d): OpenSSL internal error, assertion failed: %s\n",
-+        file,line,assertion);
-+#endif    
++	fprintf(stderr,
++		"%s(%d): OpenSSL internal error, assertion failed: %s\n",
++		file,line,assertion);
++#endif	
  #if !defined(_WIN32) || defined(__CYGWIN__)
      abort();
  #else
---- openssl-1.0.0e/crypto/err/err_all.c    2009-08-09 07:58:05.000000000 -0700
-+++ openssl-1.0.0e_patched/crypto/err/err_all.c    2011-12-13 05:22:01.205351400 -0800
+--- openssl-1.0.0e/crypto/err/err_all.c	2009-08-09 07:58:05.000000000 -0700
++++ openssl-1.0.0e_patched/crypto/err/err_all.c	2011-12-13 05:22:01.205351400 -0800
 @@ -148,7 +148,9 @@
      ERR_load_X509V3_strings();
      ERR_load_PKCS12_strings();
@@ -135,14 +90,14 @@
      ERR_load_TS_strings();
  # ifndef OPENSSL_NO_ENGINE
      ERR_load_ENGINE_strings();
---- openssl-1.0.0e/crypto/evp/evp_key.c    2010-03-27 12:27:50.000000000 -0700
-+++ openssl-1.0.0e_patched/crypto/evp/evp_key.c    2011-12-13 05:19:32.956908600 -0800
+--- openssl-1.0.0e/crypto/evp/evp_key.c	2010-03-27 12:27:50.000000000 -0700
++++ openssl-1.0.0e_patched/crypto/evp/evp_key.c	2011-12-13 05:19:32.956908600 -0800
 @@ -83,7 +83,7 @@
      else
          return (prompt_string);
  }
 -
-+#ifndef    _BOOT
++#ifndef	_BOOT
  /*
   * For historical reasons, the standard function for reading passwords is in
   * the DES library -- if someone ever wants to disable DES, this function
@@ -150,17 +105,17 @@
      OPENSSL_cleanse(buff, BUFSIZ);
      return ret;
  }
-+#endif    /* !_BOOT */
++#endif	/* !_BOOT */
  
  int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
                     const unsigned char *salt, const unsigned char *data,
---- openssl-1.0.0e/crypto/rand/rand_unix.c    2009-04-06 07:31:36.000000000 -0700
-+++ openssl-1.0.0e_patched/crypto/rand/rand_unix.c    2011-12-19 07:28:39.988944800 -0800
+--- openssl-1.0.0e/crypto/rand/rand_unix.c	2009-04-06 07:31:36.000000000 -0700
++++ openssl-1.0.0e_patched/crypto/rand/rand_unix.c	2011-12-19 07:28:39.988944800 -0800
 @@ -122,7 +122,11 @@
  # include <sys/time.h>
  # include <sys/times.h>
  # include <sys/stat.h>
-+#ifdef    _BOOT
++#ifdef	_BOOT
 +# include <sys/fcntl.h>
 +#else
  # include <fcntl.h>
@@ -228,7 +183,7 @@
      }
  #  endif
  
-+#ifndef    _BOOT
++#ifndef	_BOOT
      /* put in some default random data, we need more than just this */
      l = curr_pid;
      RAND_add(&l, sizeof(l), 0.0);
@@ -236,21 +191,21 @@
  
      l = time(NULL);
      RAND_add(&l, sizeof(l), 0.0);
-+#endif /* !_BOOT */    
++#endif /* !_BOOT */	
  
  #  if defined(OPENSSL_SYS_BEOS)
      {
---- openssl-1.0.0e/crypto/rand/randfile.c    2011-03-19 02:44:37.000000000 -0700
-+++ openssl-1.0.0e_patched/crypto/rand/randfile.c    2011-12-13 05:26:51.884824200 -0800
+--- openssl-1.0.0e/crypto/rand/randfile.c	2011-03-19 02:44:37.000000000 -0700
++++ openssl-1.0.0e_patched/crypto/rand/randfile.c	2011-12-13 05:26:51.884824200 -0800
 @@ -57,9 +57,11 @@
   */
  
  /* We need to define this to get macros like S_IFBLK and S_IFCHR */
-+#ifndef    _BOOT
++#ifndef	_BOOT
  #if !defined(OPENSSL_SYS_VXWORKS)
  # define _XOPEN_SOURCE 500
  #endif
-+#endif    /* _BOOT */
++#endif	/* _BOOT */
  
  #include <errno.h>
  #include <stdio.h>
@@ -258,7 +213,7 @@
      return (ret);
  }
  
-+#ifndef    _BOOT
++#ifndef	_BOOT
  int RAND_write_file(const char *file)
  {
      unsigned char buf[BUFSIZE];
@@ -268,13 +223,13 @@
  }
 +
 +#endif /* _BOOT */
---- openssl-1.0.0e/crypto/x509v3/v3_utl.c    2009-07-27 14:08:53.000000000 -0700
-+++ openssl-1.0.0e_patched/crypto/x509v3/v3_utl.c    2011-12-13 05:10:08.844191400 -0800
+--- openssl-1.0.0e/crypto/x509v3/v3_utl.c	2009-07-27 14:08:53.000000000 -0700
++++ openssl-1.0.0e_patched/crypto/x509v3/v3_utl.c	2011-12-13 05:10:08.844191400 -0800
 @@ -715,9 +715,50 @@
      }
  }
  
-+#if    defined(_BOOT)
++#if	defined(_BOOT)
 +/* This function was copied from bio/b_sock.c */
 +static int get_ip(const char *str, unsigned char ip[4])
 +{
@@ -314,10 +269,10 @@
  {
      int a0, a1, a2, a3;
 +
-+#if    defined(_BOOT)
-+    if (get_ip(in, v4) != 1)
-+        return 0;
-+#else    /* _BOOT */
++#if	defined(_BOOT)
++	if (get_ip(in, v4) != 1)
++		return 0;
++#else	/* _BOOT */
      if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4)
          return 0;
      if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255)
@@ -325,17 +280,17 @@
      v4[1] = a1;
      v4[2] = a2;
      v4[3] = a3;
-+#endif    /* _BOOT */
++#endif	/* _BOOT */
      return 1;
  }
 
---- openssl-1.0.0e/e_os.h    2011-12-19 04:17:51.631087400 -0800
-+++ openssl-1.0.0e_patched/e_os.h    2011-12-19 04:15:15.776668900 -0800
+--- openssl-1.0.0e/e_os.h	2011-12-19 04:17:51.631087400 -0800
++++ openssl-1.0.0e_patched/e_os.h	2011-12-19 04:15:15.776668900 -0800
 @@ -213,10 +213,19 @@
  #  define get_last_socket_error() errno
  #  define clear_socket_error()    errno=0
  #  define ioctlsocket(a,b,c)      ioctl(a,b,c)
-+#ifdef    _BOOT
++#ifdef	_BOOT
 +#include <netinet/in.h>
 +extern int socket_read(int, void *, size_t, int);
 +extern int socket_close(int);
@@ -353,9 +308,9 @@
  #  define MS_CALLBACK   _far _loadds
 --- openssl-1.0.0e/crypto/sparcv9cap.c	2010-09-05 12:48:01.000000000 -0700
 +++ openssl-1.0.0e_patched/crypto/sparcv9cap.c	2011-12-23 05:24:02.011607700 -0800
-@@ -13,7 +13,11 @@
+@@ -12,7 +12,11 @@
+ #define SPARCV9_VIS2            (1<<3) /* reserved */
  #define SPARCV9_FMADD           (1<<4) /* reserved for SPARC64 V */
- #define SPARCV9_BLK             (1<<5)
 
 +#ifndef        _BOOT
  static int OPENSSL_sparcv9cap_P = SPARCV9_TICK_PRIVILEGED;
@@ -365,15 +320,15 @@
  
  int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
                  const BN_ULONG *np, const BN_ULONG *n0, int num)
-@@ -34,6 +38,7 @@
- unsigned long _sparcv9_rdtick(void);
- unsigned long _sparcv9_vis1_instrument(void);
+@@ -36,6 +40,7 @@
+ void _sparcv9_vis2_probe(void);
+ void _sparcv9_fmadd_probe(void);
  
 +#ifndef _BOOT
  unsigned long OPENSSL_rdtsc(void)
  {
      if (OPENSSL_sparcv9cap_P & SPARCV9_TICK_PRIVILEGED)
-@@ -45,8 +50,19 @@
+@@ -47,8 +52,19 @@
      else
          return _sparcv9_rdtick();
  }
@@ -396,7 +351,7 @@
   * and libmalloc.so.1 (see below for details)
 --- openssl-1.0.0e/crypto/sparccpuid.S	2010-09-05 12:48:01.000000000 -0700
 +++ openssl-1.0.0e_patched/crypto/sparccpuid.S	2012-02-13 07:42:58.259478325 -0800
-@@ -369,8 +369,13 @@
+@@ -397,8 +397,13 @@
  .type	OPENSSL_cleanse,#function
  .size	OPENSSL_cleanse,.-OPENSSL_cleanse
  
@@ -404,8 +359,8 @@
  .section	".init",#alloc,#execinstr
  	call	solaris_locking_setup
  	nop
- 	call	OPENSSL_cpuid_setup
- 	nop
+	call	OPENSSL_cpuid_setup
+	nop
 +#else
 +	nop
 +	nop
@@ -416,7 +371,7 @@
  
          p = s->s3->client_random;
 
-+#ifndef    _BOOT
++#ifndef	_BOOT
          if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0)
 +#else
 +        if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE) <= 0)
@@ -430,7 +385,7 @@
           * Apparently we're using a version-flexible SSL_METHOD (not at its
           * highest protocol version).
           */
-+#ifndef    _BOOT
++#ifndef	_BOOT
          if (s->ctx->method->version == SSLv23_method()->version) {
 +#else
 +        if (s->ctx->method->version == TLS1_2_VERSION) {

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list