From patchwork Tue Oct 31 17:22:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Voss X-Patchwork-Id: 832650 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yRJ8c41CWz9sNr for ; Wed, 1 Nov 2017 04:23:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4CC1D8821F; Tue, 31 Oct 2017 17:23: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 j6O84xT05-no; Tue, 31 Oct 2017 17:23:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id A70BD881E1; Tue, 31 Oct 2017 17:23:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 75E5D1C0AD9 for ; Tue, 31 Oct 2017 17:23:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6CF9330473 for ; Tue, 31 Oct 2017 17:23:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vp-VU82yicba for ; Tue, 31 Oct 2017 17:23:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs02.rockwellcollins.com (smtpimr.rockwellcollins.com [205.175.225.241]) by silver.osuosl.org (Postfix) with ESMTPS id 4F28E30419 for ; Tue, 31 Oct 2017 17:23:02 +0000 (UTC) Received: from ofwgwc03.rockwellcollins.com (HELO dtulimr02.rockwellcollins.com) ([205.175.225.12]) by secvs02.rockwellcollins.com with ESMTP; 31 Oct 2017 12:23:00 -0500 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by dtulimr02.rockwellcollins.com (Postfix) with ESMTP id 033602006C; Tue, 31 Oct 2017 12:23:00 -0500 (CDT) From: Sam Voss To: buildroot@buildroot.org Date: Tue, 31 Oct 2017 12:22:58 -0500 Message-Id: <1509470578-42323-2-git-send-email-sam.voss@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509470578-42323-1-git-send-email-sam.voss@rockwellcollins.com> References: <1509470578-42323-1-git-send-email-sam.voss@rockwellcollins.com> Cc: Sam Voss Subject: [Buildroot] [PATCH v4 2/2] package/libssh2: Add selectable crypto libraries 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" Add functionality to allow crypto libraries for libssh2 to be selectable by a choice instead of a fallback that may not work in all cases. Previous fallback is maintained from within the "defaults" of the choice menu, but can be overridden by making a choice. This fixes issues where two crypto libraries are present on the system, but the fallback order picks the wrong one. Signed-off-by: Sam Voss --- [v2->v3] - Fix comment about favoring mbedtls [v1->v2] - Do not have comments when crypo is not selected, select it instead. - Do not select OpenSSL by default when libssh2 is selected if no others are chosen --- package/libssh2/Config.in | 24 +++++++++++++++++++++++- package/libssh2/libssh2.mk | 6 +++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/package/libssh2/Config.in b/package/libssh2/Config.in index 9b60823..fcdbbf3 100644 --- a/package/libssh2/Config.in +++ b/package/libssh2/Config.in @@ -1,6 +1,5 @@ config BR2_PACKAGE_LIBSSH2 bool "libssh2" - select BR2_PACKAGE_OPENSSL if !(BR2_PACKAGE_MBEDTLS || BR2_PACKAGE_LIBGCRYPT) help libssh2 is a client-side C library implementing the SSH2 protocol as defined by Internet Drafts: SECSH-TRANS(22), @@ -8,3 +7,26 @@ config BR2_PACKAGE_LIBSSH2 SECSH-FILEXFER(06)*, SECSH-DHGEX(04), and SECSH-NUMBERS(10) http://www.libssh2.org/ + +if BR2_PACKAGE_LIBSSH2 + +choice + prompt "Crypto Backend" + help + Select crypto library to be used in libssh2. + +config BR2_PACKAGE_LIBSSH2_MBEDTLS + select BR2_PACKAGE_MBEDTLS + bool "mbedtls" + +config BR2_PACKAGE_LIBSSH2_LIBGCRYPT + select BR2_PACKAGE_LIBGCRYPT + depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS # libgcrypt -> libgpg-error + bool "gcrypt" + +config BR2_PACKAGE_LIBSSH2_OPENSSL + select BR2_PACKAGE_OPENSSL + bool "openssl" + +endchoice +endif diff --git a/package/libssh2/libssh2.mk b/package/libssh2/libssh2.mk index f1f0ec6..befac92 100644 --- a/package/libssh2/libssh2.mk +++ b/package/libssh2/libssh2.mk @@ -15,19 +15,19 @@ LIBSSH2_CONF_OPTS = --disable-examples-build LIBSSH2_AUTORECONF = YES # Dependency is one of mbedtls, libgcrypt or openssl, guaranteed in -# Config.in. Favour mbedtls. +# Config.in. ifeq ($(BR2_PACKAGE_LIBSSH2_MBEDTLS),y) LIBSSH2_DEPENDENCIES += mbedtls LIBSSH2_CONF_OPTS += --with-libmbedcrypto-prefix=$(STAGING_DIR)/usr \ --with-crypto=mbedtls -else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y) +else ifeq ($(BR2_PACKAGE_LIBSSH2_LIBGCRYPT),y) LIBSSH2_DEPENDENCIES += libgcrypt LIBSSH2_CONF_OPTS += --with-libgcrypt-prefix=$(STAGING_DIR)/usr \ --with-crypto=libgcrypt # configure.ac forgets to link to dependent libraries of gcrypt breaking static # linking LIBSSH2_CONF_ENV += LIBS="`$(STAGING_DIR)/usr/bin/libgcrypt-config --libs`" -else +else ifeq ($(BR2_PACKAGE_LIBSSH2_OPENSSL),y) LIBSSH2_DEPENDENCIES += openssl LIBSSH2_CONF_OPTS += --with-libssl-prefix=$(STAGING_DIR)/usr \ --with-crypto=openssl