[Question] bind 9.11 source code for openssl_link.c

tec tecabu at gmail.com
Thu Apr 12 02:29:59 UTC 2018


Hi all,

Have a question at OpenSSL code on bind9.11.3.
from target file : openssl_link.c

I read source code,
it's looks like so that the "lock_callback" function may define it in
case of OpenSSL version more than 1.0 or less than 1.1. *1

However, I looks like the code line number 206 (in openssl_link.c) is
in case of OpenSSL version less than 1.1 on call of function
"lock_callback()". *2
Which is right?

I tried compile in rhel5 at now.(openssl 0.9.8 ......)
It'll be a compile error at this code line.
And when delete this code, any problems?


#### *1
106 #if OPENSSL_VERSION_NUMBER >= 0x10000000L &&
OPENSSL_VERSION_NUMBER < 0x10100000L ||
defined(LIBRESSL_VERSION_NUMBER)
107 static void
108 lock_callback(int mode, int type, const char *file, int line) {
109         UNUSED(file);
110         UNUSED(line);
111         if ((mode & CRYPTO_LOCK) != 0)
112                 LOCK(&locks[type]);
113         else
114                 UNLOCK(&locks[type]);
115 }
116 #endif


#### *2
206 #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
207         nlocks = CRYPTO_num_locks();
208         locks = mem_alloc(sizeof(isc_mutex_t) * nlocks FILELINE);
209         if (locks == NULL)
210                 return (ISC_R_NOMEMORY);
211         result = isc_mutexblock_init(locks, nlocks);
212         if (result != ISC_R_SUCCESS)
213                 goto cleanup_mutexalloc;
214         CRYPTO_set_locking_callback(lock_callback);
215 # if OPENSSL_VERSION_NUMBER >= 0x10000000L &&
OPENSSL_VERSION_NUMBER < 0x10100000L
216         CRYPTO_THREADID_set_callback(_set_thread_id);
217 # else
218         CRYPTO_set_id_callback(id_callback);
219 # endif
220
221         ERR_load_crypto_strings();
222 #endif

regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20180412/9a1ef3df/attachment.html>


More information about the bind-users mailing list