Some additions from the OpenSSL docs:

OPENSSL_malloc_init() sets the lower-level memory allocation functions
to their default implementation.
It is generally not necessary to call this, except perhaps in certain
shared-library situations.

and from INSTALL.W32

One final comment about compiling applications linked to the OpenSSL library.
 If you don't use the multithreaded DLL runtime library (/MD option) your
 program will almost certainly crash because malloc gets confused -- the
 OpenSSL DLLs are statically linked to one version, the application must
 not use a different one.  You might be able to work around such problems
 by adding CRYPTO_malloc_init() to your program before any calls to the
 OpenSSL libraries: This tells the OpenSSL libraries to use the same
 malloc(), free() and realloc() as the application.  However there are many
 standard library functions used by OpenSSL that call malloc() internally
 (e.g. fopen()), and OpenSSL cannot change these; so in general you cannot
 rely on CRYPTO_malloc_init() solving your problem, and you should
 consistently use the multithreaded library.

I can't currently judge myself, whether we can safely remove the call to CRYPTO_malloc_init, but to me it looks like if it was needed before the rename, we should keep it and rename to OPENSSL_malloc_init.

Regards,

Rainer

Am 18.01.2016 um 10:28 schrieb Rainer Jung:
Hi Bill,

According to the log message of the OpenSSL commit
bbd86bf5424a611cb6b77a3a17fc522931c4dcb8 (January 7th), we might need to
use OPENSSL_malloc_init instead:

"Rename CRYPTO_malloc_init to OPENSSL_malloc_init; remove needless calls."

I didn't look for details though.

Regards,

Rainer

Am 13.01.2016 um 03:16 schrieb billbar...@apache.org:
Author: billbarker
Date: Wed Jan 13 02:16:18 2016
New Revision: 1724345

URL: http://svn.apache.org/viewvc?rev=1724345&view=rev
Log:
It seems that CRYPTO_malloc_init has been removed from OpenSSL master,
but not yet from the header files. Waiting for next Gump run to see if
anything else is missing before porting to trunk

Modified:
     tomcat/native/branches/1.1.x/native/src/ssl.c

Modified: tomcat/native/branches/1.1.x/native/src/ssl.c
URL:
http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/ssl.c?rev=1724345&r1=1724344&r2=1724345&view=diff

==============================================================================

--- tomcat/native/branches/1.1.x/native/src/ssl.c (original)
+++ tomcat/native/branches/1.1.x/native/src/ssl.c Wed Jan 13 02:16:18
2016
@@ -462,7 +462,7 @@ static void ssl_dyn_lock_function(int mo
      else {
          apr_thread_mutex_unlock(l->mutex);
      }
-}
+

  /*
   * Dynamic lock destruction callback
@@ -661,11 +661,12 @@ TCN_IMPLEMENT_CALL(jint, SSL, initialize
          ssl_initialized = 0;
          return (jint)APR_EINVAL;
      }
-#endif
+
      /* We must register the library in full, to ensure our
configuration
       * code can successfully test the SSL environment.
       */
      CRYPTO_malloc_init();
+#endif
      ERR_load_crypto_strings();
      SSL_load_error_strings();
      SSL_library_init();

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to