From patchwork Thu Mar 14 21:25:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1056711 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pr9/JSEZ"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44L1xG5q07z9s3q for ; Fri, 15 Mar 2019 08:26:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1B96786D2C; Thu, 14 Mar 2019 21:26:40 +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 x60SpiD_zHFG; Thu, 14 Mar 2019 21:26:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3C6CE86D2F; Thu, 14 Mar 2019 21:26:39 +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 1C8CC1BF38A for ; Thu, 14 Mar 2019 21:26:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1979F87C1C for ; Thu, 14 Mar 2019 21:26:38 +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 GFGnf9Lriw4q for ; Thu, 14 Mar 2019 21:26:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 94E5587C17 for ; Thu, 14 Mar 2019 21:26:36 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id f3so4617701wmj.4 for ; Thu, 14 Mar 2019 14:26:36 -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; bh=TmFXtcinAegBoeQ5igwNwcT5ZX6qrkCTWksAc4epGsE=; b=pr9/JSEZOj3yNCBMbFiXK5aZn43FfgSvCO0IOEcwIqyhXX7Uax020cZmYyyfBHJEaH 4dxyTGvue/xJ0wwffQ7dFMxBSmccozW1FVWSDeXxVFxjItFDY8XotHw12nn/djknr4l0 TAWLglH03F7UB9fJ8k8EPVUaWXh216KjK5mkUIyj0exHXua68VJf4xfe+XZtvnRiUjHS m2GsPAzMJHZCa5H559yj/PlNJMV/C7B0+EWTy6J5m1HkDMtg35KZIZQEAV21WpMfsV9X eo6dyzymCdO9eNhQpS8fSgs5pnd8FuubENua2ct74/fiVHi3MlrkMxyKPggCOLGOpS4C jM3w== 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=TmFXtcinAegBoeQ5igwNwcT5ZX6qrkCTWksAc4epGsE=; b=Zxz7Fck+qRfpNcp7XVhGtVJ6HGbT92P82Nfd4nGjhgcamy38drGhbeswN+I5Uf4CBx X7Ko70l0Ra0TV5MFODGle46GoRxUDju+hm9bmhyt52q1Jw87sgeRKbq3Rc//jilEz4QZ d+jly5fz8JsWAbdqQtXFr23XxwuSjQmwLkay/ZADglGfmMrBUgAnoB+C6NIsfu1WU/23 FSc/A7FOIEMuDp1kwbvAZ5C0juiW9TWojYvuo4rz66PwADmbPxXD6cphP8+cXqLH13iD l/avI8+aXtsp+1A7Z/Tou1nDIBbcK8c8Dp0a31p4BMUaD16ZPAS3HuCOrT6PEIIQ4DkV ylTg== X-Gm-Message-State: APjAAAVQw7N9gchgJdHkN45w++6D4wC7bzf+HFFraP1Ae10cLkQynEo1 xqyZYfaow1SWNo8QxcpIXYHcXPSG X-Google-Smtp-Source: APXvYqxZJJhbEu44qd8jxwVV1b8Lo5wzI0NJddvP07BO5vnpVCmUjexPp2l2jl775J5m8Mf0sn4aow== X-Received: by 2002:a1c:9c0e:: with SMTP id f14mr366671wme.78.1552598794840; Thu, 14 Mar 2019 14:26:34 -0700 (PDT) Received: from localhost.localdomain ([80.12.34.164]) by smtp.gmail.com with ESMTPSA id a24sm4209296wmm.1.2019.03.14.14.26.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 14:26:34 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Thu, 14 Mar 2019 22:25:59 +0100 Message-Id: <20190314212600.20918-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH 1/2] package/libhtp: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" LibHTP is a security-aware parser for the HTTP protocol and the related bits and pieces. https://github.com/OISF/libhtp Signed-off-by: Fabrice Fontaine --- DEVELOPERS | 1 + package/Config.in | 1 + .../0001-fix-build-without-GNU-libiconv.patch | 60 ++++++++++++++++++++++ package/libhtp/Config.in | 9 ++++ package/libhtp/libhtp.hash | 3 ++ package/libhtp/libhtp.mk | 20 ++++++++ 6 files changed, 94 insertions(+) create mode 100644 package/libhtp/0001-fix-build-without-GNU-libiconv.patch create mode 100644 package/libhtp/Config.in create mode 100644 package/libhtp/libhtp.hash create mode 100644 package/libhtp/libhtp.mk diff --git a/DEVELOPERS b/DEVELOPERS index 36e2295d2d..24737b858f 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -784,6 +784,7 @@ F: package/libgee/ F: package/libglib2/ F: package/libgtk2/ F: package/libgtk3/ +F: package/libhtp/ F: package/libidn/ F: package/libidn2/ F: package/libjpeg/ diff --git a/package/Config.in b/package/Config.in index 85a37f2c0b..bb57afab08 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1534,6 +1534,7 @@ menu "Networking" source "package/libeXosip2/Config.in" source "package/libfcgi/Config.in" source "package/libgsasl/Config.in" + source "package/libhtp/Config.in" source "package/libhttpparser/Config.in" source "package/libidn/Config.in" source "package/libidn2/Config.in" diff --git a/package/libhtp/0001-fix-build-without-GNU-libiconv.patch b/package/libhtp/0001-fix-build-without-GNU-libiconv.patch new file mode 100644 index 0000000000..8f6cddf2da --- /dev/null +++ b/package/libhtp/0001-fix-build-without-GNU-libiconv.patch @@ -0,0 +1,60 @@ +From 1531a8e9b91b567979a2a0d7fd6a4c2e9126b01c Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Wed, 6 Mar 2019 23:06:54 +0100 +Subject: [PATCH] fix build without GNU libiconv + +iconvctl is only defined in GNU libiconv so check for the availability +of this function before using it + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/OISF/libhtp/pull/193] +--- + configure.ac | 18 ++++++++++++++++++ + htp/htp_transcoder.c | 2 +- + 2 files changed, 19 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 7f0a58d..388ec7b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -155,6 +155,24 @@ sinclude(m4/lib-link.m4) + sinclude(m4/lib-prefix.m4) + AM_ICONV + ++# iconvctl is not standard, it is defined only in GNU libiconv ++AC_MSG_CHECKING(for iconvctl) ++TMPLIBS="${LIBS}" ++LIBS="${LIBS} ${LIBICONV}" ++ ++AC_TRY_LINK([#include ++ #include ], ++ [int iconv_param = 0; ++ iconv_t cd = iconv_open("",""); ++ iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, &iconv_param); ++ iconv_close(cd);], ++ [ac_cv_func_iconvctl=yes]) ++AC_MSG_RESULT($ac_cv_func_iconvctl) ++if test "$ac_cv_func_iconvctl" == yes; then ++ AC_DEFINE(HAVE_ICONVCTL,1,"Define to 1 if you have the `iconvctl' function.") ++fi ++LIBS="${TMPLIBS}" ++ + dnl ----------------------------------------------- + dnl Check and enable the GCC opts we want to use. + dnl We may need to add more checks +diff --git a/htp/htp_transcoder.c b/htp/htp_transcoder.c +index 57ff74c..d8e8280 100644 +--- a/htp/htp_transcoder.c ++++ b/htp/htp_transcoder.c +@@ -64,7 +64,7 @@ int htp_transcode_params(htp_connp_t *connp, htp_table_t **params, int destroy_o + return HTP_ERROR; + } + +- #if (_LIBICONV_VERSION >= 0x0108) ++ #if (_LIBICONV_VERSION >= 0x0108 && HAVE_ICONVCTL) + int iconv_param = 0; + iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param); + iconv_param = 1; +-- +2.14.1 + diff --git a/package/libhtp/Config.in b/package/libhtp/Config.in new file mode 100644 index 0000000000..98b9e2adea --- /dev/null +++ b/package/libhtp/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_LIBHTP + bool "libhtp" + select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE + select BR2_PACKAGE_ZLIB + help + LibHTP is a security-aware parser for the HTTP protocol and + the related bits and pieces. + + https://github.com/OISF/libhtp diff --git a/package/libhtp/libhtp.hash b/package/libhtp/libhtp.hash new file mode 100644 index 0000000000..be68547be2 --- /dev/null +++ b/package/libhtp/libhtp.hash @@ -0,0 +1,3 @@ +# Locally computed: +sha256 7384f8461ad0431e9247c49b37a73929b284f39408d1f11b80949b188069b638 libhtp-0.5.30.tar.gz +sha256 87c93904e5434c81622ea690c2b90097b9f162aaa92a96542649a157dbf98d15 LICENSE diff --git a/package/libhtp/libhtp.mk b/package/libhtp/libhtp.mk new file mode 100644 index 0000000000..7606684b31 --- /dev/null +++ b/package/libhtp/libhtp.mk @@ -0,0 +1,20 @@ +################################################################################ +# +# libhtp +# +################################################################################ + +LIBHTP_VERSION = 0.5.30 +LIBHTP_SITE = $(call github,OISF,libhtp,$(LIBHTP_VERSION)) +LIBHTP_LICENSE = BSD-3-Clause +LIBHTP_LICENSE_FILES = LICENSE +LIBHTP_DEPENDENCIES = \ + $(if $(BR2_PACKAGE_LIBICONV),libiconv) \ + zlib +LIBHTP_INSTALL_STAGING = YES +# From git +LIBHTP_AUTORECONF = YES + +LIBHTP_CONF_ENV = NO_STACK_PROTECTOR=$(if $(BR2_TOOLCHAIN_HAS_SSP),no,true) + +$(eval $(autotools-package))