From patchwork Tue Dec 19 19:12:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 851007 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="WSa0ITvr"; 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 3z1SGM5Rsjz9t16 for ; Wed, 20 Dec 2017 06:12:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AAC8588C29; Tue, 19 Dec 2017 19:12:40 +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 3r2OfwXNDQr3; Tue, 19 Dec 2017 19:12:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 0DF7B88BF3; Tue, 19 Dec 2017 19:12:38 +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 D2C0E1C26AC for ; Tue, 19 Dec 2017 19:12:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CD09888035 for ; Tue, 19 Dec 2017 19:12:36 +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 chWLpym3u1ep for ; Tue, 19 Dec 2017 19:12:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3D99F86CAB for ; Tue, 19 Dec 2017 19:12:13 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id u19so13849180wrc.3 for ; Tue, 19 Dec 2017 11:12:13 -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=qsnyjsESyjLaOy9oME/IbS7TOYK0JdVUwnDJQDNpiVw=; b=WSa0ITvr+DzUDAl7BDHGi2h15/gILuFbuvZc5Ewptg+jrQGtUepdkVifiVtLLf8Ic8 XAv0FHoCMCYG9OmmsLTk+AqTp321KasUi3Fzgzj+LSYfHDqSwXmnBdBJDVljW+HQK/Yk Ee2lW9f1GM5djyfRBHis4QMO7HwF20/hILrTe1g5wokwUcCB+u44wuHy2+Xof8UCCjFc fe02+xWF1v0s/eiZzadkgQpLVeBdlT6WpidjN1bbJxrxUsAvqVOMysEZr1V7DjApV6sB o/0tLYS3TYIX1shV9gvqwoxLBIkgfT4pyMixwGGhV6Mh65PswtHtCsq2Drn0edE+5c9+ ps0Q== 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=qsnyjsESyjLaOy9oME/IbS7TOYK0JdVUwnDJQDNpiVw=; b=HWdoK+rx4J4ENtnSrQ1/0V/+AOcI4D7oYj+tm40fp60SaxIsQ35te84QyKRcRKcIpV h3QphEQ/cI0nWNM4KSdpHM9Yp8L1irr2GP27+EOdEYHxikp/vSxiP0TUgAyh0uNHR65L uU/m7K+1XBCMwsssSmP408ahJwu0E+YxZ7xyTu0bTntnWqer12w04FCCiBfiqMRMBiXq 7heQ/+8JPjzEExCKMW/5eeOLmbe+uyOWdr96+IsAFXGs0v79d37ZAjfYpzbJ76O3fPb9 H3S+3Ch0YIow4FEZm5EF6ySOnzL/j9sVpiXb9c1iEwVQomnOE0yRSsC9L/marTCw+AKW 5jpw== X-Gm-Message-State: AKGB3mL+TsAbfh9CK8vYai9kp3lZf2y8bbOSKEA5ja2IYa+FLhSlD6kQ VgzUNNSIhaewWe6zmBkayIfC4Q== X-Google-Smtp-Source: ACJfBotA7SS9GCJS6LtRnbABCzNcNL2uXTpZvuuF209Or788AlEh/PyhtzvzKfrb0o2HQHxP1gaM3Q== X-Received: by 10.223.201.138 with SMTP id f10mr6500436wrh.9.1513710731370; Tue, 19 Dec 2017 11:12:11 -0800 (PST) Received: from fabrice-VirtualBox.home (ARennes-656-1-410-249.w92-135.abo.wanadoo.fr. [92.135.62.249]) by smtp.gmail.com with ESMTPSA id f4sm13022848wra.75.2017.12.19.11.12.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 11:12:10 -0800 (PST) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Tue, 19 Dec 2017 20:12:04 +0100 Message-Id: <20171219191204.17680-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH v2,1/1] safeclib: new package 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: Fabrice Fontaine MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" safec fork with all C11 Annex K functions This library implements the secure C11 Annex K functions on top of most libc implementations, which are missing from them. https://rurban.github.io/safeclib/ Signed-off-by: Fabrice Fontaine --- Changes v1 -> v2: - Fix build when wchar is disabled (patch already merged upstream) DEVELOPERS | 1 + package/Config.in | 1 + ...0001-Fix-install-when-HAVE_WCHAR-is-unset.patch | 50 ++++++++++++++++++++++ package/safeclib/Config.in | 9 ++++ package/safeclib/safeclib.hash | 3 ++ package/safeclib/safeclib.mk | 15 +++++++ 6 files changed, 79 insertions(+) create mode 100644 package/safeclib/0001-Fix-install-when-HAVE_WCHAR-is-unset.patch create mode 100644 package/safeclib/Config.in create mode 100644 package/safeclib/safeclib.hash create mode 100644 package/safeclib/safeclib.mk diff --git a/DEVELOPERS b/DEVELOPERS index 082d7e1740..a64a14e546 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -633,6 +633,7 @@ F: package/libupnp18/ F: package/minissdpd/ F: package/motion/ F: package/rygel/ +F: package/safeclib/ F: package/tinycbor/ F: package/tinydtls/ diff --git a/package/Config.in b/package/Config.in index 6847f8965c..24cd00254f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1544,6 +1544,7 @@ menu "Security" source "package/libselinux/Config.in" source "package/libsemanage/Config.in" source "package/libsepol/Config.in" + source "package/safeclib/Config.in" endmenu menu "Text and terminal handling" diff --git a/package/safeclib/0001-Fix-install-when-HAVE_WCHAR-is-unset.patch b/package/safeclib/0001-Fix-install-when-HAVE_WCHAR-is-unset.patch new file mode 100644 index 0000000000..c34002d24e --- /dev/null +++ b/package/safeclib/0001-Fix-install-when-HAVE_WCHAR-is-unset.patch @@ -0,0 +1,50 @@ +From 5991f0d4b86c02a3d7739509b96815ccfa734be7 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 18 Dec 2017 17:17:54 +0100 +Subject: [PATCH] Fix install when HAVE_WCHAR is unset + +Don't build WCSNORM_xxx man pages if HAVE_WHCAR is not set otherwise +installation will fail as the wcsnorm_mode enum is not defined in +safe_str_lib.h when SAFECLIB_DISABLE_WCHAR is set + +Signed-off-by: Fabrice Fontaine +--- + Makefile.am | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 31398d1..b7e65a5 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -142,12 +142,6 @@ dist_man_MANS += \ + doc/man/man3/SAFE_STR_PASSWORD_MIN_LENGTH.3 \ + doc/man/man3/STRTOK_DELIM_MAX_LEN.3 \ + doc/man/man3/TMP_MAX_S.3 \ +- doc/man/man3/WCSNORM_FCC.3 \ +- doc/man/man3/WCSNORM_FCD.3 \ +- doc/man/man3/WCSNORM_NFC.3 \ +- doc/man/man3/WCSNORM_NFD.3 \ +- doc/man/man3/WCSNORM_NFKC.3 \ +- doc/man/man3/WCSNORM_NFKD.3 \ + doc/man/man3/abort_handler_s.3 \ + doc/man/man3/abort_handler_s.c.3 \ + doc/man/man3/asctime_s.3 \ +@@ -461,6 +455,15 @@ dist_man_MANS += \ + doc/man/man3/wprintf_s.c.3 \ + doc/man/man3/wscanf_s.3 \ + doc/man/man3/wscanf_s.c.3 ++if ENABLE_WCHAR ++dist_man_MANS += \ ++ doc/man/man3/WCSNORM_FCC.3 \ ++ doc/man/man3/WCSNORM_FCD.3 \ ++ doc/man/man3/WCSNORM_NFC.3 \ ++ doc/man/man3/WCSNORM_NFD.3 \ ++ doc/man/man3/WCSNORM_NFKC.3 \ ++ doc/man/man3/WCSNORM_NFKD.3 ++endif + CLEANFILES += Doxyfile doc/footer README.md + + # avoid parallel doxygen +-- +2.7.4 + diff --git a/package/safeclib/Config.in b/package/safeclib/Config.in new file mode 100644 index 0000000000..5117c49da7 --- /dev/null +++ b/package/safeclib/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_SAFECLIB + bool "safeclib" + help + safec fork with all C11 Annex K functions + + This library implements the secure C11 Annex K functions on + top of most libc implementations, which are missing from them. + + https://rurban.github.io/safeclib/ diff --git a/package/safeclib/safeclib.hash b/package/safeclib/safeclib.hash new file mode 100644 index 0000000000..95a862eef0 --- /dev/null +++ b/package/safeclib/safeclib.hash @@ -0,0 +1,3 @@ +# Locally computed: +sha256 9c09c6e9fc95207c7d45944f8b669f2454056bef2bbaef70c94ba3f81be1cbb2 safeclib-v09102017.tar.gz +sha256 c33e77efd5781e3d59a2bb648c82d2a615035ef0d24cf58880380e3af906510b COPYING diff --git a/package/safeclib/safeclib.mk b/package/safeclib/safeclib.mk new file mode 100644 index 0000000000..65c6621e0a --- /dev/null +++ b/package/safeclib/safeclib.mk @@ -0,0 +1,15 @@ +################################################################################ +# +# safeclib +# +################################################################################ + +SAFECLIB_VERSION = v09102017 +SAFECLIB_SITE = $(call github,rurban,safeclib,$(SAFECLIB_VERSION)) +SAFECLIB_LICENSE = MIT +SAFECLIB_LICENSE_FILES = COPYING +SAFECLIB_INSTALL_STAGING = YES +# From git +SAFECLIB_AUTORECONF = YES + +$(eval $(autotools-package))