]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Kconfig: Add CONFIG_HASH to enable hashing API
authorSimon Glass <sjg@chromium.org>
Wed, 17 May 2017 15:05:34 +0000 (09:05 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 22 May 2017 16:38:22 +0000 (12:38 -0400)
At present CONFIG_CMD_HASH enables the 'hash' command which also brings
in the hashing API. Some boards may wish to enable the API without the
command. Add a separate CONFIG to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
cmd/Kconfig
common/Kconfig
common/Makefile
common/hash.c

index b05e69a8b73bef29a4378dcc898934c15fda7e40..1e3cd0270317631622d201c5be42b6e81ce70d89 100644 (file)
@@ -350,6 +350,7 @@ config CMD_MEMORY
 
 config CMD_CRC32
        bool "crc32"
+       select HASH
        default y
        help
          Compute CRC32.
@@ -998,6 +999,7 @@ config CMD_BLOB
 
 config CMD_HASH
        bool "Support 'hash' command"
+       select HASH
        help
          This provides a way to hash data in memory using various supported
          algorithms (such as SHA1, MD5, CRC32). The computed digest can be
index 1879aefaf83d3e3c5b85a9113879f18cbe767e12..5c39663f56a87db11155632f0fa1033c42961f20 100644 (file)
@@ -493,4 +493,16 @@ config BOARD_EARLY_INIT_F
 
 endmenu
 
+menu "Security support"
+
+config HASH
+       bool # "Support hashing API (SHA1, SHA256, etc.)"
+       help
+         This provides a way to hash data in memory using various supported
+         algorithms (such as SHA1, MD5, CRC32). The API is defined in hash.h
+         and the algorithms it supports are defined in common/hash.c. See
+         also CMD_HASH for command-line access.
+
+endmenu
+
 source "common/spl/Kconfig"
index 14d01844adb16217fe86ace331a923476f39d86c..b2d663530dbe1b0a37f4584551126cb51c4466d7 100644 (file)
@@ -10,7 +10,7 @@ ifndef CONFIG_SPL_BUILD
 obj-y += init/
 obj-y += main.o
 obj-y += exports.o
-obj-y += hash.o
+obj-$(CONFIG_HASH) += hash.o
 obj-$(CONFIG_HUSH_PARSER) += cli_hush.o
 obj-$(CONFIG_AUTOBOOT) += autoboot.o
 
index b645298afcd5be74f1eef8b801c6523a37cc73b8..a0eded98d063d6fad98dac679c7d2be7626ce135 100644 (file)
@@ -473,5 +473,5 @@ int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag,
 
        return 0;
 }
-#endif
-#endif
+#endif /* CONFIG_CMD_HASH || CONFIG_CMD_SHA1SUM || CONFIG_CMD_CRC32) */
+#endif /* !USE_HOSTCC */