summaryrefslogtreecommitdiffstats
path: root/common/cmd_sha1sum.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_sha1sum.c
parent0ccff500cf787bb71e514eb2904d773ec84bf11d (diff)
downloadtalos-obmc-uboot-d5b76673a5dfe0b5250baea3c36cdfa7a9fd5230.tar.gz
talos-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_sha1sum.c')
-rw-r--r--common/cmd_sha1sum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/cmd_sha1sum.c b/common/cmd_sha1sum.c
index fe927ab248..9f08629b87 100644
--- a/common/cmd_sha1sum.c
+++ b/common/cmd_sha1sum.c
@@ -31,7 +31,7 @@
int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- int verify = 0;
+ int flags = HASH_FLAG_ENV;
int ac;
char * const *av;
@@ -42,13 +42,13 @@ int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ac = argc - 1;
#ifdef CONFIG_SHA1SUM_VERIFY
if (strcmp(*av, "-v") == 0) {
- verify = 1;
+ flags |= HASH_FLAG_VERIFY;
av++;
ac--;
}
#endif
- return hash_command("sha1", verify, cmdtp, flag, ac, av);
+ return hash_command("sha1", flags, cmdtp, flag, ac, av);
}
#ifdef CONFIG_SHA1SUM_VERIFY
OpenPOWER on IntegriCloud