From patchwork Tue Jul 18 23:38:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 27685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7458EB64DC for ; Tue, 18 Jul 2023 23:39:32 +0000 (UTC) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.web11.2589.1689723565131242134 for ; Tue, 18 Jul 2023 16:39:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=WGj7i3jq; spf=pass (domain: gmail.com, ip: 209.85.208.48, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-51cff235226so500516a12.0 for ; Tue, 18 Jul 2023 16:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689723563; x=1692315563; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=eYN4UG3I2Avy1blxIQbXwebQqXGhhurkKyHOxA4JCdg=; b=WGj7i3jqZoTeV5T4gh/Me730h5fSJmPSdgNyvayJvZcS/fYlwDbK99XZYqpoFdKn0Y UrxSFmexEMwFICI/AyprEvOPv7rY11LHut4+qgtf3yAZZ0F1n4ifCYHVzBAnELxvQdDO 3VN+S4GDOPCUW2bsfT20ai5GlmUrnCzY32dGCnppUlfk/KfuAn1JiYUvRUvfDWY4ZmGW 1FeGiDipG46MDK/tdO56AEAjNIdffk2DuxFDifMfY/XmuZ0YQ5MMk+MUZs/yLcj1L1nP X5r4vonqQMpExW2muGolgyDMS9suSXaF5n5PUpv0onYB35ZvCpKpwd+65WI7TqRJ+qNi uzxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689723563; x=1692315563; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eYN4UG3I2Avy1blxIQbXwebQqXGhhurkKyHOxA4JCdg=; b=JuTXuOuoBoiRtF8Q6mp+gZI54b178h4UckDdSBWqbXp7inP8AMt/msaDr5+sZXZLEC m9yW5QszDkC3HVBBCSNl2rtEUT+Bw32qjnpYhK4H0ReFMgB9qo/+k18ODKf5xagGMbg7 OAwyX+iSy4brqm0JGp/ljw55ma10Uiz6AZsTAVHSPpCAt3859STw+ZMv8zpbnmeY8/QW ZjMVef7KfHfH05Fo4xblw2N0UuQsKYZsaDGT2nWokcudC3MEraIdYBT1fEcy++Wjj9KF MvyOb0i7zVxwU2bDzrINjXJ4a6xhfwcvAx7vvtiFURuYxck0pw6prAWZ+0S5yiuFP51V A0FQ== X-Gm-Message-State: ABy/qLZLbc29EeK/XlaNUM24pnIfXfd5bMRSQJy5jKbnApNUkDEbSn5H pEQQk/pTOz8GPAVPBFYvuJXki0zlyHw= X-Google-Smtp-Source: APBJJlE822n8ECn5M2CLNKxI6xomPii/W/pgXKhzF4tlQCFyqHHuFAyabkRy6WJtkHIypqxdPBm/Ig== X-Received: by 2002:a05:6402:3596:b0:521:ae30:787d with SMTP id y22-20020a056402359600b00521ae30787dmr584550edc.21.1689723563337; Tue, 18 Jul 2023 16:39:23 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id e19-20020aa7d7d3000000b0051e2a6cef4fsm1855059eds.36.2023.07.18.16.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 16:39:22 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-devel@lists.openembedded.org Cc: Martin Jansa Subject: [meta-oe][PATCHv3 1/3] libtommath: add recipe for LibTomMath used by dropbear Date: Wed, 19 Jul 2023 01:38:38 +0200 Message-ID: <20230718233840.2461756-1-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 18 Jul 2023 23:39:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/103951 * When system-libtom PACKAGECONFIG is used, both libtomcrypt and libtommath are used from system and we need a recipes for both. * libtomcrypt was already added to meta-oe in langdale and PACKAGECONFIG was added in dropbear in: https://git.openembedded.org/openembedded-core/commit/?id=b7c2edd2d6ded287d8b34dd047ae84d3fd69d4c6 Signed-off-by: Martin Jansa --- v3: add libtool-cross dependency to fix cross compilation (dunfell needs LIBTOOL to be set in EXTRA_OEMAKE because of ${HOST_SYS} prefix), but the dependency is needed for all releases when cross compiling .../libtommath/libtommath_1.2.0.bb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 meta-oe/recipes-support/libtommath/libtommath_1.2.0.bb diff --git a/meta-oe/recipes-support/libtommath/libtommath_1.2.0.bb b/meta-oe/recipes-support/libtommath/libtommath_1.2.0.bb new file mode 100644 index 0000000000..1efccdd843 --- /dev/null +++ b/meta-oe/recipes-support/libtommath/libtommath_1.2.0.bb @@ -0,0 +1,23 @@ +SUMMARY = "LibTomMath is a number theoretic multiple-precision integer library" +HOMEPAGE = "https://www.libtom.net/LibTomMath" +SECTION = "libs" +LICENSE = "Unlicense" +LIC_FILES_CHKSUM = "file://LICENSE;md5=23e7e0a32e53a2b1d35f5fd9ef053402" + +DEPENDS = "libtool-cross" + +SRC_URI = "git://github.com/libtom/libtommath.git;protocol=https;branch=master" + +SRCREV = "6ca6898bf37f583c4cc9943441cd60dd69f4b8f2" + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE = "'PREFIX=${prefix}' 'DESTDIR=${D}' 'LIBPATH=${libdir}' 'CFLAGS=${CFLAGS}'" + +do_compile() { + oe_runmake -f makefile.shared +} + +do_install() { + oe_runmake -f makefile.shared install +} From patchwork Tue Jul 18 23:38:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 27683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A99D1EB64DD for ; Tue, 18 Jul 2023 23:39:32 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mx.groups.io with SMTP id smtpd.web10.2648.1689723566036345115 for ; Tue, 18 Jul 2023 16:39:26 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=H2ZRpKrL; spf=pass (domain: gmail.com, ip: 209.85.218.53, mailfrom: martin.jansa@gmail.com) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-993a37b79e2so837180066b.1 for ; Tue, 18 Jul 2023 16:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689723564; x=1692315564; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QL24286ntq/vosKmahAJjonrDVJCJoxcSIP36tCt+ms=; b=H2ZRpKrL4Ak4WyEvTo9HpDijgPAbftXzlqlLJTVg/y/JrhEiXxSeR1ICoi4Sd9QKhR IusUhdnvFapY8HfqnkpLCFLyOdVR9VZ/x5n0vUQYpLFhoykt/tCnwL6JLhIa5+vv+HV+ NO0hGMaTSkM0ybV9IWOGyA/uUzJcGBB3ji5lDiIOPYdIHFLcDedTVMZY5YUPnT4H0hBs oH4/nb4SgeTlydh8LCVaKpqdmXo3kwEYNXgcBhUPLXaA3vJ3S+msNqm+uKxEvGGFsoc5 TSpxUc+e2P38QwWlzcAdVxhtiXJhmTQyosJNbUxB+0RVzs31pvNhXXAQy2hxhMqBseTN D2wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689723564; x=1692315564; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QL24286ntq/vosKmahAJjonrDVJCJoxcSIP36tCt+ms=; b=WzIrIQaevFIUVEMcsqNzAF6a5cL5nmNJu/Mq4W5gVz7gem1Eyhc8EJqKr9snDRpHlw X1haRVtTRvHTTSv0Rril0g07YQGqZGxCUy6nV8ue7IEuNOeOSboDjNBO1VOQKgxr9MTu J4S7bYenSe4eGBnEmdh88q486K4qPaRO8/qAMtEdPi2VFg/s0YlrUX8I3/OqeJ8oTlXK FHoaHmaayWvBZ+UZ8K5d9+sT0fyspxNz0bArf6PFP41o5ZByFLBYE5LT1/34Jge9IsFJ 98exj2+Ri9yAYfyTa8yHetJZ6WvIcf28T7XClcTW0bGKmqVqiGKa82ynaTbRbwT4sX02 I23w== X-Gm-Message-State: ABy/qLZzzC7uqkMbr8ITspGFfMjZ/KAcg1/tgWRUmsJLvKtmieGNPC7P cV06j9N19Nf6ns9pcKDbZzOiPt265jg= X-Google-Smtp-Source: APBJJlFsOJGz2WK7s/YA2HnjtAMc2eKj3N1TlfBFnyIVsuwDcKs4OS1IhVAjTQevXYSNbSgADMZTwQ== X-Received: by 2002:a17:906:10dd:b0:991:e458:d14 with SMTP id v29-20020a17090610dd00b00991e4580d14mr876176ejv.34.1689723564172; Tue, 18 Jul 2023 16:39:24 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id r16-20020a170906549000b00992b50fbbe9sm1574980ejo.90.2023.07.18.16.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 16:39:23 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-devel@lists.openembedded.org Cc: Martin Jansa Subject: [meta-oe][PATCHv3 2/3] libtomcrypt: backport a fix for CVE-2019-17362 Date: Wed, 19 Jul 2023 01:38:39 +0200 Message-ID: <20230718233840.2461756-2-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230718233840.2461756-1-Martin.Jansa@gmail.com> References: <20230718233840.2461756-1-Martin.Jansa@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 18 Jul 2023 23:39:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/103952 Signed-off-by: Martin Jansa --- v3: no change, just to send v3 of whole series .../libtomcrypt/CVE-2019-17362.patch | 25 +++++++++++++++++++ .../libtomcrypt/libtomcrypt_1.18.2.bb | 4 ++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-crypto/libtomcrypt/libtomcrypt/CVE-2019-17362.patch diff --git a/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt/CVE-2019-17362.patch b/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt/CVE-2019-17362.patch new file mode 100644 index 0000000000..8b7348a11f --- /dev/null +++ b/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt/CVE-2019-17362.patch @@ -0,0 +1,25 @@ +From 25c26a3b7a9ad8192ccc923e15cf62bf0108ef94 Mon Sep 17 00:00:00 2001 +From: werew +Date: Thu, 3 Oct 2019 19:57:10 +0200 +Subject: [PATCH] Fixes #507 + +Signed-off-by: Martin Jansa +--- +Upstream-Status: Backport [https://github.com/libtom/libtomcrypt/commit/64d1153e5a515740ab56f39c46baf4cf6991a9d3] + + src/pk/asn1/der/utf8/der_decode_utf8_string.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/pk/asn1/der/utf8/der_decode_utf8_string.c b/src/pk/asn1/der/utf8/der_decode_utf8_string.c +index 94555b99f..d3ed82bea 100644 +--- a/src/pk/asn1/der/utf8/der_decode_utf8_string.c ++++ b/src/pk/asn1/der/utf8/der_decode_utf8_string.c +@@ -65,7 +65,7 @@ int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, + /* count number of bytes */ + for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF); + +- if (z > 4 || (x + (z - 1) > inlen)) { ++ if (z == 1 || z > 4 || (x + (z - 1) > inlen)) { + return CRYPT_INVALID_PACKET; + } + diff --git a/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb b/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb index b144338921..8b73cdda85 100644 --- a/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb +++ b/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb @@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=71baacc459522324ef3e2b9e052e8180" DEPENDS += "libtool-cross" -SRC_URI = "git://github.com/libtom/libtomcrypt.git;protocol=https;branch=master" +SRC_URI = "git://github.com/libtom/libtomcrypt.git;protocol=https;branch=master \ + file://CVE-2019-17362.patch \ +" SRCREV = "7e7eb695d581782f04b24dc444cbfde86af59853" From patchwork Tue Jul 18 23:38:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 27684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB50CC3DA40 for ; Tue, 18 Jul 2023 23:39:32 +0000 (UTC) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by mx.groups.io with SMTP id smtpd.web11.2590.1689723566724518386 for ; Tue, 18 Jul 2023 16:39:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=Aktgp9qZ; spf=pass (domain: gmail.com, ip: 209.85.208.42, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-51e2a6a3768so8908751a12.0 for ; Tue, 18 Jul 2023 16:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689723565; x=1692315565; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hXZd6k4D18nGX03fPIdC6Ai9GYq9WleZj+AzZOplxlI=; b=Aktgp9qZm1C1Y/4BpfX3FUx2Gzq9lzPLXy9znB+pgpjSu4NiyVVRX1v6XRMEYPrWxY fQPvkY8JKQEZJMUFNlzYjQzFNqbT+R2n8LSj3nNgWXl0PzBA79qDbLCWWF3AAHbMwnT5 OWx1ocTTQ4qjON/xYzdcmL8vlB8qZbzbkOaGl+IxDjokpaozZKbSYyKg2jV9l4T5coVM xUQzLDxSgRfZcCoVNlaHD1/EJXhkteb4YBzel4rgB2/S4fGM2DZeVhrbMZ4CKPK3Wj3H KwaAiHrR5sKSg2cruWmtKOGN4Q1yVYZ5dauaqg4z7ulqbB5B26xoiUzfKv735jlav94l +eTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689723565; x=1692315565; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hXZd6k4D18nGX03fPIdC6Ai9GYq9WleZj+AzZOplxlI=; b=OykyFd9KHeiq8yhwCeJ8BdwAZsx7BT6KXGQxOkTvTwNoJaSb/j7B3Gy9GZnvU2WTTR WonvAeXJulwOpg+qEnagNso4Q49gLxlBOg57KSnoz+9g1/000Z17Tuwtd+6Sf5dgAOP4 ZKbpD7jyS6NLLsNlIihXqOTDVn5FI19UhkxqHbZISNkqgX7g2+N/Mu8GkNGPaFxTy5Pd 6g9+gFXWc9tOUoUww3rE2I+HRdkZw6s+ywcFUh5nFLk1LrqrWgk6YvGPT9d90eAkzpTn jFVPjCnja+AgqHkOhy+Xoe+1Hrl6GIS08e1WtAMg6yLE8FhW9bX94NVUmnLz55pL+Oc2 Rv3w== X-Gm-Message-State: ABy/qLapz9OH8RTWr8cDgs2L4JJqEeB+UMbP7/rctrpqPf13fFuHCsmV Qir6vsf94dM5XBU40grKd5IAyDyL2CM= X-Google-Smtp-Source: APBJJlGjKyIn8rS1w9mWF2INjXFYSNMWypw2lyOXmaiXLwLk4NNdvnL0i/CQ+veQdFa6ZYmNhKOaQA== X-Received: by 2002:aa7:d412:0:b0:51d:e4b6:ff6b with SMTP id z18-20020aa7d412000000b0051de4b6ff6bmr907550edq.33.1689723564897; Tue, 18 Jul 2023 16:39:24 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id n17-20020aa7c791000000b005215eb17bb7sm1829163eds.88.2023.07.18.16.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 16:39:24 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-devel@lists.openembedded.org Cc: Martin Jansa Subject: [meta-oe][PATCHv3 3/3] libtomcrypt: add PACKAGECONFIG for ltm enabled by default Date: Wed, 19 Jul 2023 01:38:40 +0200 Message-ID: <20230718233840.2461756-3-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230718233840.2461756-1-Martin.Jansa@gmail.com> References: <20230718233840.2461756-1-Martin.Jansa@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 18 Jul 2023 23:39:32 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/103953 * enabled by default, because that's what dropbear expects and fails without as shown in: http://errors.yoctoproject.org/Errors/Details/720460/ dropbear/2022.83-r0/crypto_desc.c:72: undefined reference to `ltm_desc' * add comment about the LICENSE * use EXTRA_OEMAKE * FYI: if you need to use this in dunfell (for whatever reason e.g. to avoid CVE-2019-17362 in dropbear which contains bundled libtomcrypt), then you need to add: # Only needed for dunfell, fixed in kirkstone with: # https://git.openembedded.org/openembedded-core/commit/?h=kirkstone&id=4b308773eca7570ce5007e8f953b56252c17fdb1 DEPENDS += "libtool-cross" EXTRA_OEMAKE += "'LIBTOOL=${HOST_SYS}-libtool'" Signed-off-by: Martin Jansa --- v3: add libtool-cross dependency to fix cross compilation (dunfell needs LIBTOOL to be set in EXTRA_OEMAKE because of ${HOST_SYS} prefix), but the dependency is needed for all releases when cross compiling .../libtomcrypt/libtomcrypt_1.18.2.bb | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb b/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb index 8b73cdda85..5479007d92 100644 --- a/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb +++ b/meta-oe/recipes-crypto/libtomcrypt/libtomcrypt_1.18.2.bb @@ -1,10 +1,19 @@ SUMMARY = "LibTomCrypt is a public domain open source cryptographic toolkit" HOMEPAGE = "https://www.libtom.net/LibTomCrypt" SECTION = "libs" +# Unlicense isn't very accurate for this revision, it was WTFPL in 0.18.0-rc1: +# https://github.com/libtom/libtomcrypt/commit/77e31fb6a980212e90b9a50f116dc5a7bd91e527 +# then updated to dual license PD and WTFPL also in 0.18.0-rc1: +# https://github.com/libtom/libtomcrypt/commit/412b2ee1fccc3a0df58f93f372c90d6d0f93bfc9 +# and then updated again to Unlicense after the 0.18.2 tag (it's only in develop branch): +# https://github.com/libtom/libtomcrypt/commit/3630bee6fc0f73dd9c7923fd43f8ae15a2c0fb70 +# but keep using Unlicense to avoid triggering people with WTFPL license: +# https://groups.google.com/g/libtom/c/17Z7xkECULM +# and this comment can be removed next time libtomcrypt is updated LICENSE = "Unlicense" LIC_FILES_CHKSUM = "file://LICENSE;md5=71baacc459522324ef3e2b9e052e8180" -DEPENDS += "libtool-cross" +DEPENDS = "libtool-cross" SRC_URI = "git://github.com/libtom/libtomcrypt.git;protocol=https;branch=master \ file://CVE-2019-17362.patch \ @@ -14,10 +23,19 @@ SRCREV = "7e7eb695d581782f04b24dc444cbfde86af59853" S = "${WORKDIR}/git" +inherit pkgconfig + +PACKAGECONFIG ??= "ltm" +PACKAGECONFIG[ltm] = ",,libtommath" + +CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'ltm', '-DUSE_LTM -DLTM_DESC', '', d)}" + +EXTRA_OEMAKE = "'PREFIX=${prefix}' 'DESTDIR=${D}' 'LIBPATH=${libdir}' 'CFLAGS=${CFLAGS}'" + do_compile() { oe_runmake -f makefile.shared } do_install() { - oe_runmake -f makefile.shared 'PREFIX=${prefix}' 'DESTDIR=${D}' 'LIBPATH=${libdir}' install + oe_runmake -f makefile.shared install }