components/openssl/common/patches/029-fork_safe.patch
changeset 4822 1fb8a14c6702
parent 4425 114f035efde7
child 6619 57ad7bed64ee
equal deleted inserted replaced
4821:54dafbe33fdb 4822:1fb8a14c6702
    58 +     * setting of another locking callback.
    58 +     * setting of another locking callback.
    59 +     */
    59 +     */
    60  }
    60  }
    61 
    61 
    62  void (*CRYPTO_get_locking_callback(void)) (int mode, int type,
    62  void (*CRYPTO_get_locking_callback(void)) (int mode, int type,
    63 @@ -402,6 +414,129@@
    63 @@ -402,6 +414,128@@
    64      return (add_lock_callback);
    64      return (add_lock_callback);
    65  }
    65  }
    66 
    66 
    67 +/*
    67 +/*
    68 + * This is the locking callback function which all applications will be
    68 + * This is the locking callback function which all applications will be
    75 +        pthread_mutex_lock(&solaris_openssl_locks[type]);
    75 +        pthread_mutex_lock(&solaris_openssl_locks[type]);
    76 +    } else {
    76 +    } else {
    77 +        pthread_mutex_unlock(&solaris_openssl_locks[type]);
    77 +        pthread_mutex_unlock(&solaris_openssl_locks[type]);
    78 +    }
    78 +    }
    79 +}
    79 +}
    80 +
       
    81 +
    80 +
    82 +/*
    81 +/*
    83 + * Implement Solaris's own dynamic locking routines.
    82 + * Implement Solaris's own dynamic locking routines.
    84 + */
    83 + */
    85 +static struct CRYPTO_dynlock_value *
    84 +static struct CRYPTO_dynlock_value *
   215 +     * thread and disallow setting the threadid callback.
   214 +     * thread and disallow setting the threadid callback.
   216 +     */
   215 +     */
   217      return 1;
   216      return 1;
   218  }
   217  }
   219  
   218  
   220 @@ -531,7 +611,10 @@
   219 @@ -529,7 +669,10 @@
   221  
   220  
   222  void CRYPTO_set_id_callback(unsigned long (*func) (void))
   221  void CRYPTO_set_id_callback(unsigned long (*func) (void))
   223  {
   222  {
   224 -    id_callback = func;
   223 -    id_callback = func;
   225 +    /*
   224 +    /*
   240  #ifdef  __cplusplus
   239  #ifdef  __cplusplus
   241  }
   240  }
   242  #endif
   241  #endif
   243 --- openssl-1.0.1f/crypto/sparccpuid.S.~1~	Fri Feb  7 10:41:37 2014
   242 --- openssl-1.0.1f/crypto/sparccpuid.S.~1~	Fri Feb  7 10:41:37 2014
   244 +++ openssl-1.0.1f/crypto/sparccpuid.S	Thu Feb  6 16:04:14 2014
   243 +++ openssl-1.0.1f/crypto/sparccpuid.S	Thu Feb  6 16:04:14 2014
   245 @@ -398,5 +398,7 @@
   244 @@ -525,5 +525,7 @@
   246  .size	OPENSSL_cleanse,.-OPENSSL_cleanse
   245  .size	_sparcv9_vis1_instrument_bus2,.-_sparcv9_vis1_instrument_bus2
   247 
   246 
   248  .section	".init",#alloc,#execinstr
   247  .section	".init",#alloc,#execinstr
   249 +	call	solaris_locking_setup
   248 +	call	solaris_locking_setup
   250 +	nop
   249 +	nop
   251  	call	OPENSSL_cpuid_setup
   250  	call	OPENSSL_cpuid_setup
   263  	call	OPENSSL_cpuid_setup
   262  	call	OPENSSL_cpuid_setup
   264  
   263  
   265  .hidden	OPENSSL_ia32cap_P
   264  .hidden	OPENSSL_ia32cap_P
   266 --- openssl-1.0.1f/crypto/x86cpuid.pl.~1~	Wed Feb 12 13:38:03 2014
   265 --- openssl-1.0.1f/crypto/x86cpuid.pl.~1~	Wed Feb 12 13:38:03 2014
   267 +++ openssl-1.0.1f/crypto/x86cpuid.pl	Wed Feb 12 13:38:31 2014
   266 +++ openssl-1.0.1f/crypto/x86cpuid.pl	Wed Feb 12 13:38:31 2014
   268 @@ -353,6 +353,7 @@
   267 @@ -379,8 +379,10 @@
   269  	&ret	();
   268  	&ret	();
   270  &function_end_B("OPENSSL_ia32_rdrand");
   269  &function_end_B("OPENSSL_ia32_rdseed");
   271  
   270  
   272 +&initseg("solaris_locking_setup");
   271 +&initseg("solaris_locking_setup");
   273  &initseg("OPENSSL_cpuid_setup");
   272  &initseg("OPENSSL_cpuid_setup");
   274  
   273  
   275  &asm_finish();
   274 +&hidden("solaris_locking_setup");
       
   275  &hidden("OPENSSL_cpuid_setup");
       
   276  &hidden("OPENSSL_ia32cap_P");
       
   277