From patchwork Fri Jul 14 18:15:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 788714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x8LVf2DyRz9s78 for ; Sat, 15 Jul 2017 04:16:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="u8VDdU1b"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 73976890BD; Fri, 14 Jul 2017 18:16:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dvTmIH68TKEf; Fri, 14 Jul 2017 18:16:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 3FEA889148; Fri, 14 Jul 2017 18:16:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E57131C42AA for ; Fri, 14 Jul 2017 18:16:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DDE5888327 for ; Fri, 14 Jul 2017 18:16:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m-zQpcfRfRsf for ; Fri, 14 Jul 2017 18:16:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-io0-f195.google.com (mail-io0-f195.google.com [209.85.223.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0742187B3F for ; Fri, 14 Jul 2017 18:16:08 +0000 (UTC) Received: by mail-io0-f195.google.com with SMTP id f66so2881294iof.1 for ; Fri, 14 Jul 2017 11:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pE6B79wAPHbF8dosNVQqnAvW/Mg32DnfwHXCf9FOWTk=; b=u8VDdU1byKvOGdVwMhcw6/p4qvAONjPOtAfqYMKuf6FLNr6U+GOPKDbE4EM0P8B6Iq m8PYwrnYP9bcmXnwGmqPFQkLUSDb8TVizgGmJVMSjzvX8QVjiS8o4dnZJ8yhmpDTWBtU FPdCqVjalXfhaeUmRSjGeO61VxNChimQRffUZmY+Mbbj0EOXoJP7iJ7DSKVQyPDv3MLG qqJwu2/6MSgNEXX72W8xGSnjGlrDf6gJ2yVJ4c6r020S+YoGOvY0avNqlcYTdM2UBCm9 MAjzLIODY5f8VKTq7Y1KY7AKlemgQ5jqZKTnrkMmSO5TAEvrZ6VFnusAEVvs/3e3rafj ZPfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pE6B79wAPHbF8dosNVQqnAvW/Mg32DnfwHXCf9FOWTk=; b=EcUUTCzBJ5xp61vjHfWEadmUak6RT7N1aZ1pzi0gWzQYufFQoOEVtr81Z73cphtKqb NPN9RzdF0T765y7NqL2aLxy/b3I5aeH/KgBzCDO7aQAm63vfuPW+n+9J50+cSWgZ7/Uu sMn/uJVWunckKCQ/r7PIVXvUH+CP7/sQpR2lgsTfJNaLqtGHzJC18VYdDVGukInkmDbH sscQyYKv4CLWOMwwdCd0YDi0HO86p3c1C6kRsDV0ZbqroBElJpeXd1iKEw2aI27xvf6Q NHFl4K6uLfQvwLr3lLCQ9Lt+tyviVCnlhi8+HaqB8BkiNXWSGhferV/VzP/Qa8nosIMe 3ejw== X-Gm-Message-State: AIVw110PfhRE5u2e3/wAyWfcUZ1lHnvzzbGbtw0iw6h5PgSmPtb9ePHU TNH9m63PzBPa+c/2434= X-Received: by 10.107.156.132 with SMTP id f126mr759112ioe.78.1500056167129; Fri, 14 Jul 2017 11:16:07 -0700 (PDT) Received: from localhost.localdomain (mail.codeblue.com. [65.183.183.198]) by smtp.gmail.com with ESMTPSA id u201sm1550305ita.16.2017.07.14.11.16.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jul 2017 11:16:06 -0700 (PDT) From: Adam Duskett To: buildroot@buildroot.org Date: Fri, 14 Jul 2017 14:15:33 -0400 Message-Id: <20170714181537.17479-11-aduskett@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170714181537.17479-1-aduskett@gmail.com> References: <20170714181537.17479-1-aduskett@gmail.com> Cc: Adam Duskett Subject: [Buildroot] [PATCH 11/15] ntp: support libressl X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- 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 +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 +--- + 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 +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 + +-#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