summaryrefslogtreecommitdiff
path: root/common/cmd_hash.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-02-24 17:33:32 +0000
committerSimon Glass <sjg@chromium.org>2013-02-28 19:49:13 -0800
commit218da0f35f4b5e5bf13d3dba6d975d4d5d65516f (patch)
tree0601a777e77d4c582882426e5aefcd3541032be5 /common/cmd_hash.c
parentbd091b67d0ef2959ed0ff2aa6575ddb0d21c1f71 (diff)
downloadu-boot-imx-218da0f35f4b5e5bf13d3dba6d975d4d5d65516f.zip
u-boot-imx-218da0f35f4b5e5bf13d3dba6d975d4d5d65516f.tar.gz
u-boot-imx-218da0f35f4b5e5bf13d3dba6d975d4d5d65516f.tar.bz2
hash: Use lower case for hash algorithm names
Rather than use strcasecmp() in the hash algorithm search, require the caller to do this first. Most of U-Boot can use lower case anyway, and the hash command can convert to lower case before calling hash_command(). This saves needing strcasecmp() for boards that use hashing but not the hash command. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_hash.c')
-rw-r--r--common/cmd_hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/cmd_hash.c b/common/cmd_hash.c
index 8c03b5c..4fe0e78 100644
--- a/common/cmd_hash.c
+++ b/common/cmd_hash.c
@@ -26,9 +26,11 @@
#include <common.h>
#include <command.h>
#include <hash.h>
+#include <linux/ctype.h>
static int do_hash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
+ char *s;
#ifdef CONFIG_HASH_VERIFY
int flags = HASH_FLAG_ENV;
@@ -45,6 +47,8 @@ static int do_hash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* Move forward to 'algorithm' parameter */
argc--;
argv++;
+ for (s = *argv; *s; s++)
+ *s = tolower(*s);
return hash_command(*argv, flags, cmdtp, flag, argc - 1, argv + 1);
}