-
Notifications
You must be signed in to change notification settings - Fork 164
Fix compilation without deprecated OpenSSL 1.1 APIs #122
Conversation
There seems to be an unterminated ifdef in here. Trying to work this one out. |
All threading APIs are gone with 1.1. dh.h header does not get included with ssl.h automatically when deprecated APIs are disabled. X509_getBefore/After were replaced with get0 and getm variants. Switched to the former as it can be const.
I added a space. Seems to work now? |
Reorganized the ifdef maze. Should be more readable and consistent (only < #if statements) |
With this, it seems that the only time either It's easier to read with indents: #if OPENSSL_VERSION_NUMBER < 0x10100000L
#ifndef WIN32
#define _HTP_tid (unsigned long)pthread_self()
#else
#define _HTP_tid pthread_self().p
#endif
#if OPENSSL_VERSION_NUMBER < 0x10000000L
static unsigned long
htp__ssl_get_thread_id_(void)
{
return _HTP_tid;
}
#else
static void
htp__ssl_get_thread_id_(CRYPTO_THREADID *id)
{
CRYPTO_THREADID_set_numeric(id, _HTP_tid);
}
#endif
#endif It doesn't seem like this is the expected result, I could be wrong, can you verify? |
I think this is what we needed. Can you verify? #ifndef WIN32
#define _HTP_tid (unsigned long)pthread_self()
#else
#define _HTP_tid pthread_self().p
#endif
#if OPENSSL_VERSION_NUMBER < 0x10000000L
static unsigned long
htp__ssl_get_thread_id_(void)
{
return _HTP_tid;
}
#else
static void
htp__ssl_get_thread_id_(CRYPTO_THREADID * id)
{
CRYPTO_THREADID_set_numeric(id, _HTP_tid);
}
#endif |
Seems correct. I changed tid from unsigned long to a define as it was warning about some const issue. edit: regarding indents.
|
I tested on an older box with 0.8 and it compiles fine. I'm going to make those mods and merge all the changes in. Thanks again. |
All threading APIs are gone with 1.1.
dh.h header does not get included with ssl.h automatically when deprecated
APIs are disabled.
X509_getBefore/After were replaced with get0 and getm variants. Switched
to the former as it can be const.