From patchwork Wed Nov 8 12:11:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 835786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XZjRrOVW"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yX4t935s7z9s74 for ; Wed, 8 Nov 2017 23:12:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 58A6F8A611; Wed, 8 Nov 2017 12:12:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qY65mJz6E1b0; Wed, 8 Nov 2017 12:12:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2A0608A565; Wed, 8 Nov 2017 12:12:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 16E831C01A1 for ; Wed, 8 Nov 2017 12:12:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0D63989E7A for ; Wed, 8 Nov 2017 12:12:08 +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 90+8Zv62kb+e for ; Wed, 8 Nov 2017 12:12:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-it0-f65.google.com (mail-it0-f65.google.com [209.85.214.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6010381CDA for ; Wed, 8 Nov 2017 12:12:07 +0000 (UTC) Received: by mail-it0-f65.google.com with SMTP id r127so6195806itb.5 for ; Wed, 08 Nov 2017 04:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=q0npA46s2iMGQ06/i5RR4FKTm0dAJ9t+NwD8CtNo/Q0=; b=XZjRrOVWCzkmKasNVpxGiNT0XemFchlN4GMm1bcP4lVOpEWwhxa+onSdfU8/rtRoX4 vEYn1FMmyoH+b0v+2yZgA+8arWAMLxTNZ4YeX1Yq35WMRVIDymLNQNiDnlUOBs9oW8e/ UdmXgI5AIclmIPzWo9GUgXxtpTFZDNCPWXIiEh7vgFYCX7A/VhYCh0RWQLkvhSN5dIQ3 019VKL9L9r+o4IAXASmAeelBS4Kq6gRLkddV+K9B3CzgTAKzILaFZeDABLn/BBpezAVu dwOiIJwXKoQylrtWVl9j4ryAcM0rgjc6s9wmpnS9uhvpN7JZw7pjKVimYd200pdrWNrV PCGQ== 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; bh=q0npA46s2iMGQ06/i5RR4FKTm0dAJ9t+NwD8CtNo/Q0=; b=EuOLQpZHoXc78ALbb6fa8nSDSw9+YlCNkpwPc5so1SCWbbY6IfMmQjE29gTKenrHaH GFqehXdFlQtFa+vRk1BS4nt2DzKcw4KiQohBOu7bMzEFfjsCWTt0KeCAEGLya3W/yGaN jTOZmXEI/LDZxOO11eRxlFQh9cGYoVgyY4zWWAalvIBThltYOga1zmOZdQbODWufEb4K dcqx2oJVBntpavCgT7XLSW7Q0yWeNFPPFlwFRQA8xgDhgqeNu4XGQZKo67o7PcVlzq4A bNkdk1Lz6v/U0ZZOJMuJRRLb0XIq4yitNRQQi8xGvYXM0RNjzBpG/ATNfI3QNVmUz2fF 088w== X-Gm-Message-State: AJaThX7tCEx6CqosPVwBa6BzUsIxFd7yIQ4nHlvT6j81jjd35tU4gvj2 xBNWWsuKpFQfQlWhMGlBmqGTItC+ X-Google-Smtp-Source: ABhQp+R3UUYL+tK/yYeXJHOhbvJ/vjEE9Kys5md2eZQ0zDHzPOJnJeq4oL+ASIQ7k7JfaYnYCcoKCQ== X-Received: by 10.36.241.77 with SMTP id q13mr298231iti.123.1510143126295; Wed, 08 Nov 2017 04:12:06 -0800 (PST) Received: from localhost.localdomain (mail.codeblue.com. [65.183.183.198]) by smtp.gmail.com with ESMTPSA id t70sm1845858ioi.72.2017.11.08.04.12.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Nov 2017 04:12:05 -0800 (PST) From: Adam Duskett To: buildroot@buildroot.org Date: Wed, 8 Nov 2017 07:11:43 -0500 Message-Id: <20171108121143.5411-1-aduskett@gmail.com> X-Mailer: git-send-email 2.13.6 Subject: [Buildroot] [PATCH 1/1] ntp: add patch to support for libressl X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Duskett MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" NTP currently fails to compile against LibreSSL because of checks used to determine the SSL library version. Upstream-Status: Pending http://bugs.ntp.org/show_bug.cgi?id=3401#c3 Signed-off-by: Adam Duskett --- package/ntp/0004-libressl-support.patch | 107 ++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) 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 0000000000..2d046b4b09 --- /dev/null +++ b/package/ntp/0004-libressl-support.patch @@ -0,0 +1,107 @@ +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 +