components/openssl/openssl-1.0.1/patches/30_wanboot.patch
branchs11-update
changeset 3017 da8a40fb54dd
parent 2931 8e563e01c224
child 2041 3426b4846b15
child 3263 8766b70c7f00
equal deleted inserted replaced
3016:ef85b23b6885 3017:da8a40fb54dd
       
     1 #
       
     2 # This patch file makes the changes neccessary to build wanboot-openssl.o
       
     3 # binary. This is Solaris-specific: not suitable for upstream.
       
     4 #
     1 --- openssl-1.0.0g/Makefile.org	2010-01-27 08:06:58.000000000 -0800
     5 --- openssl-1.0.0g/Makefile.org	2010-01-27 08:06:58.000000000 -0800
     2 +++ openssl-1.0.0g-1/Makefile.org	2012-03-26 03:04:08.440194448 -0700
     6 +++ openssl-1.0.0g-1/Makefile.org	2012-03-26 03:04:08.440194448 -0700
     3 @@ -138,7 +138,13 @@
     7 @@ -138,7 +138,13 @@
     4 
     8 
     5  BASEADDR=
     9  BASEADDR=
    30  ENGDIRS= ccgost
    34  ENGDIRS= ccgost
    31  SHLIBDIRS= crypto ssl
    35  SHLIBDIRS= crypto ssl
    32 
    36 
    33 --- openssl-1.0.0e/crypto/cryptlib.c	2011-06-22 08:39:00.000000000 -0700
    37 --- openssl-1.0.0e/crypto/cryptlib.c	2011-06-22 08:39:00.000000000 -0700
    34 +++ openssl-1.0.0e_patched/crypto/cryptlib.c	2011-12-12 06:17:45.422476900 -0800
    38 +++ openssl-1.0.0e_patched/crypto/cryptlib.c	2011-12-12 06:17:45.422476900 -0800
    35 @@ -900,6 +900,10 @@
    39 @@ -415,6 +415,7 @@
       
    40  static void solaris_locking_callback(int mode, int type, const char *file,
       
    41      int line)
       
    42  	{
       
    43 +#ifndef	_BOOT
       
    44  	if (mode & CRYPTO_LOCK)
       
    45  		{
       
    46  		pthread_mutex_lock(&solaris_openssl_locks[type]);
       
    47 @@ -423,6 +424,7 @@
       
    48  		{
       
    49  		pthread_mutex_unlock(&solaris_openssl_locks[type]);
       
    50  		}
       
    51 +#endif
       
    52  	}
       
    53 
       
    54 
       
    55 @@ -456,6 +458,12 @@
       
    56  		}
       
    57  
       
    58  	/*
       
    59 +	 * pthread_* can't be used in wanboot.
       
    60 +	 * wanboot needs not be thread-safe and mutexes and locking callback
       
    61 +	 * function will not be setup for wanboot.
       
    62 +	 */
       
    63 +#ifndef	_BOOT
       
    64 +	/*
       
    65  	 * Set atfork handler so that child can setup its own mutexes and
       
    66  	 * locking callbacks when it is forked
       
    67  	 */
       
    68 @@ -478,7 +486,7 @@
       
    69  		pthread_mutex_init(&solaris_openssl_locks[i], NULL);
       
    70  		}
       
    71  	locking_callback = solaris_locking_callback;
       
    72 -
       
    73 +#endif
       
    74  	}
       
    75  
       
    76  void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
       
    77 @@ -979,6 +979,10 @@
    36  	MessageBox (NULL,buf,_T("OpenSSL: FATAL"),MB_OK|MB_ICONSTOP);
    78  	MessageBox (NULL,buf,_T("OpenSSL: FATAL"),MB_OK|MB_ICONSTOP);
    37  }
    79  }
    38  #else
    80  #else
    39 +/* Solaris libsa.a used for WAN boot doesn't provide for vfprintf(). Since
    81 +/* Solaris libsa.a used for WAN boot doesn't provide for vfprintf(). Since
    40 + *  * OPENSSL_showfatal() is not used anywhere else then here we can safely use
    82 + *  * OPENSSL_showfatal() is not used anywhere else then here we can safely use
    41 + *   * the code from 0.9.7d version. */
    83 + *   * the code from 0.9.7d version. */
    42 +#ifndef	_BOOT
    84 +#ifndef	_BOOT
    43  void OPENSSL_showfatal (const char *fmta,...)
    85  void OPENSSL_showfatal (const char *fmta,...)
    44  { va_list ap;
    86  { va_list ap;
    45  
    87  
    46 @@ -907,14 +911,21 @@
    88 @@ -986,14 +990,21 @@
    47      vfprintf (stderr,fmta,ap);
    89      vfprintf (stderr,fmta,ap);
    48      va_end (ap);
    90      va_end (ap);
    49  }
    91  }
    50 +#endif	/* _BOOT */
    92 +#endif	/* _BOOT */
    51  int OPENSSL_isservice (void) { return 0; }
    93  int OPENSSL_isservice (void) { return 0; }
   323  /* This code path is disabled, because of incompatibility of
   365  /* This code path is disabled, because of incompatibility of
   324   * libdevinfo.so.1 and libmalloc.so.1 (see below for details)
   366   * libdevinfo.so.1 and libmalloc.so.1 (see below for details)
   325   */
   367   */
   326 --- openssl-1.0.0e/crypto/sparccpuid.S	2010-09-05 12:48:01.000000000 -0700
   368 --- openssl-1.0.0e/crypto/sparccpuid.S	2010-09-05 12:48:01.000000000 -0700
   327 +++ openssl-1.0.0e_patched/crypto/sparccpuid.S	2012-02-13 07:42:58.259478325 -0800
   369 +++ openssl-1.0.0e_patched/crypto/sparccpuid.S	2012-02-13 07:42:58.259478325 -0800
   328 @@ -397,6 +397,11 @@
   370 @@ -397,8 +397,13 @@
   329  .type	OPENSSL_cleanse,#function
   371  .type	OPENSSL_cleanse,#function
   330  .size	OPENSSL_cleanse,.-OPENSSL_cleanse
   372  .size	OPENSSL_cleanse,.-OPENSSL_cleanse
   331  
   373  
   332 +#ifndef _BOOT
   374 +#ifndef _BOOT
   333  .section	".init",#alloc,#execinstr
   375  .section	".init",#alloc,#execinstr
       
   376  	call	solaris_locking_setup
       
   377  	nop
   334 	call	OPENSSL_cpuid_setup
   378 	call	OPENSSL_cpuid_setup
   335 	nop
   379 	nop
   336 +#else
   380 +#else
   337 +	nop
   381 +	nop
   338 +	nop
   382 +	nop