tls/openssl: add LibreSSL support
OpenSSL and LibreSSL versions are incompatible. Moreover, LibreSSL always define OPENSSL_VERSION_NUMBER as 0x20000000L. Instead of checking for LibreSSL everywhere explicitly, redefine OPENSSL_VERSION_NUMBER. See similar issues with nginx project: https://trac.nginx.org/nginx/ticket/1605
This commit is contained in:
@@ -31,6 +31,22 @@
|
|||||||
#include "tls.h"
|
#include "tls.h"
|
||||||
#include "sock.h"
|
#include "sock.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Redefine OPENSSL_VERSION_NUMBER for LibreSSL.
|
||||||
|
* LibreSSL and OpenSSL use different and incompatible version schemes. Solve
|
||||||
|
* this issue in the way how nginx project did.
|
||||||
|
*/
|
||||||
|
#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L)
|
||||||
|
#undef OPENSSL_VERSION_NUMBER
|
||||||
|
#if (LIBRESSL_VERSION_NUMBER >= 0x2080000fL)
|
||||||
|
#define OPENSSL_VERSION_NUMBER 0x1010000fL
|
||||||
|
#elif (LIBRESSL_VERSION_NUMBER >= 0x2070000fL)
|
||||||
|
#define OPENSSL_VERSION_NUMBER 0x1000200fL
|
||||||
|
#else
|
||||||
|
#define OPENSSL_VERSION_NUMBER 0x1000107fL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _tls {
|
struct _tls {
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
sock_t sock;
|
sock_t sock;
|
||||||
|
|||||||
Reference in New Issue
Block a user