]> granicus.if.org Git - apache/commit
PR60947: avoid CRYPTO_THREADID_set_callback() if possible
authorJacob Champion <jchampion@apache.org>
Tue, 18 Apr 2017 00:19:32 +0000 (00:19 +0000)
committerJacob Champion <jchampion@apache.org>
Tue, 18 Apr 2017 00:19:32 +0000 (00:19 +0000)
commit7b2bdcea91c8db88f572bfb495619356ed9a8ed5
tree0e0eb95cc42cc7c174c14a5bc46f5c33b232754b
parentd06424f11601e0389ed3d0b5d8f841a1a4d50a4f
PR60947: avoid CRYPTO_THREADID_set_callback() if possible

CRYPTO_THREADID_set_callback() is write-once, so if mod_ssl is unloaded
and reloaded into a different address, we'll crash if OpenSSL wasn't
also unloaded and reloaded at the same time. This can happen if another
module or library is using OpenSSL as well.

- OpenSSL 1.1.0 isn't affected.
- Certain platforms (Windows, BeOS, and POSIX-compliant systems) can
  make use of the default THREADID callback in OpenSSL 1.0.x.
- If the deprecated CRYPTO_set_id_callback() is available, we can use it
  instead of CRYPTO_THREADID_set_callback().

Otherwise, we have to fall back to CRYPTO_THREADID_set_callback(), but
hopefully that applies to a small percentage of users at this point.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/trunk-openssl-threadid@1791732 13f79535-47bb-0310-9956-ffa450edef68
acinclude.m4
modules/ssl/ssl_util.c