[Git][NTPsec/ntpsec][master] Fix build with LibreSSL
Matt Selsky
gitlab at mg.gitlab.com
Sun Feb 5 22:01:43 UTC 2017
Matt Selsky pushed to branch master at NTPsec / ntpsec
Commits:
68053b01 by Matt Selsky at 2017-02-05T16:59:14-05:00
Fix build with LibreSSL
LibreSSL uses the OpenSSL 1.0 API, but reports itself as OpenSSL 2.0
- - - - -
3 changed files:
- devel/ifdex-ignores
- libntp/ssl_init.c
- wafhelpers/check_openssl.py
Changes:
=====================================
devel/ifdex-ignores
=====================================
--- a/devel/ifdex-ignores
+++ b/devel/ifdex-ignores
@@ -58,6 +58,7 @@ NTP_API
# OpenSSL
OPENSSL_VERSION_NUMBER
+LIBRESSL_VERSION_NUMBER
# Things WAF sets that don't get #undefs if they're not set
ENABLE_EARLY_DROPROOT
=====================================
libntp/ssl_init.c
=====================================
--- a/libntp/ssl_init.c
+++ b/libntp/ssl_init.c
@@ -14,7 +14,7 @@
#include <openssl/evp.h>
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
void atexit_ssl_cleanup(void);
#endif
@@ -28,7 +28,7 @@ ssl_init(void)
init_lib();
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
OpenSSL_add_all_digests();
atexit(&atexit_ssl_cleanup);
#endif
@@ -37,7 +37,7 @@ ssl_init(void)
}
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
void
atexit_ssl_cleanup(void)
{
=====================================
wafhelpers/check_openssl.py
=====================================
--- a/wafhelpers/check_openssl.py
+++ b/wafhelpers/check_openssl.py
@@ -5,7 +5,7 @@ int main(void) {
#if OPENSSL_VERSION_NUMBER < 0x0090704fL
#error OpenSSL is too old.
#endif
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
OpenSSL_add_all_digests();
#endif
return 0;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/68053b017a954b7d37279cbe5fec279841ba7d82
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170205/f527363a/attachment.html>
More information about the vc
mailing list