summaryrefslogtreecommitdiffstats
path: root/common/cmd_hash.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-02-24 17:33:26 +0000
committerSimon Glass <sjg@chromium.org>2013-02-28 19:09:23 -0800
commitd5b76673a5dfe0b5250baea3c36cdfa7a9fd5230 (patch)
tree70e8af37b0ecd53b92336afe52c9515647e0ea55 /common/cmd_hash.c
parent0ccff500cf787bb71e514eb2904d773ec84bf11d (diff)
downloadblackbird-obmc-uboot-d5b76673a5dfe0b5250baea3c36cdfa7a9fd5230.tar.gz
blackbird-obmc-uboot-d5b76673a5dfe0b5250baea3c36cdfa7a9fd5230.zip
hash: Add a flag to support saving hashes in the environment
Some hashing commands permit saving the hash in an environment variable, and verifying a hash from there. But the crc32 command does not support this. In order to permit crc32 to use the generic hashing infrastructure, add a flag to select which behaviour to use. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_hash.c')
-rw-r--r--common/cmd_hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/cmd_hash.c b/common/cmd_hash.c
index eb6a33873b..8c03b5c723 100644
--- a/common/cmd_hash.c
+++ b/common/cmd_hash.c
@@ -30,22 +30,22 @@
static int do_hash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
#ifdef CONFIG_HASH_VERIFY
- int verify = 0;
+ int flags = HASH_FLAG_ENV;
if (argc < 4)
return CMD_RET_USAGE;
if (!strcmp(argv[1], "-v")) {
- verify = 1;
+ flags |= HASH_FLAG_VERIFY;
argc--;
argv++;
}
#else
- const int verify = 0;
+ const int flags = HASH_FLAG_ENV;
#endif
/* Move forward to 'algorithm' parameter */
argc--;
argv++;
- return hash_command(*argv, verify, cmdtp, flag, argc - 1, argv + 1);
+ return hash_command(*argv, flags, cmdtp, flag, argc - 1, argv + 1);
}
#ifdef CONFIG_HASH_VERIFY
OpenPOWER on IntegriCloud