]> git.kaiwu.me - nginx.git/commitdiff
SSL: fixed build with LibreSSL 2.8.0 (ticket #1605).
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 10 Aug 2018 17:49:06 +0000 (20:49 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 10 Aug 2018 17:49:06 +0000 (20:49 +0300)
LibreSSL 2.8.0 "added const annotations to many existing APIs from OpenSSL,
making interoperability easier for downstream applications".  This includes
the const change in the SSL_CTX_sess_set_get_cb() callback function (see
9dd43f4ef67e), which breaks compilation.

To fix this, added a condition on how we redefine OPENSSL_VERSION_NUMBER
when working with LibreSSL (see 382fc7069e3a).  With LibreSSL 2.8.0,
we now set OPENSSL_VERSION_NUMBER to 0x1010000fL (OpenSSL 1.1.0), so the
appropriate conditions in the code will use "const" as it happens with
OpenSSL 1.1.0 and later versions.

src/event/ngx_event_openssl.h

index 1962aa016fd2b938063af8402fdf44d87c91ca35..159deb7fb2f09f0df8110a23dbba84a0f4dcf6ea 100644 (file)
 
 #if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L)
 #undef OPENSSL_VERSION_NUMBER
+#if (LIBRESSL_VERSION_NUMBER >= 0x2080000fL)
+#define OPENSSL_VERSION_NUMBER  0x1010000fL
+#else
 #define OPENSSL_VERSION_NUMBER  0x1000107fL
 #endif
+#endif
 
 
 #if (OPENSSL_VERSION_NUMBER >= 0x10100001L)