From mboxrd@z Thu Jan 1 00:00:00 1970 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 0BFC0C433F5 for ; Fri, 3 Sep 2021 00:54:48 +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 747AE60FC4 for ; Fri, 3 Sep 2021 00:54:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 747AE60FC4 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 243E78350D; Fri, 3 Sep 2021 02:54:41 +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="LLze6S6u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C1F1383519; Fri, 3 Sep 2021 02:54:31 +0200 (CEST) Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 D1FD683506 for ; Fri, 3 Sep 2021 02:54:26 +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-x329.google.com with SMTP id o16-20020a9d2210000000b0051b1e56c98fso4805452ota.8 for ; Thu, 02 Sep 2021 17:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jIOWkXMSHqiywT5R4WREXNxRF4FOD80roSRY2r875+0=; b=LLze6S6usn0v+ZWmeOsD2B160J6tNBVvmWRis5O3ZKjS+fpdOSbmz5tT/0jUh+DCMe NAqjhM0ju/h+XpREnsdcZzx4OiJMR8nAEgnbl8gipUcdpoYYnBRNRd3DSX7HDZYjNvc3 rput3zzhBAD4/Gkq6AXmQvr9FEkQe5tEWe32M5fF0iFTX8qptcyOcu9wXAlnpRUJ3Cm5 MUtU9OxL0BOnFFqwstsVI2L2GSlfGqxJO61E+E7tulv85DYkM3nFgUtWGJsv1nUC6/lx S9LGeYc6v2RM839zuJdLMFyCpVLI7x9TR4fkauF6kzw7ym/3laYznwgNKaJCPLF+mAsL 5mjA== 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=jIOWkXMSHqiywT5R4WREXNxRF4FOD80roSRY2r875+0=; b=T4NpovPfOl/bgHvsrTelShglnCY/qXyAirEBdNxlxkTw1gUrQ5/DGyc+K+yNOwfcDY t+Y5mtbW4B/3Dpm8H6Ov5CfG8njHiJcymAnO5i2Pjku/l83qjMNwZMnd8J3pKnBeICTD VWgb0AmUDihqU7roUtP6LmLm1KK373ArxpM6Zwxjg6VpNb4vKwgA4dtF/C+9IRhBLKit sUfXEG/4PqsJWx8sByAULPqPaZE1c5mpEvOij99SfQSjbF45cHZdisCNAuoVe0yEK7gV /hNNHIeznWw/Duqo5WeQdfuBVmntv/Lg2SDX5la9aBjjy3eXh01sBHj17ArkK9zcpyZ/ G2Ow== X-Gm-Message-State: AOAM533XlzhY+NBelSpOAu+V9sZ01gw7OnSwIqjQs03FVwpC4eOLZTkO NMcPNv9C3V2mpD0mRISz7so= X-Google-Smtp-Source: ABdhPJzRnBqnRWGVs99ZIcdpNLESDKoW/9ArqC/oPxuR6mW1HyVTEKeKCh9VKbHxYEL9wQ79ey/zwQ== X-Received: by 2002:a9d:4c89:: with SMTP id m9mr832486otf.255.1630630465267; Thu, 02 Sep 2021 17:54:25 -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 186sm708396ood.39.2021.09.02.17.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 17:54:24 -0700 (PDT) From: Alexandru Gagniuc To: trini@konsulko.com, u-boot@lists.denx.de Cc: sjg@chromium.org, Alexandru Gagniuc Subject: [PATCH v2 0/6] Fix FIT hash algos in SPL (Fixes v2021.10-rc3) Date: Thu, 2 Sep 2021 19:54:16 -0500 Message-Id: <20210903005422.1336362-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. Changes since v1: - Taken in all of Tom's fixes from WIP/30Aug2021 branch - CMD_MVEBU_BUBT: select SHA256 if ARMADA_3700 (sha256_update() reference) - fsl: FSL_CAAM: imply SPL_CRYPTO (Fixes undefined reference to hw_sha1) - Add MD5 to hash_algos[] (Fixes "Can't add hashes to FIT: -93") Alexandru Gagniuc (6): common: Remove unused CONFIG_FIT_SHAxxx selectors lib: Drop SHA512_ALGO in lieu of SHA512 common/spl: Drop [ST]PL_HASH_SUPPORT in favor of [ST]PL_HASH common: Move MD5 hash to hash_algo[] array. image: Drop if/elseif hash selection in calculate_hash() image: Drop IMAGE_ENABLE_{MD5, CRC32} #defines arch/arm/mach-socfpga/Kconfig | 2 +- board/freescale/common/Kconfig | 1 + cmd/mvebu/Kconfig | 1 + common/Kconfig.boot | 32 +-------- common/Makefile | 4 +- common/hash.c | 13 ++++ common/image-fit.c | 45 ++++++------- common/spl/Kconfig | 65 +------------------ ...s1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 - configs/ls1043ardb_nand_SECURE_BOOT_defconfig | 1 - .../ls1043ardb_sdcard_SECURE_BOOT_defconfig | 1 - .../ls1046ardb_sdcard_SECURE_BOOT_defconfig | 1 - ...1088ardb_sdcard_qspi_SECURE_BOOT_defconfig | 1 - configs/mt8516_pumpkin_defconfig | 2 +- drivers/crypto/fsl/Kconfig | 2 + include/configs/xilinx_zynqmp.h | 2 +- include/image.h | 24 +------ include/u-boot/md5.h | 6 +- lib/Kconfig | 12 ++-- lib/Makefile | 4 +- lib/crypt/Kconfig | 2 +- lib/efi_loader/Kconfig | 2 +- lib/md5.c | 4 +- lib/sha512.c | 2 - 24 files changed, 59 insertions(+), 171 deletions(-) -- 2.31.1