Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 054B7C47088 for ; Wed, 26 May 2021 16:21:25 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B6D56100A for ; Wed, 26 May 2021 16:21:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B6D56100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1B68382E23; Wed, 26 May 2021 18:21:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EcF7BBuv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9581F82E2F; Wed, 26 May 2021 18:21:20 +0200 (CEST) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3E9BE82E1E for ; Wed, 26 May 2021 18:21:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-oi1-x233.google.com with SMTP id c196so2034430oib.9 for ; Wed, 26 May 2021 09:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=+BA70nXn2hHhUaL89qtNlqgZyACi9Fn/Ekqmc9qTGIo=; b=EcF7BBuvqxmkhgW8g4vj4Vd3vFKUYyx+MijCsC0wjfHZxLh5o954rX7szIN7Tu7IeY s6ToVSlCQSZrqfebpZK0cHsCETL/YDzBg+a+X2Dg+QpR51fxzXO5AhoRVTtDXkVaieYQ 7AP72geEfO6aYEXhL2NxH+ewO6F4nrTdwtVgsBGCqTdpioocNqPu21//QBLaLb4ilJgu /W0fMb0sBLITaD+STJ8NIP3mtIayMDUth3rCkrZkh272+zc2TqvGCDVabmJXHgoO+rSI WmR9liH0t+j+9/B0VNXcHytuQiXqn3tP2K1eJDn/hNx1CoxBWkRAMBhkMEfexfdyAFn8 Pdcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+BA70nXn2hHhUaL89qtNlqgZyACi9Fn/Ekqmc9qTGIo=; b=GFYDRdUyzfSZ8OZ3klmvHQjibMFG6lNvCpVD4KXAm1q4enCl2XBKXmKB3UMHDzZcFA 6SSWROL3wh0MqaUERtDjXxxxFRFRMMP1dwQuAugl+zltJ+X1l154FsOjce8kM7+7y19c pqjDySz8COd4uIr5inKDkWIfIFlPowSZIvvUQP74fNjz7H/34xCVKQx77q8kLfl4gWSd 62v4yR9Cb69iYVxHqkg/WXE3HHwia57lpXUHCbNen9YZpkZzvQE7sAV0dWRu8oOo1PPv vwbmOVtBjkh19tGP7FIG+qt3t5MQcT6iPyQruKwysNN0RT2u3BdE5WExaNmtA9vjcivb uhSw== X-Gm-Message-State: AOAM530xrx//8DwEpfrBxID/qCKPOsCQ4uGkYHMAisOnu44enqMm1m+m MUG6KpfxkINmvCGFhfcwGPc= X-Google-Smtp-Source: ABdhPJxgbL2K+taPhJARkFK0sEIt25XLdHDbTmvnDq5gUA9/Em9PlDxj9civY9HrqZdrKXZLtID6Pg== X-Received: by 2002:a05:6808:609:: with SMTP id y9mr2606461oih.174.1622046075599; Wed, 26 May 2021 09:21:15 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id i133sm3862676oia.2.2021.05.26.09.21.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 May 2021 09:21:15 -0700 (PDT) Subject: Re: [PATCH RFC 1/2] Revert "lib: introduce HASH_CALCULATE option" To: Heinrich Schuchardt , u-boot@lists.denx.de Cc: masahisa.kojima@linaro.org, trini@konsulko.com, sjg@chromium.org References: <20210524192857.1486696-1-mr.nuke.me@gmail.com> <20210524192857.1486696-2-mr.nuke.me@gmail.com> From: "Alex G." Message-ID: Date: Wed, 26 May 2021 11:21:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean On 5/26/21 11:06 AM, Heinrich Schuchardt wrote: > On 5/24/21 9:28 PM, Alexandru Gagniuc wrote: >> When we think of Kconfig, we usually think of features that we like >> to enable or not. Ideally, we wouldn't use Kconfig to fix a build >> issue, although sometimes it might make sense. With Kconfig it's hard >> to guarantee that the fix is universal. We can only say that it works >> for the set of tested configurations. In the majority of cases, it's >> preferable to let the linker figure things out for us. >> >> The reverted commit attempted to fix a build issue by adding an >> invisible Kconfig option. This is wrong in several ways: >> >> It invents a new Kconfig variable when CONFIG_HASH already >> exists for the same purpose. >> Second, hash-checksum.c makes use of the hash_progressive_lookup_algo() >> symbol, which is only provided with CONFIG_HASH, but this dependency >> was not expressed in the reverted patch. >> >> It feels like Kconfig is turning into a listing of all available >> source files, and a buffet to 'select' which ones to compile. The >> purpose of this revert is to enable the next change to make use of >> CONFIG_HASH instead of adding to Kconfig. > > See upcoming patch > efi_loader: add PE/COFF image measurement > https://patchwork.ozlabs.org/project/uboot/patch/20210526030958.15701-2-masahisa.kojima@linaro.org/ > > Here we need to compile hash-checksum.o, but don't need FIT image support. You can take the nest patch in this series and "select HASH". Alex > Best regards > > Heinrich > >> >> This reverts commit 87316da05f2fd49d3709275e64ef0c5980366ade. >> >> Signed-off-by: Alexandru Gagniuc >> --- >> common/Kconfig.boot | 1 - >> lib/Kconfig | 3 --- >> lib/Makefile | 2 +- >> lib/efi_loader/Kconfig | 2 -- >> 4 files changed, 1 insertion(+), 7 deletions(-) >> >> diff --git a/common/Kconfig.boot b/common/Kconfig.boot >> index 3c6e77d099..89a3161f1f 100644 >> --- a/common/Kconfig.boot >> +++ b/common/Kconfig.boot >> @@ -80,7 +80,6 @@ config FIT_SIGNATURE >> select RSA_VERIFY >> select IMAGE_SIGN_INFO >> select FIT_FULL_CHECK >> - select HASH_CALCULATE >> help >> This option enables signature verification of FIT uImages, >> using a hash signed and verified using RSA. If >> diff --git a/lib/Kconfig b/lib/Kconfig >> index d675ab1d82..15019d2c65 100644 >> --- a/lib/Kconfig >> +++ b/lib/Kconfig >> @@ -439,9 +439,6 @@ config CRC32C >> config XXHASH >> bool >> >> -config HASH_CALCULATE >> - bool >> - >> endmenu >> >> menu "Compression Support" >> diff --git a/lib/Makefile b/lib/Makefile >> index 0835ea292c..6825671955 100644 >> --- a/lib/Makefile >> +++ b/lib/Makefile >> @@ -61,7 +61,7 @@ endif >> obj-$(CONFIG_$(SPL_)ACPIGEN) += acpi/ >> obj-$(CONFIG_$(SPL_)MD5) += md5.o >> obj-$(CONFIG_$(SPL_)RSA) += rsa/ >> -obj-$(CONFIG_HASH_CALCULATE) += hash-checksum.o >> +obj-$(CONFIG_FIT_SIGNATURE) += hash-checksum.o >> obj-$(CONFIG_SHA1) += sha1.o >> obj-$(CONFIG_SHA256) += sha256.o >> obj-$(CONFIG_SHA512_ALGO) += sha512.o >> diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig >> index eb5c4d6f29..c259abe033 100644 >> --- a/lib/efi_loader/Kconfig >> +++ b/lib/efi_loader/Kconfig >> @@ -174,7 +174,6 @@ config EFI_CAPSULE_AUTHENTICATE >> select PKCS7_MESSAGE_PARSER >> select PKCS7_VERIFY >> select IMAGE_SIGN_INFO >> - select HASH_CALCULATE >> default n >> help >> Select this option if you want to enable capsule >> @@ -343,7 +342,6 @@ config EFI_SECURE_BOOT >> select X509_CERTIFICATE_PARSER >> select PKCS7_MESSAGE_PARSER >> select PKCS7_VERIFY >> - select HASH_CALCULATE >> default n >> help >> Select this option to enable EFI secure boot support. >> >