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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 5E6ADC4338F for ; Tue, 24 Aug 2021 00:53:35 +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 9E372613BD for ; Tue, 24 Aug 2021 00:53:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9E372613BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD66E82DEF; Tue, 24 Aug 2021 02:53:31 +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="tQLO2xQE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 97BF982DB2; Tue, 24 Aug 2021 02:53:28 +0200 (CEST) Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 529AF82D7E for ; Tue, 24 Aug 2021 02:53:25 +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-x32d.google.com with SMTP id 61-20020a9d0d430000b02903eabfc221a9so41514569oti.0 for ; Mon, 23 Aug 2021 17:53:25 -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:mime-version :content-transfer-encoding; bh=mdjhZaODf2bRyajMucrrvqIVARAXx/io+WXd4ruEmuo=; b=tQLO2xQEMyRa+j1jOrll3znz1lYGb/ziMKege+hvP0DmVCCLZCNkwSBlDzM6BnRAig Fc0931cx1sUWs+X5ajnT+yapCdkhrL2AVPs1hFQvqpA0k34KihT3CEEuJjgmBabgigmd VtAKDziS6Nmi9RFovcmeTiGmj0C1YGGHQhebORq3/duFEVJ9iOSC+qXIUVCuUZqvnrUh KL5+RXp+X0LclUUjHZ0Jo0i+QhX4eK93UU2I0fEGar8jSauXL+nnm3NY8nWhJGJbv/// f2aW2qG4gBlQyiM8eBTgIw9uYck8m4u5LGLcgh+LyhX2X+ObpwDXQ0AsJJSOOIRxYNFJ Wa8g== 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:mime-version :content-transfer-encoding; bh=mdjhZaODf2bRyajMucrrvqIVARAXx/io+WXd4ruEmuo=; b=lTCh5Rk7T1HpgN+7wTmhAwFpgqpLEvWMvSyFCXqgQM9oU2tOnLpQQOTjSnN7GBDUhI amDfij0PZIKC1/rVaRioR2Va6IbWDHWD71XvGByYiI6c4rRKPh6WR+us6yNWyoBlCStC nJvDG97I8SBOCJRs+9f4LP3X8YacbIw2mAwKZ1HPynNJrZgcWJH3YBZK2T8z+pMpzQUc fkDR2mhjli2JXFRvU7juT9eWlvBJH0JBEKBf2rAfXiMaMjdrl9N3UICIkTe4iVz1BQOp ixiolhX4147JbfoDjjurLIhR0CADEOkXO/RLw3M+8CxhN2zuDw2FR/q7EUckT6YVNouH hmDg== X-Gm-Message-State: AOAM53135rjPf4iCBD7RIkLGK336b+OVINmiHOdJaD21CgMidxtMQHUs Om7XlWv5G9iPCAzHi8wbaLw= X-Google-Smtp-Source: ABdhPJx69s9QkvTJGDOjQsTKbae2iPDb8JBeB6LbvFiq4gctQVfB3mg1UpkHuXlKwjEV+XZ/YPJRng== X-Received: by 2002:a05:6830:2815:: with SMTP id w21mr8164673otu.37.1629766403743; Mon, 23 Aug 2021 17:53:23 -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 h14sm4229142otm.5.2021.08.23.17.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 17:53:23 -0700 (PDT) From: Alexandru Gagniuc To: trini@konsulko.com, u-boot@lists.denx.de Cc: sjg@chromium.org, Alexandru Gagniuc Subject: [PATCH 0/5] Fix FIT hash algos in SPL (Fixes v2021.10-rc2) Date: Mon, 23 Aug 2021 19:53:15 -0500 Message-Id: <20210824005320.3647668-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 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.103.2 at phobos.denx.de X-Virus-Status: Clean Simon and I recently worked on killing a bunch extra definitions. One of the side-effects is that certain hash algorithms won't work in SPL when used in the context of FIT verification. For example, in FIT verification, CONFIG_IS_ENABLED(SHA256) is used (good), but there is no corresponding CONFIG_SPL_SHA256 (bad). This will always be false for SPL, hence certain "hash" algos are broken. This series resolves the selection by replacing the broken selection with hash_lookup_algo(), which does not have the aforementioned problem. This at the very least allows 'algo = "sha256"' FIT nodes to work in SPL. This series does not attempt to add individual SHA/CRC/MD5 configs for SPL. Hash algo selection for SPL has been problematic even before. This series is meant as an emergency fix, so it does not attempt to tackle general refactoring issues. Alexandru Gagniuc (5): common: Remove unused CONFIG_FIT_SHAxxx selectors lib: Drop SHA512_ALGO in lieu of SHA512 common/spl: Drop SPL_HASH_SUPPORT in favor of SPL_HASH image: Drop if/elseif hash selection in calculate_hash() image: Drop IMAGE_ENABLE_{MD5, CRC32} #defines arch/arm/mach-socfpga/Kconfig | 2 +- common/Kconfig.boot | 32 ++--------- common/Makefile | 3 +- common/image-fit.c | 45 +++++++--------- common/spl/Kconfig | 54 +------------------ ...s1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 2 +- configs/ls1043ardb_nand_SECURE_BOOT_defconfig | 2 +- .../ls1043ardb_sdcard_SECURE_BOOT_defconfig | 2 +- .../ls1046ardb_sdcard_SECURE_BOOT_defconfig | 2 +- ...1088ardb_sdcard_qspi_SECURE_BOOT_defconfig | 2 +- configs/mt8516_pumpkin_defconfig | 2 +- include/configs/xilinx_zynqmp.h | 2 +- include/image.h | 23 -------- lib/Kconfig | 12 ++--- lib/Makefile | 2 +- lib/crypt/Kconfig | 2 +- lib/efi_loader/Kconfig | 2 +- lib/sha512.c | 2 - 18 files changed, 39 insertions(+), 154 deletions(-) -- 2.31.1