From patchwork Sat May 27 14:59:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 100604 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp714973qge; Sat, 27 May 2017 07:59:27 -0700 (PDT) X-Received: by 10.80.182.35 with SMTP id b32mr6442018ede.123.1495897167777; Sat, 27 May 2017 07:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495897167; cv=none; d=google.com; s=arc-20160816; b=MxN+SYpp2xgTLpulk5prxDfdwGqZUjnO0f34BAUStWvaCM6EshjafWTjkGzk+mQHo9 OoQecYVfYLhCa9DzRygHK/Kb3Zgtun/iJCZ9O/QOCE9Y932EiCCxgEKMLPLqcfJByBv0 0J7X5PvYn/1AD8pXkonaMmjyb1b5NWTc7car85V9QoDqlSZ9MTaDcDmrWinMTGat+jGP FKkfTBSwl3D85sj98ctbvnbA0d43SaVGL5sakXLym2/8VaoHHS2HtK5iaJ3hAEIJs299 jhsswMcRNtTlQGuRaGL/5LcRZsFVqC8TW2M2rvqsRLbCE4A14OmDx+08n6/GVsPleAiu O8zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=I6o68ixYioJCYMhdH5IcNW8NWttEXGQOSvyG6MvD2Bk=; b=LKhE/LeIQgToiHyCMXxfytNrdvC2bd0hF2KcV5XJiCfKXtkzVczDJ22Uo/f9yQafUp jFfBdVxcotGuuK/B1nF1b4NbEcQmCw2OYHtIDpCqjw8+9DOtwggSfHfE3I7V2RnBa2ln leC9cPgLFp8igPLfvrSnEzeNmp7bKfzbLie+a3d5PR3aiy4ZYTLgv8ET/aW1eXyaePPL utNd8oIreHJYOaL0bH1TNbpwsbA0ofhmim0LPK/V6A1mNII8okNfzmtgpQm+2MBrof9Z P84j5neNUlyL7iM9C9EJUaVgmSnWp7GtR9Y4TFqMvNMgbae8IUF6RRFgCWTbeE4w5KTQ Zftg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id k23si4320824eda.31.2017.05.27.07.59.27; Sat, 27 May 2017 07:59:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 8F384C21C56; Sat, 27 May 2017 14:59:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7CC81C21C27; Sat, 27 May 2017 14:59:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6D5EAC21C27; Sat, 27 May 2017 14:59:19 +0000 (UTC) Received: from mail-yb0-f193.google.com (mail-yb0-f193.google.com [209.85.213.193]) by lists.denx.de (Postfix) with ESMTPS id CE058C21BE6 for ; Sat, 27 May 2017 14:59:18 +0000 (UTC) Received: by mail-yb0-f193.google.com with SMTP id 130so1136487ybl.2 for ; Sat, 27 May 2017 07:59:18 -0700 (PDT) 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; bh=BjKxq6XTEvMwwrd6lxpVTSMHsVUzp9jIUO79BTi0VJ8=; b=KdpGuZ9e96Na9cjye3mqfl0hEczOYsJdtib5ei50K69n+UFUaSZAujQk0NtpdmDi1M m5ywSRCRlwEtxvETZDqKNPHU9mmcesfn6XI+czQxupEWsUdhJ/+xjsVkFq92Nk4MqnWc Dh2bdKsGW7qzHMkbb/eW5OR7WBbHxnZZHtLcQn7vJnXy5APxJeqcq+SHlJ0evKReJt7b BBFTZDD4Wv6O73iZZok0FeWTrxYL5NtmbX+PWc6eapkSh1hH/rwp6YpemaU8jXeF+0+7 3NsyEkdPHNC/A2ui5QA2H2p+0SDqhVRG1tGjWJG4dP2ZHwF2tch7cDhLEoXDuAZJR3gc AjdQ== X-Gm-Message-State: AODbwcB166UniDn/P9TJmOR1YHFbEJv0hp29so8ZN0tlzdDl+H4GICLT lYxyiyNjgEZanQ== X-Received: by 10.37.175.18 with SMTP id a18mr29897198ybh.128.1495897157586; Sat, 27 May 2017 07:59:17 -0700 (PDT) Received: from localhost.localdomain (cpe-75-180-228-133.ec.res.rr.com. [75.180.228.133]) by smtp.gmail.com with ESMTPSA id c198sm1887246ywh.79.2017.05.27.07.59.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 27 May 2017 07:59:16 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Sat, 27 May 2017 10:59:15 -0400 Message-Id: <1495897155-9664-1-git-send-email-trini@konsulko.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20170519162658.14212-1-daniel.thompson@linaro.org> References: <20170519162658.14212-1-daniel.thompson@linaro.org> Cc: Daniel Thompson Subject: [U-Boot] [PATCH 1/1] Kconfig: Add support for hash and sha1sum commands X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Daniel Thompson Currently these (board agnostic) commands cannot be selected using menuconfig and friends. Fix this the obvious way. Signed-off-by: Daniel Thompson [trini: Re-apply, add imply for a few cases, run moveconfig.py] Signed-off-by: Tom Rini Reviewed-by: Simon Glass --- README | 11 ----------- arch/Kconfig | 1 + arch/arm/Kconfig | 1 + arch/arm/mach-exynos/Kconfig | 1 + cmd/Kconfig | 18 ++++++++++++++++++ configs/bcm958622hr_defconfig | 1 + include/configs/bcm_ep_board.h | 3 --- include/configs/exynos5-common.h | 3 --- include/configs/imx6qdl_icore.h | 1 - include/configs/imx6qdl_icore_rqs.h | 1 - include/configs/imx6ul_geam.h | 1 - include/configs/imx6ul_isiot.h | 1 - include/configs/sandbox.h | 2 -- include/hash.h | 4 ---- scripts/config_whitelist.txt | 1 - 15 files changed, 22 insertions(+), 28 deletions(-) diff --git a/README b/README index 9d351ec5ad..f9931f6a6f 100644 --- a/README +++ b/README @@ -889,8 +889,6 @@ The following options need to be configured: CONFIG_CMD_SETGETDCR Support for DCR Register access (4xx only) CONFIG_CMD_SF * Read/write/erase SPI NOR flash - CONFIG_CMD_SHA1SUM * print sha1 memory digest - (requires CONFIG_CMD_MEMORY) CONFIG_CMD_SOFTSWITCH * Soft switch setting command for BF60x CONFIG_CMD_SOURCE "source" command Support CONFIG_CMD_SPI * SPI serial bus support @@ -2679,15 +2677,6 @@ The following options need to be configured: A better solution is to properly configure the firewall, but sometimes that is not allowed. -- Hashing support: - CONFIG_HASH_VERIFY - - Enable the hash verify command (hash -v). This adds to code - size a little. - - Note: There is also a sha1sum command, which should perhaps - be deprecated in favour of 'hash sha1'. - - bootcount support: CONFIG_BOOTCOUNT_LIMIT diff --git a/arch/Kconfig b/arch/Kconfig index 02e887ac86..6e291e7316 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -76,6 +76,7 @@ config SANDBOX imply CMD_IOTRACE imply LZMA imply CMD_LZMADEC + imply HASH_VERIFY config SH bool "SuperH architecture" diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 91f50b0637..0df99904a2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -504,6 +504,7 @@ config TARGET_BCMCYGNUS bool "Support bcmcygnus" select CPU_V7 imply CMD_HASH + imply HASH_VERIFY config TARGET_BCMNSP bool "Support bcmnsp" diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 5b6c5ea328..9c5387e37a 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -19,6 +19,7 @@ config ARCH_EXYNOS5 select BOARD_EARLY_INIT_F select SHA_HW_ACCEL imply CMD_HASH + imply HASH_VERIFY help Samsung Exynos5 SoC family are based on ARM Cortex-A15 CPU (and Cortex-A7 CPU in big.LITTLE configuration). There are multiple SoCs diff --git a/cmd/Kconfig b/cmd/Kconfig index 5ee52f62cc..d3580ec779 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -417,6 +417,18 @@ config MD5SUM_VERFIY help Add -v option to verify data against an MD5 checksum. +config CMD_SHA1SUM + bool "sha1sum" + select SHA1 + help + Compute SHA1 checksum. + +config SHA1SUM_VERFIY + bool "sha1sum -v" + depends on CMD_SHA1SUM + help + Add -v option to verify data against an SHA1 checksum. + config LOOPW bool "loopw" help @@ -1068,6 +1080,12 @@ config CMD_HASH saved to memory or to an environment variable. It is also possible to verify a hash against data in memory. +config HASH_VERIFY + bool "hash -v" + depends on CMD_HASH + help + Add -v option to verify data against a hash. + config CMD_TPM bool "Enable the 'tpm' command" depends on TPM diff --git a/configs/bcm958622hr_defconfig b/configs/bcm958622hr_defconfig index c2713c61fa..69b9fe878b 100644 --- a/configs/bcm958622hr_defconfig +++ b/configs/bcm958622hr_defconfig @@ -14,6 +14,7 @@ CONFIG_CMD_ASKENV=y CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_HASH=y +CONFIG_HASH_VERIFY=y CONFIG_CMD_FAT=y # CONFIG_MMC is not set CONFIG_SYS_NS16550=y diff --git a/include/configs/bcm_ep_board.h b/include/configs/bcm_ep_board.h index 957cd9e0ba..53220491b8 100644 --- a/include/configs/bcm_ep_board.h +++ b/include/configs/bcm_ep_board.h @@ -66,9 +66,6 @@ /* Commands */ #define CONFIG_FAT_WRITE -/* SHA hashing */ -#define CONFIG_HASH_VERIFY - /* Enable Time Command */ /* Misc utility code */ diff --git a/include/configs/exynos5-common.h b/include/configs/exynos5-common.h index 6915dc1a48..378219d83a 100644 --- a/include/configs/exynos5-common.h +++ b/include/configs/exynos5-common.h @@ -131,9 +131,6 @@ #define CONFIG_ENV_SROM_BANK 1 #endif /*CONFIG_CMD_NET*/ -/* SHA hashing */ -#define CONFIG_HASH_VERIFY - /* Enable Time Command */ /* USB */ diff --git a/include/configs/imx6qdl_icore.h b/include/configs/imx6qdl_icore.h index 741bdfa807..13fc48fa3a 100644 --- a/include/configs/imx6qdl_icore.h +++ b/include/configs/imx6qdl_icore.h @@ -125,7 +125,6 @@ /* FIT */ #ifdef CONFIG_FIT -# define CONFIG_HASH_VERIFY # define CONFIG_IMAGE_FORMAT_LEGACY #endif diff --git a/include/configs/imx6qdl_icore_rqs.h b/include/configs/imx6qdl_icore_rqs.h index f52865b5a0..a588823da0 100644 --- a/include/configs/imx6qdl_icore_rqs.h +++ b/include/configs/imx6qdl_icore_rqs.h @@ -107,7 +107,6 @@ /* FIT */ #ifdef CONFIG_FIT -# define CONFIG_HASH_VERIFY # define CONFIG_IMAGE_FORMAT_LEGACY #endif diff --git a/include/configs/imx6ul_geam.h b/include/configs/imx6ul_geam.h index 2e12b97767..1d48726086 100644 --- a/include/configs/imx6ul_geam.h +++ b/include/configs/imx6ul_geam.h @@ -124,7 +124,6 @@ /* FIT */ #ifdef CONFIG_FIT -# define CONFIG_HASH_VERIFY # define CONFIG_IMAGE_FORMAT_LEGACY #endif diff --git a/include/configs/imx6ul_isiot.h b/include/configs/imx6ul_isiot.h index 76ae159da3..a0eb6e25fe 100644 --- a/include/configs/imx6ul_isiot.h +++ b/include/configs/imx6ul_isiot.h @@ -124,7 +124,6 @@ /* FIT */ #ifdef CONFIG_FIT -# define CONFIG_HASH_VERIFY # define CONFIG_IMAGE_FORMAT_LEGACY #endif diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index c62b45e51c..fbbd6cd99b 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -98,8 +98,6 @@ #define CONFIG_BOOTP_SERVERIP #define CONFIG_IP_DEFRAG -#define CONFIG_HASH_VERIFY - #define CONFIG_CMD_SANDBOX #define CONFIG_BOOTARGS "" diff --git a/include/hash.h b/include/hash.h index d81433772f..4f9a8cf1db 100644 --- a/include/hash.h +++ b/include/hash.h @@ -17,10 +17,6 @@ enum { HASH_FLAG_ENV = 1 << 1, /* Allow env vars */ }; -#if defined(CONFIG_SHA1SUM_VERIFY) || defined(CONFIG_CRC32_VERIFY) -#define CONFIG_HASH_VERIFY -#endif - struct hash_algo { const char *name; /* Name of algorithm */ int digest_size; /* Length of digest */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index e8f49ebe5d..a20f1c593c 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1074,7 +1074,6 @@ CONFIG_H264_FREQ CONFIG_H8300 CONFIG_HALEAKALA CONFIG_HARD_SPI -CONFIG_HASH_VERIFY CONFIG_HAS_DATAFLASH CONFIG_HAS_ETH0 CONFIG_HAS_ETH1