From patchwork Tue Jul 26 12:26:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 652756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rzHS92Rfsz9t18 for ; Tue, 26 Jul 2016 22:27:05 +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=NvD+Wz0g; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E016130F8E; Tue, 26 Jul 2016 12:27:02 +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 o0aSIhsPNyDO; Tue, 26 Jul 2016 12:26:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6F08F30EDD; Tue, 26 Jul 2016 12:26:59 +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 AA5A01C1F38 for ; Tue, 26 Jul 2016 12:26:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 84DC730EDD for ; Tue, 26 Jul 2016 12:26:58 +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 6wdrqJzXbMLp for ; Tue, 26 Jul 2016 12:26:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by silver.osuosl.org (Postfix) with ESMTPS id 9ED242F4A5 for ; Tue, 26 Jul 2016 12:26:56 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id x83so1412633wma.3 for ; Tue, 26 Jul 2016 05:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=bd/xuoyEvpYDJCz5qag1zLzcLlwQdYuLAtYvmN9e9VI=; b=NvD+Wz0gd9MGSM8IMkCOl9zHbbdvbsthRUkojFIacgynWsAwD86M1Ld8A+kfl8Guxa u+kz+CUwTYq8S95n3DMiEHdQ/zgBGTIXb9VQsuJqtRumpCd24MFQeu4MG0l12b35Muza 8XF4VawiRr5TmG3bFZUmLiX91PocuSP13OplOnerw3bRXD9qQpjUfLqv15BFKO3dJ+nR kbZO5rPDaCDRpufuxOt6gUAXWMkaiBHDqiElMqeinPZUYZVhm3pkutmtsTfKzT2iDPEF 7JvrgKgKj30LeQTop5UPAFW8atFw/b4n1fL2WDMNWwq+dpzTpJEhTERWbn4xBTrGKUgs DcvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bd/xuoyEvpYDJCz5qag1zLzcLlwQdYuLAtYvmN9e9VI=; b=NpTNM8BxTpussIlBQ2G6OzgqVZJxNaG5qFaCUwUDIONhdiy9L8d+8UUnFFgMaWf2iu dNr9p+UogdX7pXKr1WgDGYlDQVXf+rCTnwvqd8nexKXkASMxnHjHe5jRrOeHFJTYeVGI OqBakMyawFK8OBs7z4eu/ZfdV8pUa2JbCMCV+fledB0L63cBDwqw2aUKEeTa22zu0/+8 +Bxwj+gweUUWRClji3beSyUVf1sL+rO++7H31cILcQO2526QHGWmFIPN+K7cAqGUWVMJ Jp0LJQYo2II5LS5MUjIcDAbBwvqbC57cVayJL2IeLWGvmmGMJ4zYykIHbooGgQ+PxeaM HehQ== X-Gm-Message-State: AEkoouvWHR4NrQ2duTuPn6HGdIPUbcMPBvozlS/DBAby+2FRlgGQZDNE0c2H3DNMeGowwA== X-Received: by 10.28.41.131 with SMTP id p125mr22612730wmp.15.1469536015024; Tue, 26 Jul 2016 05:26:55 -0700 (PDT) Received: from r-x-uffo8396.rd.francetelecom.fr (ARennes-654-1-255-172.w2-13.abo.wanadoo.fr. [2.13.202.172]) by smtp.gmail.com with ESMTPSA id a194sm32629012wmd.24.2016.07.26.05.26.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jul 2016 05:26:54 -0700 (PDT) From: Fabrice Fontaine X-Google-Original-From: Fabrice Fontaine To: buildroot@buildroot.org Date: Tue, 26 Jul 2016 14:26:39 +0200 Message-Id: <1469535999-23385-1-git-send-email-fabrice.fontaine@orange.com> X-Mailer: git-send-email 2.7.4 Cc: Fabrice Fontaine Subject: [Buildroot] [PATCH 1/1] tinydtls: new package 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" tinydtls is a library for Datagram Transport Layer Security (DTLS) covering both the client and the server state machine. It is implemented in C and provides support for the mandatory cipher suites specified in CoAP. https://sourceforge.net/projects/tinydtls Signed-off-by: Fabrice Fontaine --- package/Config.in | 1 + ...te-Makefile.in-to-allow-cross-compilation.patch | 170 +++++++++++++++++++++ package/tinydtls/Config.in | 13 ++ package/tinydtls/tinydtls.hash | 2 + package/tinydtls/tinydtls.mk | 18 +++ 5 files changed, 204 insertions(+) create mode 100644 package/tinydtls/0001-Update-Makefile.in-to-allow-cross-compilation.patch create mode 100644 package/tinydtls/Config.in create mode 100644 package/tinydtls/tinydtls.hash create mode 100644 package/tinydtls/tinydtls.mk diff --git a/package/Config.in b/package/Config.in index 563c279..3563870 100644 --- a/package/Config.in +++ b/package/Config.in @@ -887,6 +887,7 @@ menu "Crypto" source "package/nettle/Config.in" source "package/openssl/Config.in" source "package/polarssl/Config.in" + source "package/tinydtls/Config.in" source "package/trousers/Config.in" endmenu diff --git a/package/tinydtls/0001-Update-Makefile.in-to-allow-cross-compilation.patch b/package/tinydtls/0001-Update-Makefile.in-to-allow-cross-compilation.patch new file mode 100644 index 0000000..5e91f2e --- /dev/null +++ b/package/tinydtls/0001-Update-Makefile.in-to-allow-cross-compilation.patch @@ -0,0 +1,170 @@ +From a6f312dfb4497d5e72664c4772a8b122e25b81d8 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Tue, 26 Jul 2016 09:09:53 +0200 +Subject: [PATCH] Update Makefile.in to allow cross-compilation + +Use CC, CPP and DESTDIR environment variables passed to configure in Makefile.in files +Fix definition of LIBS and LDFLAGS (LDFLAGS was set to @LIBS@) + +Signed-off-by: Fabrice Fontaine +--- + Makefile.in | 13 ++++++++----- + aes/Makefile.in | 7 +++++-- + doc/Makefile.in | 4 ++-- + ecc/Makefile.in | 7 +++++-- + sha2/Makefile.in | 7 +++++-- + tests/Makefile.in | 4 +++- + 6 files changed, 28 insertions(+), 14 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 38cc665..7dcd424 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -40,7 +40,9 @@ OBJECTS:= $(patsubst %.c, %.o, $(SOURCES)) $(SUB_OBJECTS) + HEADERS:=dtls.h hmac.h dtls_debug.h dtls_config.h uthash.h numeric.h crypto.h global.h ccm.h \ + netq.h alert.h utlist.h prng.h peer.h state.h dtls_time.h session.h \ + tinydtls.h ++CC:=@CC@ + CFLAGS:=-Wall -pedantic -std=c99 @CFLAGS@ ++CPP:=@CPP@ + CPPFLAGS:=@CPPFLAGS@ -DDTLS_CHECK_CONTENTTYPE + SUBDIRS:=tests doc platform-specific sha2 aes ecc + DISTSUBDIRS:=$(SUBDIRS) +@@ -48,7 +50,8 @@ DISTDIR=$(top_builddir)/$(package) + FILES:=Makefile.in configure configure.in dtls_config.h.in tinydtls.h.in \ + Makefile.tinydtls $(SOURCES) $(HEADERS) + LIB:=libtinydtls.a +-LDFLAGS:=@LIBS@ ++LDFLAGS:=@LDFLAGS@ ++LIBS:=@LIBS@ + ARFLAGS:=cru + doc:=doc + +@@ -100,10 +103,10 @@ dist: $(FILES) $(DISTSUBDIRS) + tar czf $(package).tar.gz $(DISTDIR) + + install: $(LIB) $(HEADERS) $(SUBDIRS) +- test -d $(libdir) || mkdir -p $(libdir) +- test -d $(includedir) || mkdir -p $(includedir) +- $(install) $(LIB) $(libdir)/ +- $(install) $(HEADERS) $(includedir)/ ++ test -d $(DESTDIR)$(libdir) || mkdir -p $(DESTDIR)$(libdir) ++ test -d $(DESTDIR)$(includedir) || mkdir -p $(DESTDIR)$(includedir) ++ $(install) $(LIB) $(DESTDIR)$(libdir)/ ++ $(install) $(HEADERS) $(DESTDIR)$(includedir)/ + for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir install="$(install)" includedir=$(includedir) install; \ + done +diff --git a/aes/Makefile.in b/aes/Makefile.in +index 7c9f6ef..9ff7799 100644 +--- a/aes/Makefile.in ++++ b/aes/Makefile.in +@@ -28,8 +28,11 @@ top_srcdir:= @top_srcdir@ + SOURCES:= rijndael.c + HEADERS:= rijndael.h + OBJECTS:= $(patsubst %.c, %.o, $(SOURCES)) ++CPP=@CPP@ + CPPFLAGS=@CPPFLAGS@ ++CC=@CC@ + CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ ++LDFLAGS=@LDFLAGS@ + LDLIBS=@LIBS@ + FILES:=Makefile.in $(SOURCES) $(HEADERS) + DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ +@@ -60,8 +63,8 @@ dist: $(FILES) + cp -p $(FILES) $(DISTDIR)/aes + + install: $(HEADERS) +- test -d $(includedir)/aes || mkdir -p $(includedir)/aes +- $(install) $(HEADERS) $(includedir)/aes ++ test -d $(DESTDIR)$(includedir)/aes || mkdir -p $(DESTDIR)$(includedir)/aes ++ $(install) $(HEADERS) $(DESTDIR)$(includedir)/aes + + .gitignore: + echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@ +diff --git a/doc/Makefile.in b/doc/Makefile.in +index a07101e..5ab0a35 100644 +--- a/doc/Makefile.in ++++ b/doc/Makefile.in +@@ -32,5 +32,5 @@ dist: doc + cp -r $(FILES) $(DISTDIR)/doc + + install: $(doc) html +- test -d $(htmldir) || mkdir -p $(htmldir) +- cp -r html/* $(htmldir) ++ test -d $(DESTDIR)$(htmldir) || mkdir -p $(DESTDIR)$(htmldir) ++ cp -r html/* $(DESTDIR)$(htmldir) +diff --git a/ecc/Makefile.in b/ecc/Makefile.in +index 2ba17a1..2086d4f 100644 +--- a/ecc/Makefile.in ++++ b/ecc/Makefile.in +@@ -36,8 +36,11 @@ include Makefile.contiki + else + ECC_OBJECTS:= $(patsubst %.c, %.o, $(ECC_SOURCES)) ecc_test.o + PROGRAMS:= testecc testfield ++CPP=@CPP@ + CPPFLAGS=@CPPFLAGS@ ++CC=@CC@ + CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ -DTEST_INCLUDE ++LDFLAGS=@LDFLAGS@ + LDLIBS=@LIBS@ + + .PHONY: all dirs clean install distclean .gitignore doc +@@ -74,8 +77,8 @@ dist: $(FILES) + cp -p $(FILES) $(DISTDIR)/ecc + + install: $(HEADERS) +- test -d $(includedir)/ecc || mkdir -p $(includedir)/ecc +- $(install) $(HEADERS) $(includedir)/ecc ++ test -d $(DESTDIR)$(includedir)/ecc || mkdir -p $(DESTDIR)$(includedir)/ecc ++ $(install) $(ECC_HEADERS) $(DESTDIR)$(includedir)/ecc + + .gitignore: + echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@ +diff --git a/sha2/Makefile.in b/sha2/Makefile.in +index 9f19314..69f8793 100644 +--- a/sha2/Makefile.in ++++ b/sha2/Makefile.in +@@ -28,8 +28,11 @@ top_srcdir:= @top_srcdir@ + SOURCES:= sha2.c + HEADERS:=sha2.h + OBJECTS:= $(patsubst %.c, %.o, $(SOURCES)) ++CPP=@CPP@ + CPPFLAGS=@CPPFLAGS@ -I$(top_srcdir) ++CC=@CC@ + CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ ++LDFLAGS=@LDFLAGS@ + LDLIBS=@LIBS@ + FILES:=Makefile.in $(SOURCES) $(HEADERS) README sha2prog.c sha2speed.c sha2test.pl + DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ +@@ -62,8 +65,8 @@ dist: $(FILES) + cp -pr testvectors $(DISTDIR)/sha2/testvectors + + install: $(HEADERS) +- test -d $(includedir)/sha2 || mkdir -p $(includedir)/sha2 +- $(install) $(HEADERS) $(includedir)/sha2 ++ test -d $(DESTDIR)$(includedir)/sha2 || mkdir -p $(DESTDIR)$(includedir)/sha2 ++ $(install) $(HEADERS) $(DESTDIR)$(includedir)/sha2 + + .gitignore: + echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@ +diff --git a/tests/Makefile.in b/tests/Makefile.in +index a8a2ed0..b45f440 100644 +--- a/tests/Makefile.in ++++ b/tests/Makefile.in +@@ -32,9 +32,11 @@ SOURCES:= dtls-server.c ccm-test.c prf-test.c \ + OBJECTS:= $(patsubst %.c, %.o, $(SOURCES)) + PROGRAMS:= $(patsubst %.c, %, $(SOURCES)) + HEADERS:= ++CC:=@CC@ + CFLAGS:=-Wall @CFLAGS@ ++CPP:=@CPP@ + CPPFLAGS:=-I$(top_srcdir) @CPPFLAGS@ +-LDFLAGS:=-L$(top_builddir) ++LDFLAGS:=-L$(top_builddir) @LDFLAGS@ + LDLIBS:=-ltinydtls @LIBS@ + DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ + FILES:=Makefile.in $(SOURCES) ccm-testdata.c #cbc_aes128-testdata.c +-- +2.7.4 + diff --git a/package/tinydtls/Config.in b/package/tinydtls/Config.in new file mode 100644 index 0000000..df9c4b5 --- /dev/null +++ b/package/tinydtls/Config.in @@ -0,0 +1,13 @@ +config BR2_PACKAGE_TINYDTLS + bool "tinydtls" + depends on BR2_TOOLCHAIN_HAS_THREADS + help + tinydtls is a library for Datagram Transport Layer Security + (DTLS) covering both the client and the server state machine. + It is implemented in C and provides support for the mandatory + cipher suites specified in CoAP. + + https://sourceforge.net/projects/tinydtls + +comment "tinydtls needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/tinydtls/tinydtls.hash b/package/tinydtls/tinydtls.hash new file mode 100644 index 0000000..909c8d1 --- /dev/null +++ b/package/tinydtls/tinydtls.hash @@ -0,0 +1,2 @@ +# Locally computed: +sha256 ccf6d8fbae03fb2e0ba32878ed8e57d8b4f73538b1064df90a3e764da5fac010 tinydtls-0.8.2.tar.gz diff --git a/package/tinydtls/tinydtls.mk b/package/tinydtls/tinydtls.mk new file mode 100644 index 0000000..c4dc35d --- /dev/null +++ b/package/tinydtls/tinydtls.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# tinydtls +# +################################################################################ + +TINYDTLS_RELEASE = r5 +TINYDTLS_VERSION = 0.8.2 +TINYDTLS_SOURCE = tinydtls-$(TINYDTLS_VERSION).tar.gz +TINYDTLS_SITE = \ + http://downloads.sourceforge.net/project/tinydtls/$(TINYDTLS_RELEASE) +TINYDTLS_LICENSE = MIT + +TINYDTLS_INSTALL_STAGING = YES + +TINYDTLS_STRIP_COMPONENTS = 2 + +$(eval $(autotools-package))