mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user