From: Adam Duskett <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 11/15] ntp: support libressl
Date: Fri, 14 Jul 2017 14:15:33 -0400 [thread overview]
Message-ID: <20170714181537.17479-11-aduskett@gmail.com> (raw)
In-Reply-To: <20170714181537.17479-1-aduskett@gmail.com>
In addition, add the patch 0004-libressl-support.patch
This fixes some preprocessor checks that determine whether
or not to use OpenSSL 1.1 or 1.0.x. Because LibreSSL returns 2.x
the macros think that OpenSSL 1.1 should be used. This patch
checks to see if there is an LIBRESSL_VERSION_NUMBER defined
as well.
Upstream-Status: Pending
http://bugs.ntp.org/show_bug.cgi?id=3401#c3
Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
package/ntp/0004-libressl-support.patch | 105 ++++++++++++++++++++++++++++++++
package/ntp/Config.in | 2 +-
package/ntp/ntp.mk | 9 ++-
3 files changed, 114 insertions(+), 2 deletions(-)
create mode 100644 package/ntp/0004-libressl-support.patch
diff --git a/package/ntp/0004-libressl-support.patch b/package/ntp/0004-libressl-support.patch
new file mode 100644
index 000000000..2ac4ee89d
--- /dev/null
+++ b/package/ntp/0004-libressl-support.patch
@@ -0,0 +1,106 @@
+From a3bd714d3028241c7546ded6ae6b93887a17a7fa Mon Sep 17 00:00:00 2001
+From: Adam Duskett <aduskett@gmail.com>
+Date: Wed, 12 Jul 2017 09:14:38 -0400
+Subject: [PATCH] add libressl support
+
+Fix some preprocessor macros to add libressl support.
+Upstream-Status: Pending
+http://bugs.ntp.org/show_bug.cgi?id=3401#c3
+
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+---
+ include/libssl_compat.h | 4 +++-
+ libntp/libssl_compat.c | 2 +-
+ libntp/ssl_init.c | 2 +-
+ ports/winnt/include/msvc_ssl_autolib.h | 2 +-
+ sntp/libevent/test/regress_ssl.c | 4 ++--
+ 5 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/include/libssl_compat.h b/include/libssl_compat.h
+index 2a3697c..eede47b 100644
+--- a/include/libssl_compat.h
++++ b/include/libssl_compat.h
+@@ -25,8 +25,10 @@
+ #include "openssl/rsa.h"
+
+ #ifndef OPENSSL_VERSION_NUMBER
++#ifndef LIBRESSL_VERSION_NUMBER
+ #define OPENSSL_VERSION_NUMBER SSLEAY_VERSION_NUMBER
+ #endif
++#endif
+
+ #ifndef OPENSSL_VERSION_TEXT
+ #define OPENSSL_VERSION_TEXT SSLEAY_VERSION_TEXT
+@@ -37,7 +39,7 @@
+ #endif
+
+ /* ----------------------------------------------------------------- */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ /* ----------------------------------------------------------------- */
+
+ # include <openssl/objects.h>
+diff --git a/libntp/libssl_compat.c b/libntp/libssl_compat.c
+index afe4d07..dae7017 100644
+--- a/libntp/libssl_compat.c
++++ b/libntp/libssl_compat.c
+@@ -26,7 +26,7 @@
+ /* ----------------------------------------------------------------- */
+
+ /* ----------------------------------------------------------------- */
+-#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L
++#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ /* ----------------------------------------------------------------- */
+
+ #include "libssl_compat.h"
+diff --git a/libntp/ssl_init.c b/libntp/ssl_init.c
+index bebf6e1..0a27050 100644
+--- a/libntp/ssl_init.c
++++ b/libntp/ssl_init.c
+@@ -21,7 +21,7 @@
+
+ int ssl_init_done;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ static void
+ atexit_ssl_cleanup(void)
+diff --git a/ports/winnt/include/msvc_ssl_autolib.h b/ports/winnt/include/msvc_ssl_autolib.h
+index 688b5e2..393e1c9 100644
+--- a/ports/winnt/include/msvc_ssl_autolib.h
++++ b/ports/winnt/include/msvc_ssl_autolib.h
+@@ -85,7 +85,7 @@
+ * request in the object file, depending on the SSL version and the
+ * build variant.
+ */
+-# if OPENSSL_VERSION_NUMBER >= 0x10100000L
++# if OPENSSL_VERSION_NUMBER >= 0x10100000L && ! defined(LIBRESSL_VERSION_NUMBER)
+ # pragma comment(lib, "libcrypto" LTAG_SIZE LTAG_RTLIB LTAG_DEBUG ".lib")
+ # else
+ # pragma comment(lib, "libeay32" LTAG_RTLIB LTAG_DEBUG ".lib")
+diff --git a/sntp/libevent/test/regress_ssl.c b/sntp/libevent/test/regress_ssl.c
+index 226a2a3..dc761dc 100644
+--- a/sntp/libevent/test/regress_ssl.c
++++ b/sntp/libevent/test/regress_ssl.c
+@@ -61,7 +61,7 @@
+
+ #include <string.h>
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) || defined(LIBRESSL_VERSION_NUMBER)
+ #define OpenSSL_version_num SSLeay
+ #endif /* OPENSSL_VERSION_NUMBER */
+
+@@ -130,7 +130,7 @@ getcert(void)
+ X509_set_subject_name(x509, name);
+ X509_set_issuer_name(x509, name);
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ X509_time_adj(X509_get_notBefore(x509), 0, &now);
+ now += 3600;
+ X509_time_adj(X509_get_notAfter(x509), 0, &now);
+--
+2.13.0
+
diff --git a/package/ntp/Config.in b/package/ntp/Config.in
index 1af02dbc0..804efec54 100644
--- a/package/ntp/Config.in
+++ b/package/ntp/Config.in
@@ -1,7 +1,7 @@
config BR2_PACKAGE_NTP
bool "ntp"
select BR2_PACKAGE_LIBEVENT
- select BR2_PACKAGE_OPENSSL
+ select BR2_PACKAGE_OPENSSL if !BR2_PACKAGE_LIBRESSL
help
Network Time Protocol suite/programs.
Provides things like ntpd, ntpdate, ntpq, etc...
diff --git a/package/ntp/ntp.mk b/package/ntp/ntp.mk
index c70d6e635..929a5fd87 100644
--- a/package/ntp/ntp.mk
+++ b/package/ntp/ntp.mk
@@ -7,7 +7,7 @@
NTP_VERSION_MAJOR = 4.2
NTP_VERSION = $(NTP_VERSION_MAJOR).8p10
NTP_SITE = https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$(NTP_VERSION_MAJOR)
-NTP_DEPENDENCIES = host-pkgconf libevent openssl $(if $(BR2_PACKAGE_BUSYBOX),busybox)
+NTP_DEPENDENCIES = host-pkgconf libevent $(if $(BR2_PACKAGE_BUSYBOX),busybox)
NTP_LICENSE = NTP
NTP_LICENSE_FILES = COPYRIGHT
NTP_CONF_ENV = ac_cv_lib_md5_MD5Init=no
@@ -24,6 +24,13 @@ NTP_CONF_OPTS = \
# 0003-ntpq-fpic.patch
NTP_AUTORECONF = YES
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+NTP_DEPENDENCIES += openssl
+endif
+ifeq ($(BR2_PACKAGE_LIBRESSL),y)
+NTP_DEPENDENCIES += libressl
+endif
+
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),y)
NTP_CONF_OPTS += --with-locfile=linux
else
--
2.13.0
next prev parent reply other threads:[~2017-07-14 18:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 18:15 [Buildroot] [PATCH 01/15] libressl: bump version to 2.5.5 Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 02/15] libwebsockets: support libressl Adam Duskett
2017-07-14 22:08 ` Thomas Petazzoni
2017-07-15 17:32 ` Adam Duskett
2017-07-18 19:38 ` Arnout Vandecappelle
2017-07-14 18:15 ` [Buildroot] [PATCH 03/15] libevent: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 04/15] libcurl: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 05/15] libsrtp: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 06/15] apr-uti: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 07/15] openssh: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 08/15] snmppp: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 09/15] syslog-ng: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 10/15] netsnmp: " Adam Duskett
2017-07-14 18:15 ` Adam Duskett [this message]
2017-07-14 18:15 ` [Buildroot] [PATCH 12/15] postgresql: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 13/15] swupdate: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 14/15] janus-gateway: " Adam Duskett
2017-07-14 18:15 ` [Buildroot] [PATCH 15/15] sngrep: " Adam Duskett
2017-07-15 7:13 ` [Buildroot] [PATCH 01/15] libressl: bump version to 2.5.5 Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170714181537.17479-11-aduskett@gmail.com \
--to=aduskett@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox