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=-15.8 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,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 19C29C04FF3 for ; Mon, 24 May 2021 19:29:19 +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 66BD661401 for ; Mon, 24 May 2021 19:29:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66BD661401 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 5D45F82EC1; Mon, 24 May 2021 21:29:14 +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="chqirkM6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C9F282EA2; Mon, 24 May 2021 21:29:06 +0200 (CEST) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (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 E06AB82EA2 for ; Mon, 24 May 2021 21:29:01 +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-ot1-x32b.google.com with SMTP id 66-20020a9d02c80000b02903615edf7c1aso4407898otl.13 for ; Mon, 24 May 2021 12:29:01 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=zEepIm7S7l+wUSEAE1PWHYBaB9zXz872g4jLpMnNkqI=; b=chqirkM6fZrDy7pyl5c2DkflTO+CtFNo4hPGZmwkJuUpjlRH0hOvj9V3Cae9EC1XIb gPtd9P46fH4pEFaaCUM6BT9Iv5ZHK7GPnxhU28p08Dl17t6sf2cfLar7upJwR4Nw38AK YECfGxPWISUFuSzP0Qbgl2vUTGh3hHzSWyE821PV/MwUV81FvfdYXq7upYvJLlE+v3gV 0KrLFCAQEG8Smex6pJ+N0Q+hcY3C9HlE+KnbuZy9vFvq98TyH70WMnPwVxMUPyN5n7eM VXFKJoAD62n910I1hqK+xI+K1JRms8ZxU7q9hYNKt/x3vJU2dqviMennYrRlj5GiFUow Y2Uw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=zEepIm7S7l+wUSEAE1PWHYBaB9zXz872g4jLpMnNkqI=; b=LMq6Ly1/w/kkZapwPwLH3nvEqxLFR2qKc+pavhuRo7opggd+Ppg9IYAp7ayAaeJlPw HlOp3ZNGgmZBQ7PrLyZjcrCymjRevlbVUA8aFduMiMeeVp77HrHXOgDO/cQSrXxKrYkw OlJmjo6OIctycZ5DUIYOSd1YYaC+Uh7Hl4XiI3bjyM8cyzCdcyr+GKZDib+in6rQM8L/ YdzSRGawjAs65+BYaOBHx3cqmYreWyu8tatw5fbIMGsoBqfUH2a2C1wcXx7i7T9KDzhB a9NoYd9+snkvCfxdQr93nqfnqr4aNWYol+1EbHyNrFZrtorBGZOREgLwQehXgn5vqJup 9AWQ== X-Gm-Message-State: AOAM532S4ysVZ38PjPvkOoggVV8VilBloxpycJ2ZYOGB3Wu1DE+rIj1l K6WJShyvJhn/SWyOBgQM1EQGVHh+pAvadA== X-Google-Smtp-Source: ABdhPJxh1U7hT0kOVjNvWn/jZLOi1R8rG+GdrpnNV4GfMuMXuhl6e4/3JvkSnsT+Si9du465f8Xgaw== X-Received: by 2002:a05:6830:1656:: with SMTP id h22mr20346652otr.371.1621884540121; Mon, 24 May 2021 12:29:00 -0700 (PDT) Received: from nuclearis3.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id w198sm2778664oie.26.2021.05.24.12.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 12:28:59 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de Cc: Alexandru Gagniuc , masahisa.kojima@linaro.org, xypron.glpk@gmx.de, trini@konsulko.com, sjg@chromium.org Subject: [PATCH RFC 1/2] Revert "lib: introduce HASH_CALCULATE option" Date: Mon, 24 May 2021 14:28:56 -0500 Message-Id: <20210524192857.1486696-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524192857.1486696-1-mr.nuke.me@gmail.com> References: <20210524192857.1486696-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. 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. -- 2.31.1